Make sure to schedule draw when calling removeChildren or destroyChildren

This commit is contained in:
Albert Brand
2021-06-30 10:06:41 +02:00
parent e558ec961e
commit 7c1787ca35
2 changed files with 30 additions and 0 deletions

View File

@@ -83,6 +83,8 @@ export abstract class Container<
child.remove();
});
this.children = [];
// because all children were detached from parent, request draw via container
this._requestDraw();
return this;
}
/**
@@ -98,6 +100,8 @@ export abstract class Container<
child.destroy();
});
this.children = [];
// because all children were detached from parent, request draw via container
this._requestDraw();
return this;
}
abstract _validateAdd(node: Node): void;