瀏覽代碼

fix removeChildren : prevent scaleGrid to be reset

ncannasse 6 年之前
父節點
當前提交
1e6167da5c
共有 1 個文件被更改,包括 4 次插入8 次删除
  1. 4 8
      h2d/Flow.hx

+ 4 - 8
h2d/Flow.hx

@@ -409,14 +409,10 @@ class Flow extends Object {
 	}
 
 	override function removeChildren() {
-		super.removeChildren();
-		if( background != null ) {
-			addChild(background);
-			properties[properties.length - 1].isAbsolute = true;
-		}
-		if( interactive != null ) {
-			addChild(interactive);
-			properties[properties.length - 1].isAbsolute = true;
+		var k = 0;
+		while( numChildren>k ) {
+			var c = getChildAt(k);
+			if( c == background || c == interactive ) k++; else removeChild(c);
 		}
 	}