summaryrefslogtreecommitdiff
path: root/src/pdf_view.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-22 09:50:43 -0300
committerGabriel Schneider <[email protected]>2026-10-22 10:03:24 -0300
commita8b457a306a4442975210bcac3f04b56513c61c3 (patch)
tree6e2026ecb15da2fb919a0202f5d8b38e3b36a595 /src/pdf_view.zig
parenta8a1499bdffffc5b6919e24ec957e92fabaf003b (diff)
parent7e9d2c4169245072265b483ffaa6aa05f23f08d3 (diff)
downloadpardes-a8b457a306a4442975210bcac3f04b56513c61c3.tar.gz
pardes-a8b457a306a4442975210bcac3f04b56513c61c3.zip
Merge: Def/Refs, the diff viewer, Helix n/N, Callstack, Zig 0.17, Window mode and the terminal cwd fix onto 0.24
The docs keep both sides: 0.24's Ctrl-i fallbacks and typed ls with this line's Window mode, raw Esc and Helix n/N wording. The CHANGELOG's unreleased entries go above 0.24, Def/Refs and the context rows among them. cheatsheet-a4.pdf rendered again; .scratch/ ignored. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/pdf_view.zig')
-rw-r--r--src/pdf_view.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pdf_view.zig b/src/pdf_view.zig
index d5769ad3..2a89ef01 100644
--- a/src/pdf_view.zig
+++ b/src/pdf_view.zig
@@ -1843,7 +1843,7 @@ pub fn applyNormal(
.leader => result.host = .leader,
.command_line => result.host = .command_line,
.search => result.host = .search,
- .search_step => |direction| result.host = if (direction == .forward)
+ .search_step => |step| result.host = if (step.direction == .forward)
.search_forward
else
.search_backward,
@@ -2604,7 +2604,7 @@ pub fn pointerRelease(
) PointerRelease {
if (comptime !enabled) return .{};
const state = &(pane.pdf orelse return .{});
- const slot = @intFromEnum(button);
+ const slot = @backingInt(button);
const grid_selection = pane.sel[slot];
pane.sel[slot].state = .none; // native quads, not projected text cells
@@ -2814,6 +2814,8 @@ pub fn draw(
));
rail.thumb_y = @intCast(pos);
rail.thumb_h = @intCast(@min(len, track_h -| pos));
+ rail.thumb_at = @floatCast(state.document_scroll_y / @as(f64, @floatFromInt(total)));
+ rail.thumb_span = @as(f32, @floatFromInt(view.pixel_h)) / @as(f32, @floatFromInt(total));
s.fill(rail.rect.x, rail.rect.y, 1, rail.rect.h, .{ .bg = .{ .rgb = chrome.scroll_track } });
s.fill(rail.rect.x + 1, rail.rect.y, 1, rail.rect.h, .{ .bg = pane_bg });
s.fill(rail.rect.x, rail.rect.y + rail.thumb_y, 1, rail.thumb_h, .{ .bg = .{ .rgb = chrome.scroll_thumb } });