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.3 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="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 fill-rule="evenodd" clip-rule="evenodd" d="M17.5993 13.8072C18.0962 13.8072 18.4995 14.2107 18.4997 14.7076V15.2916C18.4997 15.7886 18.0964 16.1919 17.5993 16.1919H12.4001C11.9032 16.1918 11.4997 15.7885 11.4997 15.2916V14.7076C11.5 14.2108 11.9033 13.8073 12.4001 13.8072H17.5993Z" fill="white"/>
<path d="M0.435028 0.95752C0.297673 0.627831 0.6278 0.297688 0.957489 0.435059L17.104 7.1626C17.4513 7.30795 17.4234 7.80937 17.062 7.91553L9.99069 9.99072L7.9155 17.062C7.80935 17.4235 7.30791 17.4513 7.16257 17.104L0.435028 0.95752ZM17.6001 14.3081C17.8209 14.3081 18.0004 14.4867 18.0005 14.7075V15.2925C18.0003 15.5133 17.8209 15.6919 17.6001 15.6919H12.3999C12.1791 15.6918 12.0006 15.5133 12.0005 15.2925V14.7075C12.0005 14.4867 12.1791 14.3082 12.3999 14.3081H17.6001ZM7.41647 14.854L8.94968 9.62842C9.04554 9.30178 9.30175 9.04557 9.62839 8.94971L14.854 7.4165L2.10397 2.104L7.41647 14.854Z" fill="black"/>
</g>
</svg>