Browse Source

bugfix parentContainer was not correctly handled in Layers

ncannasse 6 years ago
parent
commit
ee42e2f705
1 changed files with 3 additions and 0 deletions
  1. 3 0
      h2d/Layers.hx

+ 3 - 0
h2d/Layers.hx

@@ -41,11 +41,14 @@ class Layers extends Object {
 				children.splice(i, 1);
 				children.splice(i, 1);
 				if( s.allocated ) s.onRemove();
 				if( s.allocated ) s.onRemove();
 				s.parent = null;
 				s.parent = null;
+				s.posChanged = true;
+				if( s.parentContainer != null ) s.setParentContainer(null);
 				var k = layerCount - 1;
 				var k = layerCount - 1;
 				while( k >= 0 && layersIndexes[k] > i ) {
 				while( k >= 0 && layersIndexes[k] > i ) {
 					layersIndexes[k]--;
 					layersIndexes[k]--;
 					k--;
 					k--;
 				}
 				}
+				onContentChanged();
 				break;
 				break;
 			}
 			}
 		}
 		}