penpot/frontend/resources/images/icons/handlers-equal.svg
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

4 lines
744 B
XML

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" stroke-linecap="round" stroke-linejoin="round">
<path d="M3.005,13L6.588,9.414M9.413,6.586L12.995,3M2.152,13.854C1.957,13.658 1.957,13.342 2.152,13.147C2.348,12.951 2.664,12.951 2.859,13.147C3.054,13.342 3.054,13.658 2.859,13.854C2.664,14.049 2.347,14.049 2.152,13.854M13.141,2.854C12.946,2.658 12.946,2.342 13.141,2.146C13.336,1.951 13.653,1.951 13.848,2.146C14.043,2.342 14.043,2.658 13.848,2.854C13.653,3.049 13.336,3.049 13.141,2.854M6.587,9.414C5.807,8.633 5.807,7.367 6.587,6.586C7.368,5.805 8.633,5.805 9.413,6.586C9.413,6.586 9.413,6.586 9.413,6.586C10.193,7.367 10.193,8.633 9.413,9.414C8.633,10.195 7.368,10.195 6.588,9.414C6.588,9.414 6.587,9.414 6.587,9.414"/>
</svg>