diff options
| author | dam <dam@gudinoff> | 2022-02-22 00:10:01 +0000 |
|---|---|---|
| committer | dam <dam@gudinoff> | 2022-02-22 00:10:01 +0000 |
| commit | 0de881ffb462b32e4c6e59134868a1adaafc9873 (patch) | |
| tree | cc93f7cf35034464d9ee1cac7af1e6fc728397b6 /touch_item_list/touch_item_list.gd | |
| parent | ffcc5bf2cabd03518ad4606914b011c286a8e0bc (diff) | |
| download | surgery-log-0de881ffb462b32e4c6e59134868a1adaafc9873.tar.zst surgery-log-0de881ffb462b32e4c6e59134868a1adaafc9873.zip | |
Improve feedback when releasing touch scroll.
Diffstat (limited to 'touch_item_list/touch_item_list.gd')
| -rw-r--r-- | touch_item_list/touch_item_list.gd | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/touch_item_list/touch_item_list.gd b/touch_item_list/touch_item_list.gd index 2b18eae..5a1279c 100644 --- a/touch_item_list/touch_item_list.gd +++ b/touch_item_list/touch_item_list.gd @@ -2,6 +2,7 @@ extends ItemList class_name TouchItemList const POINTER_VELOCITY_DECAYING_FACTOR: float = 2.5 +const POINTER_VELOCITY_BOOST_FACTOR: float = 1.5 const EXACT_SELECTION: bool = false var is_pointer_dragging := false @@ -33,7 +34,7 @@ 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_drag_velocity = pointer.velocity.y * POINTER_VELOCITY_BOOST_FACTOR v_scroll_bar.value -= pointer.relative_position.y |
