diff options
Diffstat (limited to 'src/gui/gui.zig')
| -rw-r--r-- | src/gui/gui.zig | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig index f9b757f8..7c042703 100644 --- a/src/gui/gui.zig +++ b/src/gui/gui.zig @@ -1018,7 +1018,7 @@ const Gui = struct { scroll_pane: ?usize = null, scroll_rect: pardes.Rect = .{ .x = 0, .y = 0, .w = 0, .h = 0 }, - scroll_body_y: u16 = 0, // that rect's first BODY row (Tagbottom moves it) + scroll_body_y: u16 = 0, // that rect's first BODY row scroll_body_h: u16 = 0, // and its BODY rows, which a taller tag leaves fewer of scroll_held_px: f32 = 0, // its tree-sitter context band, which never moves scroll_col: u16 = 0, // where the wheel turned: crossed rows are delivered @@ -5801,7 +5801,6 @@ test "the layer cover is the per-cell layer scan, over a core's layouts and rand var cover: [97 * 31]Cover = undefined; var notices = false; for (0..32) |step| { - core.settings.tag_bottom = step & 1 != 0; if (step & 3 == 0) try std.testing.expect(core.executeBuiltinLine(2, "Collapse")); core.prefix = if (step & 4 != 0) .leader else .none; if (step & 8 != 0) { @@ -6141,8 +6140,7 @@ test "every pixel of a grip column is band, button or ring, and the button sits const pane = try core.setTestFile(std.mem.asBytes(&@as([60][5]u8, @splat("text\n".*)))); pane.tag.own = try gpa.dupe(u8, "second\nthird"); core.newScratchBelow(0); - for ([_]struct { w: u32, h: u32, tag: u32 }{ .{ .w = 10, .h = 20, .tag = 12 }, .{ .w = 17, .h = 35, .tag = 30 }, .{ .w = 9, .h = 19, .tag = 15 }, .{ .w = 12, .h = 24, .tag = 24 } }) |m| for ([_]bool{ false, true }) |bottom| for ([_]usize{ 0, 1 }) |focus| for ([_]bool{ false, true }) |dirty| { - core.settings.tag_bottom = bottom; + for ([_]struct { w: u32, h: u32, tag: u32 }{ .{ .w = 10, .h = 20, .tag = 12 }, .{ .w = 17, .h = 35, .tag = 30 }, .{ .w = 9, .h = 19, .tag = 15 }, .{ .w = 12, .h = 24, .tag = 24 } }) |m| for ([_]usize{ 0, 1 }) |focus| for ([_]bool{ false, true }) |dirty| { core.active = focus; pane.file.?.revision = pane.file.?.saved_revision + @intFromBool(dirty); core.sync(); @@ -6208,11 +6206,11 @@ test "every pixel of a grip column is band, button or ring, and the button sits // Under the first row there is no button: band and rules only. if (n / w_px >= m.h and n / w_px < h_px - 1 and !std.meta.eql(got, rgb(band)) and !std.meta.eql(got, rgb(chrome.border))) return error.TestButtonUnderFirstRow; - if (!known) std.debug.print("sliver {any} at {d},{d} of {d}x{d} (metrics {d}x{d}/{d}, bottom {}, focus {d}, dirty {}) page {any}\n", .{ got, n % w_px, n / w_px, w_px, h_px, m.w, m.h, m.tag, bottom, focus, dirty, s.chrome.page }); + if (!known) std.debug.print("sliver {any} at {d},{d} of {d}x{d} (metrics {d}x{d}/{d}, focus {d}, dirty {}) page {any}\n", .{ got, n % w_px, n / w_px, w_px, h_px, m.w, m.h, m.tag, focus, dirty, s.chrome.page }); try std.testing.expect(known); } // The rule under the tag runs unbroken across the grip column. - if (!bottom) for (pixels[(h_px - 1) * w_px ..][0..w_px]) |pixel| + for (pixels[(h_px - 1) * w_px ..][0..w_px]) |pixel| try std.testing.expectEqual(rgb(chrome.tag_rule orelse mixRgb(chrome.tag_bg, chrome.page orelse bg_default)), pixel.?); // The button's edges are the scrollbar's. const button = gripButton(&g, chrome, grip.rect.x, grip.rect.y, layout); |
