fix:Tool lock binding behavior restored

This commit is contained in:
Mark Tolmacs
2025-09-17 20:52:52 +02:00
parent 43816eb62d
commit 50e58abfd3
5 changed files with 38 additions and 829 deletions

View File

@@ -217,7 +217,7 @@ describe("Test Linear Elements", () => {
// drag line from midpoint // drag line from midpoint
drag(midpoint, pointFrom(midpoint[0] + delta, midpoint[1] + delta)); drag(midpoint, pointFrom(midpoint[0] + delta, midpoint[1] + delta));
expect(renderInteractiveScene.mock.calls.length).toMatchInlineSnapshot(`9`); expect(renderInteractiveScene.mock.calls.length).toMatchInlineSnapshot(`8`);
expect(renderStaticScene.mock.calls.length).toMatchInlineSnapshot(`7`); expect(renderStaticScene.mock.calls.length).toMatchInlineSnapshot(`7`);
expect(line.points.length).toEqual(3); expect(line.points.length).toEqual(3);
expect(line.points).toMatchInlineSnapshot(` expect(line.points).toMatchInlineSnapshot(`
@@ -329,7 +329,7 @@ describe("Test Linear Elements", () => {
expect(h.state.selectedLinearElement?.isEditing).toBe(false); expect(h.state.selectedLinearElement?.isEditing).toBe(false);
mouse.doubleClick(); mouse.doubleClick();
expect(h.state.selectedLinearElement).toBe(null); expect(h.state.selectedLinearElement?.isEditing).toBe(false);
await getTextEditor(); await getTextEditor();
}); });
@@ -357,6 +357,7 @@ describe("Test Linear Elements", () => {
const originalY = line.y; const originalY = line.y;
enterLineEditingMode(line); enterLineEditingMode(line);
expect(h.state.selectedLinearElement?.isEditing).toBe(true);
expect(line.points.length).toEqual(2); expect(line.points.length).toEqual(2);
mouse.clickAt(midpoint[0], midpoint[1]); mouse.clickAt(midpoint[0], midpoint[1]);

View File

@@ -7809,7 +7809,10 @@ class App extends React.Component<AppProps, AppState> {
selectedLinearElement: prevState.selectedLinearElement selectedLinearElement: prevState.selectedLinearElement
? { ? {
...prevState.selectedLinearElement, ...prevState.selectedLinearElement,
isEditing: isBindingElement(hitElement), isEditing:
!!hitElement &&
hitElement.id ===
this.state.selectedLinearElement?.elementId,
} }
: null, : null,
selectedElementIds: prevState.selectedLinearElement selectedElementIds: prevState.selectedLinearElement

View File

@@ -234,7 +234,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"strokeColor": "#1e1e1e", "strokeColor": "#1e1e1e",
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"suggestedBinding": undefined,
"type": "arrow", "type": "arrow",
"updated": 1, "updated": 1,
"version": 37, "version": 37,
@@ -363,40 +362,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
], ],
"mode": "orbit", "mode": "orbit",
}, },
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id4",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id0",
"index": "a0",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 493213705,
"width": 100,
"x": -100,
"y": -50,
},
"version": 36, "version": 36,
"width": 88, "width": 88,
"y": "16.71973", "y": "16.71973",
@@ -429,40 +394,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
], ],
"mode": "orbit", "mode": "orbit",
}, },
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id4",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id1",
"index": "a1",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 1163661225,
"width": 100,
"x": 100,
"y": -50,
},
"version": 33, "version": 33,
"width": 88, "width": 88,
"y": "10.00000", "y": "10.00000",
@@ -520,7 +451,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
], ],
"mode": "inside", "mode": "inside",
}, },
"suggestedBinding": undefined,
"version": 37, "version": 37,
"width": 94, "width": 94,
"x": 0, "x": 0,
@@ -546,40 +476,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
], ],
"mode": "orbit", "mode": "orbit",
}, },
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id4",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id0",
"index": "a0",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 493213705,
"width": 100,
"x": -100,
"y": -50,
},
"version": 36, "version": 36,
"width": 88, "width": 88,
"x": 6, "x": 6,
@@ -999,7 +895,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"strokeColor": "#1e1e1e", "strokeColor": "#1e1e1e",
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"suggestedBinding": undefined,
"type": "arrow", "type": "arrow",
"updated": 1, "updated": 1,
"version": 34, "version": 34,
@@ -1071,40 +966,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
], ],
"mode": "orbit", "mode": "orbit",
}, },
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id4",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id0",
"index": "a0",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 493213705,
"width": 100,
"x": -100,
"y": -50,
},
"version": 33, "version": 33,
"width": "44.00000", "width": "44.00000",
"y": "2.93333", "y": "2.93333",
@@ -1137,40 +998,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
], ],
"mode": "orbit", "mode": "orbit",
}, },
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id4",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id1",
"index": "a1",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 1996028265,
"width": 100,
"x": 100,
"y": -50,
},
"version": 31, "version": 31,
"width": "6.00000", "width": "6.00000",
"y": 10, "y": 10,
@@ -1220,7 +1047,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
], ],
"mode": "inside", "mode": "inside",
}, },
"suggestedBinding": undefined,
"version": 34, "version": 34,
"width": 0, "width": 0,
"x": 250, "x": 250,
@@ -1246,40 +1072,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
], ],
"mode": "orbit", "mode": "orbit",
}, },
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id4",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id0",
"index": "a0",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 493213705,
"width": 100,
"x": -100,
"y": -50,
},
"version": 33, "version": 33,
"width": "44.00000", "width": "44.00000",
"x": 144, "x": 144,
@@ -2694,40 +2486,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"strokeColor": "#1e1e1e", "strokeColor": "#1e1e1e",
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id4",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id1",
"index": "a1",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 640725609,
"width": 100,
"x": 100,
"y": -50,
},
"type": "arrow", "type": "arrow",
"updated": 1, "updated": 1,
"version": 13, "version": 13,
@@ -2894,40 +2652,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"strokeColor": "#1e1e1e", "strokeColor": "#1e1e1e",
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id4",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id1",
"index": "a1",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 640725609,
"width": 100,
"x": 100,
"y": -50,
},
"type": "arrow", "type": "arrow",
"version": 13, "version": 13,
"width": 488, "width": 488,
@@ -16600,40 +16324,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeColor": "#1e1e1e", "strokeColor": "#1e1e1e",
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id13",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id2",
"index": "a2",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 1163661225,
"width": 100,
"x": 100,
"y": -50,
},
"type": "arrow", "type": "arrow",
"updated": 1, "updated": 1,
"version": 13, "version": 13,
@@ -16689,40 +16379,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
], ],
"mode": "orbit", "mode": "orbit",
}, },
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id13",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id2",
"index": "a2",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 1163661225,
"width": 100,
"x": 100,
"y": -50,
},
"version": 13, "version": 13,
}, },
"inserted": { "inserted": {
@@ -16743,35 +16399,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
], ],
"mode": "orbit", "mode": "orbit",
}, },
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id2",
"index": "a2",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 4,
"versionNonce": 888958951,
"width": 100,
"x": 100,
"y": -50,
},
"version": 10, "version": 10,
}, },
}, },
@@ -17113,40 +16740,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeColor": "#1e1e1e", "strokeColor": "#1e1e1e",
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id13",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id2",
"index": "a2",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 1163661225,
"width": 100,
"x": 100,
"y": -50,
},
"type": "arrow", "type": "arrow",
"version": 9, "version": 9,
"width": 88, "width": 88,
@@ -17479,40 +17072,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeColor": "#1e1e1e", "strokeColor": "#1e1e1e",
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id13",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id2",
"index": "a2",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 1163661225,
"width": 100,
"x": 100,
"y": -50,
},
"type": "arrow", "type": "arrow",
"updated": 1, "updated": 1,
"version": 13, "version": 13,
@@ -17819,40 +17378,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeColor": "#1e1e1e", "strokeColor": "#1e1e1e",
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id13",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id2",
"index": "a2",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 1163661225,
"width": 100,
"x": 100,
"y": -50,
},
"type": "arrow", "type": "arrow",
"version": 13, "version": 13,
"width": "88.00000", "width": "88.00000",
@@ -18193,40 +17718,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeColor": "#1e1e1e", "strokeColor": "#1e1e1e",
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id13",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id2",
"index": "a2",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 1163661225,
"width": 100,
"x": 100,
"y": -50,
},
"type": "arrow", "type": "arrow",
"updated": 1, "updated": 1,
"version": 13, "version": 13,
@@ -18533,40 +18024,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeColor": "#1e1e1e", "strokeColor": "#1e1e1e",
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id13",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id2",
"index": "a2",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 1163661225,
"width": 100,
"x": 100,
"y": -50,
},
"type": "arrow", "type": "arrow",
"version": 13, "version": 13,
"width": "88.00000", "width": "88.00000",
@@ -18905,40 +18362,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeColor": "#1e1e1e", "strokeColor": "#1e1e1e",
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id13",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id2",
"index": "a2",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 1163661225,
"width": 100,
"x": 100,
"y": -50,
},
"type": "arrow", "type": "arrow",
"updated": 1, "updated": 1,
"version": 13, "version": 13,
@@ -19010,40 +18433,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
], ],
"mode": "orbit", "mode": "orbit",
}, },
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id13",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id2",
"index": "a2",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 1163661225,
"width": 100,
"x": 100,
"y": -50,
},
"version": 13, "version": 13,
}, },
"inserted": { "inserted": {
@@ -19056,40 +18445,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"mode": "orbit", "mode": "orbit",
}, },
"startBinding": null, "startBinding": null,
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id13",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id2",
"index": "a2",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 1163661225,
"width": 100,
"x": 100,
"y": -50,
},
"version": 10, "version": 10,
}, },
}, },
@@ -19399,40 +18754,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeColor": "#1e1e1e", "strokeColor": "#1e1e1e",
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id13",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id2",
"index": "a2",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 1163661225,
"width": 100,
"x": 100,
"y": -50,
},
"type": "arrow", "type": "arrow",
"version": 9, "version": 9,
"width": 88, "width": 88,
@@ -19793,40 +19114,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeColor": "#1e1e1e", "strokeColor": "#1e1e1e",
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id13",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id2",
"index": "a2",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 1163661225,
"width": 100,
"x": 100,
"y": -50,
},
"type": "arrow", "type": "arrow",
"updated": 1, "updated": 1,
"version": 14, "version": 14,
@@ -19909,79 +19196,11 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
], ],
"mode": "orbit", "mode": "orbit",
}, },
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id13",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id2",
"index": "a2",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 1163661225,
"width": 100,
"x": 100,
"y": -50,
},
"version": 14, "version": 14,
}, },
"inserted": { "inserted": {
"endBinding": null, "endBinding": null,
"startBinding": null, "startBinding": null,
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id13",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id2",
"index": "a2",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 1163661225,
"width": 100,
"x": 100,
"y": -50,
},
"version": 11, "version": 11,
}, },
}, },
@@ -20283,40 +19502,6 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"strokeColor": "#1e1e1e", "strokeColor": "#1e1e1e",
"strokeStyle": "solid", "strokeStyle": "solid",
"strokeWidth": 2, "strokeWidth": 2,
"suggestedBinding": {
"angle": 0,
"backgroundColor": "transparent",
"boundElements": [
{
"id": "id13",
"type": "arrow",
},
],
"customData": undefined,
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": 100,
"id": "id2",
"index": "a2",
"isDeleted": false,
"link": null,
"locked": false,
"opacity": 100,
"roughness": 1,
"roundness": null,
"seed": 1,
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "rectangle",
"updated": 1,
"version": 3,
"versionNonce": 1163661225,
"width": 100,
"x": 100,
"y": -50,
},
"type": "arrow", "type": "arrow",
"version": 9, "version": 9,
"width": 88, "width": 88,

View File

@@ -6235,7 +6235,34 @@ exports[`regression tests > draw every type of shape > [end of test] appState 1`
"selectedElementIds": {}, "selectedElementIds": {},
"selectedElementsAreBeingDragged": false, "selectedElementsAreBeingDragged": false,
"selectedGroupIds": {}, "selectedGroupIds": {},
"selectedLinearElement": null, "selectedLinearElement": {
"customLineAngle": null,
"elbowed": false,
"elementId": "id20",
"hoverPointIndex": -1,
"initialState": {
"arrowStartIsInside": false,
"lastClickedPoint": -1,
"origin": null,
"prevSelectedPointsIndices": null,
"segmentMidpoint": {
"added": false,
"index": null,
"value": null,
},
},
"isDragging": false,
"isEditing": false,
"lastCommittedPoint": null,
"lastUncommittedPoint": null,
"pointerDownState": undefined,
"pointerOffset": {
"x": 0,
"y": 0,
},
"segmentMidPointHoveredCoords": null,
"selectedPointsIndices": null,
},
"selectionElement": null, "selectionElement": null,
"shouldCacheIgnoreZoom": false, "shouldCacheIgnoreZoom": false,
"showHyperlinkPopup": false, "showHyperlinkPopup": false,
@@ -6863,15 +6890,8 @@ exports[`regression tests > draw every type of shape > [end of test] undo stack
{ {
"appState": AppStateDelta { "appState": AppStateDelta {
"delta": Delta { "delta": Delta {
"deleted": { "deleted": {},
"selectedLinearElement": null, "inserted": {},
},
"inserted": {
"selectedLinearElement": {
"elementId": "id20",
"isEditing": false,
},
},
}, },
}, },
"elements": { "elements": {

View File

@@ -102,7 +102,7 @@ describe("move element", () => {
new Pointer("mouse").clickOn(rectB); new Pointer("mouse").clickOn(rectB);
expect(renderInteractiveScene.mock.calls.length).toMatchInlineSnapshot( expect(renderInteractiveScene.mock.calls.length).toMatchInlineSnapshot(
`16`, `15`,
); );
expect(renderStaticScene.mock.calls.length).toMatchInlineSnapshot(`14`); expect(renderStaticScene.mock.calls.length).toMatchInlineSnapshot(`14`);
expect(h.state.selectionElement).toBeNull(); expect(h.state.selectionElement).toBeNull();