mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-11-06 22:04:38 +01:00
@@ -149,7 +149,8 @@ export const bindOrUnbindBindingElement = (
|
||||
scene: Scene,
|
||||
appState: AppState,
|
||||
opts?: {
|
||||
newArrow: boolean;
|
||||
newArrow?: boolean;
|
||||
altKey?: boolean;
|
||||
},
|
||||
) => {
|
||||
const { start, end } = getBindingStrategyForDraggingBindingElementEndpoints(
|
||||
@@ -554,6 +555,7 @@ export const getBindingStrategyForDraggingBindingElementEndpoints = (
|
||||
opts?: {
|
||||
newArrow?: boolean;
|
||||
shiftKey?: boolean;
|
||||
altKey?: boolean;
|
||||
finalize?: boolean;
|
||||
},
|
||||
): { start: BindingStrategy; end: BindingStrategy } => {
|
||||
@@ -587,6 +589,7 @@ const getBindingStrategyForDraggingBindingElementEndpoints_simple = (
|
||||
opts?: {
|
||||
newArrow?: boolean;
|
||||
shiftKey?: boolean;
|
||||
altKey?: boolean;
|
||||
finalize?: boolean;
|
||||
},
|
||||
): { start: BindingStrategy; end: BindingStrategy } => {
|
||||
@@ -687,14 +690,15 @@ const getBindingStrategyForDraggingBindingElementEndpoints_simple = (
|
||||
: {
|
||||
mode: "orbit",
|
||||
element: hit,
|
||||
focusPoint:
|
||||
projectFixedPointOntoDiagonal(
|
||||
arrow,
|
||||
globalPoint,
|
||||
hit,
|
||||
startDragged ? "start" : "end",
|
||||
elementsMap,
|
||||
) || globalPoint,
|
||||
focusPoint: opts?.altKey
|
||||
? globalPoint
|
||||
: projectFixedPointOntoDiagonal(
|
||||
arrow,
|
||||
globalPoint,
|
||||
hit,
|
||||
startDragged ? "start" : "end",
|
||||
elementsMap,
|
||||
) || globalPoint,
|
||||
}
|
||||
: { mode: null };
|
||||
const otherBindableElement = otherBinding
|
||||
@@ -707,7 +711,9 @@ const getBindingStrategyForDraggingBindingElementEndpoints_simple = (
|
||||
startDragged ? -1 : 0,
|
||||
elementsMap,
|
||||
);
|
||||
|
||||
const other: BindingStrategy =
|
||||
!opts?.altKey &&
|
||||
opts?.newArrow &&
|
||||
otherBindableElement &&
|
||||
!isPointInElement(otherPoint, otherBindableElement, elementsMap)
|
||||
|
||||
@@ -356,6 +356,7 @@ export class LinearElementEditor {
|
||||
elements,
|
||||
app,
|
||||
event.shiftKey,
|
||||
event.altKey,
|
||||
);
|
||||
|
||||
LinearElementEditor.movePoints(element, app.scene, positions, {
|
||||
@@ -520,6 +521,7 @@ export class LinearElementEditor {
|
||||
elements,
|
||||
app,
|
||||
event.shiftKey,
|
||||
event.altKey,
|
||||
);
|
||||
|
||||
LinearElementEditor.movePoints(element, app.scene, positions, {
|
||||
@@ -2058,6 +2060,7 @@ const pointDraggingUpdates = (
|
||||
elements: readonly Ordered<NonDeletedExcalidrawElement>[],
|
||||
app: AppClassProperties,
|
||||
shiftKey: boolean,
|
||||
altKey: boolean,
|
||||
): {
|
||||
positions: PointsPositionUpdates;
|
||||
updates?: PointMoveOtherUpdates;
|
||||
@@ -2104,6 +2107,7 @@ const pointDraggingUpdates = (
|
||||
{
|
||||
newArrow: !!app.state.newElement,
|
||||
shiftKey,
|
||||
altKey,
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -104,6 +104,7 @@ export const actionFinalize = register<FormData>({
|
||||
|
||||
bindOrUnbindBindingElement(element, draggedPoints, scene, appState, {
|
||||
newArrow,
|
||||
altKey: event.altKey,
|
||||
});
|
||||
} else if (isLineElement(element)) {
|
||||
if (
|
||||
|
||||
@@ -8616,7 +8616,7 @@ class App extends React.Component<AppProps, AppState> {
|
||||
]),
|
||||
this.scene,
|
||||
this.state,
|
||||
{ newArrow: true },
|
||||
{ newArrow: true, altKey: event.altKey },
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user