mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-02-18 13:29:36 +01:00
fix: only bind arrow (#8152)
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
parent
4dc4590f24
commit
a1ffa064df
@ -23,6 +23,7 @@ import {
|
||||
refreshTextDimensions,
|
||||
} from "../element";
|
||||
import {
|
||||
isArrowElement,
|
||||
isLinearElement,
|
||||
isTextElement,
|
||||
isUsingAdaptiveRadius,
|
||||
@ -469,13 +470,15 @@ export const restoreElements = (
|
||||
if (isLinearElement(element)) {
|
||||
if (
|
||||
element.startBinding &&
|
||||
!restoredElementsMap.has(element.startBinding.elementId)
|
||||
(!restoredElementsMap.has(element.startBinding.elementId) ||
|
||||
!isArrowElement(element))
|
||||
) {
|
||||
(element as Mutable<ExcalidrawLinearElement>).startBinding = null;
|
||||
}
|
||||
if (
|
||||
element.endBinding &&
|
||||
!restoredElementsMap.has(element.endBinding.elementId)
|
||||
(!restoredElementsMap.has(element.endBinding.elementId) ||
|
||||
!isArrowElement(element))
|
||||
) {
|
||||
(element as Mutable<ExcalidrawLinearElement>).endBinding = null;
|
||||
}
|
||||
|
@ -358,6 +358,9 @@ export const bindLinearElement = (
|
||||
startOrEnd: "start" | "end",
|
||||
elementsMap: NonDeletedSceneElementsMap,
|
||||
): void => {
|
||||
if (!isArrowElement(linearElement)) {
|
||||
return;
|
||||
}
|
||||
mutateElement(linearElement, {
|
||||
[startOrEnd === "start" ? "startBinding" : "endBinding"]: {
|
||||
elementId: hoveredElement.id,
|
||||
|
Loading…
Reference in New Issue
Block a user