From 6c237cff31411c2cb28cbd4077807c2fa1fdb553 Mon Sep 17 00:00:00 2001 From: Jordan Rowland <46544691+undo-k@users.noreply.github.com> Date: Mon, 25 May 2026 11:41:40 -0400 Subject: [PATCH] fix(vxfw): out of bounds panic on ScrollBars --- src/vxfw/ScrollBars.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vxfw/ScrollBars.zig b/src/vxfw/ScrollBars.zig index 669200d3..eff49f18 100644 --- a/src/vxfw/ScrollBars.zig +++ b/src/vxfw/ScrollBars.zig @@ -166,7 +166,7 @@ pub fn handleCapture(self: *ScrollBars, ctx: *vxfw.EventContext, event: vxfw.Eve // If the new thumb position is at the top we know we've scrolled to the top of // the scroll view. - if (new_thumb_top == 0) { + if (new_thumb_top <= 0) { self.scroll_view.scroll.top = 0; return ctx.consumeAndRedraw(); } @@ -238,7 +238,7 @@ pub fn handleCapture(self: *ScrollBars, ctx: *vxfw.EventContext, event: vxfw.Eve // If the new thumb position is at the horizontal beginning of the current view // we know we've scrolled to the beginning of the scroll view. - if (new_thumb_col_start == 0) { + if (new_thumb_col_start <= 0) { self.scroll_view.scroll.left = 0; return ctx.consumeAndRedraw(); }