Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

ensure duplicateElement does deep copy of points (#742)

David Luzar2a472bb91242
diff --git a/src/element/newElement.ts b/src/element/newElement.ts
index 812afb4c55..314493f2c1 100644
--- a/src/element/newElement.ts
+++ b/src/element/newElement.ts
@@ -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();