mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-21 01:18:43 +00:00
The ants were snapped to the middle of an egui point and drawn one point wide without antialiasing. At a fractional display scale (125 %, 150 %) a point is not a whole number of pixels, so one edge of a selection came out 2 px thick and the next 1 px, and dashes were 5 px here and 4 px there. New ants.rs draws every ants outline (committed selection, marquee/lasso/ zoom/move-box drag previews, Free Transform, Content-Aware Move) in device pixels: every edge ceil(ppp) px thick, dashes and gaps 4x the thickness, a screen-fixed pattern whose rows shift against each other so dash ends slant as in Photoshop, and an unchanged march speed. Straight edges are pixel-aligned mesh quads cut to the view; slanted edges stay antialiased line shapes at the same thickness. Tests: ants::tests (unit), tests/marching_ants_pixels.rs (GPU render at 1/1.25/1.5/2x; on the old code it fails with top 1 px, right 2 px). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>