Fix touch input: tap suppression must only fire when camera mode is active
_touch_drag_active was set unconditionally on 36px drag, silently eating board taps even when no camera action occurred. Now only set when a camera mode (orbit/pan/zoom) is actually active. Gesture timer also immediately marks drag-active on activation so the 3s hold doesn't fire a board click. Buttons enlarged to 44px minimum height for touch usability. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -335,8 +335,8 @@ anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
offset_left = 8.0
|
||||
offset_top = 56.0
|
||||
offset_right = 96.0
|
||||
offset_bottom = 164.0
|
||||
offset_right = 104.0
|
||||
offset_bottom = 200.0
|
||||
visible = false
|
||||
|
||||
[node name="CamCtrlVBox" type="VBoxContainer" parent="HUD/CamCtrlPanel"]
|
||||
@@ -346,17 +346,20 @@ theme_override_constants/separation = 4
|
||||
[node name="CamOrbitBtn" type="Button" parent="HUD/CamCtrlPanel/CamCtrlVBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
custom_minimum_size = Vector2(0, 44)
|
||||
toggle_mode = true
|
||||
text = "Orbit"
|
||||
|
||||
[node name="CamPanBtn" type="Button" parent="HUD/CamCtrlPanel/CamCtrlVBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
custom_minimum_size = Vector2(0, 44)
|
||||
toggle_mode = true
|
||||
text = "Pan"
|
||||
|
||||
[node name="CamZoomBtn" type="Button" parent="HUD/CamCtrlPanel/CamCtrlVBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
custom_minimum_size = Vector2(0, 44)
|
||||
toggle_mode = true
|
||||
text = "Zoom"
|
||||
|
||||
@@ -860,6 +860,9 @@ func _on_cam_gesture_timer_fired() -> void:
|
||||
_touch_cam_pan = true
|
||||
_touch_cam_orbit = false
|
||||
_touch_cam_zoom = false
|
||||
# The user deliberately held — mark as drag so release won't fire a board click.
|
||||
_touch_drag_active = true
|
||||
_hold_timer.stop()
|
||||
|
||||
|
||||
# ── Input ─────────────────────────────────────────────────────────────────────
|
||||
@@ -989,8 +992,11 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
if _touch_points.size() == 1 and not _was_multi_touch:
|
||||
_touch_drag_total += sd.relative.length()
|
||||
if _touch_drag_total > 36.0:
|
||||
_touch_drag_active = true
|
||||
_hold_timer.stop()
|
||||
# Only suppress the tap click when a camera action will actually happen.
|
||||
# Without this, a normal swipe with no camera mode active silently eats the touch.
|
||||
if _touch_cam_orbit or _touch_cam_pan or _touch_cam_zoom:
|
||||
_touch_drag_active = true
|
||||
if _touch_drag_active:
|
||||
if _touch_cam_orbit:
|
||||
_cam_yaw -= sd.relative.x * 0.4
|
||||
|
||||
Reference in New Issue
Block a user