Clamp scroll position when dragging the scrollbar without animations

This commit is contained in:
Guldoman 2022-04-26 22:49:55 +02:00
parent 9f7c6974ae
commit a7ea84ae8f
No known key found for this signature in database
GPG Key ID: C08A498EC7F1AFDD
1 changed files with 1 additions and 0 deletions

View File

@ -135,6 +135,7 @@ function View:on_mouse_moved(x, y, dx, dy)
local delta = self:get_scrollable_size() / self.size.y * dy local delta = self:get_scrollable_size() / self.size.y * dy
self.scroll.to.y = self.scroll.to.y + delta self.scroll.to.y = self.scroll.to.y + delta
if not config.animate_drag_scroll then if not config.animate_drag_scroll then
self:clamp_scroll_position()
self.scroll.y = self.scroll.to.y self.scroll.y = self.scroll.to.y
end end
end end