Engine split step 8 moved Auto-Align Layers to engine-vector, so the
playback and Undo test in engine-core built a session where
`edit.autoAlignLayers` isn't registered, and no longer exercised the
real command. It moves to the engine integration tests
(`atn_auto_align_play.rs`), where `Session::new()` installs every crate's
commands, and now also checks that playing the step adds one history
state. The import and export tests stay in engine-core.
On that pin DockAreaOutput.window_files is grouped per window; the files dropped on a floating panel's window are
flattened before they open (as aiongg/photocraft@54911df7f5).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The `tmp` helper built its folder under the OS temp directory named
`photocraft-droplet-dest-<pid>-<name>` and only removed it at the start
of the next run, so every test run that did not reach the same name
again left its fixtures behind. The sibling droplet_play_options_tests.rs
already uses `tempfile::tempdir()` (engine-core has the tempfile dev
dependency); `tmp` now hands back the `TempDir` beside the path and each
test holds it, so the fixture goes when the test ends, panicked or not.
Paths are derived from the temp folder; no assertion reads the old
naming.
The first click of a new path took the subpath index it carries from the
path that was in the document before the write. A replacing click sends
`path.set` without `op`, and that write leaves the drawn path the
document's only one (`vector_cmds/paths.rs`), so after Enter had finished
a path with one subpath the draft looked for its anchor at index one,
found no subpath there, and never went live: every further click stayed
in the draft and made no History step of its own. A click that joins the
path selected in the Paths panel still appends with `op`, so the count
that path had stays its index there.
Redo of one of the Pen's own clicks back to the History tip left no state
waiting to be redone, so the live draft did not follow the path: the next
pass cancelled it ("Pen draft cancelled because its source document or
path changed") and the click after that wrote a new one-anchor Work Path
over the path being drawn. `can_redo()` cannot tell that case from a
command that replaced the subpath, so the rule now asks who made the
state the document is on: the six Pen step names are refused for any
other `path.set` (`paths.rs`), so Redo and Step Forward to one of those
states rebuild the draft from its path, as stepping back to an earlier
state always did, while a command from elsewhere leaves a state under
another label and the draft goes stale there (#6593). `PEN_STEP_NAMES`
becomes an export of `vector_cmds` so the Pen's route and the allowlist
read one list.
`the_path_that_replaces_the_one_enter_finished_is_live_from_its_first_click`
and `redoing_to_the_tip_of_a_live_path_puts_its_click_back_on_the_pen`
fail at 39a3bc5377 - after Enter the steps there are only
["New Work Path"] where the clicks are two, and at the tip of a Redo the
draft is gone - and pass here.
The merged main moved the Actions state and the playback counters behind accessors
(ActionsExt::actions/actions_mut, Session::recording) and the preset store behind PresetStoreExt.
`run_droplet_open` now reads and writes the captured action list, the batch depth and the script
step budget through those, and its tests build their sessions with `crate::session()`, the way the
droplet tests on main do. The rule the tests pin is unchanged: a None run installs the droplet's
captured actions, raises the nesting depth for its own steps and hands both back.
CI runs one test process per test. These four started from a bare
Session::new(), so the first command returned NotInstalled and the unwrap
panicked: crates/engine-core/src/cmd/actions_cmds/tests.rs:438 in
recording_starts_with_no_document_open, and :447 in the shared helper
other_names_document that the three playback pins call. Every other test
in this file starts from crate::session(), which installs this crate's
commands first; the four now do the same.
Verified per test rather than per run: run alone, each of the four failed
before this change (unwrap on Err(NotInstalled)) and passes alone after
it. A single whole-lib process hides this because one test's install serves
the rest; the whole lib stays green either way (3276 passed, 0 failed).
Since #15449 File › New is the shared NewDocumentDialog, so the old
app-local Recent heading, grid and tests are dropped in favour of main's
dialog code; that part now goes through storytold/craft-libs#2261.
Kept: document.recent.add and load_recent keep equal settings as
separate entries, now in crates/engine-core.
In Path mode the Pen kept its anchors in a draft and put the whole path
into the document at the finish, so one Undo took a whole path of clicks
back. The first anchor now makes the Work Path, and every further press
writes it again, so History gains the step that press has: New Work Path,
New Anchor Point, Close Path, New Path Component, Pick-up Path or Drag
Anchor Point. Undo takes one click back at a time and the draft follows
its path; Enter and Esc end the drawing without a step of their own, and
the Make Shape button's step reads "Make shape from path".
The live draft reuses what Shape mode already does for its live layer, so
the Curvature Pen, the Freeform Pen, Shape mode, a selected saved path and
a vector mask keep holding their anchors in the draft until the finish.
main's engine split moved these tests into photocraft-engine-core, where the
session's action state sits behind actions() and actions_mut(); the three
action pushes now use the accessor.
fill_ui.rs: main (#13421) seeds the Fill dialog's colour inks and gives defaults() the picked CMYK; this PR's
rows(app, ...) call stays so the Mode row reads the document. main's new reset test builds its rows with an app.
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]>
#12887 measured a second half of the rule the reference application holds: it refuses an Indexed pattern from another image, whose colours are not in the document's colour table, and paints only the one carrying that table. Tracking the source mode and not the table lets that case paint. Pin it exactly as it behaves now - the tile's red and green land in a document whose table holds neither - so the follow-up (#16642) is met with a test that says which way the behaviour has to go, and record the same thing where the field is documented: how a repeat definition of pixels already in the library picks its source, and that the PSD raw-block comparison now covers the new field. An index written before the source member still loads the whole pattern with no source, which the library test now strips the member to prove.
Edit > Define Pattern composites the area in the document's pixel format, which stores an Indexed Color document expanded to RGB. Nothing on Pattern said where the tile came from, so a pattern taken from an Indexed image was indistinguishable from an RGB one, and a tool that cares about the difference had nothing to read.
The new field names the source mode. The pixels, the id and what the pattern library lists stay as they were. A pattern read from a file records no source: a .pat or PSD block says what its pixels are, not which document they came from. The library index and .pcraft carry the field, so a defined pattern keeps its source across a restart or a save; files written before it read as no source.