#543 if you move the group and try to undo the move, the text does not undo correctly issue fixed
parent
1897e2e0ff
commit
8e01c1890c
|
@ -98,6 +98,24 @@ export const getUndoManager = function () {
|
|||
// // Ok to replace above with this? `sib.before(elem);`
|
||||
// }
|
||||
// }
|
||||
if (cmd.elem.tagName === 'text'){
|
||||
const [ dx, dy ] = [ cmd.newValues.x - cmd.oldValues.x,
|
||||
cmd.newValues.y - cmd.oldValues.y ];
|
||||
|
||||
const tspans = cmd.elem.children;
|
||||
|
||||
for (let i = 0; i < tspans.length; i++){
|
||||
let x = +tspans[i].getAttribute('x');
|
||||
let y = +tspans[i].getAttribute('y');
|
||||
|
||||
const unapply = (eventType === EventTypes.AFTER_UNAPPLY);
|
||||
x = unapply? x - dx: x + dx;
|
||||
y = unapply? y - dy: y + dy;
|
||||
|
||||
tspans[i].setAttribute('x', x);
|
||||
tspans[i].setAttribute('y', y);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue