diff options
Diffstat (limited to 'client/gui/components/touch_scroll_container.gd')
-rw-r--r-- | client/gui/components/touch_scroll_container.gd | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/client/gui/components/touch_scroll_container.gd b/client/gui/components/touch_scroll_container.gd index c6c1393b..292d084a 100644 --- a/client/gui/components/touch_scroll_container.gd +++ b/client/gui/components/touch_scroll_container.gd @@ -18,7 +18,7 @@ class_name ScrollContainerCustom # Adds support for scrolling with joypad and touch -const SCROLL_SPEED := 1000. +const SCROLL_SPEED := 70. var velocity := 0. @export var auto_scroll_to_bottom := false @@ -35,7 +35,7 @@ func scroll_to_bottom(): func _process(delta): velocity = G.interpolate(velocity, 0., delta * 5.) - velocity = 0. if abs(velocity) < .001 else velocity + velocity = 0. if abs(velocity) < .1 else velocity if Input.get_axis("scroll_up", "scroll_down") != 0.: velocity = Input.get_axis("scroll_up", "scroll_down") set_deferred("scroll_vertical", scroll_vertical + velocity * delta * SCROLL_SPEED) @@ -43,4 +43,4 @@ func _process(delta): func _input(event): if event is InputEventScreenDrag: if Rect2(global_position, size).has_point(event.position): - velocity = -(scroll_vertical - (scroll_vertical - event.relative.y)) * .1 + velocity = -event.screen_relative.y |