mirror of
https://github.com/penpot/penpot.git
synced 2026-09-23 20:36:15 +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>
9 lines
2.5 KiB
XML
9 lines
2.5 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16">
|
|
<g transform="scale(0.76190476)">
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.6599 10.5835C18.2457 9.9979 19.1952 9.9979 19.781 10.5835C20.3662 11.1693 20.3664 12.119 19.781 12.7046C19.5027 12.9829 19.1422 13.124 18.78 13.1382L17.5485 14.3697C17.8471 15.2433 17.6505 16.2501 16.9528 16.9478C16.2552 17.6455 15.2483 17.842 14.3747 17.5435L13.1433 18.775C13.1291 19.1372 12.988 19.4976 12.7097 19.7759C12.1241 20.3614 11.1744 20.3612 10.5886 19.7759C10.0029 19.1902 10.0029 18.2406 10.5886 17.6548C10.8668 17.3766 11.2265 17.2336 11.5886 17.2193L12.82 15.9878C12.5222 15.1145 12.7194 14.109 13.4167 13.4117C14.1141 12.7144 15.1196 12.5171 15.9929 12.815L17.2243 11.5835C17.2386 11.2215 17.3816 10.8618 17.6599 10.5835Z" fill="white"/>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M-0.0266525 1.14995C-0.31627 0.454553 0.319614 -0.242906 1.01143 -0.0727049L1.15011 -0.0268064L17.2966 6.70073C18.0785 7.02732 18.0168 8.15579 17.2038 8.39507L10.3933 10.3931L8.39522 17.2037C8.15608 18.0168 7.02745 18.0786 6.70089 17.2964L-0.0266525 1.14995Z" fill="white"/>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.013 10.9369C18.4035 10.5464 19.0366 10.5464 19.4271 10.9369C19.8173 11.3274 19.8175 11.9605 19.4271 12.3509C19.1958 12.5822 18.8791 12.6748 18.5785 12.6322L16.9574 14.2542C17.351 15.0082 17.2312 15.9599 16.598 16.5931C15.9647 17.2263 15.0131 17.3461 14.2591 16.9525L12.637 18.5736C12.6797 18.8742 12.587 19.191 12.3558 19.4222C11.9654 19.8125 11.3322 19.8124 10.9417 19.4222C10.5513 19.0317 10.5512 18.3977 10.9417 18.0072C11.1729 17.7762 11.489 17.6834 11.7894 17.7259L13.4105 16.1048C13.0168 15.3508 13.1366 14.3983 13.7699 13.765C14.4032 13.1317 15.3557 13.0119 16.1097 13.4056L17.7308 11.7845C17.6882 11.4839 17.7818 11.1681 18.013 10.9369ZM15.7494 14.6136C15.4369 14.3014 14.9308 14.3013 14.6185 14.6136C14.3062 14.926 14.3063 15.4321 14.6185 15.7445C14.9309 16.0569 15.4369 16.0568 15.7494 15.7445C16.0618 15.4321 16.0618 14.926 15.7494 14.6136Z" fill="black"/>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.434899 0.957365C0.297544 0.627676 0.627671 0.297533 0.95736 0.434904L17.1038 7.16244C17.4513 7.30772 17.4234 7.80926 17.0619 7.91537L9.99056 9.99057L7.91537 17.0619C7.80926 17.4234 7.3077 17.4514 7.16244 17.1038L0.434899 0.957365ZM7.41634 14.8538L8.94955 9.62826C9.04541 9.30163 9.30162 9.04541 9.62826 8.94955L14.8538 7.41635L2.10384 2.10385L7.41634 14.8538Z" fill="black"/>
|
|
</g>
|
|
</svg>
|