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]>
The anchor tools' overlay moved to the shared UI framework, so the old ui-egui changes are dropped
in favour of main's structure; the engine and vector changes stay.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
path.moveAnchors with duplicate cloned the subpath with its stored
operation, so a copy of a joined subpath (a component's hole) became part
of whichever component was last. It now goes through
edit::duplicate_subpaths, which keeps the source's operation (as measured
for #13211) but gives a joined subpath's copy its component's stored
operation. The helper no longer forces Combine on a copy of the first
component, which contradicted the measured case. Direct Selection's drag
preview uses the same helper.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
One component sums the halves' winding numbers; two Combine components are
filled each on its own and united, so a reversed half inside the other would
turn a hole into fill. Split a Combine subpath only when the halves' boxes,
handles included, are apart.
An open subpath split by path.deleteSegment gave the new half a copy of
its op, so an Intersect, Exclude or Subtract subpath folded in as two
components, a first subpath's stored op suddenly applied, and a Join
subpath after it moved to the other half's component. Until #13606
measures the reference, only splits where both readings agree go
ahead: a Combine subpath that is a component of its own, or a Join
subpath after the first. The rest return an error with no History
step; the Delete key shows it and keeps the layer.
Review fixes for #12709:
- The canvas captures the press modifiers for Add Anchor Point, so letting
go of Alt before the drag is recognised still duplicates the subpath.
- duplicate_subpaths gives a copy the operation its component draws with;
the first component always combines, so its copy no longer subtracts a
hole from the original.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Alt no longer turns Add Anchor Point into Delete Anchor Point. Alt+click
on a segment of the targeted path selects that whole subpath with no
History step; Alt+drag copies the subpath and moves the copy, one step
"Drag Path", leaving the copy selected. Alt+click on an anchor deletes
nothing. The cursor with Alt held is the arrow with "+" everywhere.
path.moveAnchors gains "duplicate": the subpaths holding the anchors are
copied to the end of the path and the copies move (vector
edit::duplicate_subpaths, shared by the canvas preview).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
With a base bent toward the tip, the shaft stopped where the bent base
crosses its edge and left the wedge up to the base's middle unfilled. The
shaft's end now follows the bent base to its middle, which fills the wedge
without reaching past the head's flanks, matching the reference outline.
shape.create / shape.edit round arrowConcavity to a whole percent, as the
gear and Properties fields do.
Concavity is a whole number from -50 % to 50 % of the head's length, as in
Photoshop. A negative value bends the head's base away from the tip, and the
shaft now ends where the bent base crosses the shaft's edge. Values outside
the range (documents, PSDs and settings saved with the old 0..100 range) are
clamped to the nearest end instead of failing.
- vector: arrow_line bends the base by concavity x length, both directions
- engine: shape.create / shape.edit take arrowConcavity in -50..=50
- io: PSD import keeps negative concavity, clamped to -50..50
- ui: gear and Properties Concavity are whole-number fields with the
"Closest value inserted" alert; the gear menu stays open on clicks inside
so a value can be typed
The hostile-radii test now tells the command guard's internal error from a graceful one, and a new test sends hostile boxes. The vector tests pin zero-size, sliver and tall thin boxes. The format tests cover both fields present, a field holding another kind, and junk in triangle_live.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Model-Effort: Opus 5.5 drove; Fable 5.2 briefed; Sonnet 5.5 wrote at medium
A new live shape kind, LiveShape::Triangle { rect, corner_radius }, draws an isosceles triangle that fills the dragged box (apex at the top centre, then bottom right, bottom left). The engine no longer turns a triangle into an inscribed 3-sided polygon. Triangles saved before this are 3-sided polygons and keep that geometry.
The .pcraft manifest stores a live triangle in a new optional triangle_live field beside live (as arrow_live does), so older builds open the file and show the saved path. PSD export writes no vogk for a triangle, as for polygons.
Arms the new kind forces: live_kind, the axis-aligned transform, params, the corner radius widgets and the Properties Shape section (Corner radius only). Shift keeps today's equilateral triangle, sent as its tight box.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Model-Effort: Opus 5.5 drove; Fable 5.2 briefed; Sonnet 5.5 wrote at medium
A few samples can fit worse than more, so a failed doubling step looks one
step further before it stops. On whole-pixel samples the vee now gets the
reference application's four anchors at Curve Fit 2 (was five); the Curve
Fit 2 tests run on both the given and the whole-pixel strokes.
fit_trace places the Freeform Pen's anchors as the reference application
does on the issue's sample strokes: corners only at turns sharper than
80°, each run fitted one segment at a time as far as one cubic follows the
trace, ending on the first turning point in x or y within reach, with the
segment's turn bounded by Curve Fit (75° per px, at most 150°). The end
handle of each piece is fitted, not estimated. A closed trace keeps its
release point as an anchor. Make Work Path keeps its fitting.
Curve Fit 2: sine 6 anchors on the peaks, circle 5, open circle 4, vee 4
smooth, line unchanged; 0.5 and 1 px give more anchors.
live_path rounds a star's outer points and leaves its inner points
sharp corners, as the reference application does: a 5-point star at
Star Ratio 50 % with corner radius 10 has 15 anchors instead of 20.
Plain polygons keep rounding every vertex.
The on-canvas corner radius widget shows knobs at the outer points only
and takes its largest radius from them, so it previews the same path
as shape.create.
With Direct Selection, Delete / Backspace fell through to Edit › Clear and
deleted the active layer. Now, as measured in the reference:
- one selected anchor goes with its two segments (path.deleteAnchor
segments:true, as for the anchor tools, #12703): History "Delete Anchor Point";
- a selected segment goes on its own: the anchors stay, a closed subpath opens
starting at the segment's end (new path.deleteSegment, History "Delete Anchor
Point");
- with nothing selected, the targeted saved path or Work Path is deleted
(path.delete, "Delete Path"), and a targeted vector mask goes as the Paths
panel's trash deletes it.
Several selected anchors and a shape layer's path with nothing selected were
not measured and keep today's route.
add_anchor no longer special-cases a straight segment: it is split by de Casteljau at t with controls (start, start, end, end), like any cubic. The neighbours' handles stay retracted, the new knot is smooth with handles a quarter of the segment either side at the middle, and it stays at the cubic point at t. New tests in edit_add_anchor_straight_tests.rs; the two corner expectations in edit.rs and the Add tool's straight-segment test now expect the smooth point.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium
* fix(ui): Delete on an anchor selected with Add Anchor Point removes it, not the layer (#12703)
With the Add Anchor Point tool and one anchor selected (Ctrl+click), Delete
and Backspace fell through to Edit > Clear and deleted the active layer.
They now remove the anchor and its two segments, as in the reference
application: a closed subpath opens there. One history step, Delete Anchor
Point.
- vector: edit::delete_anchor_and_segments (a closed subpath opens at the
anchor; an open one loses an end or splits at an inner anchor)
- engine: path.deleteAnchor takes "segments": bool (default false keeps
joining the neighbours, as the tool's click does)
- ui: delete_key_deletes_anchor next to delete_key_deletes_work_path, and a
Delete/Backspace branch before the work path's
* test(vector): Delete on one anchor of a closed two-anchor subpath leaves the other, open (#12703)
The kept anchor retains its handles and smooth flag, and the subpath keeps its path operation.
A saved path whose only anchor is deleted keeps its place in the Paths panel with no subpaths, as in Photoshop. The Work Path, a shape's path, a vector mask and a Type Path still refuse it.
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.