mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
add arrowBoundToElement check
This commit is contained in:
parent
0d3e9cb1bc
commit
9ea9275fbd
2 changed files with 6 additions and 2 deletions
|
@ -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" ||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue