summaryrefslogtreecommitdiff
path: root/src/gui/gui.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-15 17:30:38 -0300
committerGabriel Schneider <[email protected]>2026-09-15 17:34:36 -0300
commite462d566f710e714e3b7176672e98fc82a6dea62 (patch)
tree64b3e9dc1ef36aeedbaae7f7e3a77b556676b952 /src/gui/gui.zig
parentebe561b8083782a105a2ee29fb0a031d1c2427d3 (diff)
downloadpardes-e462d566f710e714e3b7176672e98fc82a6dea62.tar.gz
pardes-e462d566f710e714e3b7176672e98fc82a6dea62.zip
Separate pane and column grip hit areas from tagline text with a small gap
Diffstat (limited to 'src/gui/gui.zig')
-rw-r--r--src/gui/gui.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig
index 590e5aa8..87e19687 100644
--- a/src/gui/gui.zig
+++ b/src/gui/gui.zig
@@ -6528,7 +6528,7 @@ fn appendPaneChrome(
const body_end = body_y + r.h - pardes.BOX_H;
const x0 = @as(f32, @floatFromInt(r.x)) * layout.w;
const x1 = x0 + @as(f32, @floatFromInt(r.w)) * layout.w;
- const tag_cells = surface.cells[@as(usize, tag_y) * surface.cols + r.x + config.GUTTER ..][0 .. r.w - config.GUTTER];
+ const tag_cells = surface.cells[@as(usize, tag_y) * surface.cols + r.x + pardes.TAG_TEXT_INSET ..][0 .. r.w - pardes.TAG_TEXT_INSET];
const tag_visible = for (tag_cells) |*cell| {
if (cellFontRole(cell) != .tagline) break false;
} else true;
@@ -6568,8 +6568,8 @@ fn appendPaneChrome(
fn appendTagGrips(g: *const Gui, surface: *const pardes.Surface, layout: CellLayout, builder: *OverlayBuilder) void {
if (g.tagline_height < 6 or g.tagline_width < 3) return;
for (surface.tagLayers()) |layer| {
- if (layer.cols == 0 or layer.kind != .pane or layer.viewport.x < config.GUTTER) continue;
- const x = layer.viewport.x - config.GUTTER;
+ if (layer.cols == 0 or layer.kind != .pane or layer.viewport.x < pardes.TAG_TEXT_INSET) continue;
+ const x = layer.viewport.x - pardes.TAG_TEXT_INSET;
const y = layer.viewport.y;
if (x >= surface.cols or y >= surface.rows) continue;
const cell = &surface.cells[@as(usize, y) * surface.cols + x];
@@ -6593,8 +6593,8 @@ test "column grips stay unmarked while pane marks retain physical centering" {
g.cell_h = 20;
var cells: [80]pardes.Cell = @splat(.{ .default = false, .style = .{ .fg = .{ .rgb = .{ 100, 120, 140 } } } });
var surface: pardes.Surface = .{ .cols = 20, .rows = 4, .cells = &cells };
- surface.tag_layers[0] = .{ .kind = .column, .viewport = .{ .x = 7, .y = 1, .w = 13, .h = 1 }, .cols = 20 };
- surface.tag_layers[1] = .{ .kind = .pane, .viewport = .{ .x = 7, .y = 3, .w = 13, .h = 1 }, .cols = 20 };
+ surface.tag_layers[0] = .{ .kind = .column, .viewport = .{ .x = 8, .y = 1, .w = 13, .h = 1 }, .cols = 20 };
+ surface.tag_layers[1] = .{ .kind = .pane, .viewport = .{ .x = 8, .y = 3, .w = 13, .h = 1 }, .cols = 20 };
var vertices: [24]OverlayVertex = undefined;
var builder: OverlayBuilder = .{ .vertices = &vertices, .win_w = 200, .win_h = 80 };
appendTagGrips(&g, &surface, .{ .w = 10, .h = 20, .x_off = 0, .y_off = 0 }, &builder);