mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix for duplicating elements (#261)
This commit is contained in:
parent
7f7f51f70b
commit
2122a9cf9f
3 changed files with 20 additions and 8 deletions
|
@ -32,3 +32,10 @@ export function newElement(
|
|||
};
|
||||
return element;
|
||||
}
|
||||
|
||||
export function duplicateElement(element: ReturnType<typeof newElement>) {
|
||||
const copy = { ...element };
|
||||
copy.id = nanoid();
|
||||
copy.seed = randomSeed();
|
||||
return copy;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue