mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-14 23:36:15 -04:00
fix: Dragging fix 2
This commit is contained in:
parent
9a49c8e448
commit
8dae900bbb
@ -49,7 +49,6 @@ import {
|
|||||||
getFixedBindingDistance,
|
getFixedBindingDistance,
|
||||||
isBindingEnabled,
|
isBindingEnabled,
|
||||||
maybeSuggestBindingsForBindingElementAtCoords,
|
maybeSuggestBindingsForBindingElementAtCoords,
|
||||||
unbindBindingElement,
|
|
||||||
updateBoundPoint,
|
updateBoundPoint,
|
||||||
} from "./binding";
|
} from "./binding";
|
||||||
import {
|
import {
|
||||||
@ -2235,10 +2234,10 @@ const pointDraggingUpdates = (
|
|||||||
const indices = Array.from(indicesSet);
|
const indices = Array.from(indicesSet);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
updates:
|
updates: updates.startBinding
|
||||||
Object.hasOwn(updates, "startBinding") ||
|
? {
|
||||||
Object.hasOwn(updates, "endBinding")
|
startBinding: updates.startBinding,
|
||||||
? updates
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
positions: new Map(
|
positions: new Map(
|
||||||
indices.map((idx) => {
|
indices.map((idx) => {
|
||||||
@ -2281,9 +2280,6 @@ const shouldAllowDraggingPoint = (
|
|||||||
const inside = isPointInElement(scenePointer, boundElement, elementsMap);
|
const inside = isPointInElement(scenePointer, boundElement, elementsMap);
|
||||||
allowDrag =
|
allowDrag =
|
||||||
allowDrag && (dist > getFixedBindingDistance(boundElement) || inside);
|
allowDrag && (dist > getFixedBindingDistance(boundElement) || inside);
|
||||||
if (allowDrag) {
|
|
||||||
unbindBindingElement(element, "start", app.scene);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
selectedPointsIndices.includes(element.points.length - 1) &&
|
selectedPointsIndices.includes(element.points.length - 1) &&
|
||||||
@ -2296,9 +2292,6 @@ const shouldAllowDraggingPoint = (
|
|||||||
const inside = isPointInElement(scenePointer, boundElement, elementsMap);
|
const inside = isPointInElement(scenePointer, boundElement, elementsMap);
|
||||||
allowDrag =
|
allowDrag =
|
||||||
allowDrag && (dist > getFixedBindingDistance(boundElement) || inside);
|
allowDrag && (dist > getFixedBindingDistance(boundElement) || inside);
|
||||||
if (allowDrag) {
|
|
||||||
unbindBindingElement(element, "end", app.scene);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return allowDrag;
|
return allowDrag;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user