summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-02-11 14:35:54 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-02-11 14:35:54 +0100
commit7bcd9a10498655b63ffddfc560b1adc425f33117 (patch)
treeefc4727abd25e8b5b004a02fa3d60c497d6dd207 /editor
parent7725a1a14cd316552f8b379d5e7efca5d56266ae (diff)
parentbe916233f9022cb527cd053339102e141497761f (diff)
Merge pull request #73082 from aaronfranke/check-canvas-item
Check for CanvasItem instead of Control and Node2D
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_node.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 3adebb2f8e..1dce65cfab 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -3685,7 +3685,7 @@ void EditorNode::_set_main_scene_state(Dictionary p_state, Node *p_for_scene) {
Node *editor_node = SceneTreeDock::get_singleton()->get_tree_editor()->get_selected();
editor_node = editor_node == nullptr ? get_edited_scene() : editor_node;
- if (Object::cast_to<Node2D>(editor_node) || Object::cast_to<Control>(editor_node)) {
+ if (Object::cast_to<CanvasItem>(editor_node)) {
editor_select(EDITOR_2D);
} else if (Object::cast_to<Node3D>(editor_node)) {
editor_select(EDITOR_3D);