diff --git a/src/element/newElement.ts b/src/element/newElement.ts index 314493f2c1..13e37f5d2e 100644 --- a/src/element/newElement.ts +++ b/src/element/newElement.ts @@ -65,8 +65,13 @@ export function newTextElement( export function duplicateElement(element: ReturnType) { const copy = { ...element, - points: JSON.parse(JSON.stringify(element.points)), }; + if ("points" in copy) { + copy.points = Array.isArray(element.points) + ? JSON.parse(JSON.stringify(element.points)) + : element.points; + } + delete copy.shape; copy.id = nanoid(); copy.seed = randomSeed();