mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Additional fixes
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
parent
9b643abcee
commit
4ffe7fd991
3 changed files with 33 additions and 54 deletions
|
@ -41,7 +41,7 @@ export const actionFinalize = register({
|
|||
const { interactiveCanvas, focusContainer, scene } = app;
|
||||
|
||||
const elementsMap = scene.getNonDeletedElementsMap();
|
||||
console.log("actionFinalize");
|
||||
|
||||
if (data?.event && appState.selectedLinearElement) {
|
||||
const linearElementEditor = LinearElementEditor.handlePointerUp(
|
||||
data.event,
|
||||
|
@ -162,6 +162,7 @@ export const actionFinalize = register({
|
|||
newElements = newElements.filter((el) => el.id !== element!.id);
|
||||
}
|
||||
|
||||
if (isLinearElement(element) || element.type === "freedraw") {
|
||||
// If the multi point line closes the loop,
|
||||
// set the last point to first point.
|
||||
// This ensures that loop remains closed at different scales.
|
||||
|
@ -184,7 +185,6 @@ export const actionFinalize = register({
|
|||
isBindingElement(element) &&
|
||||
!isLoop &&
|
||||
element.points.length > 1 &&
|
||||
!appState.selectedElementIds[element.id] &&
|
||||
isBindingEnabled(appState)
|
||||
) {
|
||||
const [x, y] = LinearElementEditor.getPointAtIndexGlobalCoordinates(
|
||||
|
@ -195,6 +195,7 @@ export const actionFinalize = register({
|
|||
maybeBindLinearElement(element, appState, { x, y }, scene);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
(!appState.activeTool.locked &&
|
||||
|
|
|
@ -2925,28 +2925,6 @@ class App extends React.Component<AppProps, AppState> {
|
|||
this.setState({ selectedLinearElement: null });
|
||||
}
|
||||
|
||||
const { multiElement } = prevState;
|
||||
if (
|
||||
prevState.activeTool !== this.state.activeTool &&
|
||||
multiElement != null &&
|
||||
isBindingEnabled(this.state) &&
|
||||
isBindingElement(multiElement, false)
|
||||
) {
|
||||
this.actionManager.executeAction(actionFinalize);
|
||||
// maybeBindLinearElement(
|
||||
// multiElement,
|
||||
// this.state,
|
||||
// tupleToCoors(
|
||||
// LinearElementEditor.getPointAtIndexGlobalCoordinates(
|
||||
// multiElement,
|
||||
// -1,
|
||||
// nonDeletedElementsMap,
|
||||
// ),
|
||||
// ),
|
||||
// this.scene,
|
||||
// );
|
||||
}
|
||||
|
||||
this.store.commit(elementsMap, this.state);
|
||||
|
||||
// Do not notify consumers if we're still loading the scene. Among other
|
||||
|
|
|
@ -173,7 +173,7 @@ exports[`move element > rectangles with binding arrow 6`] = `
|
|||
"type": "rectangle",
|
||||
"updated": 1,
|
||||
"version": 7,
|
||||
"versionNonce": 745419401,
|
||||
"versionNonce": 1051383431,
|
||||
"width": 300,
|
||||
"x": 201,
|
||||
"y": 2,
|
||||
|
@ -231,7 +231,7 @@ exports[`move element > rectangles with binding arrow 7`] = `
|
|||
"type": "arrow",
|
||||
"updated": 1,
|
||||
"version": 11,
|
||||
"versionNonce": 1051383431,
|
||||
"versionNonce": 1996028265,
|
||||
"width": "86.85786",
|
||||
"x": "107.07107",
|
||||
"y": "47.07107",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue