mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-24 09:46:59 -06:00
Layers::shift read a crack's sub-pixel shift from its inside pixel, looking for a thin run on the inside before one on the outside. Where both sides are thin (a one- or two-pixel sliver beside another, as in soft gradients and noisy scans) the two regions of the crack got different shifts, so their shared piece got different points and the abutting curves left slivers that no path covers. The shift is now the mean of the readings from both sides, (s(c) - s(c flipped)) / 2, which is exactly antisymmetric in floating point (Crack::flipped gives the crack seen from its other side). Tests (code-drawn images): - a_crack_between_thin_slivers_has_the_same_shift_from_either_side: every crack's shift is the exact negative of its flipped crack's, on a noisy ripple of 1-2 px columns at three thresholds. - shared_boundaries::thin_slivers_on_both_sides_of_an_edge_leave_nothing_uncovered: a 48 px noisy ripple in Black and White at thresholds 140/157/170 and Paths 0/50/100, sampled on the shared-boundary check's 4x4 grid per pixel: 482-1,228 uncovered points per trace before, 0 after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018tBcdwNhptqtmX32JCGFzB