Alonso Torres 217284b1e1
✨ Improve path operations and edition (#10807)
* ✨ 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>
2026-08-27 10:51:10 +02:00

8 lines
2.4 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.072 10.9283C17.6585 10.3534 18.5993 10.358 19.1814 10.939C19.7668 11.5248 19.7679 12.4744 19.1823 13.0601C18.6218 13.6206 17.7286 13.6436 17.1394 13.1314C17.0389 13.1452 16.9321 13.1632 16.821 13.1861C16.0895 13.3369 15.1513 13.6976 14.3034 14.5455C13.4556 15.3934 13.0949 16.3315 12.9441 17.063C12.9211 17.1743 12.9033 17.2812 12.8894 17.3814C13.4016 17.9707 13.3786 18.8638 12.8181 19.4244C12.2324 20.0099 11.2827 20.0098 10.697 19.4244C10.1162 18.8425 10.1119 17.9015 10.6862 17.315C10.7082 17.1044 10.738 16.8696 10.7898 16.6187C11.0062 15.5692 11.5302 14.2094 12.7487 12.9908C13.9673 11.7722 15.3271 11.2482 16.3767 11.0318C16.6275 10.9801 16.862 10.9501 17.072 10.9283Z" 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 d="M17.4141 11.292C17.8043 10.902 18.4376 10.9026 18.8282 11.292C19.2187 11.6826 19.2187 12.3166 18.8282 12.7071C18.4376 13.0972 17.8045 13.0974 17.4141 12.7071C17.3827 12.6756 17.3536 12.6419 17.3272 12.6075C17.1485 12.6238 16.9436 12.6504 16.7207 12.6963C15.9168 12.8621 14.8825 13.2602 13.9502 14.1924C13.0183 15.1245 12.6199 16.1581 12.4541 16.962C12.4081 17.1853 12.3806 17.3914 12.3643 17.5704C12.3988 17.5968 12.4333 17.6248 12.4649 17.6563C12.8552 18.0467 12.8551 18.6798 12.4649 19.0704C12.0744 19.4609 11.4414 19.4608 11.0508 19.0704C10.661 18.6798 10.6605 18.0466 11.0508 17.6563C11.0859 17.6213 11.1236 17.5903 11.1622 17.5616C11.1806 17.3185 11.2148 17.0328 11.2793 16.7198C11.4809 15.7425 11.9673 14.4781 13.1016 13.3438C14.2359 12.2095 15.5003 11.7231 16.4776 11.5215C16.7903 11.4571 17.0755 11.4237 17.3184 11.4053C17.3474 11.3663 17.3787 11.3275 17.4141 11.292ZM0.434617 0.957086C0.297691 0.627629 0.62762 0.297673 0.957078 0.434626L17.1036 7.16216C17.4511 7.30744 17.4232 7.80898 17.0616 7.91509L9.99028 9.99029L7.91509 17.0616C7.80897 17.4232 7.30742 17.4511 7.16216 17.1036L0.434617 0.957086ZM7.41606 14.8536L8.94927 9.62798C9.04515 9.3015 9.30149 9.04515 9.62798 8.94927L14.8536 7.41607L2.10356 2.10357L7.41606 14.8536Z" fill="black"/>
</g>
</svg>