瀏覽代碼

Ensure CSG parent's _make_dirty() is called when entering a tree.

(cherry picked from commit 9be7b30f3536057b22fd70d5367268749c1a7ea9)
Marcel Admiraal 5 年之前
父節點
當前提交
c8d8134288
共有 1 個文件被更改,包括 3 次插入8 次删除
  1. 3 8
      modules/csg/csg_shape.cpp

+ 3 - 8
modules/csg/csg_shape.cpp

@@ -136,18 +136,13 @@ void CSGShape::_make_dirty() {
 	if (!is_inside_tree())
 		return;
 
-	if (dirty) {
-		return;
-	}
-
-	dirty = true;
-
 	if (parent) {
 		parent->_make_dirty();
-	} else {
-		//only parent will do
+	} else if (!dirty) {
 		call_deferred("_update_shape");
 	}
+
+	dirty = true;
 }
 
 CSGBrush *CSGShape::_get_brush() {