diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-28 13:24:06 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:14 -0300 |
| commit | e11048c20a50b67841e648a4d5ddd7490bc9c9b7 (patch) | |
| tree | 2f4737d83c5f894e8b7a68e5798bd2a2cebb70b9 /src/pdf_view.zig | |
| parent | e0b5564f04aa0ae6666f29ef29c768d800fbabce (diff) | |
| download | pardes-e11048c20a50b67841e648a4d5ddd7490bc9c9b7.tar.gz pardes-e11048c20a50b67841e648a4d5ddd7490bc9c9b7.zip | |
Paint into a target Surface instead of swapping the frame's out
The painters of a pane's body and tag (renderBody and its selection,
gutter, syntax, ANSI and wrap-marker passes; paintPaneTag; paintHeaders;
renderPane; the image and PDF grid paths) take the Surface they paint as a
parameter. The body layer and the tag layers paint straight into their own
temporary surfaces, and the std.mem.swap of p.surface around those calls is
gone. No behaviour change.
Diffstat (limited to 'src/pdf_view.zig')
| -rw-r--r-- | src/pdf_view.zig | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pdf_view.zig b/src/pdf_view.zig index b2fd5866..78d3de27 100644 --- a/src/pdf_view.zig +++ b/src/pdf_view.zig @@ -2542,6 +2542,7 @@ pub fn horizontalWheel(core: *pardes.Pardes, pane: *pardes.Pane, direction: i8) pub fn draw( core: *pardes.Pardes, + s: *pardes.Surface, pane: *pardes.Pane, rect: pardes.Rect, pane_id: usize, @@ -2622,8 +2623,8 @@ pub fn draw( const theme = core.theme(); const pane_bg: pardes.Color = if (theme.bg) |color| .{ .rgb = color } else .default; // The rail runs past the notice bands; only the thumb tracks the text. - core.surface.fill(rect.x, body_y, 1, body_h, .{ .bg = .{ .rgb = chrome.scroll_track } }); - core.surface.fill(rect.x + 1, body_y, 1, body_h, .{ .bg = pane_bg }); + s.fill(rect.x, body_y, 1, body_h, .{ .bg = .{ .rgb = chrome.scroll_track } }); + s.fill(rect.x + 1, body_y, 1, body_h, .{ .bg = pane_bg }); const track_h: usize = body_h; const total = @max(@as(u64, 1), state.document_height); @@ -2641,7 +2642,7 @@ pub fn draw( )); var y = pos; while (y < track_h and y < pos + len) : (y += 1) - core.surface.fill( + s.fill( rect.x, body_y + @as(u16, @intCast(y)), 1, |
