aboutsummaryrefslogtreecommitdiff
path: root/touch_item_list/touch_item_list.gd
diff options
context:
space:
mode:
Diffstat (limited to 'touch_item_list/touch_item_list.gd')
-rw-r--r--touch_item_list/touch_item_list.gd6
1 files changed, 5 insertions, 1 deletions
diff --git a/touch_item_list/touch_item_list.gd b/touch_item_list/touch_item_list.gd
index 5a1279c..8b79431 100644
--- a/touch_item_list/touch_item_list.gd
+++ b/touch_item_list/touch_item_list.gd
@@ -34,7 +34,11 @@ func pointer_input_on_press_handler(pointer: PointerInputSensor.PointerInputData
func pointer_input_on_drag_handler(pointer: PointerInputSensor.PointerInputData):
is_pointer_dragging = true
- pointer_drag_velocity = pointer.velocity.y * POINTER_VELOCITY_BOOST_FACTOR
+ var reported_velocity_abs := abs(pointer.velocity.y)
+ var relative_velocity := pointer.relative_position.y * Engine.get_frames_per_second()
+ var relative_velocity_abs := abs(relative_velocity)
+ var max_velocity := pointer.velocity.y if reported_velocity_abs > relative_velocity_abs else relative_velocity
+ pointer_drag_velocity = max_velocity * POINTER_VELOCITY_BOOST_FACTOR
v_scroll_bar.value -= pointer.relative_position.y