Skip to content

Commit 68c35f4

Browse files
committed
Merge pull request #98232 from dbnicholson/editor-dock-select-root
Fix selecting root node before button released
2 parents da01ffc + b05aab4 commit 68c35f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

editor/scene_tree_dock.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ void SceneTreeDock::input(const Ref<InputEvent> &p_event) {
126126
Ref<InputEventMouseButton> mb = p_event;
127127

128128
if (mb.is_valid() && (mb->get_button_index() == MouseButton::LEFT || mb->get_button_index() == MouseButton::RIGHT)) {
129-
if (mb->is_pressed() && scene_tree->get_rect().has_point(scene_tree->get_local_mouse_position())) {
129+
Tree *tree = scene_tree->get_scene_tree();
130+
if (mb->is_pressed() && tree->get_rect().has_point(tree->get_local_mouse_position())) {
130131
tree_clicked = true;
131132
} else if (!mb->is_pressed()) {
132133
tree_clicked = false;

0 commit comments

Comments
 (0)