mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
ensure duplicateElement does deep copy of points (#742)
This commit is contained in:
parent
389e40900c
commit
2a472bb912
1 changed files with 4 additions and 1 deletions
|
@ -63,7 +63,10 @@ export function newTextElement(
|
|||
}
|
||||
|
||||
export function duplicateElement(element: ReturnType<typeof newElement>) {
|
||||
const copy = { ...element };
|
||||
const copy = {
|
||||
...element,
|
||||
points: JSON.parse(JSON.stringify(element.points)),
|
||||
};
|
||||
delete copy.shape;
|
||||
copy.id = nanoid();
|
||||
copy.seed = randomSeed();
|
||||
|
|
Loading…
Add table
Reference in a new issue