mirror of
https://github.com/penpot/penpot.git
synced 2026-09-21 11:26: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
3.0 KiB
XML
9 lines
3.0 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="M16.4148 10.9996C16.8049 11.3899 16.8046 12.0231 16.4148 12.4136C16.2192 12.6091 15.962 12.7069 15.7058 12.7066L15.7067 13.7076H16.7067C16.7067 13.4517 16.8046 13.1948 16.9997 12.9996C17.3902 12.6094 18.0234 12.6095 18.4138 12.9996L20.1208 14.7066L18.4138 16.4136C18.0234 16.8037 17.3902 16.8047 16.9997 16.4146C16.8047 16.2194 16.7067 15.9624 16.7067 15.7066H15.7067V16.7066C15.9626 16.7065 16.2185 16.8045 16.4138 16.9996L16.4148 17.0005C16.8046 17.3911 16.8039 18.0233 16.4138 18.4136L14.7067 20.1207L12.9997 18.4136C12.6096 18.0231 12.6094 17.39 12.9997 16.9996C13.1949 16.8044 13.451 16.7066 13.7067 16.7066V15.7066H12.7067C12.7068 15.9625 12.609 16.2184 12.4138 16.4136C12.0233 16.804 11.3903 16.8042 10.9997 16.4136L9.29268 14.7066L10.9997 12.9996C11.3901 12.6093 12.0233 12.6096 12.4138 12.9996C12.609 13.1948 12.7068 13.4516 12.7067 13.7076H13.7067V12.7076C13.451 12.7075 13.1949 12.6097 12.9997 12.4146C12.6094 12.0242 12.6097 11.3911 12.9997 11.0005L14.7077 9.29253L16.4148 10.9996Z" 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.02731 18.0168 8.1558 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 d="M16.061 11.354C16.2558 11.5493 16.2561 11.8659 16.061 12.061C15.8659 12.2561 15.5493 12.2558 15.354 12.061L15.2075 11.9145V14.2075H17.5005L17.354 14.061C17.1588 13.8657 17.1588 13.5492 17.354 13.354C17.5492 13.1587 17.8657 13.1587 18.061 13.354L19.4145 14.7075L18.061 16.061C17.8659 16.2561 17.5493 16.2558 17.354 16.061C17.1588 15.8657 17.1588 15.5492 17.354 15.354L17.5005 15.2075H15.2075V17.5005L15.354 17.354C15.5492 17.1587 15.8657 17.1587 16.061 17.354C16.2558 17.5493 16.2561 17.8659 16.061 18.061L14.7075 19.4145L13.354 18.061C13.1588 17.8657 13.1588 17.5492 13.354 17.354C13.5492 17.1587 13.8657 17.1587 14.061 17.354L14.2075 17.5005V15.2075H11.9145L12.061 15.354C12.2558 15.5493 12.2561 15.8659 12.061 16.061C11.8659 16.2561 11.5493 16.2558 11.354 16.061L10.0005 14.7075L11.354 13.354C11.5492 13.1587 11.8657 13.1587 12.061 13.354C12.2558 13.5493 12.2561 13.8659 12.061 14.061L11.9145 14.2075H14.2075V11.9145L14.061 12.061C13.8659 12.2561 13.5493 12.2558 13.354 12.061C13.1588 11.8657 13.1588 11.5492 13.354 11.354L14.7075 10.0005L16.061 11.354Z" fill="black"/>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.435036 0.957487C0.297681 0.627798 0.627808 0.297655 0.957497 0.435026L17.104 7.16257C17.4513 7.30791 17.4234 7.80934 17.062 7.91549L9.9907 9.99069L7.9155 17.062C7.80936 17.4234 7.30791 17.4513 7.16258 17.104L0.435036 0.957487ZM7.41648 14.854L8.94968 9.62839C9.04554 9.30175 9.30176 9.04553 9.6284 8.94967L14.854 7.41647L2.10398 2.10397L7.41648 14.854Z" fill="black"/>
|
|
</g>
|
|
</svg>
|