mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Bound text ordering fix
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
parent
f9566b04a5
commit
351abdb70a
2 changed files with 15 additions and 5 deletions
|
@ -193,8 +193,18 @@ export const duplicateElements = (
|
|||
return;
|
||||
}
|
||||
|
||||
if (opts?.reverseOrder && index < 1) {
|
||||
elementsWithClones.unshift(...castArray(elements));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!opts?.reverseOrder && index > elementsWithClones.length - 1) {
|
||||
elementsWithClones.push(...castArray(elements));
|
||||
return;
|
||||
}
|
||||
|
||||
elementsWithClones.splice(
|
||||
Math.max(index + (!!opts?.reverseOrder ? -1 : 1), 0),
|
||||
index + (!!opts?.reverseOrder ? 0 : 1),
|
||||
0,
|
||||
...castArray(elements),
|
||||
);
|
||||
|
@ -278,7 +288,7 @@ export const duplicateElements = (
|
|||
|
||||
if (boundTextElement) {
|
||||
insertAfterIndex(
|
||||
targetIndex,
|
||||
targetIndex + (!!opts?.reverseOrder ? -1 : 0),
|
||||
copyElements([element, boundTextElement]),
|
||||
);
|
||||
} else {
|
||||
|
|
|
@ -10629,7 +10629,7 @@ History {
|
|||
"id7",
|
||||
],
|
||||
"height": 10,
|
||||
"index": "a0G",
|
||||
"index": "a1G",
|
||||
"isDeleted": false,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
|
@ -10662,7 +10662,7 @@ History {
|
|||
"id7",
|
||||
],
|
||||
"height": 10,
|
||||
"index": "a0V",
|
||||
"index": "a1V",
|
||||
"isDeleted": false,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
|
@ -10695,7 +10695,7 @@ History {
|
|||
"id7",
|
||||
],
|
||||
"height": 10,
|
||||
"index": "a0l",
|
||||
"index": "a1l",
|
||||
"isDeleted": false,
|
||||
"link": null,
|
||||
"locked": false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue