Main's #13326 tests keep the Star tool without the checkbox (the reference
application has no Star tool; its stars are the Polygon tool's). Keep that,
and the comments and docs that name the Polygon drag.
Co-Authored-By: superplay2021 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The PR snapped shapes with a per-edge heuristic (pixel_align.rs, dash-cap tie
rules, a PSD coordinate-frame field threaded through engine, format and caches),
defaulted the option to off, and renamed the existing Rectangle/Triangle
"Align Edges" checkbox to "Snap Bounding Box" next to a second checkbox.
The reference application fits the whole shape at render time: the bounds of
what it paints (fill, or the stroke's outer edge) get a whole-pixel left/top
(a half rounds up) and a whole width/height, and the path is translated and
scaled into that box. Fill and stroke take one transform; curves stay
antialiased; inner edges of several subpaths are not snapped.
- photocraft_vector::align_edges implements that rule; CompiledShape applies it,
so caches, the compositor, previews and extents agree; the fill/stroke split
under layer effects starts from the whole shape's transform.
- Removed pixel_align.rs, the rasterizer helpers it needed, the document-space
drag preview and psd_coordinate_frame (rounding the bounds absorbs the PSD
quantization it was for).
- One Align Edges checkbox (ToolOptions::align_edges, stored and scripted as
useAlignedRendering, older align_edges still read) on every shape tool and the
Pen, on by default and after Reset Tool; it snaps the drag and sets the layer.
- PSD sn2P: written as 1 when on and left out when off, as the reference saves it.
- Dropped the dead path.set param, moved the control-protocol paragraph,
rewrote docs/pixel-aligned-strokes.md, reverted the unrelated raw, font,
Cargo and test-harness changes.
- Tests reproduce the measured cases (rectangles at .25/.4/.5/.6/.75, ellipse
extremes and curve symmetry, 1/2/3 px strokes, rotated rect, Pen triangle,
two subpaths, toggle off, stored path unchanged, one checkbox, Reset Tool).
Co-Authored-By: superplay2021 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Align isolated integer-axis 1px stroke runs at render time while preserving
stored paths, dash lengths/offsets, and curve/diagonal antialiasing. Handle
filled live Line/ArrowLine geometry separately and retain rectangle corners
through reversed traversal and quarter-turn transforms.
Quantize eligible dash caps consistently, including fractional periods and
negative offsets. Round and square caps retain their extra pixel of extent.
Add model/native/PSD flag roundtrips, command validation and undo coverage,
selected-shape controls, custom-shape presets, and tool preset/reset support.
Document conservative fallback for unsupported widths, alignments and paths.
Validation: desktop build with two jobs in standard target; cargo fmt check;
cargo check --workspace; touched-crate clippy; 112 vector tests; command,
selected-shape/preset/reset, native roundtrip and PSD flag tests; adversarial
command panic hunt; layering checks. Manual 24MP vector render also passes.
Known validation limits: the broader workspace run is not completely green
(Windows junction permissions, automation cancellation, GPU timing, and
font-selection tests). Targeted font-input reruns resolve localization cases.
WASM std/core target is not installed. Full IO corpus and release perf checks
were attempted but not completed. No blanket Photoshop rendering-parity claim.