Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/display/draw.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Element from './elements/Element';
import { newElement } from './elements/creator';

export const draw = (context, data) => {
Expand All @@ -17,6 +18,8 @@ export const draw = (context, data) => {
const destroyChildren = (parent) => {
const children = [...parent.children];
for (const child of children) {
child.destroy({ children: true });
if (child instanceof Element) {
child.destroy({ children: true });
}
}
};