summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Michel Bernard <jmb462@gmail.com>2022-02-11 18:44:17 +0100
committerJean-Michel Bernard <jmb462@gmail.com>2022-02-11 18:44:17 +0100
commitef995b222eaa491d0bcca92afb85b2bed38b11ae (patch)
treeb1cbaa6e9d3177af24e29c284b4be2ad705e4936
parentcf13f8af648c075282e596744e48d60c25fae283 (diff)
Hide CollisionShape2D handles when node is not visible in tree.
-rw-r--r--editor/plugins/collision_shape_2d_editor_plugin.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/editor/plugins/collision_shape_2d_editor_plugin.cpp b/editor/plugins/collision_shape_2d_editor_plugin.cpp
index 8a5df6ac50..894b1dd160 100644
--- a/editor/plugins/collision_shape_2d_editor_plugin.cpp
+++ b/editor/plugins/collision_shape_2d_editor_plugin.cpp
@@ -323,6 +323,10 @@ bool CollisionShape2DEditor::forward_canvas_gui_input(const Ref<InputEvent> &p_e
return false;
}
+ if (!node->is_visible_in_tree()) {
+ return false;
+ }
+
if (shape_type == -1) {
return false;
}
@@ -445,6 +449,10 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla
return;
}
+ if (!node->is_visible_in_tree()) {
+ return;
+ }
+
_get_current_shape_type();
if (shape_type == -1) {