Don't animate scrolling by dragging the scroll bar (#940)

Also added the `config.animate_drag_scroll` option to re-enable the 
behavior.
This commit is contained in:
Guldoman
2022-04-26 09:54:11 -04:00
committed by GitHub
parent 0c456eb664
commit 444b3e3c66
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -134,6 +134,9 @@ function View:on_mouse_moved(x, y, dx, dy)
if self.dragging_scrollbar then
local delta = self:get_scrollable_size() / self.size.y * dy
self.scroll.to.y = self.scroll.to.y + delta
if not config.animate_drag_scroll then
self.scroll.y = self.scroll.to.y
end
end
self.hovered_scrollbar = self:scrollbar_overlaps_point(x, y)
self.hovered_scrollbar_track = self.hovered_scrollbar or self:scrollbar_track_overlaps_point(x, y)