various refactor
This commit is contained in:
@@ -108,7 +108,6 @@ export const moveUpDownSelected = function (dir) {
|
||||
if (!selected) { return; }
|
||||
|
||||
elementContext_.setCurBBoxes([]);
|
||||
// curBBoxes = [];
|
||||
let closest; let foundCur;
|
||||
// jQuery sorts this list
|
||||
const list = elementContext_.getIntersectionList(getStrokedBBoxDefaultVisible([ selected ]));
|
||||
@@ -163,10 +162,8 @@ export const moveSelectedElements = function (dx, dy, undoable = true) {
|
||||
}
|
||||
|
||||
const batchCmd = new BatchCommand('position');
|
||||
let i = selectedElements.length;
|
||||
while (i--) {
|
||||
const selected = selectedElements[i];
|
||||
if (!isNullish(selected)) {
|
||||
selectedElements.forEach((selected, i) => {
|
||||
if (selected) {
|
||||
const xform = elementContext_.getSVGRoot().createSVGTransform();
|
||||
const tlist = selected.transform?.baseVal;
|
||||
|
||||
@@ -190,7 +187,7 @@ export const moveSelectedElements = function (dx, dy, undoable = true) {
|
||||
|
||||
elementContext_.gettingSelectorManager().requestSelector(selected).resize();
|
||||
}
|
||||
}
|
||||
});
|
||||
if (!batchCmd.isEmpty()) {
|
||||
if (undoable) {
|
||||
elementContext_.addCommandToHistory(batchCmd);
|
||||
@@ -893,12 +890,7 @@ export const ungroupSelectedElement = function () {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (anchor) {
|
||||
anchor.before(elem);
|
||||
} else {
|
||||
g.after(elem);
|
||||
}
|
||||
children[i++] = elem;
|
||||
children[i++] = parent.insertBefore(elem, anchor);
|
||||
batchCmd.addSubCommand(new MoveElementCommand(elem, oldNextSibling, oldParent));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user