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
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="M14.9997 11.7994C16.7669 11.7994 18.1997 13.2325 18.1999 14.9996C18.1999 16.7669 16.767 18.1998 14.9997 18.1998C13.2325 18.1996 11.7995 16.7668 11.7995 14.9996C11.7998 13.2326 13.2327 11.7995 14.9997 11.7994Z" 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="M15.0003 12.3002C16.4913 12.3004 17.7005 13.5093 17.7005 15.0004C17.7003 16.4913 16.4912 17.7004 15.0003 17.7006C13.5093 17.7006 12.3003 16.4914 12.3001 15.0004C12.3001 13.5092 13.5092 12.3002 15.0003 12.3002ZM0.434906 0.957397C0.297551 0.627708 0.627678 0.297565 0.957367 0.434937L17.1039 7.16248C17.4513 7.30775 17.4234 7.80929 17.0619 7.91541L9.99057 9.9906L7.91537 17.0619C7.80926 17.4235 7.30771 17.4514 7.16245 17.1039L0.434906 0.957397ZM15.0003 13.7006C14.2824 13.7006 13.7005 14.2824 13.7005 15.0004C13.7007 15.7182 14.2825 16.3002 15.0003 16.3002C15.718 16.3 16.3 15.7181 16.3001 15.0004C16.3001 14.2825 15.7181 13.7007 15.0003 13.7006ZM7.41635 14.8539L8.94955 9.6283C9.04541 9.30166 9.30163 9.04544 9.62827 8.94958L14.8539 7.41638L2.10385 2.10388L7.41635 14.8539Z" fill="black"/>
</g>
</svg>