Merge pull request #98299 from timothyqiu/tree-coordinate
Some checks are pending
🔗 GHA / 📊 Static checks (push) Waiting to run
🔗 GHA / 🤖 Android (push) Blocked by required conditions
🔗 GHA / 🍏 iOS (push) Blocked by required conditions
🔗 GHA / 🐧 Linux (push) Blocked by required conditions
🔗 GHA / 🍎 macOS (push) Blocked by required conditions
🔗 GHA / 🏁 Windows (push) Blocked by required conditions
🔗 GHA / 🌐 Web (push) Blocked by required conditions
🔗 GHA / 🪲 Godot CPP (push) Blocked by required conditions

Fix button click detection when `Tree` is rotated
This commit is contained in:
Thaddeus Crews 2024-10-21 16:39:31 -05:00
commit b3bcb2dc14
No known key found for this signature in database
GPG Key ID: 62181B86FE9E5D84

View File

@ -3022,7 +3022,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, int
}
// Make sure the click is correct.
Point2 click_pos = get_global_mouse_position() - get_global_position();
const Point2 click_pos = get_local_mouse_position();
if (!get_item_at_position(click_pos)) {
pressed_button = -1;
cache.click_type = Cache::CLICK_NONE;