Fix orbit binding highlight

This commit is contained in:
Mark Tolmacs
2025-08-22 19:19:52 +02:00
parent 216ba26a45
commit e30c518e00
3 changed files with 20 additions and 10 deletions

View File

@@ -698,17 +698,24 @@ export const maybeSuggestBindingsForBindingElementAtCoords = (
linearElement: NonDeleted<ExcalidrawArrowElement>,
startOrEndOrBoth: "start" | "end" | "both",
scene: Scene,
pointerCoords: GlobalPoint,
): ExcalidrawBindableElement[] => {
const startCoords = LinearElementEditor.getPointAtIndexGlobalCoordinates(
linearElement,
0,
scene.getNonDeletedElementsMap(),
);
const endCoords = LinearElementEditor.getPointAtIndexGlobalCoordinates(
linearElement,
-1,
scene.getNonDeletedElementsMap(),
);
const startCoords =
startOrEndOrBoth === "start"
? pointerCoords
: LinearElementEditor.getPointAtIndexGlobalCoordinates(
linearElement,
0,
scene.getNonDeletedElementsMap(),
);
const endCoords =
startOrEndOrBoth === "end"
? pointerCoords
: LinearElementEditor.getPointAtIndexGlobalCoordinates(
linearElement,
-1,
scene.getNonDeletedElementsMap(),
);
const startHovered = getHoveredElementForBinding(
startCoords,
scene.getNonDeletedElements(),

View File

@@ -466,6 +466,7 @@ export class LinearElementEditor {
? "start"
: "end",
app.scene,
pointFrom<GlobalPoint>(scenePointerX, scenePointerY),
);
}
}