fix issue on rotation undo
This commit is contained in:
@@ -402,7 +402,11 @@ export const setRotationAngle = function (val, preventUndo) {
|
|||||||
// we need to undo it, then redo it so it can be undo-able! :)
|
// we need to undo it, then redo it so it can be undo-able! :)
|
||||||
// TODO: figure out how to make changes to transform list undo-able cross-browser?
|
// TODO: figure out how to make changes to transform list undo-able cross-browser?
|
||||||
const newTransform = elem.getAttribute('transform');
|
const newTransform = elem.getAttribute('transform');
|
||||||
elem.setAttribute('transform', oldTransform);
|
if (oldTransform) {
|
||||||
|
elem.setAttribute('transform', oldTransform);
|
||||||
|
} else {
|
||||||
|
elem.removeAttribute('transform');
|
||||||
|
}
|
||||||
selectionContext_.getCanvas().changeSelectedAttribute('transform', newTransform, selectedElements);
|
selectionContext_.getCanvas().changeSelectedAttribute('transform', newTransform, selectedElements);
|
||||||
selectionContext_.getCanvas().call('changed', selectedElements);
|
selectionContext_.getCanvas().call('changed', selectedElements);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,7 +188,11 @@ export const changeSelectedAttributeNoUndoMethod = function (attr, newValue, ele
|
|||||||
// }
|
// }
|
||||||
} else if (attr === '#href') {
|
} else if (attr === '#href') {
|
||||||
setHref(elem, newValue);
|
setHref(elem, newValue);
|
||||||
} else { elem.setAttribute(attr, newValue); }
|
} else if (newValue) {
|
||||||
|
elem.setAttribute(attr, newValue);
|
||||||
|
} else {
|
||||||
|
elem.removeAttribute(attr);
|
||||||
|
}
|
||||||
|
|
||||||
// Go into "select" mode for text changes
|
// Go into "select" mode for text changes
|
||||||
// NOTE: Important that this happens AFTER elem.setAttribute() or else attributes like
|
// NOTE: Important that this happens AFTER elem.setAttribute() or else attributes like
|
||||||
|
|||||||
Reference in New Issue
Block a user