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:
parent
0c456eb664
commit
444b3e3c66
|
@ -4,6 +4,7 @@ config.fps = 60
|
||||||
config.max_log_items = 80
|
config.max_log_items = 80
|
||||||
config.message_timeout = 5
|
config.message_timeout = 5
|
||||||
config.mouse_wheel_scroll = 50 * SCALE
|
config.mouse_wheel_scroll = 50 * SCALE
|
||||||
|
config.animate_drag_scroll = false
|
||||||
config.scroll_past_end = true
|
config.scroll_past_end = true
|
||||||
config.file_size_limit = 10
|
config.file_size_limit = 10
|
||||||
config.ignore_files = { "^%." }
|
config.ignore_files = { "^%." }
|
||||||
|
|
|
@ -134,6 +134,9 @@ function View:on_mouse_moved(x, y, dx, dy)
|
||||||
if self.dragging_scrollbar then
|
if self.dragging_scrollbar then
|
||||||
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
|
||||||
|
self.scroll.y = self.scroll.to.y
|
||||||
|
end
|
||||||
end
|
end
|
||||||
self.hovered_scrollbar = self:scrollbar_overlaps_point(x, y)
|
self.hovered_scrollbar = self:scrollbar_overlaps_point(x, y)
|
||||||
self.hovered_scrollbar_track = self.hovered_scrollbar or self:scrollbar_track_overlaps_point(x, y)
|
self.hovered_scrollbar_track = self.hovered_scrollbar or self:scrollbar_track_overlaps_point(x, y)
|
||||||
|
|
Loading…
Reference in New Issue