summaryrefslogtreecommitdiff
path: root/src/pdf_view.zig
diff options
context:
space:
mode:
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 } });