Commit Graph
6222 Commits
Author SHA1 Message Date
Dylan M. Taylor 9366cd58ec Refactor UI canvas for strict Clippy checks 2026-10-27 23:47:05 +00:00
Dylan M. Taylor ef065ee66e Refactor UI application for strict Clippy checks 2026-10-27 23:47:05 +00:00
David MannandClaude Opus 5.5 5ccb6fb723 Merge main
Conflicts with main's batch #9880:
- psd file.rs / layer.rs: #5287 (PSB by encoded size, RLE tables widened on
  promotion) against #6583's lazy reader. Main's new widening and length code
  read `.data`, which #6583 leaves empty while the bytes stay in the source;
  it now goes through `encoded()` / `encoded_len()` (also the auto-merged
  lines in `rle_widening`, `encoded_len` and `LayerRecord::write`), and the
  lazy reader sets `write_as_psb: false`. New test
  `a_lazy_psd_promotes_to_the_same_psb_as_an_eager_one`: a lazily read PSD
  writes the same PSB bytes as an eager one; it fails with a `.data` read.
- direct_select.rs / vector_ui.rs: #9321's Type Path and #6353's hidden
  Work Path both kept.
- io tests main.rs: both modules. scorecard.md regenerated (12 of 181);
  ui-parity.md and gaps.md follow it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-27 19:49:42 +01:00
David Mann 8bc71f924b Merge main
# Conflicts:
#	crates/format/src/store.rs
2026-10-27 19:10:28 +01:00
aiongg 55effab1aa Merge #9689: CMYK: the test reference keeps a fully covered type pixel's ink exact (#9688) 2026-10-27 17:44:31 +00:00
aiongg 0bc6abc783 Merge #9680: Plug-ins: refuse a code section with no functions but many bytes instead of panicking (#9679) 2026-10-27 17:44:30 +00:00
aiongg c1f3219dfb Merge #9445: Automation: refuse to replace a non-image file in the write root (#9439) 2026-10-27 17:44:26 +00:00
aiongg c284e78c40 Merge #9425: Automation: refuse every Windows device name in request paths (#9424) 2026-10-27 17:44:25 +00:00
aiongg 0e3a6f7e8d Merge #9421: XML: deeply nested ORA, KRA, Camera Raw XMP, .kys and layer XMP are an error, not a crash (#9419) 2026-10-27 17:44:23 +00:00
aiongg 3e0ec5004c Merge #9398: SVG: an embedded data-URL SVG gets the nesting-depth check (#9397) 2026-10-27 17:44:19 +00:00
aiongg 9547aec94a Merge #9395: Color panel: the Color Wheel fits the panel at its default height (#9394) 2026-10-27 17:44:18 +00:00
aiongg d01f2de508 Merge #9393: Preferences: the Generator checkbox reads Enable Generator, as in the reference application (#9392) 2026-10-27 17:44:16 +00:00
aiongg 2f6392574d Merge #9385: Actions: save and read the Lab Lightness channel as Lght (#9384) 2026-10-27 17:44:15 +00:00
aiongg b57b64207e Merge #9340: Tests: the effect-map deadlock watchdog waits 120 s for each render, not for all 101 2026-10-27 17:44:13 +00:00
aiongg ae661394b2 Merge #9036: Autosave: replace a recovery sidecar in one step, so a listing never misses or doubles it (#9034) 2026-10-27 17:44:12 +00:00
aiongg a78414a720 Merge #7412: Print: list printers and spool from one thread at a time 2026-10-27 17:44:09 +00:00
aiongg fa86237e63 Merge #7154: Paste: a drawing copied as SVG markup pastes its pixels 2026-10-27 17:44:07 +00:00
aiongg 266c854a9c Merge #7058: Crop: X with a ratio preset turns the frame instead of shrinking it (#7057) 2026-10-27 17:44:06 +00:00
aiongg 6e9fb30dbc Merge #6723: Color Lookup: PSD save keeps a .3dl/.look LUT file as loaded (#6544) 2026-10-27 17:44:05 +00:00
aiongg 46b6f87709 Merge #6353: Paths: making a selection from a path deselects the path (#6079) 2026-10-27 17:44:03 +00:00
aiongg bf825aa490 Merge #6303: PSD: Diffuse, Trace Contour, Crystallize and Pointillize smart filters open and save like Photoshop (#6302) 2026-10-27 17:44:02 +00:00
aiongg 01594f1f25 Merge #5890: PSD: Frame layers keep their stroke (#4381) 2026-10-27 17:44:01 +00:00
aiongg 5623fe7e29 Merge #5837: Compose: Transparency Shapes Layer off blends a layer's alpha as Fill in the special eight (#5692) 2026-10-27 17:43:59 +00:00
aiongg 0662885964 Merge #5789: Channels: CMYK channels duplicate, load, split and merge as tone, not ink (#5787) 2026-10-27 17:43:58 +00:00
aiongg 0c64f0b642 Merge #5287: PSD save: choose PSB by the encoded size, not the raw estimate (#5285) 2026-10-27 17:43:57 +00:00
aiongg 6f75b63b37 Merge #3535: History: History Options with Allow Non-Linear History and undoable visibility changes (#2966) 2026-10-27 17:43:52 +00:00
aiongg a85d79167e Merge pull request #9877 from Silvertree2010/perf/export-speed
perf(save): faster .pcraft and PSD saves, byte-identical output
2026-10-27 13:42:11 -04:00
David MannandClaude Opus 5.5 199092edfd Integration: a failed favourite toggle shows as an error; preference count from the scorecard (#6526)
CodeRabbit on #9775: FontLibrary::finish wrote a failed type.font.favorite to the status bar as plain information; it now sets status_error like the other status writes. The regenerated scorecard counts 12 of 179 preferences that do nothing; ui-parity.md and gaps.md still said 178.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-27 18:18:49 +01:00
David MannandClaude Opus 5.5 3b964c0cdf Integration: video footage off the active artboard stays out of it; one depth check for copied layers (#4329)
CodeRabbit on #9775: newVideoLayerFromFile placed the layer while its content was still empty, so an active artboard always took it and clipped footage centred elsewhere; the first frame is now the content before placement, as in frames_to_layers (footage_off_the_active_artboard_stays_out_of_it fails without it). The merge also left a second check_group_depth ("Duplicate Layers") before main's "Copy Layers" one in layer.copyToDocument, so main's message could never show; it is removed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-27 18:18:48 +01:00
David MannandClaude Opus 5.5 425b5efeed Integration: a painted fill reserves its buffers before it builds them (#3779)
CodeRabbit on #9775: paint.stroke with fill:true builds the coverage, its feathered copy, the selection read and the mask over the region, up to the whole canvas (file.new allows 300000 x 300000), with infallible allocations that abort the process when memory runs out. The peak is now reserved through the fallible allocator first, and the selection is read through it; fill_survives_allocation_failure fails without this (the error came from a later blend).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-27 18:18:48 +01:00
David MannandClaude Opus 5.5 88c19a59d4 Integration: the font menu shrinks to a search with no matches, as on main (#6526)
Main's #9849 lets dropdowns grow back after a short list, and its test
`clearing_a_query_that_matches_nothing_grows_the_menu_back` expects a
search with no matches to shrink the font menu. #6526's menu stayed at its
full 534 px: its font list never shrank (auto_shrink y off), and the
vertical separator between the class list and the font list took the row's
whole available height. The list now shrinks, and the line is drawn over
the laid-out row instead, so the menu ends with the class list.

The test now checks that the menu ends with the class list (it can't drop
below half with the class list beside the list), and a new test pins that
the wheel past the end of the list, or over the class list, never moves
the header, also in a window too short for the full menu.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-27 17:22:37 +01:00
David MannandClaude Opus 5.5 4a6c0d82d7 Integration: rustfmt the Character panel's preset menu after main's craft_ui::ComboBox switch (#3558)
Main's #9849 bans egui::ComboBox; the preset menu #3558 added now uses
craft_ui::ComboBox, three characters past rustfmt's 160-column limit.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-27 16:43:34 +01:00
NetterSilverandClaude Opus 5.5 b23eabf60c Write the PSD merged image and 8-bit layer planes in place
merged_planes scanned each composite band twice on the calling thread
for alpha, encoded every range into per-channel Vecs one push at a time,
then copied them into the planes. The workers now write their slice of
every plane directly, check alpha as they go, and run a loop
monomorphised per sample type. The 8-bit deinterleave of layer pixels
used one thread per channel with a strided iterator; it now splits the
pixels into one band per core and writes each plane's slice in place.
Same arithmetic, same bytes; a test pins merged_planes against the
previous per-band implementation for RGB, Gray, Lab and CMYK at 8, 16
and 32 bits, with and without the matte.

bench_export .psd, 36 MP, 3 layers, 16 interleaved rounds of 7 reps
(median of medians / min), Ryzen 16 threads, Linux:
  709.4 / 413.7 ms -> 540.8 / 318.9 ms  (-24 % / -23 %)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 16:42:16 +01:00
NetterSilverandClaude Opus 5.5 86245d0719 Encode .pcraft previews while the bundle is prepared and compressed
A ZIP save encoded the thumbnail and the 1024 px composite preview as PNG
on the calling thread before any tile was compressed. The composite alone
is a ~200 ms single-threaded deflate on a 36 MP document, about 40 % of a
full save. The previews are now encoded on their own threads while the
document is collected and its new objects are compressed on all cores;
the bundle is assembled afterwards in the same order, so the bytes are
unchanged. Directory saves encode them up front as before. wasm stays
sequential.

bench_export, 36 MP, 3 layers, 16 interleaved rounds of 7 reps (median
of medians / min), Ryzen 16 threads, Linux:
  .pcraft            517.9 / 471.1 ms -> 319.3 / 287.8 ms  (-38 %)
  .pcraft with cache 360.1 / 334.1 ms -> 277.5 / 268.3 ms  (-23 %)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 16:42:16 +01:00
David Mann fa0e095941 Merge main
# Conflicts:
#	crates/ui-egui/src/tools/type_tool/fonts.rs
#	crates/ui-egui/src/tools/type_tool/ime_tests.rs
2026-10-27 16:26:20 +01:00
David Mann b731cdf9eb Merge PR #4329: Layers: New Group dialog and modifiers; new layers go into an open group and join its clip group
# Conflicts:
#	docs/ui-parity.md
2026-10-27 16:14:37 +01:00
dotCooCoo 0a8dcd07af Retry printer page setup after spooler contention 2026-10-27 08:04:02 -07:00
bb88098343 Integration: new layers go into locked open groups; Stamp Visible above an open group (#4329)
A new layer with an open group active went above the group whenever the
group had any lock (all, pixels, transparency or position). The
reference application puts it inside, on top of the group's layers, even
when the group is locked with Lock All. Locks no longer keep New Layer,
New Group, adjustment and fill layers out. Layers that are edited right
after they are made (Type, Shape, Place's transform box, Paste, the
Gradient tool's live gradient, video layers, Render, Vanishing Point, a
new frame) take Place::AutoEditable and keep the PR's rule: they go
above a locked group, as before.

Stamp Visible with an open group active put the stamp inside the group,
where the group's opacity, mode or mask applied to the composite a
second time. The reference application puts it directly above the
group; with a layer inside the group active it still lands above that
layer, inside the group.

Co-authored-by: SckraT <70698629+SckraT@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 16:03:49 +01:00
David MannandClaude Opus 5.5 3983593916 Integration: re-export active_type_path from vector_ui after main's tools/ move (#9321)
#9321's Direct Selection change calls crate::vector_ui::active_type_path, which
main's layout refactor (#9758) made a private path_ops item, so ui-egui did not
build after the batch's main merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 15:53:57 +01:00
David Mann 33e3fa2f8e Merge PR #6526: Font menu: favourites, recent fonts, class and similar-font filters, live preview 2026-10-27 15:53:56 +01:00
David Mann a7102d3076 Merge PR #3558: feat(type): add editable font size, leading and tracking preset menus 2026-10-27 15:37:22 +01:00
aiongg 07bd794686 fix(ui): dropdown menus grow back after a search with no matches (#9849)
* refactor(ui): build every dropdown on craft_ui::ComboBox

Repin craft-libs to the revision with craft_ui::ComboBox, whose menu grows back
after its contents shrink while it is open (egui#5225), and ban egui::ComboBox
in clippy.toml.

* fix(type): the font menu grows back after a search

The search field is the ComboBox header and only the family list scrolls, so
the menu follows the list's height: no unfiltered height kept while searching.

* chore(deps): craft-libs 60d60d48 (dropdown fixes)

* chore(deps): craft-libs 6af63481 (dropdown fixes)

* chore(deps): craft-libs 4d7b82f7 (dropdown fixes)

* chore(deps): craft-libs 92d392cf (#387 merged)
2026-10-27 10:32:56 -04:00
4add96c84b Integration: Character panel presets as in the reference app, on main's layout (#3558)
Ports the size, leading and tracking preset chevrons onto main's split type
tool (tools/type_tool/panel.rs, next to num_field, which now names its scrub
icon) and fixes what review found:

- The lists differ from the reference app: Size is 6, 8, 9, 10, 11, 12, 14, 16,
  18, 24, 30, 36, 48, 60, 72, 150, 300 pt (the PR had 96, no 16/150/300);
  Leading is Auto plus the same list (one shared pub(crate) const); Tracking is
  -100..-5 | 0 | 5..200 with separators (the PR lacked -5/5 and separators).
- The PR's layout test was red on CI: the chevron ended ~20 px short of the
  column. The numeric field now gets the column width minus the chevron's
  exact button width, and the test is strict again (the chevron ends at the
  panel edge within 0.5 px, the field's suffix slot matches Transform's).
- In mm the labels read "2.1166668 mm" and a pick stored 12.000001 pt. Labels
  now have at most two decimals, a picked preset stores its point value
  directly, and "selected" uses a relative tolerance.
- The chevrons have accessible names (Font size / Leading / Tracking presets,
  translated in every complete catalog); tests find them by name.

New tests: the literal lists (fail on the PR's lists), the strict layout test,
mm labels and exact 12 pt, a preset while editing a span, and presets without
a type layer setting the defaults with no history step.

Co-authored-by: Ni-zav <106657905+Ni-zav@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 15:32:41 +01:00
David MannandClaude Opus 5.5 6fcbedd229 Merge origin/main into pr-4329-fixup
Main moved the engine commands into crates/engine/src/cmd/ and the
dialogs and panels into submodules. The PR's placement calls follow
them, and main's new insert sites (new_adjustment in adjust_params.rs,
Place in file_cmds/open.rs, shapes in vector_cmds/shape.rs) use
layer_place::insert_new like the PR's originals. The New Group dialog
moves to dialogs/new_group_ui.rs; the Layers panel flyout's New Group…
opens it.

Main's Session::precheck now also checks layer.new.group's and
layer.new.groupFromLayers' new params (name, color, mode, opacity,
position), so precheck_agrees_with_execute holds. Main had since added
"New Group…" to every catalog: the PR's duplicate rows are dropped.
Main's newer tests that made a layer with an open group active now
open the group last, as the PR did for the older ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 15:22:03 +01:00
David Mann e7ccac4d0f Merge remote-tracking branch 'origin/main' into pr-3558-fixup
main moved crates/ui-egui/src/type_tool.rs under tools/type_tool/; the PR's change to it is ported in the next commit.
2026-10-27 15:14:16 +01:00
David Mann 9324f7e823 Merge PR #9262: feat: Artboard from Layers takes a size of your own (#9087)
# Conflicts:
#	crates/engine/src/cmd/artboard_cmds/tests.rs
#	crates/ui-egui/src/filter_dialog.rs
2026-10-27 14:59:48 +01:00
David Mann 0a17fe371a Merge PR #5405: feat(transform): show distort and skew cursor indicators when holding Ctrl/Cmd 2026-10-27 14:55:53 +01:00
760b9d1cc8 Integration: distort/skew pointers only where the drag distorts or skews (#5405)
Cmd armed the new Distort and Skew pointers in every transform mode, while the
drag did something else: in Rotate mode a Cmd-drag on a corner or edge rotates
but showed the dart or skew arrows; a Skew-mode corner with Cmd showed the dart
but slides along an edge; Distort mode with Cmd drew skew arrows on edges it
refuses. Cmd also hid the curved rotate arrow just outside a corner (the Alias
commit pointer showed) although a Cmd-drag there still rotates.

One helper, handle_indicator, now answers "what does this drag do" with the
same rules as the drag (drag_mods, mode_mods, apply_mode_drag), and both the
cursor and the drawn pointer use it. The pointer is drawn from the canvas's
cursor branch, so a guide, pan or zoom cursor over a handle no longer gets a
second pointer on top, and cursor() no longer hides the pointer while the box
is being applied (the overlay draws nothing then). During a drag the rotate
arrow shows only while the drag rotates (also a Rotate-mode handle drag), not
when a scaling corner strays past another corner. The warp split guide reads
sticky keys like the cursor does.

Co-authored-by: Catur Sura <8650781+catursurapam@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 14:52:45 +01:00
e3b2854838 Integration: font menu fix-ups after merging main (#6526)
- Character section: a style picked under a family's ">" with type layers
  selected set the layers but not the style for new type (the options bar
  did both). Pick "Inter > Thin" in Properties > Character: new type stayed
  Regular.
- Faux bold: a pointed tip moved r/sin(half its angle) along its bisector,
  uncapped (3.9 r at 30 degrees, an A apex grew a spike), and tips sharper
  than about 20 degrees did not move at all. Every tip now moves at most
  2r, continuously; inner corners (the crotch of a V) keep their exact
  miter.
- Faux bold: each point searched past runs of coincident points for its
  neighbours, O(n^2); a contour of 50 000 copies of one point took ~8 s per
  glyph. Neighbours now come from one O(n) pass over the runs.
- prefs.reset {"path":"type"} and Preferences > Type > Reset Section wiped
  the favourite fonts; they are kept now (type.favoriteFonts by name, or
  Reset All, still clear them).
- An expanded family whose own row scrolled out of view lost its style
  rows, so the list below jumped up.
- Show Similar Fonts re-sorted around each font an arrow step applied, so
  Down went back and forth between two fonts; the list now compares with
  the font current when the filter was turned on (or the menu opened).
- Docs: an uninstalled favourite is kept but not listed; FAUX_BOLD_RADIUS
  and the raster budget describe the thickened outline; the unused
  "Recent font list" rows are gone; docs/scorecard.md regenerated (the
  favourite fonts are one more setting).

Co-authored-by: D-monized <341904702+D-monized@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 14:52:20 +01:00
9462fa130c Integration: Artboard from Layers dialog opens at the layers' size; refuse -0.4 (#9262)
The dialog remembered the last Width/Height: make a 1080x1350 board from one
layer, then open it for a 20x30 layer and press OK, and that layer got a
1080x1350 board too. It also opened at 0 and an empty Name. It now starts at
the selected layers' size and the next "Artboard N" every time, as in the
reference application. `{"height": -0.4}` rounded to 0 and kept the bounds;
negative sizes are now refused before rounding.

Co-authored-by: DuBearte <130190089+DuBearte@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 14:49:25 +01:00