Fix binding suggestion

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
fix/elbow-inside-binding
Mark Tolmacs 14 hours ago
parent d150745c0f
commit 80df9baee4
No known key found for this signature in database

@ -133,6 +133,7 @@ import {
shouldEnableBindingForPointerEvent,
updateBoundElements,
getSuggestedBindingsForArrows,
getHoveredElementsForBinding,
} from "../element/binding";
import { LinearElementEditor } from "../element/linearElementEditor";
import { mutateElement, newElementWith } from "../element/mutateElement";
@ -10038,12 +10039,20 @@ class App extends React.Component<AppProps, AppState> {
const suggestedBindings = pointerCoords.reduce(
(acc: NonDeleted<ExcalidrawBindableElement>[], coords) => {
const hoveredBindableElement = getHoveredElementForBinding(
const hoveredBindableElement = isElbowArrow(linearElement)
? getHoveredElementsForBinding(
coords,
this.scene.getNonDeletedElements(),
this.scene.getNonDeletedElementsMap(),
this.state.zoom,
true,
)
: getHoveredElementForBinding(
coords,
this.scene.getNonDeletedElements(),
this.scene.getNonDeletedElementsMap(),
this.state.zoom,
isArrowElement(linearElement) && isElbowArrow(linearElement),
isArrowElement(linearElement),
);
if (
hoveredBindableElement != null &&

Loading…
Cancel
Save