- Remove blank lines between doc comments or #[test] attributes and the item (S8855, S8856)
- type_tool: drop the redundant else after continue in the IME event arm (S8862)
- ui_state: pass OsStr::to_os_string instead of an equivalent closure (S1612)
- macos packaging: [[ ]] for the attempt test (S7688); bind validate_staple's argument to a local (S7679)
* chore: resolve SonarCloud maintainability issues
* fix: format imports and fix effect_entry argument type
* fix: restore test closure and wildcard import that broke compilation
* refactor: split composite_to_surface to reduce cognitive complexity
Clone strokes painted every dab where its points lay, up to 1e7 px off
the canvas: on the layer itself without "newLayer", and on the work
surface with it, so each far dab allocated up to 4096x4096 px of tiles.
A stroke with points [[100,100],[-30,100],[9e6,9e6]] on a 200x200
canvas painted 3 dabs and left pixels left of the canvas. The dabs are
now cut to the canvas before any read or write.
Found by CodeRabbit on #9386.
Co-authored-by: Valentin Klein <271991477+vangel76@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(updates): startup update prompt modal and direct self-updating
Release checks and the install go through craft-update's Updater: the engine's Help ▸ Check for Updates command keeps its status machine, its transport asks craft-update instead of a private GitHub client, and a found release opens the startup prompt. An install holds back while documents are unsaved, and a finished update closes through the guarded close path. craft-update stays out of the wasm build.
Ref: storytold/craft-libs#319
* fix(updates): address review feedback
Wake the UI when a manual check is queued from a menu callback; the update prompt owns the keyboard while it is open (LightCraft); Download opens through the desktop URL hook (FilmCraft); the Help menu dispatches through menus::invoke (FigCraft); print jobs and comment drafts hold an install back (WordCraft); Check for Updates is a registered command (GridCraft); an install holds back while documents are unsaved.
Conflicts: the batch's wheel reads (#5547 Animated Zoom) keep their extra
argument with main's ids (`Id::unique`, `ui.scope_id()`); crop presets keep
#6620's `apply_choice` with main's accessible name; Bevel & Emboss keeps
#9370's per-mode id with main's name argument; the Stroke field keeps
#7203's gradients with main's name; tone.rs keeps #9139's move of the
Histogram panel to histogram_panel.rs (main only renamed ids there);
translation catalogs as unions.
Not flagged by git, the batch's new code follows egui 0.37 too: dropdowns
take an accessible name (Histogram Channel/Source #9139, tool Mode #5504,
Art History Style #1610, New Snapshot From #3567), MouseWheel events carry
`source`, `WidgetType` is `Role` (ColorButton is ColorWell, #7203),
`Id::new`/`Ui::id` are `Id::unique`/`Ui::scope_id`.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* egui037: name each control for what it sets, and order the eager fonts for the UI
CodeRabbit review follow-ups on the migration: the Artboard X/Y fields, the CAF
dropdowns, the channel Solidity field, the GPU backend/adapter dropdowns, the
corner radius fields and the canvas extension colour all had an accessible name
that named another control (or was shared by four). The eager craft-fonts
registration now puts the UI Japanese face first, as the lazy loader does, so
Japanese UI is not drawn in the manifest's Mincho face and shared Han characters
do not take Japanese forms.
Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
* egui037: rustfmt the eager craft-font order
---------
Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
Co-authored-by: Codebuff <noreply@codebuff.com>
- Each tile still copied a source window of (tile +- halo) clipped to the
dab bounds, but a rotated read can land up to a dab diameter away: a
leftward drag [[110,40],[20,40]] at size 40 read empty pixels at x = 64
(seam), and a large click still copied about the whole dab per tile.
The stamp now samples the history state directly (no window, no
StampParams::halo), and bilinear reads at pixel centres, so an
unrotated dab copies the history pixel instead of a 2x2 blend.
- Tolerance compared colour only, so an erased patch (the Eraser keeps the
colour, lowers alpha 1 -> 0.6) was skipped at tolerance 25: the
difference is now the larger of the mean colour change and the alpha
change.
- The brush had its own history lookup (row 0 unless `state` was passed):
it now uses the History Brush's source (history.setSource, snapshots,
redo rows, refusal after a canvas size change).
- A stroke that wrote nothing at tolerance 0 (wholly outside the
selection, or on Lock Transparency over transparent pixels) failed
with "no stroke points"; it is now the same quiet no-op as a stroke
under the tolerance (damage null, no History step).
- A mode other than Normal (agents only: the options bar sends none)
blended each dab with the already-mixed result at full strength, so
Multiply with a white source over 0.5 grey fell to 0.33 five pixels
from a dab's centre instead of staying 0.5. Other modes are refused
until the stroke is buffered, and the wrong path is removed.
- TOOL-213-20 is partial (8 of 10 styles, Area scales spacing); docs follow.
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The stamp now reads each dab's bounds plus one pixel, but the coverage
check still inflated the stroke bounds by the full halo, so a single
Loose Curl click of size 1400 or more on a 2600x2600 canvas failed with
"stroke too large". Inflate by one pixel instead, and add a test for
size 2000 Loose Curl and size 2400 Tight Medium clicks.
Also make the documented tolerance default match the engine's (0).
#3567 makes the document as opened snapshot 0, so {"snapshot": 0} is a valid source now;
main's bad-params test still listed it as an error.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merged with our fix-up pr-3297-fixup (1de1e9eb58) on top of the author's head 053e1e0d03.
Conflicts resolved: channel_cmds.rs routed() keeps the PR's PAINT_IDS list plus the batch's
paint.artHistoryBrush; paint_cmds.rs Paint Bucket params keep the batch's "mode" and the PR's
"filterMask" target; docs/scorecard.md takes the batch's numbers with FILE-215-3 done.
Vanishing Point is not modal, so the Layers panel and menu commands stay
usable while it is open. The stamp preview kept painting over the document
as it was when the mode opened, and OK painted whichever layer was active
by then: stamp on layer 1, click layer 2, and the canvas still showed
layer 1 while OK cloned onto layer 2 (a filter run meanwhile was hidden).
filter.vanishingPoint now takes an optional `layer` (the UI passes the
session's when another layer was picked, so recorded actions stay
portable) and makes the painted layer active, so Fade and a colour-channel
target follow it. The preview repaints over the document as it is now when
its pixels change (the canvas syncs it before drawing, so no frame goes
without the strokes); a selection or view change keeps it as it is.
display_doc's VP branch is also keyed to the session's document, as main's
Puppet and Perspective Warp branches are (#5115): a document opened in the
same frame no longer shows the other document's strokes.
Co-authored-by: Valentin Klein <271991477+vangel76@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Redone on the PR head 053e1e0d0 (the author's main merge); the earlier
fix-up f7af09d0f carried the first six points.
With a smart object's filter mask targeted, every routed command got
"target":"filterMask" and the filter-mask precondition instead of its own:
- Cmd+T and Edit > Transform > Flip/Rotate failed ("can't transform a
filter mask on its own"); now the smart object transforms, as in
Photoshop (lone_target -> Ok(None), and transforms get no target).
- Move (layer.translate) re-rendered the whole filter stack on every
nudge, and failed for contents that can't render.
- Convert for Smart Filters became enabled and nested the smart object;
Apply Image, Last Filter, Liquify, the lens filters, Vanishing Point,
the render filters and Desaturate ignore the target.
`follows_filter_mask` now leaves these out, in the shell, in
inject_target, in the precondition and in the re-render hook; Paste
keeps its own precondition.
- With the filter mask shown (Alt-click), clicking the layer, layer-mask
or vector-mask thumbnail (or ui.set maskTarget/vectorMaskTarget/
filterMaskTarget:false) left the view on (and ui.set maskTarget:false
left the filter mask targeted), so strokes kept landing in
the filter mask; those now end the view (CodeRabbit, panels.rs).
- ui.set filterMaskTarget:true on a layer without smart filters, or with
a single channel targeted, cleared the mask target and answered ok; it
is now refused before anything changes (CodeRabbit, control.rs).
- Curves on a targeted filter mask showed colour channels and the smart
object's histogram; it is now a gray plane with the mask's histogram
(GraySurface::FilterMask).
New on this head:
- Filters with a parameter schema (Gaussian Blur, High Pass, ...)
refused "target":"filterMask" ("`target` must be pixels, mask,
quickMask or {channel}"), so blurring the filter mask, the usual way to
feather it, failed from the menu, the dialog and agents. The filter
validation now accepts it (blurring_the_filter_mask_feathers_it).
- Delete with a selection and the filter mask targeted ran Edit > Clear
on the smart object ("not a pixel layer"); it now fills the filter mask
with the background colour there, as Photoshop does. With no selection
Photoshop deletes the layer, which Delete already did
(delete_with_the_filter_mask_targeted_edits_the_filter_mask).
- docs/control-protocol.md: the ui.set line lost its closing parenthesis
in the main merge.
Co-authored-by: Valentin Klein <271991477+vangel76@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
has_pixels was inserted between assets_dir's doc line and the function,
so rustdoc attached both lines to has_pixels.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Export Data Sets as Files keeps outputs in the chosen folder (#9420)
{document} was the document name verbatim, so a document named
../esc/aped.psd wrote outside the chosen folder; separators and reserved
characters in it now become _. A data set named after a Windows device
(nul, CON) gets the same _ every other exporter gives it (nul_.png).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Export Data Sets as Files: a document stem of . or .. becomes _ (#9420)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address CodeRabbit review: data-set names check every folder, an empty stem is _
A device-named document under `{document}/{name}` made a `nul` folder,
since the device check saw the whole path; it now checks each component.
A document named `.` has an empty stem and gave `.png`; it becomes `_`
like `.` and `..`. The test uses a temp dir that cleans itself up.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Reveal All: ignore erased, fully transparent pixels (#9379)
The Eraser only clears alpha, so an erased pixel keeps its colour bytes
and Surface::content_bounds counted it: Reveal All (and the Crop tool's
beyond-canvas preview) grew the canvas to pixels nothing shows. Count
only pixels with alpha > 0 outside the canvas, as Photoshop's layer
bounds do.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Reveal All: scan only off-canvas pixels, in parallel (#9379)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Paste kept clipboard pixels where they were whenever that spot lay on
the canvas, whichever document they came from: a whole small document
copied into a larger one landed in its top-left corner. The clipboard
now remembers its source document; Paste keeps pixels in place only
there and centres them in any other, as it already did for pixels that
don't fit. Images from other apps have no source and centre too. Paste
in Place is unchanged.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>