1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-14 13:41:12 +00:00

Check for CanvasItem instead of Control and Node2D

This commit is contained in:
Aaron Franke
2023-02-11 02:18:10 -06:00
parent 9f6bb7dd50
commit be916233f9
2 changed files with 3 additions and 3 deletions

View File

@@ -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);