mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 00:36:07 +03:00
fix: scrolling with fraction produces different lines count due to @floor vs @trunc (-1 vs 1)
This commit is contained in:
@ -3745,7 +3745,7 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool
|
||||
|
||||
.scroll_page_fractional => |fraction| {
|
||||
const rows: f32 = @floatFromInt(self.grid_size.rows);
|
||||
const delta: isize = @intFromFloat(@floor(fraction * rows));
|
||||
const delta: isize = @intFromFloat(@trunc(fraction * rows));
|
||||
self.io.queueMessage(.{
|
||||
.scroll_viewport = .{ .delta = delta },
|
||||
}, .unlocked);
|
||||
|
Reference in New Issue
Block a user