diff --git a/packages/element/src/typeChecks.ts b/packages/element/src/typeChecks.ts index fb321f209..aed06c812 100644 --- a/packages/element/src/typeChecks.ts +++ b/packages/element/src/typeChecks.ts @@ -285,6 +285,10 @@ export const isBoundToContainer = ( ); }; +export const isArrowBoundToElement = (element: ExcalidrawArrowElement) => { + return !!element.startBinding || !!element.endBinding; +}; + export const isUsingAdaptiveRadius = (type: string) => type === "rectangle" || type === "embeddable" || diff --git a/packages/excalidraw/data/restore.ts b/packages/excalidraw/data/restore.ts index 1811cbb57..cafc0bdd6 100644 --- a/packages/excalidraw/data/restore.ts +++ b/packages/excalidraw/data/restore.ts @@ -29,6 +29,7 @@ import { bumpVersion } from "@excalidraw/element/mutateElement"; import { getContainerElement } from "@excalidraw/element/textElement"; import { detectLineHeight } from "@excalidraw/element/textMeasurements"; import { + isArrowBoundToElement, isArrowElement, isElbowArrow, isFixedPointBinding, @@ -594,8 +595,7 @@ export const restoreElements = ( return restoredElements.map((element) => { if ( isElbowArrow(element) && - element.startBinding == null && - element.endBinding == null && + !isArrowBoundToElement(element) && !validateElbowPoints(element.points) ) { return {