finishes rotation

This commit is contained in:
Steve Ruiz 2021-05-18 09:32:20 +01:00
parent e2aac4b267
commit 1ece606db0
18 changed files with 353 additions and 198 deletions

View file

@ -16,16 +16,24 @@ export default function translateCommand(
do(data) {
const { shapes } = data.document.pages[after.currentPageId]
for (let { id, rotation } of after.shapes) {
shapes[id].rotation = rotation
for (let { id, point, rotation } of after.shapes) {
const shape = shapes[id]
shape.rotation = rotation
shape.point = point
}
data.boundsRotation = after.boundsRotation
},
undo(data) {
const { shapes } = data.document.pages[before.currentPageId]
for (let { id, rotation } of before.shapes) {
shapes[id].rotation = rotation
for (let { id, point, rotation } of before.shapes) {
const shape = shapes[id]
shape.rotation = rotation
shape.point = point
}
data.boundsRotation = before.boundsRotation
},
})
)