diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-04 23:21:07 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 01:20:23 -0300 |
| commit | c71ec2ba07a791571509552d218dce38774428fa (patch) | |
| tree | 559bb0f0bcd9d2975f776edab76554db0940a79e /src/body_layer.zig | |
| parent | 97289210592f8a863d46e1b5c0e0e26562de9876 (diff) | |
| download | pardes-c71ec2ba07a791571509552d218dce38774428fa.tar.gz pardes-c71ec2ba07a791571509552d218dce38774428fa.zip | |
draw: parameters nobody reads go (renderBody's prebuilt text, null at every call; paintPaneTag's capacity; renderHeaderLayer's and paintHeaders' arena), a pane tag's look-hover preview is painted once where it was painted twice over the same cells, the column grip's ink is inkOn's instead of a copy of its sum, boxBorder, inactiveDim, paintPaneTag and paintHeaders are draw's own, and animation's two switches with same-result arms keep one arm each
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/body_layer.zig')
| -rw-r--r-- | src/body_layer.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/body_layer.zig b/src/body_layer.zig index 027dfffb..b514cabe 100644 --- a/src/body_layer.zig +++ b/src/body_layer.zig @@ -169,14 +169,14 @@ pub fn buttonInks(th: *const colors.Theme) [3][3]u8 { /// rows the grid cannot show, and is painted straight onto the grid. The /// rail is the grid's alone. pub fn joinBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r: Rect, id: usize, active: bool, rail: pardes.Region) !void { - if (pane.file == null) return renderBody(p, s, arena, pane, r, id, active, rail, null); + if (pane.file == null) return renderBody(p, s, arena, pane, r, id, active, rail); // The pane's geometry as it is (File.geometry): made by the step that // moved it if one read it, else here, and the same either way. panes.File.geometry(pane); // Which rows are context rows is decided by the text the body shows: a // layer taller than the grid's rows when there are any. if (!p.settings.tree_context_tag_style or pane.collapsed or r.h <= pane.tag_rows or pane.body_rows == 0) - return renderBody(p, s, arena, pane, r, id, active, rail, null); + return renderBody(p, s, arena, pane, r, id, active, rail); const viewport_rows = r.h - pane.tag_rows; const logical_rows: usize = pane.body_rows; const width = r.w - config.GUTTER; @@ -187,7 +187,7 @@ pub fn joinBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, @memset(temporary_cells, .{}); var temporary: Surface = .{ .cols = r.w, .rows = @intCast(logical_rows + pane.tag_rows), .cells = temporary_cells }; const synthetic: Rect = .{ .x = 0, .y = 0, .w = r.w, .h = @intCast(logical_rows + pane.tag_rows) }; - try renderBody(p, &temporary, arena, pane, synthetic, id, active, null, null); + try renderBody(p, &temporary, arena, pane, synthetic, id, active, null); const first_row: usize = if (p.settings.tag_bottom) 0 else pane.tag_rows; for (0..logical_rows) |row| { const start = (row + first_row) * r.w + config.GUTTER; @@ -229,7 +229,7 @@ pub fn joinBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, } } -pub fn renderBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r: Rect, id: usize, active: bool, rail: ?pardes.Region, built: ?[]const u8) !void { +pub fn renderBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r: Rect, id: usize, active: bool, rail: ?pardes.Region) !void { const th = p.theme(); const chrome = p.chromeTheme(); const tx = r.x + config.GUTTER; @@ -250,7 +250,7 @@ pub fn renderBody(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane }; const tz_body = tracy.zone(@src(), "bodyText"); const probe_text = pardes.FrameStats.nowNs(); - const body = built orelse try bodyText(p, arena, pane); + const body = try bodyText(p, arena, pane); p.frames.zone(.body_text, probe_text); tz_body.end(); // A select sweep begun on the tag and dragged into the body marks the |
