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

7 lines
1.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="M2.97335 1.14995C2.68373 0.454553 3.31961 -0.242906 4.01143 -0.0727049L4.15011 -0.0268064L20.2966 6.70073C21.0785 7.02732 21.0168 8.15579 20.2038 8.39507L17.5954 9.15972C17.4941 9.26352 17.3646 9.34774 17.2038 9.39507L13.3542 10.524L11.3952 17.2037C11.1561 18.0168 10.0275 18.0786 9.70089 17.2964L9.09054 15.8316L8.39522 18.2037C8.15608 19.0168 7.02745 19.0786 6.70089 18.2964L-0.0266525 2.14995C-0.31627 1.45455 0.319614 0.757094 1.01143 0.927295L1.15011 0.973194L3.26632 1.85503L2.97335 1.14995Z" fill="white"/>
<path d="M0.434906 1.95752C0.297569 1.62792 0.627771 1.29704 0.957367 1.43408L17.1039 8.1626C17.4513 8.30789 17.4234 8.80942 17.0619 8.91553L9.99057 10.9907L7.91537 18.062C7.80921 18.4238 7.30745 18.451 7.16245 18.103L0.434906 1.95752ZM10.9154 17.062C10.8092 17.4235 10.3078 17.4514 10.1624 17.104L9.31381 15.0688L9.806 13.3901L10.4164 14.854L11.5296 11.0591L12.7845 10.6909L10.9154 17.062ZM7.41635 15.854L8.94955 10.6284C9.04541 10.3018 9.30163 10.0456 9.62827 9.94971L14.8539 8.4165L2.10385 3.104L7.41635 15.854ZM3.43491 0.95752C3.29755 0.627831 3.62768 0.297688 3.95737 0.435059L20.1039 7.1626C20.4513 7.3079 20.4234 7.80942 20.0619 7.91553L17.847 8.56494C17.8603 8.21699 17.6817 7.86151 17.2962 7.70068L17.1263 7.62939L17.8539 7.4165L5.10385 2.104L5.36362 2.729L3.92221 2.12842L3.43491 0.95752Z" fill="black"/>
</g>
</svg>