New element behavior

This commit is contained in:
Mark Tolmacs
2025-08-28 18:58:52 +02:00
parent ab6353b2fa
commit df8c98d946
2 changed files with 15 additions and 12 deletions

View File

@@ -1940,7 +1940,7 @@ const normalizeSelectedPoints = (
return nextPoints.length ? nextPoints : null;
};
export const pointDraggingUpdates = (
const pointDraggingUpdates = (
selectedPointsIndices: readonly number[],
deltaX: number,
deltaY: number,
@@ -1991,6 +1991,9 @@ export const pointDraggingUpdates = (
elementsMap,
elements,
app.state,
{
newArrow: !!app.state.newElement,
},
);
const originalStartGlobalPoint =

View File

@@ -9317,17 +9317,17 @@ class App extends React.Component<AppProps, AppState> {
)!,
});
if (isBindingElement(newElement, false)) {
// When creating a linear element by dragging
this.setState({
suggestedBinding: maybeSuggestBindingsForBindingElementAtCoords(
newElement,
"end",
this.scene,
pointFrom<GlobalPoint>(pointerCoords.x, pointerCoords.y),
),
});
}
// if (isBindingElement(newElement, false)) {
// // When creating a linear element by dragging
// this.setState({
// suggestedBinding: maybeSuggestBindingsForBindingElementAtCoords(
// newElement,
// "end",
// this.scene,
// pointFrom<GlobalPoint>(pointerCoords.x, pointerCoords.y),
// ),
// });
// }
} else {
pointerDownState.lastCoords.x = pointerCoords.x;
pointerDownState.lastCoords.y = pointerCoords.y;