mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
simplify
This commit is contained in:
parent
9bd889a994
commit
2ed9d0ebdc
1 changed files with 3 additions and 3 deletions
|
@ -198,7 +198,7 @@ export const duplicateElements = (
|
||||||
) => {
|
) => {
|
||||||
invariant(index !== -1, "targetIndex === -1 ");
|
invariant(index !== -1, "targetIndex === -1 ");
|
||||||
|
|
||||||
if (!Array.isArray(elements) && !elements) {
|
if (!elements) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ export const duplicateElements = (
|
||||||
}
|
}
|
||||||
|
|
||||||
elementsWithClones.splice(
|
elementsWithClones.splice(
|
||||||
index + (!!opts?.reverseOrder ? 0 : 1),
|
index + (opts?.reverseOrder ? 0 : 1),
|
||||||
0,
|
0,
|
||||||
...castArray(elements),
|
...castArray(elements),
|
||||||
);
|
);
|
||||||
|
@ -304,7 +304,7 @@ export const duplicateElements = (
|
||||||
|
|
||||||
if (boundTextElement) {
|
if (boundTextElement) {
|
||||||
insertBeforeOrAfterIndex(
|
insertBeforeOrAfterIndex(
|
||||||
targetIndex + (!!opts?.reverseOrder ? -1 : 0),
|
targetIndex + (opts?.reverseOrder ? -1 : 0),
|
||||||
copyElements([element, boundTextElement]),
|
copyElements([element, boundTextElement]),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue