|
@@ -1,6 +1,7 @@
|
|
import type {
|
|
import type {
|
|
ExcalidrawElement,
|
|
ExcalidrawElement,
|
|
ExcalidrawElementType,
|
|
ExcalidrawElementType,
|
|
|
|
+ ExcalidrawLinearElement,
|
|
ExcalidrawSelectionElement,
|
|
ExcalidrawSelectionElement,
|
|
ExcalidrawTextElement,
|
|
ExcalidrawTextElement,
|
|
FontFamilyValues,
|
|
FontFamilyValues,
|
|
@@ -21,7 +22,11 @@ import {
|
|
isInvisiblySmallElement,
|
|
isInvisiblySmallElement,
|
|
refreshTextDimensions,
|
|
refreshTextDimensions,
|
|
} from "../element";
|
|
} from "../element";
|
|
-import { isTextElement, isUsingAdaptiveRadius } from "../element/typeChecks";
|
|
|
|
|
|
+import {
|
|
|
|
+ isLinearElement,
|
|
|
|
+ isTextElement,
|
|
|
|
+ isUsingAdaptiveRadius,
|
|
|
|
+} from "../element/typeChecks";
|
|
import { randomId } from "../random";
|
|
import { randomId } from "../random";
|
|
import {
|
|
import {
|
|
DEFAULT_FONT_FAMILY,
|
|
DEFAULT_FONT_FAMILY,
|
|
@@ -460,6 +465,21 @@ export const restoreElements = (
|
|
),
|
|
),
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (isLinearElement(element)) {
|
|
|
|
+ if (
|
|
|
|
+ element.startBinding &&
|
|
|
|
+ !restoredElementsMap.has(element.startBinding.elementId)
|
|
|
|
+ ) {
|
|
|
|
+ (element as Mutable<ExcalidrawLinearElement>).startBinding = null;
|
|
|
|
+ }
|
|
|
|
+ if (
|
|
|
|
+ element.endBinding &&
|
|
|
|
+ !restoredElementsMap.has(element.endBinding.elementId)
|
|
|
|
+ ) {
|
|
|
|
+ (element as Mutable<ExcalidrawLinearElement>).endBinding = null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
return restoredElements;
|
|
return restoredElements;
|