Commit 5f79feb
fix(library): collapse a loop only when its arms actually meet, not at proximity
A loop between perpendicular endpoints (diagram 84) collapsed to a side-jutting L-route
the moment its arms came within ~10px of each other — so even a small drag "pushed the
edge to the side" instead of just narrowing the loop. That 10px-proximity rule
(hasArmCollapse) also auto-straightened any hand-drawn detour between facing endpoints.
Removed the proximity collapse entirely. A loop now collapses only when its arms actually
FOLD onto each other (the path reverses on itself) or squeeze so tight a stub no longer
fits — a real "collapse this loop" gesture. A narrow-but-open loop, and a hand-drawn
detour between facing endpoints, are kept exactly as drawn (per user request: "only
collapse when there really is a spike", "stay as I drew it"). The fold-collapse and the
adjacent-arm lane clamp still turn a full squeeze into the clean direct route.
Updated the U-merge / near-overlap / facing-detour unit tests to the new "meet, don't
graze" threshold. Full-drag collapse verified for diagrams 83 and 84; routing-quality
gate, fresh-bend, interactions and reset e2e green; 1525 unit.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 70aa0cf commit 5f79feb
2 files changed
Lines changed: 61 additions & 96 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2740 | 2740 | | |
2741 | 2741 | | |
2742 | 2742 | | |
2743 | | - | |
2744 | | - | |
2745 | | - | |
2746 | | - | |
2747 | | - | |
2748 | | - | |
2749 | | - | |
2750 | | - | |
2751 | | - | |
2752 | | - | |
2753 | | - | |
2754 | | - | |
2755 | | - | |
2756 | | - | |
2757 | | - | |
2758 | | - | |
2759 | | - | |
2760 | | - | |
2761 | | - | |
2762 | | - | |
2763 | | - | |
2764 | | - | |
2765 | | - | |
2766 | | - | |
2767 | | - | |
2768 | | - | |
2769 | | - | |
2770 | | - | |
2771 | | - | |
2772 | | - | |
2773 | | - | |
2774 | | - | |
2775 | | - | |
2776 | | - | |
2777 | | - | |
2778 | | - | |
2779 | | - | |
2780 | 2743 | | |
2781 | 2744 | | |
2782 | 2745 | | |
| |||
3089 | 3052 | | |
3090 | 3053 | | |
3091 | 3054 | | |
3092 | | - | |
3093 | 3055 | | |
3094 | 3056 | | |
3095 | 3057 | | |
| |||
3127 | 3089 | | |
3128 | 3090 | | |
3129 | 3091 | | |
3130 | | - | |
3131 | | - | |
3132 | | - | |
3133 | | - | |
3134 | | - | |
3135 | | - | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
3136 | 3098 | | |
3137 | 3099 | | |
3138 | 3100 | | |
3139 | 3101 | | |
3140 | 3102 | | |
3141 | | - | |
| 3103 | + | |
3142 | 3104 | | |
3143 | | - | |
| 3105 | + | |
3144 | 3106 | | |
3145 | 3107 | | |
3146 | 3108 | | |
| |||
3522 | 3484 | | |
3523 | 3485 | | |
3524 | 3486 | | |
3525 | | - | |
3526 | | - | |
| 3487 | + | |
3527 | 3488 | | |
3528 | 3489 | | |
3529 | 3490 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1081 | 1081 | | |
1082 | 1082 | | |
1083 | 1083 | | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
1087 | 1096 | | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
1093 | | - | |
1094 | | - | |
1095 | | - | |
| 1097 | + | |
1096 | 1098 | | |
1097 | 1099 | | |
1098 | 1100 | | |
1099 | 1101 | | |
1100 | 1102 | | |
1101 | 1103 | | |
1102 | | - | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
| 1104 | + | |
1106 | 1105 | | |
1107 | 1106 | | |
1108 | 1107 | | |
| |||
1320 | 1319 | | |
1321 | 1320 | | |
1322 | 1321 | | |
1323 | | - | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
1324 | 1333 | | |
1325 | | - | |
1326 | | - | |
1327 | | - | |
1328 | | - | |
1329 | | - | |
1330 | | - | |
1331 | | - | |
1332 | | - | |
| 1334 | + | |
1333 | 1335 | | |
1334 | 1336 | | |
1335 | 1337 | | |
1336 | 1338 | | |
1337 | 1339 | | |
1338 | 1340 | | |
1339 | | - | |
1340 | | - | |
1341 | | - | |
1342 | | - | |
| 1341 | + | |
1343 | 1342 | | |
1344 | 1343 | | |
1345 | 1344 | | |
| |||
1477 | 1476 | | |
1478 | 1477 | | |
1479 | 1478 | | |
1480 | | - | |
1481 | | - | |
1482 | | - | |
1483 | | - | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
1484 | 1484 | | |
1485 | 1485 | | |
1486 | 1486 | | |
| |||
1500 | 1500 | | |
1501 | 1501 | | |
1502 | 1502 | | |
1503 | | - | |
1504 | | - | |
1505 | | - | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
1506 | 1507 | | |
1507 | 1508 | | |
1508 | 1509 | | |
| |||
1519 | 1520 | | |
1520 | 1521 | | |
1521 | 1522 | | |
1522 | | - | |
1523 | | - | |
1524 | | - | |
1525 | | - | |
1526 | | - | |
1527 | | - | |
1528 | | - | |
1529 | | - | |
1530 | | - | |
1531 | | - | |
1532 | | - | |
1533 | | - | |
1534 | | - | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
1535 | 1539 | | |
1536 | 1540 | | |
1537 | 1541 | | |
| |||
0 commit comments