sync_live_draft_from_layer asked whether the step the document sits on carries one of the six Pen
step names. That name proves nothing: path.set's pen_history_name (crates/engine-core/src/cmd/
vector_cmds/paths.rs:86-97) matches historyName against the list for ANY caller, so a control-channel,
scripted or panel write that replaces the Work Path under "New Anchor Point" made the Pen believe the
document had moved onto one of its own clicks - and rebuild_live_draft handed the draft the other
caller's anchors, so the next click went on drawing over a path the Pen never drew.
The draft now keeps what it minted: every live write it makes records the History state id that write
produced (History::row_id of the current row, the same id pen_resume pins a finished path by), and the
rule reads those ids instead of the label. History mints the ids and never reuses them, and no command
parameter carries one, so a same-named write cannot forge it. Stepping back to an earlier state keeps
working through can_redo, so Undo, Step Backward and the History panel still move the draft back over
its own clicks, and Redo to the tip still puts the Pen's last click back on the Pen.
Red first: another_caller_cannot_forge_a_pen_step_with_its_history_name draws three anchors, replaces
the Work Path under "New Anchor Point" through app.run, and asks for the draft to be cancelled. At
ebb5365c24 it failed at the cancellation assert - the draft survived, rebuilt over the foreign anchors.
Gates: cargo test -p photocraft-ui-egui -p photocraft -p xtask --lib pen_history_steps 20 passed / 0
failed (redoing_to_the_tip_of_a_live_path_puts_its_click_back_on_the_pen included), --lib
pen_path_ownership 17 / 0, --lib vector 274 / 0, --lib ::pen 153 / 0, and the new test alone with
-- --exact 1 / 0; cargo fmt -p photocraft-ui-egui -- --check clean; cargo clippy
-p photocraft-ui-egui --all-targets -- -D warnings Finished; cargo check -p photocraft-ui-egui
--target wasm32-unknown-unknown Finished; cargo xtask layers OK (30 crates); cargo xtask
panel-commands OK.
Rotate 90 and 180 degrees inside Free Transform turn the box with sine and cosine, which leaves float noise (about 1e-13 px) on corners that belong on the pixel grid. The commit passed that quad to edit.transform as is, and the warp gave the layer an extra empty column or row: 201 x 300 at 149,50 instead of 200 x 300 at 150,50 for Rotate 90 CCW, 301 x 201 at 99,100 for Rotate 180. The commit now rounds a box corner to the whole pixel when it is within 1e-9 px of it, so the presets match the direct Edit > Transform commands; a real sub-pixel move keeps its fraction. Fixes#16759.
`automation_sets_the_preview_box` wrote the `preview` field through the
dialog host method directly. Going through `ui.dialog.set` instead runs
the same entry a script takes in the live app, so the test proves the
automation half of the Preview box as the user of the control channel
uses it.
Refs #14530
The reference application shows what Calculations will produce while the
dialog is open: a Preview check box, on by default and keyed to Alt+P,
paints the result channel as a grey image over the whole canvas, and
every field change redraws it. Until now the canvas kept showing the
unchanged image until OK.
The form is a hosted parameter dialog, so the check box and its state
come from the framework's own Preview half (`previews(true)`): captioned,
starting on, read and written as the `preview` field for automation. The
command itself only adds a channel, so the post-OK document composites
exactly as before and cannot be the picture; the canvas preview instead
runs the same dialog values through the same engine as the New Document
result, whose one-layer grayscale document is the grey rendering of the
result channel, and the existing filter-preview pipeline draws it over
the canvas at the document's proxy factor. Nothing is written: the run
happens in a scratch session, so Cancel leaves the document, its channels
and its history untouched, and OK stays the single "Calculations" step
with exactly the values the preview showed. The pinned framework draws
the box but keys no shortcut to it, so Alt+P is bound app-side, consumed
in the canvas pass that feeds the preview.
Fixes#14530
Holding Ctrl over the selection (or a layer in a selected group) with
the Move tool used to fall back to the canvas-edge distances. It now
draws nothing; empty canvas and the Background still measure to the
canvas edges.
`clip_bytes` trimmed trailing spaces even when it didn't cut anything,
so a sanitized prefix such as `A ` (from `A .`) lost its space in a
short file name. It now returns a part that fits unchanged and trims
only the end a cut leaves.
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.
When a part of the file name was cut, the bytes left over (less than one
character of it) could still hold a later, lower-priority part: a cut
comp name could lose its last character while a one-letter comment
stayed. Now a cut prefix leaves out the name and comment, and a cut
name leaves out the comment.
The comp comment is appended to the file name, and nothing limited the
length, so a comment of a few sentences gave a name past the 255-byte
file name limit and the save stopped the whole export at that comp.
`comp_file_name` now builds `<prefix>_<index>_<name>[_<comment>].<ext>`
within 255 bytes (which also keeps it within Windows' 255 UTF-16 units).
A name that doesn't fit loses the end of its comment first, the whole
comment with its `_` when none of it fits, then of the comp name, then
of the prefix. The index and extension always stay, and every cut falls
between characters.
The new test exports a comp with a six-sentence comment (with umlauts)
and the comp after it, as PNG and TIFF; without the change the export
fails at the first comp. The names tests now export into a folder per
run, so the PNG tests no longer share one.
Past +110 the curve mixed the slider's own roll-off with the fixed +150
fit. The power roll-offs come closer to white than that fit past about
input 220, so the mix fell there as the slider neared +150: input 200
gave 253.55 at +134 and 253.32 at +150.
The ease now starts at +109.5, the last Hermite roll-off, which stays at
or below the +150 fit everywhere, and mixes from the roll-off held at or
below the fit. Both parts of the mix then rise with the slider, and the
curve reaches the +150 fit itself at +150, so the measured ramps are
unchanged.
The new test steps the slider one unit at a time from ±100 to ±150 and
checks every 8-bit input; it fails on the previous curve.
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.
On craft-libs next the app's menu bar draws the English access key after a translated title where the language
shows one ("ファイル(F)", storytold/craft-libs#3364), while the bare menu bar the tests read the reference from
draws the translation alone. The live tests look for a drawn title that starts with it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- pressed_layers also leaves out the shapes a held corner widget rounds: the widgets show without the scale box
(Target Path hidden, the Move tool) and beside other layers in a mixed selection.
- The type editor counts inserted text as the engine stores it (a CRLF pair is one line break), for the caret and
the count it reports.
Co-Authored-By: Claude Opus 5.5 <[email protected]>