Conflicts with main's module moves resolved: driver_printable takes main's
spooler-held settings_for_layout (which already wraps the page query in
with_spooler) and drops the now unused settings/pg lines; take_turned_page and
its test move to dialogs/file_ui/print.rs and dialogs/file_ui/tests.rs;
crates/engine/src/cmd/print_cmds/tests.rs keeps main's version (the PR did
not change it in its own commit).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A double-click on a filter row of a smart object that isn't the active
layer queued `layer.select` for the Layers panel to run after the rows
were drawn, but opened the filter's editor in the same pass. The editor
captures the document revision as its target, and the later select
raised it, so OK on the reopened Liquify filter (and on the generic
parameter form) was refused with "The document or Smart Filter changed"
and the Liquify strokes were lost. This happens when both clicks reach
one frame (a real mouse on a slow frame).
The double-click now selects the layer first, as the Layers panel runs
the select (committing an open type session), and drops the queued one.
Two Layers panel tests deliver both clicks in one pass; both failed
without this.
Co-authored-by: .CooCoo <1206598+dotCooCoo@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The typed zoom glided through a leftover log distance in egui temp data that only Fit/Fill and a
scrub cleared. Any other zoom right after Enter was multiplied by what was left: type 1600 at
100 %, Enter, then View > Actual Pixels ended at 87 %, not 100 %. The glide also never landed
exactly (1600 % ended at 16.000002, 6400 % past pixel_aligned's tolerance) and changed the field's
value by a few ulps each frame, which wiped text typed during the glide.
- set_from_field sets the zoom to the target and calls View::request_zoom_animation with
General > Animated Zoom, as Zoom In/Out and Actual Pixels do: it glides with the preference on,
jumps with it off, lands exactly, and any later zoom replaces it. The private glide, its DocId
bookkeeping and field_percent go.
- A zoom field keeps the keyboard through a click on a menu title, so the menu's arrow and letter
keys were dead (menu_nav/menu_keys treated it as typing in the menu). They work now, except in
Help, whose Search field keeps its letters (#5996). A letter or Space the menu takes no longer
also reaches the zoom field as text (an alert, or a digit typed into the zoom).
- Enter in the field within two frames of a click on the pasteboard, title bar or a menu was
vetoed and the typed zoom lost; egui draws only those frames with the mouse still.
- The separator check's copy of the text restarts when the value changes under the focused field
(ArrowUp, another zoom), so `1.5`, ArrowUp, End, `.` no longer alerts.
- Doc comments: the Esc/focus path drops only the text copy; no platform sets Services::alert.
Co-authored-by: sn-o-w <2406819+sn-o-w@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The estimate charged every tile a solid layer can reach at full size, but a solid fill stores
one tile shared by every covered position and Surface::translated shares it again at any
offset, so only the edge is written. A filled 12000 x 12000 16-bit layer was estimated at
about 1.1 GiB and lost the live drag it has on main. The estimate now mirrors translated:
one target per 2 x 2 block of source tiles, and a block inside the content with four stored
tiles is charged once per distinct set of tiles, capped by the tiles the content can reach.
It also counts a smart object's filter mask, which shift_smart shifts too.
New tests: a filled 12000 x 12000 16-bit layer stays live through the real drag path (fails
at the PR head); the filter mask is counted; content off the tile grid is capped by its
reach. A 36 MP 8-bit and a 24 MP 16-bit photo layer stay live through the drag path (pins
the common case; fails with the earlier x4 estimate).
Co-authored-by: Max Witt <131544883+SiFuMax09@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Smart-object contents (Replace Contents, Convert to Layers, Stack Mode,
internal Edit Contents) refused any SVG whose canvas area times its
node count passed 24 MP, e.g. a 1920x1080 layout with 12 shapes.
decode_source now uses the bounded image parse with File > Open's
layered import (import_svg_bounded_images). Convert to Layers' shape
cache cap is 1 GiB in the document's format, the import's own budget,
not 24 MP (four full-canvas shapes in a 4K document failed).
- The bounded resolver failed the whole drawing on an embedded image it
can't read (an unknown MIME type, a corrupt PNG); it now leaves it out
as usvg does, so such SVGs place and render again. Byte and decode
overruns stay errors.
- resvg gives each embedded SVG image a scratch pixmap the size of its
target and frees it after, so the scratch budget counts the deepest
chain of nested SVG images, not every sibling: 12 SVG icons on a 2 MP
canvas, or one at a 12 MP render, no longer fail.
- Main's shared nesting budget (#9397) now covers the bounded path too:
511 + 511 levels across a drawing and its embedded SVG overflowed a
1 MB stack.
- An AI working copy is regenerated through VectorCraft only when
VectorCraft is the editor; Illustrator or another program gets the
original bytes. VectorCraft is recognised by bundle id, a known
install, or its name (vectorcraft[.exe], vectorcraft-<version> AppImage,
ai.storyteller.vectorcraft).
- updateSvg refuses an AI/PDF/EPS source (updateVectorSource saves it
back in its own format); the doc no longer calls updateSvg "existing".
- Edit Contents on contents already open in the internal editor switches
to that document, as main does, instead of an error.
- Stack Mode on an SVG refuses up front when one float frame per layer
would pass 1 GiB (the layered import no longer refuses for it).
- A stored display preview still fails on an embedded image it can't
read (strict budget, its own import_svg_preview_with_work; external-
editor saves and conversions leave the image out as placement does); skipped embedded SVGs still use up the XML byte
budget; an image under an unknown MIME type or with no pixels is left
out uncharged.
- Merge: the PSD import reads a preview's native source from the
document's global blocks; main's owned open moves them out of the
file, so every stored preview was dropped.
- Main's strict Clippy rules on the PR's app code (explicit import, a
Unix-only test helper, one long opt-in test).
Co-authored-by: Mocky Digital <282319807+mockydevs@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* perf(algo): row-parallel local_sharpen with fast-path protect_detail (#5426)
Refs #5426. Follow-up to #5499.
Cause:
While #5499 parallelized local_blur and the per-dab mix in DabTool::Focus,
local_sharpen in crates/algo/src/retouch.rs remained single-threaded.
In addition, protect_detail redundantly evaluated coordinate clamping
and strided memory lookups across 8 neighbors inside the per-channel
inner loop for every pixel in the dab. On large brush sizes (e.g. 1000–2500 px),
strokes took seconds and stalled the application.
Change:
- Process local_sharpen window rows in parallel with Rayon across threads,
with wasm32 serial fallback matching local_blur.
- Hoist protect_detail 3x3 neighborhood offset calculations outside the
channel loop.
- Fast-path interior pixels (x > 0 && x + 1 < w && y > 0 && y + 1 < h)
with direct stride offsets, skipping boundary clamping entirely for >99.9%
of pixels in large brush dabs.
- Add retouch_sharpen_exact integration test verifying bit-for-bit parity
against the frozen scalar implementation across layouts, edges, and channels.
* bench(engine): add bench_sharpen_tool example
Conflicts: svg.rs (main's bufread inflate and shared render helper, kept
with the PR's bounded raster path), psd_import.rs (the PR's vector
preview moved into main's smart_content), menus/invoke.rs (the SVG
intercept moved into main's split invoke_unguarded), rendering.rs and
the ui-egui import lists (main's explicit imports), Cargo.lock, docs
status lines (unions).
* perf(algo): reuse Reduce Noise guide statistics
* fix(algo): use fixed-size chunks for guide statistics
* Reduce Noise: test that the caller routes the cleaned luma guide and both chroma planes
Review follow-up: compares reduce_noise's output (Lab, so planes pass through) with the
independent guided filters run in order.
* test(algo): assert bit-identical output in Reduce Noise routing test
Their params doc mentions path.toSelection, so the automation filesystem-path
classifier test flagged them; they take a document path name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`is_empty_pixel_layer` took any layer without stored tiles for empty, so a
layer opaque only through its default pixel (as KRA imports it,
`Surface::with_default`) or a blank video layer became the Pattern Fill
(and the Stamp Visible target) instead of getting one above. It now
needs a transparent default pixel (alpha only: a mode or profile
conversion gives an empty layer's default pixel other colour bytes) and
no video.
Co-authored-by: Hodd <32705043+hodd1444@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The new keys went straight to the engine with the Paths-panel path name
injected in PhotocraftApp::run, skipping the route Ctrl+Enter takes
(vector_ui::path_to_selection). So a Pen path still being drawn was not
finished and used: Pen, three clicks, Ctrl+Shift+Enter combined the old
work path (or failed with "no work path") and left the Pen path open,
and the loaded path stayed selected. Both ids now go through the same
route with the mode forced to add/subtract, and the injection is gone.
Also removes crates/ui-egui/src/vector_cmds.rs, an uncompiled byte-for-
byte copy of the old engine file, and makes the add test check that both
areas end up selected.
Co-authored-by: mahefanante <42338306+mahefanante@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main split crates/engine/src/vector_cmds.rs into cmd/vector_cmds.rs and
cmd/vector_cmds/paths.rs, moved the shortcuts tests into
input/shortcuts/tests.rs and PhotocraftApp::run into app/commands.rs.
The PR's change is ported as it is to the new places; its text-field
test now draws the field every frame, as main's egui drops the focus of
a field that isn't drawn.
With Move as the default tool, `ui_set_rejects_unknown_fields_before_changing_anything`
asserted Move after the rejected `{"tool": "move", "dark": true}`, which is also the
starting tool, so a `ui.set` that applied `tool` before rejecting the call still passed.
The test now starts on Brush and asserts Brush.
`tool_memory::tests::selected_tool_and_non_default_options_roundtrip` (added on main
after this PR branched) used Move as its non-default tool; `persist` now writes no
`selectedTool` for it and the test failed. It uses Lasso instead.
No other test in photocraft-ui-egui or the photocraft app relied on the Brush default.
Co-authored-by: safvanedge <241307593+safvanedge@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's handle_at (#5405) read only the one-layer preview's gesture, so with
several layers framed the corner being dragged lost its resize pointer once
the pointer left the handle (it showed the commit pointer instead). It now
reads the shared box's gesture too, through live_gesture.
Co-authored-by: ekedal <71788463+ekedal@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main split the files this PR changes: transform_tool.rs into tools/transform_tool/ (begin,
commit, drag_modes, draw, pointer, tests), canvas.rs into canvas/ (display, tool_input,
transform_controls, transform_controls_tests, snap_ui), and transform_cmds.rs into
cmd/transform_cmds.rs + tests.rs. The PR's changes are carried into the new modules as they
were. One adaptation: rotate_dir on main takes the live gesture (#5405), so the shared box's
gesture is passed through a new live_gesture helper instead of the PR's `rotating` bool.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reference application marks a paragraph box that can't hold its text
with a black "+" inside an enlarged lower-right handle; nothing is drawn
below the box. The PR drew a red disc 0-9 px below the box at a fixed
screen offset, so on a rotated layer it came loose from the box, a click
on it either grabbed the corner handle or ended the edit, and its hover
card popped up while dragging that same corner to enlarge the box.
Now the lower-right handle grows to 11 px and carries the black "+",
centred on the transformed corner, and the whole enlarged handle grabs
that corner, also in a rotated view. The disc, the hover card (state, its
tooltip row in every catalog), the GPU pixel test and its pollster
dev-dependency are gone; detection (`TextLayout::overflows`) and the
`typeBoxOverflow` inspect flag stay. docs/ui-parity.md: the overflow row
no longer claims box threading, the Guides row the PR duplicated is
removed, and the history has one row in date order.
Tests: `an_overflowing_box_shows_a_plus_in_its_enlarged_lower_right_handle`
(upright and rotated box; fails on the PR head with a 7 px handle) and
`the_whole_enlarged_overflow_handle_grabs_in_a_rotated_view`.
Co-authored-by: VladimirPozdnyakov <49595925+VladimirPozdnyakov@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The command line's files open before the first frame, which is what
applies the interface language, so their status line and notices came
out in English in every language. open_paths now applies it first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The second questionnaire answer (Algeria). The earlier تدرج اللون read
as "colour gradient" beside Gradient تدرج. Hue, Hue/Saturation, Hue
Jitter and Hue Cube follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The preset file import status (`preset_files_ui::open`) asks for
"Imported {n} brush/pattern/gradient from {file}" plurals; the Arabic
catalog only had the style one, so these results showed in English.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>