Skip to content

Commit

Permalink
Merge pull request #98232 from dbnicholson/editor-dock-select-root
Browse files Browse the repository at this point in the history
Fix selecting root node before button released
  • Loading branch information
Repiteo committed Nov 10, 2024
2 parents da01ffc + b05aab4 commit 68c35f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion editor/scene_tree_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ void SceneTreeDock::input(const Ref<InputEvent> &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_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;
} else if (!mb->is_pressed()) {
tree_clicked = false;
Expand Down

0 comments on commit 68c35f4

Please sign in to comment.