Restore original

This commit is contained in:
Mark Tolmacs 2025-05-12 16:10:15 +02:00
parent ec255cbe53
commit d681869c4c
No known key found for this signature in database
2 changed files with 11 additions and 16 deletions

View File

@ -959,10 +959,7 @@ export const bindPointToSnapToElementOutline = (
otherPoint,
),
),
FIXED_BINDING_DISTANCE *
(bindableElement.type === "diamond"
? 1.414 // sqrt(2)
: 1),
FIXED_BINDING_DISTANCE,
)[0];
} else {
intersection = intersectElementWithLineSegment(
@ -1180,7 +1177,7 @@ export const snapToMid = (
)[0] ?? otherPoint
);
} else if (element.type === "diamond") {
const distance = FIXED_BINDING_DISTANCE * 0.7071; // 1 / sqrt(2)
const distance = FIXED_BINDING_DISTANCE;
const topLeft = pointFrom<GlobalPoint>(
x + width / 4 - distance,
y + height / 4 - distance,
@ -1202,25 +1199,25 @@ export const snapToMid = (
pointDistance(topLeft, nonRotated) <
Math.max(horizontalThreshold, verticalThreshold)
) {
return topLeft;
return pointRotateRads(topLeft, center, angle);
}
if (
pointDistance(topRight, nonRotated) <
Math.max(horizontalThreshold, verticalThreshold)
) {
return topRight;
return pointRotateRads(topRight, center, angle);
}
if (
pointDistance(bottomLeft, nonRotated) <
Math.max(horizontalThreshold, verticalThreshold)
) {
return bottomLeft;
return pointRotateRads(bottomLeft, center, angle);
}
if (
pointDistance(bottomRight, nonRotated) <
Math.max(horizontalThreshold, verticalThreshold)
) {
return bottomRight;
return pointRotateRads(bottomRight, center, angle);
}
}

View File

@ -779,7 +779,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"fillStyle": "solid",
"frameId": null,
"groupIds": [],
"height": "0.00000",
"height": 0,
"id": "id668",
"index": "a2",
"isDeleted": false,
@ -855,14 +855,14 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
],
[
100,
"-0.00000",
0,
],
],
},
"inserted": {
"endBinding": {
"elementId": "id665",
"focus": "0.00000",
"focus": -0,
"gap": 1,
},
"points": [
@ -918,7 +918,6 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
],
],
"startBinding": null,
"y": 0,
},
"inserted": {
"points": [
@ -928,15 +927,14 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
],
[
100,
"-0.00000",
0,
],
],
"startBinding": {
"elementId": "id664",
"focus": "-0.00000",
"focus": 0,
"gap": 1,
},
"y": "0.00000",
},
},
},