mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: Patch over intersection calculation issue (#8350)
* Patch over intersection calculation issue
This commit is contained in:
parent
84398a7e5c
commit
261304c1a4
2 changed files with 11 additions and 8 deletions
|
@ -759,6 +759,11 @@ export const bindPointToSnapToElementOutline = (
|
||||||
[point[0], point[1] + 2 * bindableElement.height],
|
[point[0], point[1] + 2 * bindableElement.height],
|
||||||
FIXED_BINDING_DISTANCE,
|
FIXED_BINDING_DISTANCE,
|
||||||
elementsMap,
|
elementsMap,
|
||||||
|
).map((i) =>
|
||||||
|
distanceToBindableElement(bindableElement, i, elementsMap) >=
|
||||||
|
bindableElement.height / 2
|
||||||
|
? ([point[0], -1 * i[1]] as Point)
|
||||||
|
: ([point[0], i[1]] as Point),
|
||||||
),
|
),
|
||||||
...intersectElementWithLine(
|
...intersectElementWithLine(
|
||||||
bindableElement,
|
bindableElement,
|
||||||
|
@ -766,13 +771,13 @@ export const bindPointToSnapToElementOutline = (
|
||||||
[point[0] + 2 * bindableElement.width, point[1]],
|
[point[0] + 2 * bindableElement.width, point[1]],
|
||||||
FIXED_BINDING_DISTANCE,
|
FIXED_BINDING_DISTANCE,
|
||||||
elementsMap,
|
elementsMap,
|
||||||
|
).map((i) =>
|
||||||
|
distanceToBindableElement(bindableElement, i, elementsMap) >=
|
||||||
|
bindableElement.width / 2
|
||||||
|
? ([-1 * i[0], point[1]] as Point)
|
||||||
|
: ([i[0], point[1]] as Point),
|
||||||
),
|
),
|
||||||
].map((i) =>
|
];
|
||||||
distanceToBindableElement(bindableElement, i, elementsMap) >
|
|
||||||
Math.min(bindableElement.width, bindableElement.height) / 2
|
|
||||||
? ([-1 * i[0], -1 * i[1]] as Point)
|
|
||||||
: i,
|
|
||||||
);
|
|
||||||
|
|
||||||
const heading = headingForPointFromElement(bindableElement, aabb, point);
|
const heading = headingForPointFromElement(bindableElement, aabb, point);
|
||||||
const isVertical =
|
const isVertical =
|
||||||
|
|
|
@ -1447,8 +1447,6 @@ export class LinearElementEditor {
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.warn("movePoints", options?.changedElements);
|
|
||||||
|
|
||||||
const mergedElementsMap = options?.changedElements
|
const mergedElementsMap = options?.changedElements
|
||||||
? toBrandedType<SceneElementsMap>(
|
? toBrandedType<SceneElementsMap>(
|
||||||
new Map([...elementsMap, ...options.changedElements]),
|
new Map([...elementsMap, ...options.changedElements]),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue