diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp index a43411c4ea3..88a651a7e9b 100644 --- a/editor/plugins/abstract_polygon_2d_editor.cpp +++ b/editor/plugins/abstract_polygon_2d_editor.cpp @@ -246,6 +246,10 @@ bool AbstractPolygon2DEditor::forward_gui_input(const Ref &p_event) return false; } + if (!_get_node()->is_visible_in_tree()) { + return false; + } + Ref mb = p_event; if (!_has_resource()) { @@ -479,6 +483,10 @@ void AbstractPolygon2DEditor::forward_canvas_draw_over_viewport(Control *p_overl return; } + if (!_get_node()->is_visible_in_tree()) { + return; + } + Transform2D xform = canvas_item_editor->get_canvas_transform() * _get_node()->get_global_transform(); // All polygon points are sharp, so use the sharp handle icon const Ref handle = get_theme_icon(SNAME("EditorPathSharpHandle"), SNAME("EditorIcons"));