mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Do not snap linear elements
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
parent
06b3750a2f
commit
6b9fa5bcc5
4 changed files with 85 additions and 63 deletions
|
@ -525,15 +525,18 @@ export const bindLinearElement = (
|
|||
};
|
||||
}
|
||||
const points = Array.from(linearElement.points);
|
||||
points[edgePointIndex] = toLocalPoint(
|
||||
bindPointToSnapToElementOutline(
|
||||
|
||||
if (isArrowElement(linearElement)) {
|
||||
points[edgePointIndex] = toLocalPoint(
|
||||
bindPointToSnapToElementOutline(
|
||||
linearElement,
|
||||
hoveredElement,
|
||||
startOrEnd,
|
||||
elementsMap,
|
||||
),
|
||||
linearElement,
|
||||
hoveredElement,
|
||||
startOrEnd,
|
||||
elementsMap,
|
||||
),
|
||||
linearElement,
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
mutateElement(linearElement, {
|
||||
points,
|
||||
|
|
|
@ -57,6 +57,7 @@ import { headingIsHorizontal, vectorToHeading } from "./heading";
|
|||
import { bumpVersion, mutateElement } from "./mutateElement";
|
||||
import { getBoundTextElement, handleBindTextResize } from "./textElement";
|
||||
import {
|
||||
isArrowElement,
|
||||
isBindingElement,
|
||||
isElbowArrow,
|
||||
isFixedPointBinding,
|
||||
|
@ -371,14 +372,17 @@ export class LinearElementEditor {
|
|||
app.scene,
|
||||
app.state.zoom,
|
||||
);
|
||||
|
||||
newPointPosition = LinearElementEditor.createPointAt(
|
||||
element,
|
||||
elementsMap,
|
||||
avoidancePoint[0] === newGlobalPointPosition[0]
|
||||
!isArrowElement(element) ||
|
||||
avoidancePoint[0] === newGlobalPointPosition[0]
|
||||
? newGlobalPointPosition[0] -
|
||||
linearElementEditor.pointerOffset.x
|
||||
: avoidancePoint[0],
|
||||
avoidancePoint[1] === newGlobalPointPosition[1]
|
||||
!isArrowElement(element) ||
|
||||
avoidancePoint[1] === newGlobalPointPosition[1]
|
||||
? newGlobalPointPosition[1] -
|
||||
linearElementEditor.pointerOffset.y
|
||||
: avoidancePoint[1],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue