mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-19 07:20:21 +02:00
Multipoint arrows now have single point commit in binding zones
This commit is contained in:
@@ -239,24 +239,23 @@ export class LinearElementEditor {
|
||||
});
|
||||
}
|
||||
|
||||
static getOutlineAvoidingPoint(
|
||||
static getOutlineAvoidingPointOrNull(
|
||||
element: NonDeleted<ExcalidrawLinearElement>,
|
||||
coords: { x: number; y: number },
|
||||
pointIndex: number,
|
||||
app: AppClassProperties,
|
||||
): GlobalPoint {
|
||||
const elbowed = isElbowArrow(element);
|
||||
) {
|
||||
const hoveredElement = getHoveredElementForBinding(
|
||||
coords,
|
||||
app.scene.getNonDeletedElements(),
|
||||
app.scene.getNonDeletedElementsMap(),
|
||||
app.state.zoom,
|
||||
true,
|
||||
elbowed,
|
||||
isElbowArrow(element),
|
||||
);
|
||||
const p = pointFrom<GlobalPoint>(coords.x, coords.y);
|
||||
|
||||
if (hoveredElement) {
|
||||
const p = pointFrom<GlobalPoint>(coords.x, coords.y);
|
||||
const newPoints = Array.from(element.points);
|
||||
newPoints[pointIndex] = pointFrom<LocalPoint>(
|
||||
p[0] - element.x,
|
||||
@@ -274,7 +273,27 @@ export class LinearElementEditor {
|
||||
);
|
||||
}
|
||||
|
||||
return p;
|
||||
return null;
|
||||
}
|
||||
|
||||
static getOutlineAvoidingPoint(
|
||||
element: NonDeleted<ExcalidrawLinearElement>,
|
||||
coords: { x: number; y: number },
|
||||
pointIndex: number,
|
||||
app: AppClassProperties,
|
||||
): GlobalPoint {
|
||||
const p = LinearElementEditor.getOutlineAvoidingPointOrNull(
|
||||
element,
|
||||
coords,
|
||||
pointIndex,
|
||||
app,
|
||||
);
|
||||
|
||||
if (p) {
|
||||
return p;
|
||||
}
|
||||
|
||||
return pointFrom<GlobalPoint>(coords.x, coords.y);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user