fix: scrolling with fraction produces different lines count due to @floor vs @trunc (-1 vs 1)

This commit is contained in:
theprimeagen
2024-10-03 11:17:16 -06:00
parent e78a56a033
commit f0591b4afb

View File

@ -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);