Fixes deleting undos

This commit is contained in:
Steve Ruiz 2021-06-04 19:49:27 +01:00
parent fcb11f19e3
commit 9626461ea7
4 changed files with 66 additions and 16 deletions

View file

@ -58,6 +58,18 @@ export default function deleteSelected(data: Data) {
page.shapes[shape.id] = shape
}
for (let shape of childrenToDelete) {
if (shape.parentId !== data.currentPageId) {
const parent = page.shapes[shape.parentId]
getShapeUtils(parent)
.setProperty(parent, 'children', [...parent.children, shape.id])
.onChildrenChange(
parent,
parent.children.map((id) => page.shapes[id])
)
}
}
data.selectedIds = new Set(selectedIds)
},
})