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

9 lines
1.9 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="M15.2917 11.4996C15.7886 11.4996 16.1919 11.9031 16.1921 12.4V13.8072H17.5993C18.0962 13.8072 18.4995 14.2107 18.4997 14.7076V15.2916C18.4997 15.7886 18.0964 16.1919 17.5993 16.1919H16.1921V17.5992C16.1921 18.0962 15.7888 18.4996 15.2917 18.4996H14.7077C14.2108 18.4994 13.8073 18.0961 13.8073 17.5992V16.1919H12.4001C11.9032 16.1918 11.4997 15.7885 11.4997 15.2916V14.7076C11.5 14.2108 11.9033 13.8073 12.4001 13.8072H13.8073V12.4C13.8076 11.9032 14.2109 11.4997 14.7077 11.4996H15.2917Z" 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.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="M0.434899 0.957365C0.297544 0.627676 0.627671 0.297533 0.95736 0.434904L17.1038 7.16244C17.4513 7.30772 17.4234 7.80926 17.0619 7.91537L9.99056 9.99057L7.91537 17.0619C7.80926 17.4234 7.3077 17.4514 7.16244 17.1038L0.434899 0.957365ZM7.41634 14.8538L8.94955 9.62826C9.04541 9.30163 9.30162 9.04541 9.62826 8.94955L14.8538 7.41635L2.10384 2.10385L7.41634 14.8538Z" fill="black"/>
<path d="M15.2923 12.0004C15.5131 12.0004 15.6926 12.179 15.6927 12.3998V14.308H17.5999C17.8208 14.308 18.0002 14.4866 18.0003 14.7074V15.2924C18.0003 15.5133 17.8209 15.6927 17.5999 15.6927H15.6927V17.6C15.6927 17.8209 15.5132 18.0004 15.2923 18.0004H14.7074C14.4866 18.0002 14.308 17.8208 14.308 17.6V15.6927H12.3997C12.179 15.6926 12.0003 15.5132 12.0003 15.2924V14.7074C12.0005 14.4867 12.1791 14.3081 12.3997 14.308H14.308V12.3998C14.3081 12.1791 14.4867 12.0005 14.7074 12.0004H15.2923Z" fill="black"/>
</g>
</svg>