Clamp scroll position when dragging the scrollbar without animations

This commit is contained in:
Guldoman
2022-04-26 22:50:44 +02:00
parent 9f7c6974ae
commit a7ea84ae8f
+1
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
self.scroll.to.y = self.scroll.to.y + delta
if not config.animate_drag_scroll then
self:clamp_scroll_position()
self.scroll.y = self.scroll.to.y
end
end