fix for duplicating elements (#261)
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
export { newElement } from "./newElement";
|
||||
export { newElement, duplicateElement } from "./newElement";
|
||||
export {
|
||||
getElementAbsoluteCoords,
|
||||
getDiamondPoints,
|
||||
|
@ -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