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
835 B
XML

<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16">
<g transform="scale(0.76190476)">
<path d="M-0.0270493 1.14959C-0.316667 0.454186 0.319218 -0.243272 1.01104 -0.0730711L1.14971 -0.0271726L17.2962 6.70037C18.0787 7.02675 18.0168 8.15559 17.2034 8.3947L10.3929 10.3927L8.39483 17.2033C8.15571 18.0167 7.02688 18.0786 6.70049 17.2961L-0.0270493 1.14959Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.1034 7.1621C17.4514 7.3071 17.4239 7.80898 17.0622 7.91514L9.99053 9.99041L7.91526 17.0621C7.8091 17.4238 7.30723 17.4513 7.16222 17.1033L0.434499 0.957459C0.297119 0.627761 0.627881 0.296997 0.957579 0.434377L17.1034 7.1621ZM7.41631 14.8537L8.95 9.6278C9.04586 9.30117 9.30129 9.04573 9.62792 8.94987L14.8538 7.41619L2.10381 2.10369L7.41631 14.8537Z" fill="black"/>
</g>
</svg>