Clamp scroll position when dragging the scrollbar without animations
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user