Merge pull request #98232 from dbnicholson/editor-dock-select-root

Fix selecting root node before button released
This commit is contained in:
Thaddeus Crews 2024-11-10 12:12:39 -06:00
commit 68c35f498a
No known key found for this signature in database
GPG Key ID: 62181B86FE9E5D84

View File

@ -126,7 +126,8 @@ void SceneTreeDock::input(const Ref<InputEvent> &p_event) {
Ref<InputEventMouseButton> mb = p_event; Ref<InputEventMouseButton> mb = p_event;
if (mb.is_valid() && (mb->get_button_index() == MouseButton::LEFT || mb->get_button_index() == MouseButton::RIGHT)) { if (mb.is_valid() && (mb->get_button_index() == MouseButton::LEFT || mb->get_button_index() == MouseButton::RIGHT)) {
if (mb->is_pressed() && scene_tree->get_rect().has_point(scene_tree->get_local_mouse_position())) { Tree *tree = scene_tree->get_scene_tree();
if (mb->is_pressed() && tree->get_rect().has_point(tree->get_local_mouse_position())) {
tree_clicked = true; tree_clicked = true;
} else if (!mb->is_pressed()) { } else if (!mb->is_pressed()) {
tree_clicked = false; tree_clicked = false;