fix: Ctrl/Alt elbow arrow jumps (#10432)
* fix: Ctrl/Alt elbow arrow jumps Signed-off-by: Mark Tolmacs <mark@lazycat.hu> * chore: Trigger build * style --------- Signed-off-by: Mark Tolmacs <mark@lazycat.hu> Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
@@ -11463,7 +11463,14 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
): void => {
|
): void => {
|
||||||
const selectionElement = this.state.selectionElement;
|
const selectionElement = this.state.selectionElement;
|
||||||
const pointerCoords = pointerDownState.lastCoords;
|
const pointerCoords = pointerDownState.lastCoords;
|
||||||
if (selectionElement && this.state.activeTool.type !== "eraser") {
|
const selectedElements = this.scene.getSelectedElements(this.state);
|
||||||
|
const onlyBindingElementSelected =
|
||||||
|
selectedElements?.length === 1 && isBindingElement(selectedElements[0]);
|
||||||
|
if (
|
||||||
|
selectionElement &&
|
||||||
|
this.state.activeTool.type !== "eraser" &&
|
||||||
|
!onlyBindingElementSelected
|
||||||
|
) {
|
||||||
dragNewElement({
|
dragNewElement({
|
||||||
newElement: selectionElement,
|
newElement: selectionElement,
|
||||||
elementType: this.state.activeTool.type,
|
elementType: this.state.activeTool.type,
|
||||||
@@ -11527,25 +11534,27 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
snapLines,
|
snapLines,
|
||||||
});
|
});
|
||||||
|
|
||||||
dragNewElement({
|
if (!isBindingElement(newElement)) {
|
||||||
newElement,
|
dragNewElement({
|
||||||
elementType: this.state.activeTool.type,
|
newElement,
|
||||||
originX: pointerDownState.originInGrid.x,
|
elementType: this.state.activeTool.type,
|
||||||
originY: pointerDownState.originInGrid.y,
|
originX: pointerDownState.originInGrid.x,
|
||||||
x: gridX,
|
originY: pointerDownState.originInGrid.y,
|
||||||
y: gridY,
|
x: gridX,
|
||||||
width: distance(pointerDownState.originInGrid.x, gridX),
|
y: gridY,
|
||||||
height: distance(pointerDownState.originInGrid.y, gridY),
|
width: distance(pointerDownState.originInGrid.x, gridX),
|
||||||
shouldMaintainAspectRatio: isImageElement(newElement)
|
height: distance(pointerDownState.originInGrid.y, gridY),
|
||||||
? !shouldMaintainAspectRatio(event)
|
shouldMaintainAspectRatio: isImageElement(newElement)
|
||||||
: shouldMaintainAspectRatio(event),
|
? !shouldMaintainAspectRatio(event)
|
||||||
shouldResizeFromCenter: shouldResizeFromCenter(event),
|
: shouldMaintainAspectRatio(event),
|
||||||
zoom: this.state.zoom.value,
|
shouldResizeFromCenter: shouldResizeFromCenter(event),
|
||||||
scene: this.scene,
|
zoom: this.state.zoom.value,
|
||||||
widthAspectRatio: aspectRatio,
|
scene: this.scene,
|
||||||
originOffset: this.state.originSnapOffset,
|
widthAspectRatio: aspectRatio,
|
||||||
informMutation,
|
originOffset: this.state.originSnapOffset,
|
||||||
});
|
informMutation,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
newElement,
|
newElement,
|
||||||
|
|||||||
Reference in New Issue
Block a user