mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-11-14 09:45:27 +01:00
fix: Ctrl+Alt precedence
This commit is contained in:
@@ -457,17 +457,7 @@ export class LinearElementEditor {
|
|||||||
|
|
||||||
deltaX = target[0] - draggingPoint[0];
|
deltaX = target[0] - draggingPoint[0];
|
||||||
deltaY = target[1] - draggingPoint[1];
|
deltaY = target[1] - draggingPoint[1];
|
||||||
} else if (
|
} else {
|
||||||
// shouldAllowDraggingPoint(
|
|
||||||
// element,
|
|
||||||
// scenePointerX,
|
|
||||||
// scenePointerY,
|
|
||||||
// selectedPointsIndices,
|
|
||||||
// elementsMap,
|
|
||||||
// app,
|
|
||||||
// )
|
|
||||||
true
|
|
||||||
) {
|
|
||||||
const newDraggingPointPosition = LinearElementEditor.createPointAt(
|
const newDraggingPointPosition = LinearElementEditor.createPointAt(
|
||||||
element,
|
element,
|
||||||
elementsMap,
|
elementsMap,
|
||||||
|
|||||||
@@ -6208,7 +6208,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
// Hovering with a selected tool or creating new linear element via click
|
// Hovering with a selected tool or creating new linear element via click
|
||||||
// and point
|
// and point
|
||||||
const { newElement } = this.state;
|
const { newElement } = this.state;
|
||||||
if (isBindingElement(newElement, false)) {
|
if (isBindingElement(newElement, false) && isBindingEnabled(this.state)) {
|
||||||
this.setState({
|
this.setState({
|
||||||
suggestedBinding: maybeSuggestBindingsForBindingElementAtCoords(
|
suggestedBinding: maybeSuggestBindingsForBindingElementAtCoords(
|
||||||
newElement,
|
newElement,
|
||||||
@@ -6217,8 +6217,6 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
pointFrom<GlobalPoint>(scenePointerX, scenePointerY),
|
pointFrom<GlobalPoint>(scenePointerX, scenePointerY),
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
this.maybeSuggestBindingAtCursor(scenePointer);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8280,11 +8278,13 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
pointerDownState.origin.y,
|
pointerDownState.origin.y,
|
||||||
);
|
);
|
||||||
const elementsMap = this.scene.getNonDeletedElementsMap();
|
const elementsMap = this.scene.getNonDeletedElementsMap();
|
||||||
const boundElement = getHoveredElementForBinding(
|
const boundElement = isBindingEnabled(this.state)
|
||||||
point,
|
? getHoveredElementForBinding(
|
||||||
this.scene.getNonDeletedElements(),
|
point,
|
||||||
elementsMap,
|
this.scene.getNonDeletedElements(),
|
||||||
);
|
elementsMap,
|
||||||
|
)
|
||||||
|
: null;
|
||||||
|
|
||||||
this.scene.mutateElement(element, {
|
this.scene.mutateElement(element, {
|
||||||
points: [pointFrom<LocalPoint>(0, 0), pointFrom<LocalPoint>(0, 0)],
|
points: [pointFrom<LocalPoint>(0, 0), pointFrom<LocalPoint>(0, 0)],
|
||||||
@@ -10703,20 +10703,6 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private maybeSuggestBindingAtCursor = (pointerCoords: {
|
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
}): void => {
|
|
||||||
const hoveredBindableElement = getHoveredElementForBinding(
|
|
||||||
pointFrom<GlobalPoint>(pointerCoords.x, pointerCoords.y),
|
|
||||||
this.scene.getNonDeletedElements(),
|
|
||||||
this.scene.getNonDeletedElementsMap(),
|
|
||||||
);
|
|
||||||
this.setState({
|
|
||||||
suggestedBinding: hoveredBindableElement ?? null,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
private clearSelection(hitElement: ExcalidrawElement | null): void {
|
private clearSelection(hitElement: ExcalidrawElement | null): void {
|
||||||
this.setState((prevState) => ({
|
this.setState((prevState) => ({
|
||||||
selectedElementIds: makeNextSelectedElementIds({}, prevState),
|
selectedElementIds: makeNextSelectedElementIds({}, prevState),
|
||||||
|
|||||||
Reference in New Issue
Block a user