Fix double undos, cleans up utils
This commit is contained in:
parent
8271e6d431
commit
bdafae3db6
53 changed files with 1676 additions and 1515 deletions
|
@ -13,8 +13,6 @@ export default function distributeCommand(
|
|||
data: Data,
|
||||
type: DistributeType
|
||||
): void {
|
||||
const { currentPageId } = data
|
||||
|
||||
const selectedShapes = getSelectedShapes(data).filter(
|
||||
(shape) => !shape.isLocked
|
||||
)
|
||||
|
@ -40,7 +38,7 @@ export default function distributeCommand(
|
|||
name: 'distribute_shapes',
|
||||
category: 'canvas',
|
||||
do(data) {
|
||||
const { shapes } = getPage(data, currentPageId)
|
||||
const { shapes } = getPage(data)
|
||||
const len = entries.length
|
||||
|
||||
switch (type) {
|
||||
|
@ -132,7 +130,7 @@ export default function distributeCommand(
|
|||
}
|
||||
},
|
||||
undo(data) {
|
||||
const { shapes } = getPage(data, currentPageId)
|
||||
const { shapes } = getPage(data)
|
||||
for (const id in boundsForShapes) {
|
||||
const shape = shapes[id]
|
||||
const initialBounds = boundsForShapes[id]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue