mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-08 10:07:04 +02:00
fix for duplicating elements (#261)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user