Fix items not responding to clicks #12
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/item-click-not-registering"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Root cause: every ColorRect/Label visual is a Control node, and
Control.mouse_filterdefaults to STOP — which silently swallows mouse clicks before anything else sees them. The full-screenFloorrect alone was blocking clicks across the entire window. Setmouse_filter = 2(ignore) on all purely-decorative visuals.Also switched items from
Area2D/_input_event(physics picking) to a plainNode2Dwith manual point-in-rect hit testing in_unhandled_input. Physics picking never fired in headless testing despite every relevant flag being correct; removing that dependency makes click detection simpler and verifiable from this sandbox rather than trusting an unverifiable mechanism.Verified headlessly:
_unhandled_inputnow reaches item nodes (previously swallowed by their own Visual ColorRect), hit-test math is correct for all three items, and the full #3/#4 regression suite still passes after the Area2D→Node2D change.Not verifiable from this sandbox: end-to-end click-to-drag through the real mouse pipeline, since
get_global_mouse_position()returns a fixed dummy value in headless mode regardless of synthetic input. Needs a real windowed test — next build should confirm.