- Fix(ungrouping): Ensure there is always an anchor (fixes #393 ); also fixes a bug with the ungrouped elements not being properly selectable after the ungrouping
This commit is contained in:
11
dist/index-es.js
vendored
11
dist/index-es.js
vendored
@@ -21325,14 +21325,19 @@ function SvgCanvas(container, config) {
|
|||||||
var oldParent = elem.parentNode; // Remove child title elements
|
var oldParent = elem.parentNode; // Remove child title elements
|
||||||
|
|
||||||
if (elem.tagName === 'title') {
|
if (elem.tagName === 'title') {
|
||||||
var _elem2 = elem,
|
var nextSibling = elem.nextSibling;
|
||||||
nextSibling = _elem2.nextSibling;
|
|
||||||
batchCmd.addSubCommand(new RemoveElementCommand$1(elem, nextSibling, oldParent));
|
batchCmd.addSubCommand(new RemoveElementCommand$1(elem, nextSibling, oldParent));
|
||||||
elem.remove();
|
elem.remove();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
children[i++] = elem = anchor.before(elem);
|
if (anchor) {
|
||||||
|
anchor.before(elem);
|
||||||
|
} else {
|
||||||
|
g.after(elem);
|
||||||
|
}
|
||||||
|
|
||||||
|
children[i++] = elem;
|
||||||
batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent));
|
batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent));
|
||||||
} // remove the group from the selection
|
} // remove the group from the selection
|
||||||
|
|
||||||
|
|||||||
2
dist/index-es.min.js
vendored
2
dist/index-es.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index-es.min.js.map
vendored
2
dist/index-es.min.js.map
vendored
File diff suppressed because one or more lines are too long
11
dist/index-umd.js
vendored
11
dist/index-umd.js
vendored
@@ -21331,14 +21331,19 @@
|
|||||||
var oldParent = elem.parentNode; // Remove child title elements
|
var oldParent = elem.parentNode; // Remove child title elements
|
||||||
|
|
||||||
if (elem.tagName === 'title') {
|
if (elem.tagName === 'title') {
|
||||||
var _elem2 = elem,
|
var nextSibling = elem.nextSibling;
|
||||||
nextSibling = _elem2.nextSibling;
|
|
||||||
batchCmd.addSubCommand(new RemoveElementCommand$1(elem, nextSibling, oldParent));
|
batchCmd.addSubCommand(new RemoveElementCommand$1(elem, nextSibling, oldParent));
|
||||||
elem.remove();
|
elem.remove();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
children[i++] = elem = anchor.before(elem);
|
if (anchor) {
|
||||||
|
anchor.before(elem);
|
||||||
|
} else {
|
||||||
|
g.after(elem);
|
||||||
|
}
|
||||||
|
|
||||||
|
children[i++] = elem;
|
||||||
batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent));
|
batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent));
|
||||||
} // remove the group from the selection
|
} // remove the group from the selection
|
||||||
|
|
||||||
|
|||||||
2
dist/index-umd.min.js
vendored
2
dist/index-umd.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index-umd.min.js.map
vendored
2
dist/index-umd.min.js.map
vendored
File diff suppressed because one or more lines are too long
11
dist/svgcanvas-iife.js
vendored
11
dist/svgcanvas-iife.js
vendored
@@ -21015,14 +21015,19 @@ var SvgCanvas = (function () {
|
|||||||
var oldParent = elem.parentNode; // Remove child title elements
|
var oldParent = elem.parentNode; // Remove child title elements
|
||||||
|
|
||||||
if (elem.tagName === 'title') {
|
if (elem.tagName === 'title') {
|
||||||
var _elem2 = elem,
|
var nextSibling = elem.nextSibling;
|
||||||
nextSibling = _elem2.nextSibling;
|
|
||||||
batchCmd.addSubCommand(new RemoveElementCommand$1(elem, nextSibling, oldParent));
|
batchCmd.addSubCommand(new RemoveElementCommand$1(elem, nextSibling, oldParent));
|
||||||
elem.remove();
|
elem.remove();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
children[i++] = elem = anchor.before(elem);
|
if (anchor) {
|
||||||
|
anchor.before(elem);
|
||||||
|
} else {
|
||||||
|
g.after(elem);
|
||||||
|
}
|
||||||
|
|
||||||
|
children[i++] = elem;
|
||||||
batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent));
|
batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent));
|
||||||
} // remove the group from the selection
|
} // remove the group from the selection
|
||||||
|
|
||||||
|
|||||||
2
dist/svgcanvas-iife.min.js
vendored
2
dist/svgcanvas-iife.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/svgcanvas-iife.min.js.map
vendored
2
dist/svgcanvas-iife.min.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -6799,7 +6799,7 @@ this.ungroupSelectedElement = function () {
|
|||||||
|
|
||||||
let i = 0;
|
let i = 0;
|
||||||
while (g.firstChild) {
|
while (g.firstChild) {
|
||||||
let elem = g.firstChild;
|
const elem = g.firstChild;
|
||||||
const oldNextSibling = elem.nextSibling;
|
const oldNextSibling = elem.nextSibling;
|
||||||
const oldParent = elem.parentNode;
|
const oldParent = elem.parentNode;
|
||||||
|
|
||||||
@@ -6811,7 +6811,12 @@ this.ungroupSelectedElement = function () {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
children[i++] = elem = anchor.before(elem);
|
if (anchor) {
|
||||||
|
anchor.before(elem);
|
||||||
|
} else {
|
||||||
|
g.after(elem);
|
||||||
|
}
|
||||||
|
children[i++] = elem;
|
||||||
batchCmd.addSubCommand(new MoveElementCommand(elem, oldNextSibling, oldParent));
|
batchCmd.addSubCommand(new MoveElementCommand(elem, oldNextSibling, oldParent));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21328,14 +21328,19 @@
|
|||||||
var oldParent = elem.parentNode; // Remove child title elements
|
var oldParent = elem.parentNode; // Remove child title elements
|
||||||
|
|
||||||
if (elem.tagName === 'title') {
|
if (elem.tagName === 'title') {
|
||||||
var _elem2 = elem,
|
var nextSibling = elem.nextSibling;
|
||||||
nextSibling = _elem2.nextSibling;
|
|
||||||
batchCmd.addSubCommand(new RemoveElementCommand$1(elem, nextSibling, oldParent));
|
batchCmd.addSubCommand(new RemoveElementCommand$1(elem, nextSibling, oldParent));
|
||||||
elem.remove();
|
elem.remove();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
children[i++] = elem = anchor.before(elem);
|
if (anchor) {
|
||||||
|
anchor.before(elem);
|
||||||
|
} else {
|
||||||
|
g.after(elem);
|
||||||
|
}
|
||||||
|
|
||||||
|
children[i++] = elem;
|
||||||
batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent));
|
batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent));
|
||||||
} // remove the group from the selection
|
} // remove the group from the selection
|
||||||
|
|
||||||
|
|||||||
@@ -21328,14 +21328,19 @@
|
|||||||
var oldParent = elem.parentNode; // Remove child title elements
|
var oldParent = elem.parentNode; // Remove child title elements
|
||||||
|
|
||||||
if (elem.tagName === 'title') {
|
if (elem.tagName === 'title') {
|
||||||
var _elem2 = elem,
|
var nextSibling = elem.nextSibling;
|
||||||
nextSibling = _elem2.nextSibling;
|
|
||||||
batchCmd.addSubCommand(new RemoveElementCommand$1(elem, nextSibling, oldParent));
|
batchCmd.addSubCommand(new RemoveElementCommand$1(elem, nextSibling, oldParent));
|
||||||
elem.remove();
|
elem.remove();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
children[i++] = elem = anchor.before(elem);
|
if (anchor) {
|
||||||
|
anchor.before(elem);
|
||||||
|
} else {
|
||||||
|
g.after(elem);
|
||||||
|
}
|
||||||
|
|
||||||
|
children[i++] = elem;
|
||||||
batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent));
|
batchCmd.addSubCommand(new MoveElementCommand$1(elem, oldNextSibling, oldParent));
|
||||||
} // remove the group from the selection
|
} // remove the group from the selection
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user