From c8d8134288429f713dc09c788b17b387fbbba777 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Thu, 30 Jul 2020 11:25:28 +0100 Subject: [PATCH] Ensure CSG parent's _make_dirty() is called when entering a tree. (cherry picked from commit 9be7b30f3536057b22fd70d5367268749c1a7ea9) --- modules/csg/csg_shape.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index 7d3c02a39ed..bc2d037d401 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -136,18 +136,13 @@ void CSGShape::_make_dirty() { if (!is_inside_tree()) return; - if (dirty) { - return; + if (parent) { + parent->_make_dirty(); + } else if (!dirty) { + call_deferred("_update_shape"); } dirty = true; - - if (parent) { - parent->_make_dirty(); - } else { - //only parent will do - call_deferred("_update_shape"); - } } CSGBrush *CSGShape::_get_brush() {