mirror of
https://github.com/penpot/penpot.git
synced 2026-09-20 02:46:14 +00:00
* ✨ Improve path operations and edition * 🐛 Fix floating-point equality issues in path editing Replace exact equality checks with tolerance-based comparisons in path editing functions to handle floating-point rounding differences after transforms, rotations, or curve fitting. Changes: - distribute-content: Round coordinates to 0.1 precision before grouping to ensure coincident nodes move together - separate-node: Use gpt/close? instead of exact equality to find nodes with floating-point imprecision - collision-step: Use mth/close? for tolerance-based comparison to detect paste collisions correctly - resolve-edit-fills: Add cycle detection to prevent infinite loops with corrupted parent chains Made collision-step, available-offset-step, and resolve-edit-fills public for better testability. Added comprehensive tests for all fixes covering both exact and floating-point coordinate scenarios. AI-assisted-by: qwen3.7-plus * 🐛 Fix path editor code review findings Fix issues identified during code review of path editor enhancements: - Fix unused binding lint warning in distribute-content that blocked CI - Fix collision-step floor comparison to use round instead of floor, correctly detecting collisions when coordinates drift slightly below integer boundaries - Fix resolve-edit-fills to recurse through empty parent groups when searching for inherited fills in nested group hierarchies - Fix expand-coincident-node-indices to use fuzzy comparison (gpt/close?) instead of exact equality, handling floating-point divergence after transforms or rotations - Remove unreachable dead code in path-point* on-pointer-down handler - Add tests for collision-step boundary cases, nested group fill inheritance, and coincident node alignment/flipping AI-assisted-by: mimo-v2.5-pro --------- Co-authored-by: Andrey Antukh <niwi@niwi.nz>
7 lines
2.3 KiB
XML
7 lines
2.3 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16">
|
|
<g transform="scale(0.94117647)">
|
|
<path d="M0.88185 -0.0985746L1.00294 -0.0780668L1.9922 0.146543C2.32172 0.22003 2.65158 0.291781 2.98146 0.361386C4.00537 0.577427 5.31198 0.837091 6.47267 1.01666C7.39865 1.15991 8.48547 1.32767 9.51369 1.64459C10.5458 1.96275 11.6036 2.45467 12.4395 3.30377C14.1067 4.9977 14.7472 6.98162 14.6787 9.37115L15.8887 10.5811C16.494 11.1864 16.494 12.1682 15.8887 12.7735L12.7735 15.8887C12.1681 16.494 11.1864 16.494 10.5811 15.8887L9.37111 14.6788C6.98155 14.7472 4.99766 14.1068 3.30372 12.4395C2.4546 11.6036 1.96271 10.5458 1.64455 9.51373C1.32763 8.48551 1.15987 7.3987 1.01662 6.47271C0.837047 5.31203 0.577372 4.00542 0.361342 2.9815C0.222105 2.32158 0.0742392 1.66256 -0.0781112 1.00299C-0.218667 0.394482 0.283656 -0.15568 0.88185 -0.0985746Z" fill="white"/>
|
|
<path d="M2.87793 0.850614C3.90513 1.06735 5.22231 1.32912 6.39648 1.51077C7.32814 1.6549 8.37849 1.81766 9.36621 2.1221C10.3561 2.42723 11.3272 2.88659 12.083 3.65433C13.6877 5.28465 14.2847 7.1956 14.1738 9.57327L15.5352 10.9346C15.9452 11.3447 15.9452 12.0099 15.5352 12.42L12.4199 15.5352C12.0099 15.9452 11.3446 15.9452 10.9346 15.5352L9.57324 14.1739C7.19554 14.2848 5.28463 13.6878 3.65429 12.083C2.88654 11.3272 2.4272 10.3561 2.12207 9.36624C1.81763 8.37852 1.65487 7.32817 1.51074 6.39651C1.32909 5.22234 1.06731 3.90516 0.850582 2.87796C0.710427 2.21368 0.5614 1.55158 0.408635 0.890223C0.341875 0.601198 0.601167 0.341906 0.890192 0.408666C1.55155 0.561427 2.21365 0.710451 2.87793 0.850614ZM7.14941 6.35257C7.7714 6.05007 8.542 6.1564 9.05859 6.67288C9.71016 7.32445 9.71009 8.38064 9.05859 9.03226C8.40699 9.68386 7.35082 9.68386 6.69922 9.03226C6.18528 8.51821 6.07801 7.75322 6.375 7.13284L1.93945 2.71292C2.15522 3.73871 2.41519 5.04909 2.59765 6.22854C2.74379 7.17318 2.8959 8.14452 3.17285 9.043C3.44916 9.93925 3.83784 10.7192 4.42675 11.2989C5.85131 12.701 7.63521 13.1262 9.5496 13.0698C9.83784 13.0613 10.1199 13.1648 10.3238 13.3687L11.6768 14.7217L14.7217 11.6768L13.3687 10.3238C13.1648 10.1199 13.0613 9.83787 13.0698 9.54963C13.1261 7.63525 12.701 5.85134 11.2988 4.42679C10.7192 3.83787 9.93923 3.44919 9.04296 3.17288C8.14449 2.89593 7.17315 2.74382 6.22851 2.59768C5.0535 2.41591 3.74866 2.15672 2.72461 1.94143L7.14941 6.35257Z" fill="black"/>
|
|
</g>
|
|
</svg>
|