ensure scrollbar can never get ahead of the cursor

develop
myk002 2022-10-10 16:42:32 -07:00
parent 0dad512b5a
commit d650ba2377
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
1 changed files with 2 additions and 2 deletions

@ -420,11 +420,11 @@ local function scrollbar_do_drag(scrollbar)
x,y = scrollbar.frame_body:localXY(x,y) x,y = scrollbar.frame_body:localXY(x,y)
local bar_idx = y - scrollbar.bar_offset local bar_idx = y - scrollbar.bar_offset
local delta = bar_idx - scrollbar.is_dragging local delta = bar_idx - scrollbar.is_dragging
if delta < -2 then if delta < -scrollbar.bar_height then
scrollbar.on_scroll('up_large') scrollbar.on_scroll('up_large')
elseif delta < 0 then elseif delta < 0 then
scrollbar.on_scroll('up_small') scrollbar.on_scroll('up_small')
elseif delta > 2 then elseif delta > scrollbar.bar_height then
scrollbar.on_scroll('down_large') scrollbar.on_scroll('down_large')
elseif delta > 0 then elseif delta > 0 then
scrollbar.on_scroll('down_small') scrollbar.on_scroll('down_small')