diff --git a/packages/excalidraw/element/binding.ts b/packages/excalidraw/element/binding.ts index c367bf752..2c7ef13d5 100644 --- a/packages/excalidraw/element/binding.ts +++ b/packages/excalidraw/element/binding.ts @@ -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 = diff --git a/packages/excalidraw/element/linearElementEditor.ts b/packages/excalidraw/element/linearElementEditor.ts index c7a7361e4..900b42a90 100644 --- a/packages/excalidraw/element/linearElementEditor.ts +++ b/packages/excalidraw/element/linearElementEditor.ts @@ -1447,8 +1447,6 @@ export class LinearElementEditor { : null; } - console.warn("movePoints", options?.changedElements); - const mergedElementsMap = options?.changedElements ? toBrandedType( new Map([...elementsMap, ...options.changedElements]),