fix: Patch over intersection calculation issue (#8350)

* Patch over intersection calculation issue
This commit is contained in:
Márk Tolmács 2024-08-09 14:40:57 +02:00 committed by GitHub
parent 84398a7e5c
commit 261304c1a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 8 deletions

View File

@ -759,6 +759,11 @@ export const bindPointToSnapToElementOutline = (
[point[0], point[1] + 2 * bindableElement.height],
FIXED_BINDING_DISTANCE,
elementsMap,
).map((i) =>
distanceToBindableElement(bindableElement, i, elementsMap) >=
bindableElement.height / 2
? ([point[0], -1 * i[1]] as Point)
: ([point[0], i[1]] as Point),
),
...intersectElementWithLine(
bindableElement,
@ -766,13 +771,13 @@ export const bindPointToSnapToElementOutline = (
[point[0] + 2 * bindableElement.width, point[1]],
FIXED_BINDING_DISTANCE,
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 isVertical =

View File

@ -1447,8 +1447,6 @@ export class LinearElementEditor {
: null;
}
console.warn("movePoints", options?.changedElements);
const mergedElementsMap = options?.changedElements
? toBrandedType<SceneElementsMap>(
new Map([...elementsMap, ...options.changedElements]),