From d650ba23777726899b56e2a4ebc29c790a56de5b Mon Sep 17 00:00:00 2001 From: myk002 Date: Mon, 10 Oct 2022 16:42:32 -0700 Subject: [PATCH] ensure scrollbar can never get ahead of the cursor --- library/lua/gui/widgets.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/lua/gui/widgets.lua b/library/lua/gui/widgets.lua index f63b708cf..eb8d92244 100644 --- a/library/lua/gui/widgets.lua +++ b/library/lua/gui/widgets.lua @@ -420,11 +420,11 @@ local function scrollbar_do_drag(scrollbar) x,y = scrollbar.frame_body:localXY(x,y) local bar_idx = y - scrollbar.bar_offset local delta = bar_idx - scrollbar.is_dragging - if delta < -2 then + if delta < -scrollbar.bar_height then scrollbar.on_scroll('up_large') elseif delta < 0 then scrollbar.on_scroll('up_small') - elseif delta > 2 then + elseif delta > scrollbar.bar_height then scrollbar.on_scroll('down_large') elseif delta > 0 then scrollbar.on_scroll('down_small')