From 8f11304dfcb9e8414b781a17e7e090b757509296 Mon Sep 17 00:00:00 2001 From: Andreas Haas Date: Thu, 19 Jan 2017 17:10:47 +0100 Subject: [PATCH] 2D Editor: Don't show lock icons for hidden nodes. Now we only draw those icons for visible Nodes. Fixes #7518 Cherry-picked/adapted from a043ce7304c4a9b56b5d79efa4cca05160339e72 --- tools/editor/plugins/canvas_item_editor_plugin.cpp | 2 +- tools/editor/scene_tree_editor.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index 242310a85b8..2504dee705d 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -2336,7 +2336,7 @@ void CanvasItemEditor::_find_canvas_items_span(Node *p_node, Rect2& r_rect, cons - if (c) { + if (c && c->is_visible()) { Rect2 rect = c->get_item_rect(); Matrix32 xform = p_xform * c->get_transform(); diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp index 41819cb7cdb..85bba139979 100644 --- a/tools/editor/scene_tree_editor.cpp +++ b/tools/editor/scene_tree_editor.cpp @@ -471,6 +471,7 @@ void SceneTreeEditor::_node_visibility_changed(Node *p_node) { if (p_node->is_type("CanvasItem")) { visible = !p_node->call("is_hidden"); + CanvasItemEditor::get_singleton()->get_viewport_control()->update(); } else if (p_node->is_type("Spatial")) { visible = !p_node->call("is_hidden"); }