fix: Reimplement rectangle intersection (#8367)

This commit is contained in:
Márk Tolmács
2024-08-12 19:19:16 +02:00
committed by GitHub
parent 5daf1a1b4e
commit 8420e1aa13
4 changed files with 131 additions and 74 deletions
@@ -191,7 +191,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": "99.19726",
"height": 99,
"id": "id166",
"index": "a2",
"isDeleted": false,
@@ -205,8 +205,8 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
0,
],
[
"98.40368",
"99.19726",
"98.20800",
99,
],
],
"roughness": 1,
@@ -221,7 +221,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"type": "arrow",
"updated": 1,
"version": 40,
"width": "98.40368",
"width": "98.20800",
"x": 1,
"y": 0,
}
@@ -387,15 +387,15 @@ History {
"focus": 0,
"gap": 1,
},
"height": "99.19726",
"height": 99,
"points": [
[
0,
0,
],
[
"98.40368",
"99.19726",
"98.20800",
99,
],
],
"startBinding": null,
@@ -813,7 +813,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"updated": 1,
"version": 30,
"width": 0,
"x": 251,
"x": 200,
"y": 0,
}
`;
@@ -1242,7 +1242,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
0,
],
[
98,
"98.00000",
"-2.61991",
],
],
@@ -1266,8 +1266,8 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"type": "arrow",
"updated": 1,
"version": 11,
"width": 98,
"x": 1,
"width": "98.00000",
"x": "1.00000",
"y": "3.98333",
}
`;
@@ -1607,7 +1607,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
0,
],
[
98,
"98.00000",
"-2.61991",
],
],
@@ -1631,8 +1631,8 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"type": "arrow",
"updated": 1,
"version": 11,
"width": 98,
"x": 1,
"width": "98.00000",
"x": "1.00000",
"y": "3.98333",
}
`;
@@ -1764,7 +1764,7 @@ History {
0,
],
[
98,
"98.00000",
"-22.36242",
],
],
@@ -1786,9 +1786,9 @@ History {
"strokeStyle": "solid",
"strokeWidth": 2,
"type": "arrow",
"width": 98,
"width": "98.00000",
"x": 1,
"y": "34.00000",
"y": 34,
},
"inserted": {
"isDeleted": true,
@@ -14847,7 +14847,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
0,
],
[
98,
"98.00000",
0,
],
],
@@ -14868,7 +14868,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"type": "arrow",
"updated": 1,
"version": 10,
"width": 98,
"width": "98.00000",
"x": 1,
"y": 0,
}
@@ -15540,7 +15540,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
0,
],
[
98,
"98.00000",
0,
],
],
@@ -15561,7 +15561,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"type": "arrow",
"updated": 1,
"version": 10,
"width": 98,
"width": "98.00000",
"x": 1,
"y": 0,
}
@@ -16157,7 +16157,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
0,
],
[
98,
"98.00000",
0,
],
],
@@ -16178,7 +16178,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"type": "arrow",
"updated": 1,
"version": 10,
"width": 98,
"width": "98.00000",
"x": 1,
"y": 0,
}
@@ -16772,7 +16772,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
0,
],
[
98,
"98.00000",
0,
],
],
@@ -16793,7 +16793,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"type": "arrow",
"updated": 1,
"version": 10,
"width": 98,
"width": "98.00000",
"x": 1,
"y": 0,
}
@@ -17484,7 +17484,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
0,
],
[
98,
"98.00000",
0,
],
],
@@ -17505,7 +17505,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"type": "arrow",
"updated": 1,
"version": 11,
"width": 98,
"width": "98.00000",
"x": 1,
"y": 0,
}
+2 -2
View File
@@ -77,6 +77,6 @@ test("unselected bound arrows update when rotating their target elements", async
expect(textArrow.x).toEqual(360);
expect(textArrow.y).toEqual(300);
expect(textArrow.points[0]).toEqual([0, 0]);
expect(textArrow.points[1][0]).toBeCloseTo(-94, 1);
expect(textArrow.points[1][1]).toBeCloseTo(-116.1, 1);
expect(textArrow.points[1][0]).toBeCloseTo(-94, 0);
expect(textArrow.points[1][1]).toBeCloseTo(-116.1, 0);
});