aboutsummaryrefslogtreecommitdiff
path: root/touch_item_list
diff options
context:
space:
mode:
authordam <dam@gudinoff>2022-02-06 03:19:37 +0000
committerdam <dam@gudinoff>2022-02-06 03:19:37 +0000
commit9e96569d70660cb18b2d4669e6a71efcb4f863d6 (patch)
tree7f9cad914b9c35c9db849f05a5529327c4a56198 /touch_item_list
parent5fefdacf1e69f68b3768f419e3bed826eac79865 (diff)
downloadsurgery-log-9e96569d70660cb18b2d4669e6a71efcb4f863d6.tar.zst
surgery-log-9e96569d70660cb18b2d4669e6a71efcb4f863d6.zip
WIP: Implement option sets logic.
Diffstat (limited to 'touch_item_list')
-rw-r--r--touch_item_list/touch_item_list.gd3
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 07d8f30..2b18eae 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 EXACT_SELECTION: bool = false
var is_pointer_dragging := false
var pointer_drag_velocity := 0.0
@@ -41,7 +42,7 @@ func pointer_input_on_end_drag_handler(pointer: PointerInputSensor.PointerInputD
func pointer_input_on_click_handler(pointer: PointerInputSensor.PointerInputData):
- var selected_idx := get_item_at_position(pointer.current_position - rect_global_position, true)
+ var selected_idx := get_item_at_position(pointer.current_position - rect_global_position, EXACT_SELECTION)
if selected_idx >= 0:
select(selected_idx)
emit_signal("item_selected", selected_idx)