mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-24 10:09:32 -06:00
Cause: render::content_bounds (used by snapping's targets and source, Align, Distribute, the viewer's bounding box and handles) took shape layers' bounds from draw_bounds, the rasteriser's safety rectangle: 1 px of anti-aliasing padding around fills and width x miter limit / 2 + 1 around strokes. Two squares snapped edge to edge therefore stayed 2 px apart, or much more with strokes. Fix: shapes::content_bounds uses visual bounds, as After Effects' layer bounds do: the path bounds plus half the stroke width (through the draw's group scale), with no anti-aliasing or miter padding. Rendering keeps draw_bounds. Tests: render shape_content_bounds_are_the_visual_edges (a 100 x 100 rectangle is exactly +-50, +-55 with a 10 px stroke); engine shape_layers_align_by_their_visual_edges (widths 100 / 110, Align Left puts both edges exactly at 0). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QiAJeFttZp83Fh7YuzAR5f (cherry picked from commit bfd0abd7437ad1d38652e3aef51f9ba5dea9100b)