mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Fix alt+drag duplication order
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
parent
0fe736cd3f
commit
0e92b1206f
2 changed files with 7 additions and 1 deletions
|
@ -8447,6 +8447,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
y: origEl.y,
|
||||
};
|
||||
},
|
||||
reverseOrder: true,
|
||||
});
|
||||
clonedElements.forEach((element) => {
|
||||
pointerDownState.originalElements.set(element.id, element);
|
||||
|
|
|
@ -105,6 +105,7 @@ export const duplicateElements = (
|
|||
};
|
||||
overrides?: (element: ExcalidrawElement) => Partial<ExcalidrawElement>;
|
||||
randomizeSeed?: boolean;
|
||||
reverseOrder?: boolean;
|
||||
},
|
||||
) => {
|
||||
// Ids of elements that have already been processed so we don't push them
|
||||
|
@ -192,7 +193,11 @@ export const duplicateElements = (
|
|||
return;
|
||||
}
|
||||
|
||||
elementsWithClones.splice(index + 1, 0, ...castArray(elements));
|
||||
elementsWithClones.splice(
|
||||
index + (opts?.reverseOrder ? 0 : +1),
|
||||
0,
|
||||
...castArray(elements),
|
||||
);
|
||||
};
|
||||
|
||||
const frameIdsToDuplicate = new Set(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue