mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-16 14:00:56 +02:00
fix: Image binding rule changed
This commit is contained in:
@@ -47,7 +47,6 @@ import {
|
|||||||
isBindableElement,
|
isBindableElement,
|
||||||
isBoundToContainer,
|
isBoundToContainer,
|
||||||
isElbowArrow,
|
isElbowArrow,
|
||||||
isImageElement,
|
|
||||||
isRectanguloidElement,
|
isRectanguloidElement,
|
||||||
isTextElement,
|
isTextElement,
|
||||||
} from "./typeChecks";
|
} from "./typeChecks";
|
||||||
@@ -102,9 +101,6 @@ export const getFixedBindingDistance = (
|
|||||||
element: ExcalidrawBindableElement,
|
element: ExcalidrawBindableElement,
|
||||||
): number => FIXED_BINDING_DISTANCE + element.strokeWidth / 2;
|
): number => FIXED_BINDING_DISTANCE + element.strokeWidth / 2;
|
||||||
|
|
||||||
export const isAlwaysInsideBinding = (element: ExcalidrawBindableElement) =>
|
|
||||||
isImageElement(element);
|
|
||||||
|
|
||||||
export const shouldEnableBindingForPointerEvent = (
|
export const shouldEnableBindingForPointerEvent = (
|
||||||
event: React.PointerEvent<HTMLElement>,
|
event: React.PointerEvent<HTMLElement>,
|
||||||
) => {
|
) => {
|
||||||
@@ -379,9 +375,7 @@ const bindingStrategyForNewSimpleArrowEndpointDragging = (
|
|||||||
if (!arrow.startBinding) {
|
if (!arrow.startBinding) {
|
||||||
if (hit) {
|
if (hit) {
|
||||||
const isInsideBinding =
|
const isInsideBinding =
|
||||||
globalBindMode === "inside" ||
|
globalBindMode === "inside" || globalBindMode === "skip";
|
||||||
globalBindMode === "skip" ||
|
|
||||||
isAlwaysInsideBinding(hit);
|
|
||||||
|
|
||||||
end = {
|
end = {
|
||||||
mode: isInsideBinding ? "inside" : "orbit",
|
mode: isInsideBinding ? "inside" : "orbit",
|
||||||
@@ -429,11 +423,7 @@ const bindingStrategyForSimpleArrowEndpointDragging = (
|
|||||||
|
|
||||||
// If the global bind mode is in free binding mode, just bind
|
// If the global bind mode is in free binding mode, just bind
|
||||||
// where the pointer is and keep the other end intact
|
// where the pointer is and keep the other end intact
|
||||||
if (
|
if (globalBindMode === "inside" || globalBindMode === "skip") {
|
||||||
globalBindMode === "inside" ||
|
|
||||||
globalBindMode === "skip" ||
|
|
||||||
(hit && isAlwaysInsideBinding(hit))
|
|
||||||
) {
|
|
||||||
current = hit
|
current = hit
|
||||||
? {
|
? {
|
||||||
element:
|
element:
|
||||||
|
Reference in New Issue
Block a user