From 4021d27d5a9d71269baf7107e4d8e92a8e3015eb Mon Sep 17 00:00:00 2001 From: yoriswind Date: Thu, 26 Nov 2026 11:27:37 -0800 Subject: [PATCH 01/42] Format the native layer appearance regressions --- crates/ui-egui/src/panels/layers/tests.rs | 31 +++++++++++++++-------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/crates/ui-egui/src/panels/layers/tests.rs b/crates/ui-egui/src/panels/layers/tests.rs index 6ca4cefe9c..29ea72202a 100644 --- a/crates/ui-egui/src/panels/layers/tests.rs +++ b/crates/ui-egui/src/panels/layers/tests.rs @@ -797,10 +797,13 @@ fn appearance_diamond(shape: &egui::Shape) -> Option<(egui::Pos2, f32, f32)> { fn target_marks_painted(panel: &mut crate::tests::panel_harness::Panel, name: &str) -> Vec<(f32, bool, f32)> { let center = panel.rect(name).center(); let (shapes, _) = panel.paint_at(1.0); - let ink = shapes.iter().find_map(|shape| match shape { - egui::Shape::Circle(circle) if circle.center.distance(center) < 0.01 && (circle.radius - 5.0).abs() < 1e-4 => Some(circle.stroke.color), - _ => None, - }).expect("the cell's outer target ring"); + let ink = shapes + .iter() + .find_map(|shape| match shape { + egui::Shape::Circle(circle) if circle.center.distance(center) < 0.01 && (circle.radius - 5.0).abs() < 1e-4 => Some(circle.stroke.color), + _ => None, + }) + .expect("the cell's outer target ring"); for shape in &shapes { if appearance_diamond(shape).is_some_and(|(at, _, _)| at.distance(center) < 0.01) && let egui::Shape::Path(path) = shape @@ -809,11 +812,17 @@ fn target_marks_painted(panel: &mut crate::tests::panel_harness::Panel, name: &s assert_eq!(path.stroke.kind, egui::StrokeKind::Middle, "the diamond's stroke is centered on its outline"); } } - let mut marks: Vec<_> = shapes.iter().filter_map(|shape| match shape { - egui::Shape::Circle(circle) if circle.center.distance(center) < 0.01 && circle.radius < 5.0 - && circle.fill == egui::Color32::TRANSPARENT => Some((circle.radius, false, circle.stroke.width)), - shape => appearance_diamond(shape).filter(|(at, _, _)| at.distance(center) < 0.01).map(|(_, r, width)| (r, true, width)), - }).collect(); + let mut marks: Vec<_> = shapes + .iter() + .filter_map(|shape| match shape { + egui::Shape::Circle(circle) + if circle.center.distance(center) < 0.01 && circle.radius < 5.0 && circle.fill == egui::Color32::TRANSPARENT => + { + Some((circle.radius, false, circle.stroke.width)) + } + shape => appearance_diamond(shape).filter(|(at, _, _)| at.distance(center) < 0.01).map(|(_, r, width)| (r, true, width)), + }) + .collect(); marks.sort_by(|a, b| a.0.total_cmp(&b.0)); marks } @@ -845,7 +854,9 @@ fn a_targeted_circle_with_an_appearance_shows_both_ring_and_dot() { assert!((alone.0 - 2.5).abs() < 1e-4); let looks = [&neither, &targeted, &styled, &both]; for (i, x) in looks.iter().enumerate() { - for y in &looks[i + 1..] { assert_ne!(x, y, "all four actual cell looks differ"); } + for y in &looks[i + 1..] { + assert_ne!(x, y, "all four actual cell looks differ"); + } } } From f26086c58b2f0bf08ccfa2fe9cb8acc4c3a861c5 Mon Sep 17 00:00:00 2001 From: yoriswind Date: Thu, 26 Nov 2026 12:30:14 -0800 Subject: [PATCH 02/42] Describe the hollow diamond in current Layers feature rows --- docs/roadmap.md | 2 +- docs/target-app-parity.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/roadmap.md b/docs/roadmap.md index f8ada20777..b4f19e07a8 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -188,7 +188,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | # | Milestone | Status | Est. remaining, one agent (h) | |---|---|---|---| | M0 | Skeleton + vertical slice | ✅ done | — | -| M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (a targeted Layers item with an appearance of its own shows its inner ring around a smaller appearance dot (#8711); path and compound-path interior selection follows enabled fill rows (#6625); a marquee leaves locked or hidden guide paths out inside groups, as clicks do (#8538); hidden-fill and no-fill stroke cap/join CPU regressions passed; document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them); Layers own appearance has a hollow diamond and tooltip distinct from targeting/selection (#8710), retaining Hassan1305's #8757 ring-visibility fix; validation pending | 4–6 | +| M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (a targeted Layers item with an appearance of its own shows its inner ring around a smaller hollow diamond (#8711); path and compound-path interior selection follows enabled fill rows (#6625); a marquee leaves locked or hidden guide paths out inside groups, as clicks do (#8538); hidden-fill and no-fill stroke cap/join CPU regressions passed; document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them); Layers own appearance has a hollow diamond and tooltip distinct from targeting/selection (#8710), retaining Hassan1305's #8757 ring-visibility fix; validation pending | 4–6 | | M2 | Drawing tools + smart guides | ✅ mostly done (Eraser preserves fill outside fixed and varied tip sweeps and Alt-drag marquees on fill-only open paths and keeps their compound holes; clipping masks retain surviving contours or empty geometry in the same node; ordinary Group/Layer paints and evaluated gradient placements are preserved when the stored paint reproduces their appearance; hidden Rasterize and Along/Across stroke rows do not block visible gradients; replacement-art effects, plug-ins/Rasterize, along/across-stroke gradients and placements that cannot be reproduced keep their existing fitting; stroked open paths retain main behavior (#6582); #3380 deletion creates independent selected path pieces and keeps bounds-fitted gradients in place; endpoint highlighting remains open; Polygon/Star exact-size count persistence, with repeated-drag, tool-switch and Cancel regression coverage; Curvature point markers without direction handles (#1236, in part); Direct Selection segment click/Delete preserves neighboring edges, #1278; Flare, Reshape, Live Corners widget dragging and per-corner radii and kinds landed, on any path's corners; Shaper rough-shape recognition and orientation steps, the remaining Pen modifier nuances; Shaper Groups with editable sources and separate fill/stroke edits landed; custom ruler origin with drag preview, active-artboard reset, relative X/Y fields and native round-trip (#1212); construction widget/refinements pending); a shape just drawn moves by its centre point and turns from the zone outside a corner with its tool still active (#5477); Tangent and straight-segment perpendicular snapping use saved Smart Guides Geometric Guides preferences and Control bar quick access (#2537), including the existing Snap to Glyph and Alignment Guides toggles (#6164); no View submenu; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123); Scissors hover and cuts use the Pen's path/align/intersect/anchor snaps, with Alt Add Anchor and cut endpoint selection retained (#6470); Scissors previews the current anchor or curve cut point (#8655) | 12–18 | | M3 | Paint & appearance (swatches, color, gradient, stroke, appearance, transparency, styles) | ✅ done (M3.7–M3.98): swatches, groups, libraries, tints, Lab spots and Registration; Eyedropper copies transformed character dimensions (#6404) and styles highlighted text only (atomic transparency rejection); Eyedropper reads visible locked and outside-isolation sources (#1251); Color Picker, Color panel (its spectrum grows with a resized panel, #8005), Color Guide, Color Themes, Edit Colors and Recolor Artwork (screen-bounded Edit chip list, #3416; native Lab entry and swatch libraries in the picker, Assign-row menus, #8031/#4028; Recolor with Preset asks whether to limit the colors to a swatch library first); gradients that follow every transform, the annotator, linked stops, freeform gradients, focal points, gradients on strokes and Expand; visible strokes when paint is added to inherited None/zero-width art (#1253); stroke geometry, arrowheads, dashes fitted to corners, stroke on type, width profiles and the Width tool (Shift-double-click enables adjoining adjustment in Width Point Edit; finite-arithmetic follow-up regressions and full CI passed ([Validation evidence](target-app-parity.md#evidence-what-ships-today-by-area))), Scale Strokes and preview bounds; Appearance targeting, container appearance, target circles, Expand Appearance; knockout, isolation, blend accuracy, CMYK blending, overprint, Attributes, masks and clipping, Flatten Transparency; graphic styles, links and libraries; CSS library export preserves fractional linear and radial gradient stop positions. Left: freeform gradients in SVG/PDF, mixed spot/process gradients in SVG and PDF gradients mixing a spot color with RGB or Lab stops export as stops or process colors; PDF export writes dithered gradient fills with spot stops, and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, as images in process colors; confirm the Scale Strokes & Effects default; Recolor model selection is available through the engine and MCP only (#2520); the dialog retains its existing controls; Library panels' lists (swatch, Color Book, brush, symbol and graphic style libraries) fill a taller panel above its footer (#2992; scores and estimates unchanged); Graphic Styles list fills a taller panel above its footer (#2992; scores and estimates unchanged); Swatches list fills a taller panel above its footer (#1638; `the_list_fills_a_tall_panel_above_its_footer`; scores and estimates unchanged); | 4–8 | | M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths (#8128; estimates unchanged); Production Preflight checks fonts, overflow, links and image resolution with clickable findings and automatic rechecking (VectorCraft addition; estimates unchanged); PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; a `TJ` over more than 65 lines (the 64 its fill pass finished, kept back, and the open one) stays a filled object and a stroked one for each part (#8543; estimates unchanged); PDF import: type filled and stroked after a page of type filled only (more than 64 lines) comes in as one filled and stroked type object again, with or without a path between, and a `TJ` over more lines than are kept with a glyph kept as an outline still stays a filled object and a stroked one for each part (#8549 follow-up; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index e0c7ac9998..c763d8e4b6 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -796,7 +796,7 @@ since 2026-10-01. - **Ctrl/Cmd-click and Shift-click on Layers panel target circles (#8639):** the target circles follow the same modifier rules as the row names, as the help page describes for selecting objects in the Layers panel: Shift for adjacent objects, Ctrl or Command for non-adjacent ones ([Move objects to different layers](https://helpx.adobe.com/illustrator/desktop/manage-layers/create-and-organize-layers/move-objects-to-different-layers.html)). Ctrl/Cmd-click adds the item (a layer: its art) to the selection or takes it out, which Shift-click did before (#913); Shift-click selects the art of every row from the last circle clicked (else the targeted row) to this one, and Shift+Ctrl/Cmd-click adds it (`layer.target {range, add?}`). Hidden or locked art and art outside the isolated group in the range is left out, and nothing stays targeted. Regression tests: `clicking_a_target_circle_targets_the_layer` and `shift_clicking_a_target_circle_selects_a_range_of_rows` in `crates/ui-egui/src/panels/layers/tests.rs`. - **Shift-click in the Layers panel's selection column selects the art of a range of rows:** after a selection square is clicked, Shift-clicking another selects the art of every row listed from the last square clicked to this one, down or up and across sublayers and groups, and Shift+Ctrl/Cmd-click adds that art to the selection (`layer.selectAll {range, add?}`). Hidden and locked rows and art outside the isolated group are left out, and a range does not move where the next Shift-click starts. Ctrl/Cmd-click adds one row's art or takes it out, and so does Shift-click before any square was clicked. The panel menu's Select Art of Highlighted Rows (`layer.selectHighlighted`) selects the art of the highlighted rows by the same rules. These are VectorCraft's own rules. Regression tests: `shift_clicking_a_selection_square_selects_the_art_of_a_range_of_rows` and `shift_clicking_the_first_selection_square_adds_or_removes_one_row` in `crates/ui-egui/src/panels/layers/tests.rs`, `the_selection_column_selects_the_art_of_a_range_of_rows` and `select_highlighted_selects_the_art_of_the_highlighted_rows` in `crates/engine/src/tests/layers.rs`. - **Layers added to the selection from their target circles show as targeted (#8646):** with several items picked from their circles (nothing targeted), a layer or sublayer's circle shows its inner ring while all of its visible, unlocked art is selected, as an object's circle does while the object is selected. A layer is never selected itself, only its art, so its circle used to keep a single ring. Regression test: `a_layer_added_from_its_target_circle_shows_as_targeted` in `crates/ui-egui/src/panels/layers/tests.rs`. -- **A targeted item with an appearance of its own shows both marks (#8711):** its target circle keeps the inner ring of a targeted item, with the appearance dot drawn smaller inside it and a gap between them, so not targeted, targeted, with an appearance and both look different, as the target icons in [Appearance attributes](https://helpx.adobe.com/illustrator/using/appearance-attributes.html) do. The dot used to cover the ring. Regression test: `a_targeted_circle_with_an_appearance_shows_both_ring_and_dot` in `crates/ui-egui/src/panels/layers/tests.rs`. +- **A targeted item with an appearance of its own shows both marks (#8711):** its target circle keeps the inner ring of a targeted item, with the hollow diamond drawn smaller inside it and a gap between them, so not targeted, targeted, with an appearance and both look different, as the target icons in [Appearance attributes](https://helpx.adobe.com/illustrator/using/appearance-attributes.html) do. The dot used to cover the ring. Regression test: `a_targeted_circle_with_an_appearance_shows_both_ring_and_dot` in `crates/ui-egui/src/panels/layers/tests.rs`. - **Selection passes through raster effects:** clicks with the Selection, Direct Selection and Group Selection tools (Group Selection's repeated click included), the Selection tool's pointer and marquee, Direct Selection's marquee, pointer and anchor highlight, and Group Selection's marquee (E for enclosed objects included) leave out the area that a drop shadow, a glow, a blur or another raster effect paints beyond an object. A click on a shadow selects the object under it, or nothing over an empty canvas, a repeated Group Selection click there adds the groups of the object under it, and a press on the shadow of a selected object does not move it ([the help page](https://helpx.adobe.com/illustrator/using/selecting-objects.html)). Over a shadow, Direct Selection highlights only the anchors of the object under it, and Group Selection keeps its own pointer and highlights no anchor, as it does everywhere (VectorCraft's own rule). No setting changes this. This covers paths, groups, type, symbol instances and images. Regression tests: `crates/engine/src/tests/select_effects.rs`. - **Symbol instances are selected where their art draws past their box:** a click or a marquee selects a symbol instance where a clipping path in its art, moved or reshaped by its live geometry effects, shows the art past the instance's box, as it selects a group of the same art; a click also selects it where a stroke in its art paints past the box ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-objects/select-objects/select-objects.html)). The rest is VectorCraft's own rule: inside the box the instance is selected as before; in Outline view and below a layer whose Preview is off only the box counts; hidden art and the area a raster effect paints are left out. This covers instances in groups, nested in other symbols' art, moved and scaled. Regression tests: `a_symbol_instance_is_hit_where_a_moved_clipping_path_in_its_art_shows_the_art` and `a_symbol_instance_is_hit_on_the_stroke_of_its_art_past_its_box` in `crates/doc/src/hit/tests.rs`. - **Selection follows geometry effects:** a click or a marquee with the selection tools selects a path or compound path where its live geometry effects (Transform, Offset Path, Roughen, Zig Zag and the other effects that reshape a path, on the object or on its fills and strokes) draw it, the copies a Transform effect makes included, and not where its own geometry no longer paints. The members of a group or layer whose own geometry effects move or reshape them are selected where they are drawn, at the depth each tool selects, and a locked member there lets the click through to what is below and is listed there in the Unlock submenu. A group's own fills and strokes are clicked where they paint its members, and a clipping path inside such a group is taken on its drawn outline before the art it clips. A compound path keeps its holes, Object Selection by Path Only takes the drawn outline and not its fill, and stacking order is kept. The selection tools select objects by clicking or by a marquee ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-objects/select-objects/select-objects.html)), and the effects leave the art they reshape editable ([the help page](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/apply-and-modify-effects.html)); where clicks land on the reshaped art is VectorCraft's own rule. In Outline view clicks and marquees use the plain paths, and in a layer with Preview off they take outlines only. The area a raster effect paints is still left out. Regression tests: `a_*_shifted_art_*`, `a_click_hits_a_paths_copy_and_evaluates_its_art_once_until_it_changes`, `a_groups_own_effect_moves_where_its_members_are_hit`, `a_layers_own_effect_moves_where_its_art_is_hit`, `a_preview_off_sublayer_of_an_effected_layer_is_clicked_in_outline`, `a_painted_group_around_an_effected_symbols_instance_is_hit_where_its_art_is_drawn`, `an_intertwine_group_in_a_layers_drawn_art_is_hit_in_its_woven_order`, `a_click_in_a_plain_group_evaluates_only_its_member_with_effects`, `a_clip_groups_own_effect_moves_where_its_mask_outline_is_hit`, `an_isolated_clip_group_with_its_own_effect_is_marqueed_by_its_members_own_geometry` and `a_clip_groups_art_is_hit_when_its_drawn_art_holds_only_the_clipping_path` in `crates/doc/src/hit/tests.rs`, and `a_click_and_a_marquee_select_art_where_its_transform_effect_draws_it`, `a_click_selects_a_group_where_its_own_fill_paints_a_moved_member`, `a_marquee_takes_an_inner_groups_own_fill_inside_a_painted_group` and `a_marquee_takes_a_groups_own_fill_inside_a_painted_layer` in `crates/engine/src/tests/select_effects.rs`. From 07378009102db84ab7221fa2f6742047088675d2 Mon Sep 17 00:00:00 2001 From: yoriswind Date: Thu, 26 Nov 2026 12:55:01 -0800 Subject: [PATCH 03/42] test: assert Layers target button pressed state --- crates/ui-egui/src/panels/layers/tests.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/panels/layers/tests.rs b/crates/ui-egui/src/panels/layers/tests.rs index 29ea72202a..205a9d0f74 100644 --- a/crates/ui-egui/src/panels/layers/tests.rs +++ b/crates/ui-egui/src/panels/layers/tests.rs @@ -882,7 +882,7 @@ fn appearance_marker_names_its_state_and_keeps_targeting_actions() { let active = "Target appearance: targeted, additional appearance or transparency"; assert_eq!(panel.description("Target A").as_deref(), Some(idle)); assert_eq!(panel.description("Target B").as_deref(), Some("Target appearance: not targeted, basic appearance")); - assert!(!panel.selected("Target A")); + assert_eq!(panel.toggled("Target A"), Some(craft::behavior::Mixed::Same(false))); let before = { let app = panel.app(); (app.session.active().unwrap().selection.clone(), undo_len(&app)) @@ -899,11 +899,11 @@ fn appearance_marker_names_its_state_and_keeps_targeting_actions() { panel.click("Target A"); assert_eq!(targeted(&panel.app()), (Some(a), vec![a])); assert_eq!(panel.description("Target A").as_deref(), Some(active)); - assert!(panel.selected("Target A")); + assert_eq!(panel.toggled("Target A"), Some(craft::behavior::Mixed::Same(true))); panel.click("Target B"); assert_eq!(panel.description("Target A").as_deref(), Some(idle)); assert_eq!(panel.description("Target B").as_deref(), Some("Target appearance: targeted, basic appearance")); - assert!(panel.selected("Target B")); + assert_eq!(panel.toggled("Target B"), Some(craft::behavior::Mixed::Same(true))); assert!(target_marks_painted(&mut panel, "Target A").iter().any(|m| m.1), "the appearance stays after targeting other art"); } From d48ea9a3c06ebdf5d2b567cc255483066ece432a Mon Sep 17 00:00:00 2001 From: yoriswind Date: Thu, 26 Nov 2026 13:03:54 -0800 Subject: [PATCH 04/42] Remove the unused test selection helper --- crates/ui-egui/src/tests/panel_harness.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/crates/ui-egui/src/tests/panel_harness.rs b/crates/ui-egui/src/tests/panel_harness.rs index 7251c04291..b596f3a1c8 100644 --- a/crates/ui-egui/src/tests/panel_harness.rs +++ b/crates/ui-egui/src/tests/panel_harness.rs @@ -378,11 +378,6 @@ impl Panel { tree.keys().into_iter().any(|key| tree.value_of(key).is_some_and(&matches)) } - /// Whether the control named `name` reports selected state. - pub(crate) fn selected(&self, name: &str) -> bool { - self.fixture.tree().selected_of(self.look(name).node).unwrap_or(false) - } - /// The toggle state of the control named `name`. // PLAN: assumed the facade re-exports the behavior crate's `Mixed` as `craft::behavior::Mixed`. pub(crate) fn toggled(&self, name: &str) -> Option> { From 53c57248adb0c1c926a3a677978c7eac0b21c5d1 Mon Sep 17 00:00:00 2001 From: yoriswind Date: Thu, 26 Nov 2026 15:02:33 -0800 Subject: [PATCH 05/42] Use the current stroke paint API in Properties --- crates/ui-egui/src/panels/properties/appearance_section.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/panels/properties/appearance_section.rs b/crates/ui-egui/src/panels/properties/appearance_section.rs index cd71a0f035..e2ae112143 100644 --- a/crates/ui-egui/src/panels/properties/appearance_section.rs +++ b/crates/ui-egui/src/panels/properties/appearance_section.rs @@ -102,7 +102,7 @@ fn effect_delete(app: &mut VectorcraftApp, ui: &mut Ui, id: NodeId, effects: &[( /// active Appearance row in `PropertiesUi::edited_profiled`. False while the Type tool edits text or /// the Live Paint Bucket is active, when the list edits the stroke the panel shows. fn edited_strokes_profiled(app: &mut VectorcraftApp) -> bool { - if panels::character::text_editing(app).is_some() || app.session.bucket_paints() { + if panels::character::text_editing(app).is_some() || app.session.tool_paints(true) { return false; } let Some(st) = app.session.active() else { return false }; From a0c1a550abe31ab26eb84f340fac73018020deea Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 11:46:32 -0800 Subject: [PATCH 06/42] Menus: a rebuild runs each command's check once The menu model asked whether a command can run for every row that names it, so the rows that share a command (Effect's dialogs, Window's panels, the interface languages, the font sizes) ran the same check over and over on each edit and selection change. In a document with 20 selected rectangles one rebuild asked 1,910 times about 1,191 commands; Effect's dialog check alone ran 118 times. A rebuild now keeps each command's answer and reuses it for the tree's rows, the catalog's rows and Envelope Distort's Make and Reset rows. The answer depends on the command id and the app's state, not on the row's params, so the states and reasons are unchanged. --- crates/ui-egui/src/menus/model.rs | 61 ++++++++++++++++++++++++------- crates/ui-egui/src/menus/state.rs | 22 +++++++---- 2 files changed, 61 insertions(+), 22 deletions(-) diff --git a/crates/ui-egui/src/menus/model.rs b/crates/ui-egui/src/menus/model.rs index fffff70049..8a49015203 100644 --- a/crates/ui-egui/src/menus/model.rs +++ b/crates/ui-egui/src/menus/model.rs @@ -257,7 +257,7 @@ fn rebuild(app: &mut VectorcraftApp, target: Target) { // The Glyphs panel menu's East Asian glyph forms read the faces that draw the selected text from the layout this keeps. crate::panels::glyphs::refresh_form_faces(app); let listed = Listed::of(app); - let mut build = Build { app, lang: crate::i18n::current(), states: CommandStates::new(), refs: Vec::new() }; + let mut build = Build { app, lang: crate::i18n::current(), states: CommandStates::new(), refs: Vec::new(), checks: Checks::default() }; let menus: Vec = menu_tree_named(app.session.prefs.font_names_in_english, &listed) .into_iter() .map(|(title, nodes)| { @@ -267,7 +267,7 @@ fn rebuild(app: &mut VectorcraftApp, target: Target) { if translated { menu.english(title) } else { menu } }) .collect(); - let Build { mut states, refs, .. } = build; + let Build { mut states, refs, mut checks, .. } = build; // The catalog is built again only when what its rows are made from changed; edits and selection changes change // the rows' states alone. @@ -291,7 +291,7 @@ fn rebuild(app: &mut VectorcraftApp, target: Target) { CatalogRows { inputs, defs, known, accepted } } }; - row_states(app, &rows, &mut states); + row_states(app, &rows, &mut states, &mut checks); crate::panels::panel_menu_states(app, &mut states); let bar = MenuBar::new(menus); @@ -395,10 +395,10 @@ fn build_catalog(app: &VectorcraftApp, listed: &Listed, plays: &[(String, craft: /// The state of every catalog row the tree did not set, and of the engine commands the palette lists that no row /// names. -fn row_states(app: &VectorcraftApp, rows: &CatalogRows, states: &mut CommandStates) { +fn row_states(app: &VectorcraftApp, rows: &CatalogRows, states: &mut CommandStates, checks: &mut Checks) { for d in &rows.defs { if states.get(&d.command).is_none() { - states.set(d.command.clone(), row_state(app, &d.command, &d.label)); + states.set(d.command.clone(), row_state(app, &d.command, &d.label, checks)); } } // The engine commands the palette lists and no row names (Asset Export's Remove and Rename) are dimmed there and say @@ -406,11 +406,28 @@ fn row_states(app: &VectorcraftApp, rows: &CatalogRows, states: &mut CommandStat for c in crate::palette::listed_engine_commands().filter(|c| !rows.known.contains(c.id)) { let command = CommandRef::new(c.id); if states.get(&command).is_none() { - states.set(command.clone(), row_state(app, &command, c.label)); + states.set(command.clone(), row_state(app, &command, c.label, checks)); } } } +/// What [`why_off`] answered for each command id during one rebuild. The answer depends on the id and the app's state, +/// not on the row's params, so the rows that share an id (Effect's dialogs, Window's panels, the interface languages) +/// run their command's check once. +#[derive(Default)] +struct Checks(std::collections::HashMap>>); + +impl Checks { + fn why_off(&mut self, app: &VectorcraftApp, id: &str) -> Option> { + if let Some(why) = self.0.get(id) { + return why.clone(); + } + let why = why_off(app, id); + self.0.insert(id.to_owned(), why.clone()); + why + } +} + /// `defs` without the commands a linked framework set defines (Undo, Redo, Cut, Copy, Paste and Tab's panels toggles): /// the set's definition is the command's. With them, the keys each has beyond the set's, as the set's keys and those /// (Cut, Copy and Paste's F2, F3 and F4 outside macOS). @@ -445,10 +462,9 @@ fn linked_defaults(command: &CommandRef) -> Option> { /// The state of the row `command`, named `label` in the catalog: on or dimmed with its reason, checked, and its title /// where the app shows another. -fn row_state(app: &VectorcraftApp, command: &CommandRef, label: &str) -> CommandState { +fn row_state(app: &VectorcraftApp, command: &CommandRef, label: &str, checks: &mut Checks) -> CommandState { let state_id = crate::keymap::state_id(command); - let why = why_off(app, state_id); - let (enabled, checked) = shown_state_with(app, state_id, &command.params, &why).unwrap_or((false, None)); + let (enabled, checked) = shown_state_with(app, state_id, &command.params, &mut |id| checks.why_off(app, id)).unwrap_or((false, None)); let mut state = CommandState::new().enabled(enabled); if let Some(on) = checked { state = state.checked(on); @@ -458,7 +474,7 @@ fn row_state(app: &VectorcraftApp, command: &CommandRef, label: &str) -> Command state = state.title(shown.clone()); } if !enabled { - state = state.hint(off_reason_with(app, command, &shown, why)); + state = state.hint(off_reason_with(app, command, &shown, checks.why_off(app, state_id))); } state } @@ -493,6 +509,7 @@ struct Build<'a> { states: CommandStates, /// Every command reference the tree holds, its English label, and whether it is checkable. refs: Vec<(CommandRef, String, bool)>, + checks: Checks, } impl Build<'_> { @@ -548,8 +565,8 @@ impl Build<'_> { return Some(item); } let (id, params) = (command.id.as_str(), &command.params); - let why = why_off(self.app, id); - let (enabled, checked) = shown_state_with(self.app, id, params, &why)?; + let (app, checks) = (self.app, &mut self.checks); + let (enabled, checked) = shown_state_with(app, id, params, &mut |id| checks.why_off(app, id))?; let title = self.item_title(id, params, &item.label); let mut state = CommandState::new().enabled(enabled).title(title.clone()); if let Some(on) = checked { @@ -562,8 +579,7 @@ impl Build<'_> { None } else { // The reason reads the check of the command's state id, which is `id` but for the framework's own rows. - let state_id = crate::keymap::state_id(&command); - let why = if state_id == id { why } else { why_off(self.app, state_id) }; + let why = self.checks.why_off(self.app, crate::keymap::state_id(&command)); Some(off_reason_with(self.app, &command, &title, why)) }; if let Some(tip) = tip { @@ -658,6 +674,23 @@ mod tests { assert!(app.menus.states.get(&CommandRef::new("object.group")).is_some_and(CommandState::is_enabled)); } + /// A rebuild runs the check of a command that many rows share once: Effect's dialogs, Window's panels, the + /// interface languages and Envelope Distort's Release, which decides whether Make or Reset is shown. + #[test] + fn a_rebuild_checks_a_shared_command_once() { + let (mut app, ctx) = app_with_document(); + app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap(); + app.run("shape.rectangle", json!({"x": 20, "y": 0, "width": 10, "height": 10})).unwrap(); + app.run("select.all", json!({})).unwrap(); + super::super::state::WHY_OFF_ASKED.with_borrow_mut(Vec::clear); + refresh(&mut app, &ctx); + let asked = super::super::state::WHY_OFF_ASKED.take(); + for id in ["effect.dialog", "window.panel", "app.language", "object.envelope.release"] { + assert_eq!(asked.iter().filter(|a| *a == id).count(), 1, "{id}"); + } + assert!(app.menus.states.get(&CommandRef::new("object.group")).is_some_and(CommandState::is_enabled), "the states follow the selection"); + } + /// A rebuild asks each dimmed row's command once whether it can run, for its state and its reason together. #[test] fn a_rebuild_checks_each_dimmed_row_once() { diff --git a/crates/ui-egui/src/menus/state.rs b/crates/ui-egui/src/menus/state.rs index 80fb7475ad..1d0c038f04 100644 --- a/crates/ui-egui/src/menus/state.rs +++ b/crates/ui-egui/src/menus/state.rs @@ -153,13 +153,14 @@ pub(super) fn hidden_when_disabled(id: &str) -> bool { /// Menu items another item stands in for right now: Envelope Distort's Reset with Warp and Reset /// with Mesh take the place of Make with Warp and Make with Mesh while an envelope is selected. -fn swapped_out(app: &VectorcraftApp, id: &str) -> bool { +/// `why_off` answers [`why_off`] for Release's id. +fn swapped_out(id: &str, why_off: &mut dyn FnMut(&str) -> Option>) -> bool { let reset = match id { "object.envelope.makeWithWarp" | "object.envelope.makeWithMesh" => false, "object.envelope.resetWithWarp" | "object.envelope.resetWithMesh" => true, _ => return false, }; - enabled(app, "object.envelope.release") != reset + why_off("object.envelope.release").is_none() != reset } /// Menu items shown only with Preferences › Type › Show East Asian Options on: Type › Composite @@ -173,16 +174,21 @@ fn east_asian_hidden(app: &VectorcraftApp, id: &str) -> bool { /// another stands in for ([`swapped_out`]) or an East Asian item with those options hidden /// ([`east_asian_hidden`]). pub fn shown_state(app: &VectorcraftApp, id: &str, p: &Value) -> Option<(bool, Option)> { - shown_state_with(app, id, p, &why_off(app, id)) + shown_state_with(app, id, p, &mut |id| why_off(app, id)) } -/// [`shown_state`] from `why`, what [`why_off`] answered for `id`: a caller that also writes the reason a dimmed row -/// gives runs the command's check once. -pub(crate) fn shown_state_with(app: &VectorcraftApp, id: &str, p: &Value, why: &Option>) -> Option<(bool, Option)> { - let en = why.is_none() +/// [`shown_state`] with `why_off` answering [`why_off`] for each command id it asks about: a caller that keeps the +/// answers runs each command's check once. +pub(crate) fn shown_state_with( + app: &VectorcraftApp, + id: &str, + p: &Value, + why_off: &mut dyn FnMut(&str) -> Option>, +) -> Option<(bool, Option)> { + let en = why_off(id).is_none() && (id != crate::addons::select::link_status::COMMAND || crate::addons::select::link_status::enabled(app, p)) && (!vectorcraft_engine::cmd::plugin::is_command_id(id) || crate::dialogs::plugin::canvas_item_enabled(app, id, p)); - if (!en && hidden_when_disabled(id)) || swapped_out(app, id) || east_asian_hidden(app, id) { + if (!en && hidden_when_disabled(id)) || swapped_out(id, why_off) || east_asian_hidden(app, id) { return None; } Some((en, checked(app, id, p))) From 61ef079f6d8a7657b486f1a4a96b9d11c46899a1 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 11:54:12 -0800 Subject: [PATCH 07/42] =?UTF-8?q?Menus:=20Expand=E2=80=A6=20checks=20the?= =?UTF-8?q?=20selection's=20appearance=20once=20per=20rebuild?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each menu rebuild walked the selection's appearance twice for Object › Expand…: once in the row's check and again for its tooltip. With 10,000 objects selected the walk costs about 6 ms each time. The row's check now returns the "Expand Appearance first" reason, and the tooltip reads it from that answer. Picking a dimmed Expand… in the command palette now adds that reason to the status line's "not available right now". A new test counts the walks per rebuild: 1 with a plain or two-fill rectangle selected (2 before), 0 with nothing selected. --- crates/ui-egui/src/menus/model.rs | 30 ++++++++++++++++++++++++++++-- crates/ui-egui/src/menus/state.rs | 25 +++++++++++++++++++++---- 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/crates/ui-egui/src/menus/model.rs b/crates/ui-egui/src/menus/model.rs index fffff70049..e3c6f74d74 100644 --- a/crates/ui-egui/src/menus/model.rs +++ b/crates/ui-egui/src/menus/model.rs @@ -556,8 +556,10 @@ impl Build<'_> { state = state.checked(on); } let mut item = item; - let tip = if id == "ui.expandDialog" && vectorcraft_engine::cmd::expand::has_appearance(&self.app.session) { - Some(crate::i18n::tr(self.lang, crate::dialogs::expand::appearance_first()).to_string()) + // Expand… dimmed for appearance attributes says so in its tooltip; `why` holds what its check found. + let appearance_first = crate::dialogs::expand::appearance_first(); + let tip = if id == "ui.expandDialog" && why.as_ref().is_some_and(|w| w.as_deref() == Some(appearance_first)) { + Some(crate::i18n::tr(self.lang, appearance_first).to_string()) } else if enabled { None } else { @@ -677,4 +679,28 @@ mod tests { assert!(app.menus.states.get(&CommandRef::new(id)).is_some_and(|s| !s.is_enabled()), "{id} is still dimmed"); } } + + /// A rebuild walks the selection's appearance once for Object › Expand…, for its state and its tooltip together. + #[test] + fn a_rebuild_walks_the_appearance_once_for_expand() { + let (mut app, ctx) = app_with_document(); + let expand = CommandRef::new("ui.expandDialog"); + let tooltip = |app: &VectorcraftApp| app.menus.bar.items().into_iter().find(|it| it.command == expand).and_then(|it| it.tooltip.clone()); + let walks = |app: &mut VectorcraftApp| { + super::super::state::APPEARANCE_WALKS.set(0); + refresh(app, &ctx); + super::super::state::APPEARANCE_WALKS.get() + }; + app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap(); + assert_eq!(walks(&mut app), 1, "a plain rectangle"); + assert!(app.menus.states.get(&expand).is_some_and(CommandState::is_enabled)); + assert_eq!(tooltip(&app), None); + app.run("appearance.addFill", json!({})).unwrap(); + assert_eq!(walks(&mut app), 1, "two fills"); + assert!(app.menus.states.get(&expand).is_some_and(|s| !s.is_enabled())); + assert_eq!(tooltip(&app).as_deref(), Some(crate::dialogs::expand::appearance_first())); + app.run("select.none", json!({})).unwrap(); + assert_eq!(walks(&mut app), 0, "nothing selected"); + assert_ne!(tooltip(&app).as_deref(), Some(crate::dialogs::expand::appearance_first())); + } } diff --git a/crates/ui-egui/src/menus/state.rs b/crates/ui-egui/src/menus/state.rs index 80fb7475ad..ad272f6236 100644 --- a/crates/ui-egui/src/menus/state.rs +++ b/crates/ui-egui/src/menus/state.rs @@ -295,9 +295,30 @@ pub(crate) fn why_off(app: &VectorcraftApp, id: &str) -> Option> Err(why) => Some(Some(why)), }; } + if id == "ui.expandDialog" { + return expand_dialog_off(app); + } (!ui_enabled(app, id)).then_some(None) } +#[cfg(test)] +thread_local! { + /// How many times [`expand_dialog_off`] walked the selection's appearance on this thread. + pub(crate) static APPEARANCE_WALKS: std::cell::Cell = const { std::cell::Cell::new(0) }; +} + +/// Why Object › Expand… can't open now: dimmed with nothing selected, and with +/// [`crate::dialogs::expand::appearance_first`] for appearance attributes, which Expand Appearance expands first +/// (#3089). The selection's appearance is walked once, for the row's state and its tooltip together. +fn expand_dialog_off(app: &VectorcraftApp) -> Option> { + if !app.session.active().is_some_and(|d| !d.selection.is_empty()) { + return Some(None); + } + #[cfg(test)] + APPEARANCE_WALKS.set(APPEARANCE_WALKS.get() + 1); + vectorcraft_engine::cmd::expand::has_appearance(&app.session).then(|| Some(crate::dialogs::expand::appearance_first().to_string())) +} + /// Can UI command `id` run now? fn ui_enabled(app: &VectorcraftApp, id: &str) -> bool { match id { @@ -388,10 +409,6 @@ fn ui_enabled(app: &VectorcraftApp, id: &str) -> bool { id if id.starts_with(crate::panels::symbols::USER_SLOT) => crate::panels::symbols::user_library(app, id).is_some(), "ui.saveBrushLibrary" => crate::panels::brushes::has_brushes(app), id if id.starts_with(crate::panels::brushes::USER_SLOT) => crate::panels::brushes::user_library(app, id).is_some(), - // Dimmed for appearance attributes, which Expand Appearance expands first (#3089). - "ui.expandDialog" => { - app.session.active().is_some_and(|d| !d.selection.is_empty()) && !vectorcraft_engine::cmd::expand::has_appearance(&app.session) - } "ui.spotColors" => app.session.active().is_some(), "ui.menuDialog" => app.session.active().is_some_and(|d| !d.selection.is_empty()), "ui.simplifyAuto" | "ui.simplifyMoreOptions" => crate::dialogs::simplify_slider::showing(app), From 7a09189a8811afcf751d54d9c009c09c29b6063a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 12:32:19 -0800 Subject: [PATCH 08/42] Menus: panel menu states skip three selection walks on each rebuild The menus rebuild every panel menu's states on each edit and selection change. With 10,000 objects selected, three of those menus walked the whole selection for values they did not use or had already read: - Make Opacity Mask's check sorted the selection into paint order for its outermost objects before testing whether the selection has one subject root, and it is enabled without that sort for any other count. The check now sorts only for one root and no target. - The Transparency menu built the panel's full values (opacity, blend mode, isolation and knockout compared across the selection) to read its first target. It now reads that target alone (`Session::transparency_target`), and checks Make Opacity Mask only when that object has no mask, the only case whose rows show it. - The Color and Color Wheel menus asked the session whether the fill and stroke differ, once in the Color menu and twice in the Color Wheel menu. They now read the proxies' per-revision cache, which the Tools panel's proxies fill on the same revision. On a test document of 10,000 rectangles, all selected, one pass over the panel menus' states took 24 to 31 ms before and 16.5 to 17 ms after (release build, four passes each). --- crates/engine/src/cmd/opacitymask.rs | 45 +++++++++++++++++++-- crates/ui-egui/src/menus.rs | 2 + crates/ui-egui/src/panels.rs | 49 ++++++++++++++++++++++- crates/ui-egui/src/panels/color.rs | 13 +++--- crates/ui-egui/src/panels/color_wheel.rs | 5 ++- crates/ui-egui/src/panels/transparency.rs | 32 +++++++++++++-- 6 files changed, 130 insertions(+), 16 deletions(-) diff --git a/crates/engine/src/cmd/opacitymask.rs b/crates/engine/src/cmd/opacitymask.rs index a64d038d8f..bc07e7ccb5 100644 --- a/crates/engine/src/cmd/opacitymask.rs +++ b/crates/engine/src/cmd/opacitymask.rs @@ -185,14 +185,27 @@ fn can_change_mask(s: &Session) -> std::result::Result<(), String> { /// most one outermost object, which it masks with `ids` (a call's `ids` stand in for the selection /// here). A targeted layer is one subject root however many objects it selects. `make` itself /// refuses any single target in those modes, a layer included, so a selection with a target counts -/// as one object. +/// as one object. The check sorts the selection into paint order for its outermost objects only when it has one +/// subject root and no target. fn can_make(s: &Session) -> std::result::Result<(), String> { has_doc(s)?; let Some(st) = s.active() else { return Ok(()) }; let roots = super::appearance::subject_roots(s).map_or(0, |r| r.len()); - let outermost = super::edit::outermost(&st.doc, st.selection.in_paint_order(&st.doc)).len(); - let targeted = st.selection.target.is_some(); - if roots == 1 && (outermost <= 1 || targeted) { super::maskedit::can_edit_mask(s) } else { Ok(()) } + if roots != 1 { + return Ok(()); + } + let one = st.selection.target.is_some() || { + #[cfg(test)] + OUTERMOST_FOUND.set(OUTERMOST_FOUND.get() + 1); + super::edit::outermost(&st.doc, st.selection.in_paint_order(&st.doc)).len() <= 1 + }; + if one { super::maskedit::can_edit_mask(s) } else { Ok(()) } +} + +#[cfg(test)] +thread_local! { + /// How many times [`can_make`] found the selection's outermost objects on this thread. + static OUTERMOST_FOUND: std::cell::Cell = const { std::cell::Cell::new(0) }; } fn make(s: &mut Session, p: &Value) -> Result { @@ -485,6 +498,12 @@ impl Session { _ => TransparencyInfo::default(), } } + + /// The first of the objects the Transparency panel shows ([`TransparencyInfo::ids`]), without comparing their + /// values. + pub fn transparency_target(&self) -> Option { + transparency_targets(self, &Value::Null).ok()?.first().copied() + } } fn info(s: &mut Session, p: &Value) -> Result { @@ -759,4 +778,22 @@ mod tests { let back = vectorcraft_format::load(&bytes).unwrap(); assert_eq!(back.node(NodeId(a)).unwrap().extras().mask, d.node(NodeId(a)).unwrap().extras().mask); } + + /// Make Opacity Mask's check sorts the selection for its outermost objects only when the selection has one + /// subject root; with several roots it is enabled without that sort. + #[test] + fn the_make_check_sorts_only_a_selection_with_one_root() { + let (mut s, a, b) = session_with_two(); + let found = || OUTERMOST_FOUND.get(); + select(&mut s, &[a, b]); + let before = found(); + assert_eq!(can_make(&s), Ok(())); + assert_eq!(found(), before, "two roots: no paint-order sort"); + select(&mut s, &[a]); + assert_eq!(can_make(&s), Ok(())); + assert_eq!(found(), before + 1, "one root: the outermost objects are found"); + s.execute("select.none", &json!({})).unwrap(); + assert_eq!(can_make(&s), Ok(())); + assert_eq!(found(), before + 1, "no roots: no sort"); + } } diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index d017a1a181..568b9a36d3 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -92,6 +92,8 @@ pub use run::{check_params, run_ui_command}; pub(crate) use run::{normalize_panel, opt_bool, opt_index, opt_number}; #[cfg(test)] use slots::RECENT_FONT_IDS; +#[cfg(test)] +pub(crate) use state::WHY_OFF_ASKED; pub use state::{checked, enabled, plugin_revision, shortcut_of, shown_state}; pub(crate) use state::{command_shortcuts, shown_state_with, why_off}; pub(crate) use submenus::PATH_EFFECTS; diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index 2ebca9a8bc..2d1ea7cfb9 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -681,13 +681,35 @@ pub(crate) fn mixed_paints(app: &VectorcraftApp, ctx: &egui::Context) -> (bool, match pstate::>(ctx, "proxy-mixed") { Some((k, mixed)) if k == key => mixed, _ => { - let mixed = app.session.proxy_mixed(); + let mixed = walk_mixed_paints(app); set_pstate(ctx, "proxy-mixed", Some((key, mixed))); mixed } } } +/// [`mixed_paints`] for readers without a `Ui`, such as the panel menus' states: from the same cache while the app +/// has its interface context, else from a walk of the selection. +pub(crate) fn mixed_paints_now(app: &VectorcraftApp) -> (bool, bool) { + match &app.ui_ctx { + Some(ctx) => mixed_paints(app, ctx), + None => walk_mixed_paints(app), + } +} + +/// [`vectorcraft_engine::Session::proxy_mixed`], which walks the selection. +fn walk_mixed_paints(app: &VectorcraftApp) -> (bool, bool) { + #[cfg(test)] + MIXED_PAINT_WALKS.set(MIXED_PAINT_WALKS.get() + 1); + app.session.proxy_mixed() +} + +#[cfg(test)] +thread_local! { + /// How many times [`walk_mixed_paints`] walked the selection on this thread. + pub(crate) static MIXED_PAINT_WALKS: std::cell::Cell = const { std::cell::Cell::new(0) }; +} + /// The stroke the Stroke panel, Control bar and Properties show: while the Type tool edits text, /// the selected characters' stroke, else [`vectorcraft_engine::Session::shown_stroke`]. pub(crate) fn current_stroke(app: &VectorcraftApp) -> Option { @@ -1108,6 +1130,31 @@ pub(crate) fn popover_body(ui: &mut Ui, mut body: impl FnMut(&mut Ui) -> R) - mod tests { use super::*; + /// The panel menus' states (the Color and Color Wheel menus) read whether the fill and stroke differ from the + /// proxies' cache: one walk of the selection for each revision, which the proxies read too. + #[test] + fn panel_menu_states_walk_the_mixed_paints_once_per_revision() { + let mut app = crate::VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + let ctx = crate::testing::ui_context(); + app.adopt_context(&ctx); + app.run("file.new", json!({"width": 200, "height": 200})).unwrap(); + for x in [10, 60, 110] { + app.run("shape.rectangle", json!({"x": x, "y": 10, "width": 40, "height": 40})).unwrap(); + } + app.run("select.all", json!({})).unwrap(); + let walks = || MIXED_PAINT_WALKS.get(); + let start = walks(); + let mut states = CommandStates::new(); + panel_menu_states(&app, &mut states); + assert_eq!(walks(), start + 1, "the menus walk the selection once"); + panel_menu_states(&app, &mut states); + assert_eq!(mixed_paints(&app, &ctx), (false, false)); + assert_eq!(walks(), start + 1, "the same revision is not walked again, by the menus or the proxies"); + app.run("paint.setFill", json!({"color": "#ff0000"})).unwrap(); + panel_menu_states(&app, &mut states); + assert_eq!(walks(), start + 2, "an edit is walked again"); + } + #[test] fn proxy_events_run_their_commands() { let ran = |activated, double, swap, defaults| -> Vec<(&'static str, Value)> { proxy_commands(activated, double, swap, defaults) }; diff --git a/crates/ui-egui/src/panels/color.rs b/crates/ui-egui/src/panels/color.rs index 6208c22cb3..ba0c6cf7a3 100644 --- a/crates/ui-egui/src/panels/color.rs +++ b/crates/ui-egui/src/panels/color.rs @@ -314,14 +314,14 @@ fn target(app: &VectorcraftApp, ui: &Ui) -> Target { target_with(app, super::active_mixed(app, ui.ctx())) } -/// Whether the active proxy is "?", read from the session (the panel reads its per-frame cache). +/// Whether the active proxy is "?", from the proxies' cache ([`super::mixed_paints_now`]). fn mixed_now(app: &VectorcraftApp) -> bool { - let (fill, stroke) = app.session.proxy_mixed(); + let (fill, stroke) = super::mixed_paints_now(app); if app.session.fill_active { fill } else { stroke } } /// [`target`] with `mixed` for a "?" active proxy: the panel reads it from its per-frame cache, -/// `ui.colorPanel` from the session. +/// `ui.colorPanel` and the panel menus through [`mixed_now`]. fn target_with(app: &VectorcraftApp, mixed: bool) -> Target { if mixed { return Target::Paint(None, None); @@ -440,7 +440,7 @@ pub(crate) fn apply_output(app: &mut VectorcraftApp, out: &ColorPanelOutput) { apply_with(app, &tgt, out); } -/// [`target`] with the session's "?" state, for callers without the panel's pass. +/// [`target`] with the "?" state of [`mixed_now`], for callers without the panel's pass. pub(crate) fn target_now(app: &VectorcraftApp) -> Target { target_with(app, mixed_now(app)) } @@ -616,8 +616,9 @@ pub(crate) fn menu_rows(_app: &VectorcraftApp) -> Vec { /// The checks, titles and enabled states of [`menu_rows`]: the mode the panel shows is checked, and /// the rows that need a colour are off without one. pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { - let tgt = target_now(app); - let has_color = tgt.color().is_some() || mixed_now(app); + let mixed = mixed_now(app); + let tgt = target_with(app, mixed); + let has_color = tgt.color().is_some() || mixed; for (command, state) in ColorPanelMenu::states(LAYOUT, &app.ui.color_panel, &shown(app, &tgt), has_color) { let state = if command == ColorPanelCommand::NewSwatch && !crate::menus::enabled(app, "swatch.new") { state.enabled(false) } else { state }; states.set(command, state); diff --git a/crates/ui-egui/src/panels/color_wheel.rs b/crates/ui-egui/src/panels/color_wheel.rs index 3e706b06c1..c0389af045 100644 --- a/crates/ui-egui/src/panels/color_wheel.rs +++ b/crates/ui-egui/src/panels/color_wheel.rs @@ -618,14 +618,15 @@ pub(crate) fn menu_rows(_app: &VectorcraftApp) -> Vec { /// without a solid color, and CSS oklch() also while the active document's RGB space is not sRGB. pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) { let srgb = cms::active().rgb_is_srgb(); - for item in items(&app.ui.color_wheel, srgb, target_now(app).color()) { + let color = target_now(app).color(); + for item in items(&app.ui.color_wheel, srgb, color) { let mut state = CommandState::new().title(item.label).enabled(item.enabled).checked(item.checked); if let Some(hint) = item.hint { state = state.hint(hint); } states.set(CommandRef::new(row_id(&item.id)), state); } - let has_color = target_now(app).color().is_some(); + let has_color = color.is_some(); for (notation, label) in copy_notations() { let oklch = notation == "oklch"; let mut state = CommandState::new().title(label.to_string()).enabled(has_color && (srgb || !oklch)); diff --git a/crates/ui-egui/src/panels/transparency.rs b/crates/ui-egui/src/panels/transparency.rs index 193837507e..8b814eac71 100644 --- a/crates/ui-egui/src/panels/transparency.rs +++ b/crates/ui-egui/src/panels/transparency.rs @@ -380,11 +380,13 @@ fn mask_items(mask: Option<&OpacityMask>, can_make: bool) -> [(&'static str, &'s } /// The masked object's mask, also while editing it (the selection then is the mask art), whether the -/// object controls apply, and whether Make is possible. +/// object controls apply, and whether Make is possible. Make's check runs only for an object without a mask, the one +/// case whose rows read it ([`mask_items`]). fn menu_context(app: &VectorcraftApp) -> (Option>, bool, bool) { let editing = app.session.active().is_some_and(|d| d.doc.mask_edit.is_some()); - let n = first_node(app, &app.session.transparency_info()); - let can_make = n.is_some() && !editing && crate::menus::enabled(app, "transparency.makeOpacityMask"); + let n = app.session.transparency_target().and_then(|id| super::layers::node_arc(&app.session.active()?.doc, id)); + let unmasked = n.as_ref().is_some_and(|n| n.extras().mask.is_none()); + let can_make = unmasked && !editing && crate::menus::enabled(app, "transparency.makeOpacityMask"); (n, object_controls(app, editing), can_make) } @@ -452,6 +454,30 @@ mod tests { app } + /// The menu's states check Make Opacity Mask only for a first object without a mask: a masked one shows Release, + /// Disable and Unlink instead, and Make dimmed without its check. + #[test] + fn the_menu_checks_make_only_for_an_object_without_a_mask() { + let mut app = new_app(); + let rectangle = |app: &mut VectorcraftApp, x| run_cmd(app, "shape.rectangle", json!({"x": x, "y": 10, "width": 20, "height": 20})); + let masked = rectangle(&mut app, 10)["id"].clone(); + let art = rectangle(&mut app, 12)["id"].clone(); + let plain = rectangle(&mut app, 50)["id"].clone(); + run_cmd(&mut app, "transparency.makeOpacityMask", json!({"ids": [masked, art]})); + // How many times the states asked for Make's check, and whether Make is enabled. + let asked = |app: &VectorcraftApp| { + let mut states = CommandStates::new(); + crate::menus::WHY_OFF_ASKED.with_borrow_mut(Vec::clear); + menu_states(app, &mut states); + let make = crate::menus::WHY_OFF_ASKED.take().iter().filter(|a| *a == "transparency.makeOpacityMask").count(); + (make, states.get(&CommandRef::new("transparency.makeOpacityMask")).is_some_and(CommandState::is_enabled)) + }; + run_cmd(&mut app, "select.set", json!({"ids": [masked]})); + assert_eq!(asked(&app), (0, false), "a masked object: Make is dimmed without its check"); + run_cmd(&mut app, "select.set", json!({"ids": [plain]})); + assert_eq!(asked(&app), (1, true), "an object without a mask: Make's check runs once"); + } + #[test] fn transparency_shows_each_selected_symbol_parts_values() { let mut app = new_app(); From 950467b7de8bd1571ae8e97110c791bcfeb4658c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 12:55:18 -0800 Subject: [PATCH 09/42] Menus: the start of a drag keeps every row's state While an interaction is open (a move, scale or shape drag, a dialog's preview, a typing session), the menus' state key left the document revision out, so the key changed in the frame the interaction began and the menus rebuilt every row's state for it, on top of the rebuilds for the press and the release. A rebuild costs about 8 ms on small documents and about 160 ms with 10,000 objects selected. An interaction now records the revision it began from, and the key uses that revision while the interaction is open. The key stays the same as a drag begins and through its previews, and changes when it ends. The new test drives a Selection tool move through the whole app and counts the rebuilds in each frame: one for the press and one for the release, none as the move begins. --- crates/engine/src/interaction.rs | 3 +++ crates/engine/src/session/edit.rs | 1 + crates/ui-egui/src/canvas/tests.rs | 29 +++++++++++++++++++++++++++++ crates/ui-egui/src/menus/model.rs | 6 +++--- 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/interaction.rs b/crates/engine/src/interaction.rs index a2b9417461..bdc829fb37 100644 --- a/crates/engine/src/interaction.rs +++ b/crates/engine/src/interaction.rs @@ -10,6 +10,9 @@ pub struct Interaction { pub doc: Arc, /// The selection the previews start from (shared, so a preview frame copies nothing). pub selection: Arc, + /// The document's [`crate::DocState::revision`] when the interaction began. The previews change the document's + /// revision, and this value stays the same until the interaction ends. + pub revision: u64, pub preview: Option<(String, Value)>, /// The active tool began it (a drag): a command from outside the tool runs as a step of its /// own under it ([`crate::Session::outside_interaction`]). A dialog or a panel that begins an diff --git a/crates/engine/src/session/edit.rs b/crates/engine/src/session/edit.rs index d5d62e607c..0d2eaaef03 100644 --- a/crates/engine/src/session/edit.rs +++ b/crates/engine/src/session/edit.rs @@ -545,6 +545,7 @@ impl Session { effect: None, doc: st.doc.clone(), selection: Arc::new(st.selection.clone()), + revision: st.revision, preview: None, tool: false, paint, diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index ae6956a288..a51642ee92 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -841,6 +841,35 @@ fn the_move_of_a_releasing_frame_counts_for_the_tool_drag() { assert_eq!(draw(true), Rect::new(130.0, 115.0, 160.0, 130.0), "with Space held through the release the last move moves it"); } +/// A Selection tool move builds the menus' states again twice, in the frame of its press and in the frame of its +/// release, which commits the move. The frame the move begins in and the frames of its previews, which change the +/// document's revision, keep them. +#[test] +fn a_selection_move_rebuilds_the_menus_for_its_press_and_release_only() { + let (mut app, ctx, xf) = rectangle_tool(); + let id = app.session.execute("shape.rectangle", &json!({"x": 100, "y": 100, "width": 60, "height": 30})).unwrap()["id"].as_u64().unwrap(); + app.select_tool("selection"); + app.session.execute("select.set", &json!({"ids": [id]})).unwrap(); + let (from, to) = (xf.to_screen(Point::new(130.0, 115.0)), xf.to_screen(Point::new(170.0, 135.0))); + app_step(&mut app, &ctx, vec![egui::Event::PointerMoved(from)]); + for _ in 0..2 { + app_step(&mut app, &ctx, vec![]); + } + let none = egui::Modifiers::NONE; + let mut steps = vec![vec![primary(from, true, none)]]; + steps.extend((1..=8).map(|i| vec![egui::Event::PointerMoved(from.lerp(to, i as f32 / 8.0))])); + steps.push(vec![primary(to, false, none)]); + steps.extend([vec![], vec![], vec![]]); + let mut rebuilt = vec![]; + for events in steps { + let before = app.menus.rebuilds; + app_step(&mut app, &ctx, events); + rebuilt.push(app.menus.rebuilds - before); + } + assert_eq!(drawn_paths(&app), vec![Rect::new(140.0, 120.0, 200.0, 150.0)], "the drag moves the rectangle"); + assert_eq!(rebuilt, [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], "rebuilds in each frame: press, 8 moves, release, 3 idle"); +} + /// #6369: only the selection box remains over the temporary halftone, and the original /// selection's outlines come back when Preview is turned off or the dialog is cancelled. #[test] diff --git a/crates/ui-egui/src/menus/model.rs b/crates/ui-egui/src/menus/model.rs index fffff70049..92c1786af4 100644 --- a/crates/ui-egui/src/menus/model.rs +++ b/crates/ui-egui/src/menus/model.rs @@ -89,8 +89,8 @@ pub(crate) fn translate_label(english: &'static str) -> String { /// button pressed or released or a key pressed ([`last_press`]), changes once for each, which covers what the hash /// doesn't list (panels shown, a tool picked). While an /// interaction is open (for example a move, scale or shape drag, a dialog's or the font menu's -/// preview, or a typing session), the revision, which each of its previews changes, is left out: -/// the hash changes as the interaction begins and as it ends. +/// preview, or a typing session), the hash takes the revision the interaction began from in place of the current one, +/// which each of its previews changes: the hash stays the same as the interaction begins, and changes as it ends. pub(crate) fn state_key(app: &VectorcraftApp, input: Option) -> u64 { let mut h = DefaultHasher::new(); input.hash(&mut h); @@ -101,7 +101,7 @@ pub(crate) fn state_key(app: &VectorcraftApp, input: Option) -> u64 { let s = &app.session; (s.journal.len(), s.active_index(), s.clipboard.is_empty(), s.tool_composing()).hash(&mut h); if let Some(d) = s.active() { - let revision = d.interaction.is_none().then_some(d.revision); + let revision = d.interaction.as_ref().map_or(d.revision, |it| it.revision); (d.uid, revision, d.history.undo.len(), d.history.redo.len(), d.transparency_grid, d.print_tiling).hash(&mut h); } (app.system_paste, app.last_effect.is_some(), app.ui.recent_files.len(), app.ui.recent_files.first(), app.recent_fonts().len()).hash(&mut h); From 8e31fb06de54a46257000024823e59f1363efdf3 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 13:47:59 -0800 Subject: [PATCH 10/42] Properties: idle frames replay the Document sections' bodies With nothing selected, the Properties panel laid out the bodies of its Document, Rulers & Grids, Guides, Snap Options, Preferences and Quick Actions sections again in every frame. Each body now shows in a MemoView keyed on what it reads: the units, the artboard count, the snap settings, the keyboard increment and its unit, Scale Strokes & Effects and the interface language. A change in the command state of one of its buttons runs it again. The Units choice, the snap checkboxes and the preference edits come back through an Outbox and run after the section, as before. The section headers and the Appearance section still run in every frame. The new test counts the body runs: none over 10 idle frames, and runs again after a command changes what one shows. --- .../panels/properties/document_sections.rs | 311 ++++++++++++++---- 1 file changed, 251 insertions(+), 60 deletions(-) diff --git a/crates/ui-egui/src/panels/properties/document_sections.rs b/crates/ui-egui/src/panels/properties/document_sections.rs index e8c14ba4dd..4774bdb750 100644 --- a/crates/ui-egui/src/panels/properties/document_sections.rs +++ b/crates/ui-egui/src/panels/properties/document_sections.rs @@ -1,10 +1,10 @@ //! The Properties panel's Document sections, shown with nothing selected. -use craft::behavior::IconId; +use craft::behavior::{EditEvent, IconId}; use craft::keymap::CommandRef; use craft::ui::buttons::{Button, ToggleButton}; use craft::ui::choice::Checkbox; -use craft::ui::contract::{Bind, Entry, Props as _, Show as _, ShowContainer as _, Sizing}; +use craft::ui::contract::{Bind, Entry, MemoProps, MemoView, Outbox, Props as _, Show as _, ShowContainer as _, Sizing}; use craft::ui::form::Field; use craft::ui::layout_components::{Grid, Row}; use craft::ui::pickers::Select; @@ -17,84 +17,212 @@ use vectorcraft_doc::Unit; use super::artboard_sections::rearrange_button; use super::object_sections::HALVES; use crate::VectorcraftApp; +use crate::edits::EditPath; use crate::panels::transform; /// The panel with nothing selected: the document's units, Document Setup and artboards, the /// Appearance fill and stroke, the view's rulers, grids, guides and snapping, the keyboard /// increment and Scale Strokes & Effects, and Quick Actions. +/// +/// The body of every section but Appearance shows in a `MemoView` keyed on what it reads, so a +/// frame that changes none of it replays the body. What a body picks comes back through an `Outbox` +/// and runs after its section. pub(super) fn document_sections(app: &mut VectorcraftApp, ui: &mut Ui) { + let lang = crate::i18n::current(); let units = app.session.general_unit(); + let unit = Unit::ALL.iter().position(|u| *u == units).unwrap_or(usize::MAX); let artboards = app.session.active().map_or(0, |d| d.doc.artboards.len()); + let mut picked_units = Vec::new(); super::section(tl!("Document")).show(ui, |ui, _| { - Field::new(tl!("Units")).show(ui, |ui, _| { - let entries: Vec> = Unit::ALL.iter().map(|u| Entry::new(*u, u.label())).collect(); - let out = Select::new(tl!("Units"), Bind::given(units), &entries).show(ui); - if let Some(u) = out.events.committed() { - app.run("document.setUnits", json!({ "units": u.label() })).ok(); - } - }); - Grid::new(&HALVES).show(ui, |ui, _| { - Button::command(CommandRef::new("file.documentSetup")).label(tl!("Document Setup")).sizing(Sizing::FillWidth).show(ui); - Button::command(CommandRef::with_params("tool.select", json!({ "tool": "artboard" }))) - .label(tl!("Edit Artboards")) - .sizing(Sizing::FillWidth) - .show(ui); - if artboards > 1 { - rearrange_button(ui, artboards); - } - }); + let document = DocumentProps { unit, units, artboards, lang, picked: Outbox::new(&mut picked_units) }; + let _ = MemoView::new("properties-document", document, document_body).show(ui); }); + if let Some(u) = picked_units.pop() { + app.run("document.setUnits", json!({ "units": u.label() })).ok(); + } super::section(tl!("Appearance")).show(ui, |ui, _| super::appearance_section::fill_stroke_rows(app, ui)); super::section(tl!("Rulers & Grids")).show(ui, |ui, _| { - Row::new().show(ui, |ui, _| { - // The checked and enabled states and the tooltips come from the commands (Trim View turns the grid off). - for (command, icon) in [("view.rulers", "ruler"), ("view.grid", "grid-3x3"), ("view.transparencyGrid", "square-dashed")] { - ToggleButton::command(CommandRef::new(command)).icon(IconId::new(icon)).icon_only().show(ui); - } - }); + let _ = MemoView::new("properties-rulers", Language { lang }, rulers_body).show(ui); }); super::section(tl!("Guides")).show(ui, |ui, _| { - Row::new().show(ui, |ui, _| { - for (command, icon) in [("view.guides", "layout-grid"), ("view.smartGuides", "sparkles")] { - ToggleButton::command(CommandRef::new(command)).icon(IconId::new(icon)).icon_only().show(ui); - } - }); + let _ = MemoView::new("properties-guides", Language { lang }, guides_body).show(ui); }); + let mut snaps = Vec::new(); + let (point, grid) = (app.ui.view.snap_to_point, app.ui.view.snap_to_grid); super::section(tl!("Snap Options")).show(ui, |ui, _| { - let (point, grid) = (app.ui.view.snap_to_point, app.ui.view.snap_to_grid); - for (command, label, on) in [("view.snapToPoint", tl!("Snap to Point"), point), ("view.snapToGrid", tl!("Snap to Grid"), grid)] { - if Checkbox::new(Bind::given(on)).label(label).show(ui).value().is_some() { - app.run(command, json!({})).ok(); - } - } + let snap = SnapProps { point, grid, lang, picked: Outbox::new(&mut snaps) }; + let _ = MemoView::new("properties-snap", snap, snap_body).show(ui); }); + for command in snaps { + app.run(command, json!({})).ok(); + } + let mut prefs = Vec::new(); + let (increment, scale) = (app.session.prefs.keyboard_increment, app.session.prefs.scale_strokes); + let (bare_points, lengths) = (app.session.prefs.numbers_without_units_are_points, crate::canvas::rulers::general_lengths(app)); super::section(tl!("Preferences")).show(ui, |ui, _| { - Field::new(tl!("Keyboard Increment")).show(ui, |ui, _| { - // PLAN: assumed `canvas::rulers::general_lengths(app) -> LengthUnits` (cv.B5b) - let lengths: LengthUnits = crate::canvas::rulers::general_lengths(app); - // The engine's own range for the preference (`prefscmds.rs`): a larger value is an error. - let out = NumberField::length(tl!("Keyboard Increment"), Bind::given(Some(app.session.prefs.keyboard_increment)), lengths) - .range(0.001..=1296.0) - .show(ui); - crate::edits::apply_edits(app, &out.edit, crate::edits::EditPath::Scope, |app, v: &Option, _| { - if let Some(value) = *v { - app.run("prefs.set", json!({ "key": "keyboardIncrement", "value": value })).ok(); - } - }); - }); - let scale = app.session.prefs.scale_strokes; - let out = Checkbox::new(Bind::given(scale)).label(tl!("Scale Strokes & Effects")).show(ui); - if let Some(on) = out.value().copied() { - transform::set_pref(app, "scaleStrokes", on); + let picked = Outbox::new(&mut prefs); + let preferences = PreferencesProps { increment, unit, bare_points, lengths, scale, lang, picked }; + let _ = MemoView::new("properties-preferences", preferences, preferences_body).show(ui); + }); + for pick in prefs { + match pick { + PreferencePick::Increment(event) => { + crate::edits::apply_event(app, &event, &EditPath::Scope, &mut |app, v: &Option, _| { + if let Some(value) = *v { + app.run("prefs.set", json!({ "key": "keyboardIncrement", "value": value })).ok(); + } + }); + } + PreferencePick::ScaleStrokes(on) => transform::set_pref(app, "scaleStrokes", on), + } + } + super::section(tl!("Quick Actions")).show(ui, |ui, _| { + let _ = MemoView::new("properties-quick-actions", Language { lang }, quick_actions_body).show(ui); + }); +} + +/// What a section that reads only command states reads besides them: the interface language of its labels. +#[derive(MemoProps)] +struct Language { + #[memo_props(hash = "an interface language: an index into the languages offered")] + lang: crate::i18n::Lang, +} + +/// What the Document section reads: the document's units and how many artboards it has. +#[derive(MemoProps)] +struct DocumentProps<'a> { + /// The index of `units` in [`Unit::ALL`]. + unit: usize, + #[memo_props(covered_by = "unit", reason = "the unit's index in Unit::ALL")] + units: Unit, + /// How many artboards the document has (Rearrange All shows for more than one). + artboards: usize, + #[memo_props(hash = "an interface language: an index into the languages offered")] + lang: crate::i18n::Lang, + /// The units chosen in the Units menu. + picked: Outbox<'a, Unit>, +} + +/// The Document section's body: Units, Document Setup, Edit Artboards and Rearrange All. +fn document_body(p: &mut DocumentProps<'_>, ui: &mut Ui) { + #[cfg(test)] + tests::count_run(); + Field::new(tl!("Units")).show(ui, |ui, _| { + let entries: Vec> = Unit::ALL.iter().map(|u| Entry::new(*u, u.label())).collect(); + let out = Select::new(tl!("Units"), Bind::given(p.units), &entries).show(ui); + if let Some(u) = out.events.committed() { + p.picked.send(*u); } }); - super::section(tl!("Quick Actions")).show(ui, |ui, _| { - Grid::new(&HALVES).show(ui, |ui, _| { - // The reference panel's buttons name the dialog without the menu's ellipsis. - for (command, label) in [("file.documentSetup", tl!("Document Setup")), ("edit.preferences", tl!("Preferences"))] { - Button::command(CommandRef::new(command)).label(label).sizing(Sizing::FillWidth).show(ui); - } - }); + Grid::new(&HALVES).show(ui, |ui, _| { + Button::command(CommandRef::new("file.documentSetup")).label(tl!("Document Setup")).sizing(Sizing::FillWidth).show(ui); + Button::command(CommandRef::with_params("tool.select", json!({ "tool": "artboard" }))) + .label(tl!("Edit Artboards")) + .sizing(Sizing::FillWidth) + .show(ui); + if p.artboards > 1 { + rearrange_button(ui, p.artboards); + } + }); +} + +/// The Rulers & Grids section's body. The checked and enabled states and the tooltips come from the commands (Trim +/// View turns the grid off). +fn rulers_body(_: &mut Language, ui: &mut Ui) { + #[cfg(test)] + tests::count_run(); + Row::new().show(ui, |ui, _| { + for (command, icon) in [("view.rulers", "ruler"), ("view.grid", "grid-3x3"), ("view.transparencyGrid", "square-dashed")] { + ToggleButton::command(CommandRef::new(command)).icon(IconId::new(icon)).icon_only().show(ui); + } + }); +} + +/// The Guides section's body: Show Guides and Smart Guides, from their commands. +fn guides_body(_: &mut Language, ui: &mut Ui) { + #[cfg(test)] + tests::count_run(); + Row::new().show(ui, |ui, _| { + for (command, icon) in [("view.guides", "layout-grid"), ("view.smartGuides", "sparkles")] { + ToggleButton::command(CommandRef::new(command)).icon(IconId::new(icon)).icon_only().show(ui); + } + }); +} + +/// What the Snap Options section reads: whether Snap to Point and Snap to Grid are on. +#[derive(MemoProps)] +struct SnapProps<'a> { + point: bool, + grid: bool, + #[memo_props(hash = "an interface language: an index into the languages offered")] + lang: crate::i18n::Lang, + /// The command of each checkbox clicked. + picked: Outbox<'a, &'static str>, +} + +/// The Snap Options section's body: Snap to Point and Snap to Grid. +fn snap_body(p: &mut SnapProps<'_>, ui: &mut Ui) { + #[cfg(test)] + tests::count_run(); + for (command, label, on) in [("view.snapToPoint", tl!("Snap to Point"), p.point), ("view.snapToGrid", tl!("Snap to Grid"), p.grid)] { + if Checkbox::new(Bind::given(on)).label(label).show(ui).value().is_some() { + p.picked.send(command); + } + } +} + +/// What the Preferences section reads: the keyboard increment in the General unit, and Scale Strokes & Effects. +#[derive(MemoProps)] +struct PreferencesProps<'a> { + /// The keyboard increment, in points. + increment: f64, + /// The index of the General unit in [`Unit::ALL`]. + unit: usize, + /// Numbers without units are points (Preferences › Units). + bare_points: bool, + #[memo_props(covered_by = "unit", reason = "made from the General unit and bare_points alone (canvas::rulers::lengths)")] + lengths: LengthUnits, + /// Scale Strokes & Effects is on. + scale: bool, + #[memo_props(hash = "an interface language: an index into the languages offered")] + lang: crate::i18n::Lang, + /// The keyboard increment's edits and the Scale Strokes & Effects choice. + picked: Outbox<'a, PreferencePick>, +} + +/// What the Preferences section reports: an edit of the keyboard increment, or Scale Strokes & Effects turned on or +/// off. +enum PreferencePick { + Increment(EditEvent>), + ScaleStrokes(bool), +} + +/// The Preferences section's body: Keyboard Increment and Scale Strokes & Effects. +fn preferences_body(p: &mut PreferencesProps<'_>, ui: &mut Ui) { + #[cfg(test)] + tests::count_run(); + Field::new(tl!("Keyboard Increment")).show(ui, |ui, _| { + // The engine's own range for the preference (`prefscmds.rs`): a larger value is an error. + let out = NumberField::length(tl!("Keyboard Increment"), Bind::given(Some(p.increment)), p.lengths).range(0.001..=1296.0).show(ui); + for event in out.edit.events.iter() { + p.picked.send(PreferencePick::Increment(event.clone())); + } + }); + let out = Checkbox::new(Bind::given(p.scale)).label(tl!("Scale Strokes & Effects")).show(ui); + if let Some(on) = out.value().copied() { + p.picked.send(PreferencePick::ScaleStrokes(on)); + } +} + +/// The Quick Actions section's body: Document Setup and Preferences. The reference panel's buttons name the dialog +/// without the menu's ellipsis. +fn quick_actions_body(_: &mut Language, ui: &mut Ui) { + #[cfg(test)] + tests::count_run(); + Grid::new(&HALVES).show(ui, |ui, _| { + for (command, label) in [("file.documentSetup", tl!("Document Setup")), ("edit.preferences", tl!("Preferences"))] { + Button::command(CommandRef::new(command)).label(label).sizing(Sizing::FillWidth).show(ui); + } }); } @@ -104,6 +232,19 @@ mod tests { use crate::tests::panel_harness::Panel; use craft::ui::contract::Role; + thread_local! { + /// How many times this thread ran a memoized Document section. + static SECTION_RUNS: std::cell::Cell = const { std::cell::Cell::new(0) }; + } + + pub(super) fn count_run() { + SECTION_RUNS.with(|n| n.set(n.get() + 1)); + } + + fn runs() -> u64 { + SECTION_RUNS.with(std::cell::Cell::get) + } + #[test] fn canceling_the_units_popup_leaves_the_document_unchanged() { let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); @@ -135,4 +276,54 @@ mod tests { assert_eq!(panel.app().session.active().unwrap().doc.units, next, "Enter applies the chosen document unit"); assert_eq!(panel.app().session.general_unit(), next); } + + /// Frames that change nothing the sections show replay them instead of laying them out again. A change one of + /// them reads, from a command run elsewhere, runs it again, and it shows the change. + #[test] + fn idle_frames_replay_the_document_sections() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.run("file.new", json!({"width": 300, "height": 200})).unwrap(); + let mut panel = Panel::new(app, document_sections); + panel.room(egui::vec2(400.0, 1000.0)); + panel.frame(); + panel.frame(); + let before = runs(); + for _ in 0..10 { + panel.frame(); + } + assert_eq!(runs() - before, 0, "idle frames run the memoized sections no more"); + let point = panel.app().ui.view.snap_to_point; + panel.app().run("view.snapToPoint", json!({})).unwrap(); + panel.frame(); + panel.frame(); + assert!(runs() > before, "a new snap setting runs the sections again"); + assert_eq!(panel.app().ui.view.snap_to_point, !point); + assert_eq!(panel.toggled("Snap to Point"), Some(craft::behavior::Mixed::Same(!point)), "and the checkbox shows it"); + panel.app().run("view.rulers", json!({})).unwrap(); + let mut per_frame = Vec::new(); + for _ in 0..12 { + let at = runs(); + panel.frame(); + per_frame.push(runs() - at); + } + // A toggled button animates over the next frames, and a section runs while an animation in it has not ended. + assert_eq!(per_frame[6..], [0; 6], "idle frames after a command run them no more: {per_frame:?}"); + } + + /// The memoized sections still take input: a click on Snap to Grid turns it on, once, and Scale Strokes & Effects + /// sets its preference. + #[test] + fn the_memoized_sections_run_their_picks() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.run("file.new", json!({"width": 300, "height": 200})).unwrap(); + let grid = app.ui.view.snap_to_grid; + let scale = app.session.prefs.scale_strokes; + let mut panel = Panel::new(app, document_sections); + panel.room(egui::vec2(400.0, 1000.0)); + panel.frame(); + panel.click("Snap to Grid"); + assert_eq!(panel.app().ui.view.snap_to_grid, !grid, "the click toggles Snap to Grid once"); + panel.click("Scale Strokes & Effects"); + assert_eq!(panel.app().session.prefs.scale_strokes, !scale); + } } From d3e02f41a18d29e51628c13ba70769c8d8009f1e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 13:52:49 -0800 Subject: [PATCH 11/42] Performance: Properties rows read a large selection once per edit After an edit the selection keeps no record of its paints, so the Fill and Stroke chips and the Stroke and Width Profile rows looked up the groups around every selected object for Live Paint faces and edges each time they were drawn. DocState::live_paint_covered_kept keeps an empty answer for that version of the document and those objects. The Recolor quick action listed and sorted every color of the selection to see whether it held more than one. Session::several_colors_used reads the same objects and pattern tiles and stops at the second color. --- crates/engine/src/cmd.rs | 3 + crates/engine/src/cmd/paint.rs | 5 +- crates/engine/src/cmd/paint/tests.rs | 52 +++++++++ crates/engine/src/cmd/recolor.rs | 133 ++++++++++++++++++++++++ crates/engine/src/doc_state.rs | 34 ++++++ crates/ui-egui/src/panels/properties.rs | 8 +- 6 files changed, 229 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/cmd.rs b/crates/engine/src/cmd.rs index 43d6e3a7d4..3641f82d6b 100644 --- a/crates/engine/src/cmd.rs +++ b/crates/engine/src/cmd.rs @@ -874,6 +874,9 @@ pub(crate) use vectorcraft_doc::range::parse_range; /// What the fill and stroke proxies read from the selected objects, kept with the selection /// ([`crate::doc_state::SelectionRecord`]). pub(crate) use paint::SelectionPaints; +/// The faces and edges of Live Paint groups among objects that count with their group +/// ([`crate::DocState::live_paint_covered_kept`] keeps an empty answer). +pub(crate) use paint::live_paint_covered; #[cfg(test)] pub(crate) use paint::{PAINTS_READ, WEIGHTS_READ}; diff --git a/crates/engine/src/cmd/paint.rs b/crates/engine/src/cmd/paint.rs index c722e2a58b..2a61f7fb74 100644 --- a/crates/engine/src/cmd/paint.rs +++ b/crates/engine/src/cmd/paint.rs @@ -1470,12 +1470,13 @@ fn in_live_paint(d: &Document, id: NodeId) -> bool { impl DocState { /// [`live_paint_covered`] for `ids`, the selected objects or the selection's subjects: none - /// when the [`SelectionPaints`] of the selection say no selected object is in a Live Paint group. + /// when the [`SelectionPaints`] of the selection say no selected object is in a Live Paint group, + /// else as [`DocState::live_paint_covered_kept`] keeps it for this version of the document. pub(crate) fn selection_live_paint_covered(&self, ids: &[NodeId]) -> std::collections::HashSet { if self.selection_paints().is_some_and(|p| !p.in_live_paint()) { return std::collections::HashSet::new(); } - live_paint_covered(&self.doc, ids) + self.live_paint_covered_kept(ids) } } diff --git a/crates/engine/src/cmd/paint/tests.rs b/crates/engine/src/cmd/paint/tests.rs index ec8f02f700..9b0fb393df 100644 --- a/crates/engine/src/cmd/paint/tests.rs +++ b/crates/engine/src/cmd/paint/tests.rs @@ -242,6 +242,58 @@ fn the_question_marks_read_only_the_selected_objects() { assert!(vectorcraft_doc::tree_walks() - walks <= 1, "one walk for a large selection"); } +/// How many times this thread read the groups around selected objects for their Live Paint faces +/// and edges ([`DocState::live_paint_covered_kept`]). +fn cover_reads() -> usize { + crate::doc_state::LIVE_PAINT_COVER_READS.with(Cell::get) +} + +/// After an edit the selection keeps no record of what it holds, and the proxies, the Stroke panel +/// and the "?" ask on every frame whether its objects lie in a Live Paint group. They read the +/// objects' groups once for each version of the document and selection, not once for each question. +/// A Live Paint group selected with one of its faces still counts the face with its group. +#[test] +fn live_paint_faces_are_looked_for_once_per_document_version() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 800, "height": 600})).unwrap(); + let ids: Vec = (0..20).map(|i| rect(&mut s, 10.0 + 30.0 * f64::from(i), "#ff0000", "#000000")).collect(); + s.execute("select.all", &json!({})).unwrap(); + s.execute("object.move", &json!({"dx": 5, "dy": 0})).unwrap(); + assert!(s.active().unwrap().selection_paints().is_none(), "the edit leaves the selection without a record"); + let ask = |s: &Session| { + for _ in 0..3 { + s.proxy_paints(); + s.shown_stroke(); + s.proxy_mixed(); + s.active().unwrap().stroke_mixed(); + } + }; + let before = cover_reads(); + ask(&s); + assert_eq!(cover_reads() - before, 1, "one read for this version of the document"); + s.execute("object.move", &json!({"dx": 5, "dy": 0})).unwrap(); + let before = cover_reads(); + ask(&s); + assert_eq!(cover_reads() - before, 1, "an edit reads them again, once"); + s.execute("select.set", &json!({"ids": [ids[0].0, ids[1].0]})).unwrap(); + s.execute("object.move", &json!({"dx": 5, "dy": 0})).unwrap(); + let before = cover_reads(); + ask(&s); + assert_eq!(cover_reads() - before, 1, "another selection reads them again, once"); + + // A Live Paint group with one of its edges selected too: the edge counts with its group on every ask. + s.execute("livePaint.make", &json!({"ids": [ids[2].0, ids[3].0]})).unwrap(); + let group = s.active().unwrap().selection.objects[0]; + let edge = vectorcraft_tools::builder::edges(s.active().unwrap().doc.node(group).unwrap())[0].id; + s.execute("select.set", &json!({"ids": [group.0, edge.0]})).unwrap(); + let st = s.active().unwrap(); + let covered = live_paint_covered(&st.doc, &st.selection.objects); + assert!(covered.contains(&edge)); + for _ in 0..2 { + assert_eq!(st.selection_live_paint_covered(&st.selection.objects), covered); + } +} + /// Random selections of a document with nested groups answer as a walk does. #[test] fn random_selections_match_a_walk_of_the_document() { diff --git a/crates/engine/src/cmd/recolor.rs b/crates/engine/src/cmd/recolor.rs index b4ad26400b..174f90ecb0 100644 --- a/crates/engine/src/cmd/recolor.rs +++ b/crates/engine/src/cmd/recolor.rs @@ -1027,6 +1027,76 @@ fn used_colors(d: &Document, ids: &[NodeId], only: Option<&BTreeSet>) -> used.into_iter().map(|(_, u)| u).collect() } +#[cfg(test)] +thread_local! { + /// Tests: how many objects [`several_colors`] read on this thread. + static SEVERAL_COLORS_READS: std::cell::Cell = const { std::cell::Cell::new(0) }; +} + +/// Whether [`used_colors`] lists more than one color for the objects `ids`. The objects are read +/// until a second color turns up. +fn several_colors(d: &Document, ids: &[NodeId], only: Option<&BTreeSet>) -> bool { + struct Seen<'a> { + first: Option, + several: bool, + patterns: Vec<&'a str>, + } + impl<'a> Seen<'a> { + fn read(&mut self, m: &'a Node) { + #[cfg(test)] + SEVERAL_COLORS_READS.with(|c| c.set(c.get() + 1)); + let (first, several) = (&mut self.first, &mut self.several); + paints( + m, + &mut |c, _, _, _| { + let k = ColorKey::of(c); + match first { + None => *first = Some(k), + Some(f) => *several |= *f != k, + } + }, + &mut self.patterns, + ); + } + fn read_tree(&mut self, n: &'a Node, only: Option<&BTreeSet>) { + if self.several || only.is_some_and(|o| !o.contains(&n.id)) { + return; + } + self.read(n); + for c in n.children().into_iter().flatten() { + self.read_tree(c, only); + } + } + } + let mut seen = Seen { first: None, several: false, patterns: vec![] }; + for n in ids.iter().filter_map(|id| d.node(*id)) { + seen.read_tree(n, only); + } + let mut next = 0; + while !seen.several + && let Some(&name) = seen.patterns.get(next) + { + next += 1; + for a in d.pattern(name).map(|def| def.art.as_slice()).unwrap_or_default() { + a.walk(&mut |m| { + if !seen.several { + seen.read(m); + } + }); + } + } + seen.several +} + +impl Session { + /// Whether the objects `recolor.colors` reads without `ids` use more than one color: the + /// selection, or with nothing selected the objects Select All takes. False without a document. + pub fn several_colors_used(&self) -> bool { + let Ok((ids, only)) = scope_ids(self, &Value::Null, "recolor.colors") else { return false }; + self.doc().is_ok_and(|st| several_colors(&st.doc, &ids, only.as_ref())) + } +} + /// Count the colors `m` holds itself with `count` (the color, its swatch, the tint the paint /// stores, and whether it is a gradient stop that mixes the swatch's ink with process inks), and /// add the patterns it is painted with to `patterns`. @@ -2050,6 +2120,69 @@ mod tests { assert!(has(&t, RED), "P100 read again at the top"); } + /// How many objects [`several_colors`] read on this thread. + fn several_reads() -> usize { + SEVERAL_COLORS_READS.with(std::cell::Cell::get) + } + + /// Whether more than one color is used ([`Session::several_colors_used`]), checked against the + /// length of `recolor.colors`'s list, with how many objects the answer read. + fn several(s: &mut Session, what: &str) -> (bool, usize) { + let before = several_reads(); + let several = s.several_colors_used(); + let reads = several_reads() - before; + let listed = s.execute("recolor.colors", &json!({})).unwrap()["colors"].as_array().map_or(0, Vec::len); + assert_eq!(several, listed > 1, "{what}: {listed} colors listed"); + (several, reads) + } + + /// The Recolor quick action asks on every change whether the selection uses more than one + /// color. The answer matches `recolor.colors`, pattern tiles and Select All's objects included, + /// and the objects are read only until a second color turns up. + #[test] + fn several_colors_stop_at_the_second_color() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 800, "height": 600})).unwrap(); + let ids: Vec = (0..30) + .map(|i| { + let id = + s.execute("shape.rectangle", &json!({"x": 10 + 20 * i, "y": 10, "width": 10, "height": 10})).unwrap()["id"].as_u64().unwrap(); + s.execute("paint.setFill", &json!({"ids": [id], "color": "#ff0000"})).unwrap(); + s.execute("paint.setStroke", &json!({"ids": [id], "none": true})).unwrap(); + id + }) + .collect(); + s.execute("select.all", &json!({})).unwrap(); + assert_eq!(several(&mut s, "one red"), (false, 30), "one color: every object is read"); + // A blue object in the middle: the objects are read up to it, from either end. + s.execute("paint.setFill", &json!({"ids": [ids[15]], "color": "#0000ff"})).unwrap(); + let (found, reads) = several(&mut s, "a blue in the middle"); + assert!(found && matches!(reads, 15 | 16), "{reads} objects read"); + s.execute("paint.setFill", &json!({"ids": [ids[0], ids[29]], "color": "#00ff00"})).unwrap(); + assert_eq!(several(&mut s, "green at both ends"), (true, 2), "the second object holds the second color"); + s.execute("select.set", &json!({"ids": &ids[1..15]})).unwrap(); + assert!(!several(&mut s, "the red ones").0); + s.execute("select.none", &json!({})).unwrap(); + assert!(several(&mut s, "Select All's objects").0); + + // A red object filled with a pattern too: its tile's color counts. + for (tile, expect) in [(BLUE, true), (RED, false)] { + let filled = NodeId(ids[1]); + s.edit("t", |d, _| { + let art = square(d, 0.0, Paint::solid(tile)); + d.patterns.retain(|p| p.name != "Tile"); + d.patterns.push(PatternDef::new("Tile", vec![art])); + if let Some(n) = d.node_mut(filled) { + n.appearance.set_fill(Paint::Pattern { pattern: "Tile".into(), xf: Affine::IDENTITY }); + } + Ok(()) + }) + .unwrap(); + s.execute("select.set", &json!({"ids": [ids[1], ids[2]]})).unwrap(); + assert_eq!(several(&mut s, "a pattern tile").0, expect, "a tile of {tile:?}"); + } + } + /// A pattern tile's symbol instances charge the same limit as the art around it. #[test] fn pattern_tiles_charge_the_symbol_limit() { diff --git a/crates/engine/src/doc_state.rs b/crates/engine/src/doc_state.rs index e1bb6df83a..8307b6a8b1 100644 --- a/crates/engine/src/doc_state.rs +++ b/crates/engine/src/doc_state.rs @@ -203,6 +203,18 @@ pub struct DocState { /// The selected objects as [`crate::Session::select`] last checked them or the proxies last /// read them, with the document they were checked in ([`SelectionRecord`]). Not saved. pub(crate) selection_record: Option, + /// The objects that [`DocState::live_paint_covered_kept`] last found no face or edge of a Live + /// Paint group among, with the document it read. Not saved. + outside_live_paint: std::cell::RefCell>, +} + +/// Objects that hold no face or edge of a Live Paint group that counts with its group +/// ([`cmd::live_paint_covered`] is empty for them), with the document they were read in, held as +/// [`EmptyArtboards::doc`] holds it. +#[derive(Clone, Debug)] +struct OutsideLivePaint { + doc: std::sync::Weak, + ids: Vec, } /// A selection of objects alone ([`objects_only`]) with the document it was checked or read in: @@ -302,6 +314,8 @@ thread_local! { pub(crate) static EMPTY_ARTBOARD_MEASURES: std::cell::Cell = const { std::cell::Cell::new(0) }; /// Tests: how many times [`DocState::any_art_to_fit`] measured a document on this thread. pub(crate) static ART_TO_FIT_MEASURES: std::cell::Cell = const { std::cell::Cell::new(0) }; + /// Tests: how many times [`DocState::live_paint_covered_kept`] read the objects' groups on this thread. + pub(crate) static LIVE_PAINT_COVER_READS: std::cell::Cell = const { std::cell::Cell::new(0) }; } static NEXT_DOC_UID: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(1); @@ -522,6 +536,7 @@ impl DocState { measured_in_own: None, inline_resolved: None, selection_record: None, + outside_live_paint: Default::default(), } } /// The [`SelectionRecord`] of the selection now: `None` when the document or the selected @@ -539,6 +554,25 @@ impl DocState { pub(crate) fn selection_paints(&self) -> Option<&cmd::SelectionPaints> { self.selection_record().and_then(|r| r.paints.as_ref()) } + /// The faces and edges of Live Paint groups among `ids` that count with their group + /// ([`cmd::live_paint_covered`]). An empty answer is kept for this version of the document and + /// these objects, so the proxies and the Stroke panel, which ask on every frame, read the + /// objects' groups once after an edit. + pub(crate) fn live_paint_covered_kept(&self, ids: &[NodeId]) -> std::collections::HashSet { + let kept = |k: &OutsideLivePaint| std::ptr::eq(k.doc.as_ptr(), Arc::as_ptr(&self.doc)) && k.ids == ids; + if self.outside_live_paint.try_borrow().is_ok_and(|k| k.as_ref().is_some_and(kept)) { + return std::collections::HashSet::new(); + } + #[cfg(test)] + LIVE_PAINT_COVER_READS.with(|c| c.set(c.get() + 1)); + let covered = cmd::live_paint_covered(&self.doc, ids); + if covered.is_empty() + && let Ok(mut k) = self.outside_live_paint.try_borrow_mut() + { + *k = Some(OutsideLivePaint { doc: Arc::downgrade(&self.doc), ids: ids.to_vec() }); + } + covered + } /// Keep the [`SelectionRecord`] of the selection that [`crate::Session::select`] left, with /// Lock Guides `guides_locked`. `record` is the record of the selection before, in the same /// document: the objects that leave the selection are taken out of its paints and the objects diff --git a/crates/ui-egui/src/panels/properties.rs b/crates/ui-egui/src/panels/properties.rs index 7e3caa1a43..b137711d0d 100644 --- a/crates/ui-egui/src/panels/properties.rs +++ b/crates/ui-egui/src/panels/properties.rs @@ -291,8 +291,9 @@ fn can_merge_live_paint(app: &VectorcraftApp) -> bool { }) } -/// Whether the selection uses more than one colour (`recolor.colors`), which offers the Recolor -/// quick action; memoised per document revision. +/// Whether the selection uses more than one colour (`recolor.colors` lists more than one, +/// [`vectorcraft_engine::Session::several_colors_used`]), which offers the Recolor quick action; +/// memoised per document revision. pub(crate) fn multi_color(app: &mut VectorcraftApp) -> bool { let Some(st) = app.session.active() else { return false }; let key = (st.uid, st.revision); @@ -301,8 +302,7 @@ pub(crate) fn multi_color(app: &mut VectorcraftApp) -> bool { { return multi; } - let r = app.session.execute("recolor.colors", &json!({})).unwrap_or_default(); - let multi = r["colors"].as_array().is_some_and(|c| c.len() > 1); + let multi = app.session.several_colors_used(); app.canvas.multi_color = Some((key, multi)); multi } From 2f508db904b14e42d36d5ddd47d6c648ebf9c9bd Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 14:55:41 -0800 Subject: [PATCH 12/42] Properties: the Preferences key reads the General unit after a Units pick The Preferences section's memo key took the General unit's index before the Units commit ran, while its lengths were read after it. On the frame that picked new units the key still matched the previous frame, so the section replayed and the Keyboard Increment showed the old unit for that frame. The key now reads the unit next to the lengths. --- .../panels/properties/document_sections.rs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/crates/ui-egui/src/panels/properties/document_sections.rs b/crates/ui-egui/src/panels/properties/document_sections.rs index 4774bdb750..cff44b4f44 100644 --- a/crates/ui-egui/src/panels/properties/document_sections.rs +++ b/crates/ui-egui/src/panels/properties/document_sections.rs @@ -57,6 +57,9 @@ pub(super) fn document_sections(app: &mut VectorcraftApp, ui: &mut Ui) { app.run(command, json!({})).ok(); } let mut prefs = Vec::new(); + // Read again after the Units commit above, so the key and `lengths` come from the same General unit. + let general = app.session.general_unit(); + let unit = Unit::ALL.iter().position(|u| *u == general).unwrap_or(usize::MAX); let (increment, scale) = (app.session.prefs.keyboard_increment, app.session.prefs.scale_strokes); let (bare_points, lengths) = (app.session.prefs.numbers_without_units_are_points, crate::canvas::rulers::general_lengths(app)); super::section(tl!("Preferences")).show(ui, |ui, _| { @@ -310,6 +313,31 @@ mod tests { assert_eq!(per_frame[6..], [0; 6], "idle frames after a command run them no more: {per_frame:?}"); } + /// The frame that picks new units in the Units menu shows the Keyboard Increment in them: the Preferences + /// section's key reads the General unit after the pick runs, as its lengths do. + #[test] + fn the_frame_that_picks_units_shows_the_increment_in_them() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.run("file.new", json!({"width": 300, "height": 200})).unwrap(); + let initial = app.session.general_unit(); + let mut panel = Panel::new(app, document_sections); + panel.room(egui::vec2(400.0, 1000.0)); + panel.frame(); + let before = panel.value("Keyboard Increment"); + panel.click_role("Units", Role::COMBO_BOX); + panel.key(egui::Key::ArrowDown, egui::Modifiers::NONE); + panel.key(egui::Key::ArrowDown, egui::Modifiers::NONE); + let enter = + |pressed| egui::Event::Key { key: egui::Key::Enter, physical_key: None, pressed, repeat: false, modifiers: egui::Modifiers::NONE }; + panel.frame_with(vec![enter(true), enter(false)]); + assert_ne!(panel.app().session.general_unit(), initial, "Enter applies the chosen unit"); + let picked = panel.value("Keyboard Increment"); + panel.frame(); + let settled = panel.value("Keyboard Increment"); + assert_ne!(settled, before, "the increment shows in the new unit"); + assert_eq!(picked, settled, "the frame of the pick already shows the increment in the new unit"); + } + /// The memoized sections still take input: a click on Snap to Grid turns it on, once, and Scale Strokes & Effects /// sets its preference. #[test] From cb6703c0f106b60f5db565fdc1d89a1bff4f7b22 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 14:58:15 -0800 Subject: [PATCH 13/42] Menus: an interaction a dialog or the font menu begins reads the menus CI failed `the_font_menu_preview_reads_the_menus_when_it_ends`: with the state key holding the revision an interaction began from, the key no longer changed when the font menu's preview began, so the menus were not read then, though commands that check for an open interaction change state at that point and the menu stays open while it previews. The key now also holds whether an interaction that the active tool did not begin is open. A tool's drag still keeps the key as it begins; a dialog's, a panel's or the font menu's preview changes it as it begins and as it ends. `Interaction::by_tool` reads the flag for the UI crate. --- crates/engine/src/interaction.rs | 7 +++++++ crates/ui-egui/src/menus/model.rs | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/interaction.rs b/crates/engine/src/interaction.rs index bdc829fb37..387fc0e009 100644 --- a/crates/engine/src/interaction.rs +++ b/crates/engine/src/interaction.rs @@ -55,6 +55,13 @@ pub struct Interaction { pub keep_on_switch: bool, } +impl Interaction { + /// The active tool began it (a drag). + pub fn by_tool(&self) -> bool { + self.tool + } +} + /// An interaction that a command from outside the tool set aside while it runs /// ([`crate::Session::outside_interaction`]). #[derive(Debug)] diff --git a/crates/ui-egui/src/menus/model.rs b/crates/ui-egui/src/menus/model.rs index 92c1786af4..dc4357363b 100644 --- a/crates/ui-egui/src/menus/model.rs +++ b/crates/ui-egui/src/menus/model.rs @@ -90,7 +90,9 @@ pub(crate) fn translate_label(english: &'static str) -> String { /// doesn't list (panels shown, a tool picked). While an /// interaction is open (for example a move, scale or shape drag, a dialog's or the font menu's /// preview, or a typing session), the hash takes the revision the interaction began from in place of the current one, -/// which each of its previews changes: the hash stays the same as the interaction begins, and changes as it ends. +/// which each of its previews changes, and changes as it ends. The hash stays the same as a tool's drag begins. An +/// interaction that a dialog, a panel or the font menu begins changes the hash as it begins, since commands that check +/// for an open interaction change state then and the menus stay open while it previews. pub(crate) fn state_key(app: &VectorcraftApp, input: Option) -> u64 { let mut h = DefaultHasher::new(); input.hash(&mut h); @@ -102,7 +104,8 @@ pub(crate) fn state_key(app: &VectorcraftApp, input: Option) -> u64 { (s.journal.len(), s.active_index(), s.clipboard.is_empty(), s.tool_composing()).hash(&mut h); if let Some(d) = s.active() { let revision = d.interaction.as_ref().map_or(d.revision, |it| it.revision); - (d.uid, revision, d.history.undo.len(), d.history.redo.len(), d.transparency_grid, d.print_tiling).hash(&mut h); + let previewing = d.interaction.as_ref().is_some_and(|it| !it.by_tool()); + (d.uid, revision, previewing, d.history.undo.len(), d.history.redo.len(), d.transparency_grid, d.print_tiling).hash(&mut h); } (app.system_paste, app.last_effect.is_some(), app.ui.recent_files.len(), app.ui.recent_files.first(), app.recent_fonts().len()).hash(&mut h); // Apply Last Filter and Last Filter… are named after the filter that ran last. From 3aa41526e2009af448624f9c93cceb6a7a7fed59 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 15:02:34 -0800 Subject: [PATCH 14/42] Performance: the color check stops walking objects after a second color several_colors kept looking up the remaining ids, walking the remaining children of a group and the rest of a pattern tile after it had found two colors. It now stops as soon as the second color turns up. --- crates/engine/src/cmd/recolor.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/cmd/recolor.rs b/crates/engine/src/cmd/recolor.rs index 174f90ecb0..a0ba6d243c 100644 --- a/crates/engine/src/cmd/recolor.rs +++ b/crates/engine/src/cmd/recolor.rs @@ -1065,12 +1065,18 @@ fn several_colors(d: &Document, ids: &[NodeId], only: Option<&BTreeSet>) self.read(n); for c in n.children().into_iter().flatten() { self.read_tree(c, only); + if self.several { + return; + } } } } let mut seen = Seen { first: None, several: false, patterns: vec![] }; for n in ids.iter().filter_map(|id| d.node(*id)) { seen.read_tree(n, only); + if seen.several { + return true; + } } let mut next = 0; while !seen.several @@ -1078,11 +1084,13 @@ fn several_colors(d: &Document, ids: &[NodeId], only: Option<&BTreeSet>) { next += 1; for a in d.pattern(name).map(|def| def.art.as_slice()).unwrap_or_default() { - a.walk(&mut |m| { - if !seen.several { - seen.read(m); - } + let _ = a.try_walk(&mut |m| { + seen.read(m); + if seen.several { std::ops::ControlFlow::Break(()) } else { std::ops::ControlFlow::Continue(()) } }); + if seen.several { + break; + } } } seen.several From 9a588078419876ffa2ec576ecc13678718a74812 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 16:44:27 -0800 Subject: [PATCH 15/42] Performance: a move finds the selected objects' places in fewer walks of the tree With 10,000 objects selected, object.move walked the document's tree five times and looked each object up by id three times. It now walks the tree three times and looks each object up once. - The selected roots (for the menus, for Move, Rotate, Scale and the other transforms, for Copy and Cut, and inside an isolated group) are put in paint order and reduced to their top-level objects from one walk instead of two. - A transform finds the objects' places once for Transform Patterns and for the edit, instead of once for each. - After a transform, the check for a pixel-aligned compound path reads the parent at the object's place instead of looking the object and its parent up by id. --- crates/engine/src/cmd/edit.rs | 30 +++++++++++++++++++---- crates/engine/src/cmd/edit/tests.rs | 30 +++++++++++++++++++++++ crates/engine/src/cmd/object/pixelgrid.rs | 12 +++++++++ crates/engine/src/cmd/object/transform.rs | 18 +++++++++----- crates/engine/src/tests/large_edits.rs | 18 ++++++++++++++ 5 files changed, 97 insertions(+), 11 deletions(-) diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index 4fc1b83c29..70d7547313 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -967,7 +967,8 @@ pub(crate) fn selection_roots(st: &crate::DocState) -> Vec { } #[cfg(test)] ROOTS_FOUND.set(ROOTS_FOUND.get() + 1); - let roots = roots_of(&st.doc, st.selection.in_paint_order(&st.doc)); + let (ids, paths) = placed_in_paint_order(&st.doc, &st.selection.objects); + let roots = roots_placed(&st.doc, ids, &paths, |_, _| false); *kept = Some((Arc::downgrade(&st.doc), st.selection.objects.clone(), roots.clone())); roots }) @@ -1015,7 +1016,19 @@ pub(crate) fn no_symbol_part(s: &Session) -> std::result::Result<(), String> { pub(crate) fn selected_roots_to_transform(s: &Session) -> Result> { refuse_symbol_part(s)?; let st = s.doc()?; - Ok(roots_within(&st.doc, st.selection.in_paint_order(&st.doc), |_, _| true)) + let (ids, paths) = placed_in_paint_order(&st.doc, &st.selection.objects); + Ok(roots_placed(&st.doc, ids, &paths, |_, _| true)) +} + +/// The objects of `objects` that are in `doc`, in paint order as +/// [`vectorcraft_doc::Selection::in_paint_order`] gives them, with their places in the tree. One +/// walk finds the places for both the order and [`roots_placed`] ([`roots_within`] after +/// `in_paint_order` walks the tree twice). +fn placed_in_paint_order(doc: &Document, objects: &[NodeId]) -> (Vec, HashMap>) { + let paths = doc.index_paths(objects.iter().copied()); + let mut ids: Vec = objects.iter().copied().filter(|id| paths.contains_key(id)).collect(); + ids.sort_by(|a, b| paths.get(a).cmp(&paths.get(b))); + (ids, paths) } /// [`selected_roots`] for the selected objects inside the isolated object `root` @@ -1027,8 +1040,9 @@ pub(crate) fn selected_roots_to_transform(s: &Session) -> Result> { pub(crate) fn selected_roots_inside(s: &Session, root: NodeId, members: bool) -> Result> { refuse_symbol_part(s)?; let st = s.doc()?; - let ids = st.selection.in_paint_order(&st.doc).into_iter().filter(|id| super::inside_isolation(&st.doc, root, *id)).collect(); - Ok(roots_within(&st.doc, ids, |compound, _| members || compound == root)) + let (ids, paths) = placed_in_paint_order(&st.doc, &st.selection.objects); + let ids = ids.into_iter().filter(|id| super::inside_isolation(&st.doc, root, *id)).collect(); + Ok(roots_placed(&st.doc, ids, &paths, |compound, _| members || compound == root)) } /// The top-level objects among `ids` (in paint order): compound-path members stand for their @@ -1042,6 +1056,11 @@ pub(crate) fn roots_of(doc: &Document, ids: Vec) -> Vec { fn roots_within(doc: &Document, ids: Vec, keep_member: impl Fn(NodeId, NodeId) -> bool) -> Vec { // Every id's place in the tree, found in one walk (a lookup per id is a walk per id). let paths = doc.index_paths(ids.iter().copied()); + roots_placed(doc, ids, &paths, keep_member) +} + +/// [`roots_within`] with `paths`, the places of `ids` in `doc`'s tree, found already. +fn roots_placed(doc: &Document, ids: Vec, paths: &HashMap>, keep_member: impl Fn(NodeId, NodeId) -> bool) -> Vec { // A compound-path member acts as its compound (compounds are one object). let mut sel: Vec<(NodeId, Option>)> = ids .into_iter() @@ -1105,7 +1124,8 @@ fn copy_cut_targets(s: &Session) -> Result<(bool, Vec)> { st.doc.node(compound).and_then(|n| n.children()).is_some_and(|members| !members.is_empty() && members.iter().all(|m| whole(m))) }) }; - let roots = roots_within(&st.doc, st.selection.in_paint_order(&st.doc), |compound, _member| in_isolated_compound || !all_members_whole(compound)); + let (ids, paths) = placed_in_paint_order(&st.doc, &st.selection.objects); + let roots = roots_placed(&st.doc, ids, &paths, |compound, _member| in_isolated_compound || !all_members_whole(compound)); Ok((direct, roots)) } diff --git a/crates/engine/src/cmd/edit/tests.rs b/crates/engine/src/cmd/edit/tests.rs index 7ac2d9c162..7e0471f0f5 100644 --- a/crates/engine/src/cmd/edit/tests.rs +++ b/crates/engine/src/cmd/edit/tests.rs @@ -348,6 +348,36 @@ fn direct_selection_cut_timing() { } } +/// Finding the selected roots (for the menus, for Move and its siblings, for Copy and Cut, and +/// inside an isolated group) walks the tree once for the paint order and the roots together, in +/// paint order whatever order the objects were selected in. +#[test] +fn finding_the_selected_roots_walks_the_tree_once() { + let mut s = session(2_000, square); + let all = crate::tests_large_edits::layer(&s, 0); + let reversed: Vec = all.iter().rev().map(|id| id.0).collect(); + s.execute("select.set", &json!({"ids": reversed})).unwrap(); + type Find = fn(&Session) -> Vec; + let finds: [(&str, Find); 3] = [ + ("the selected roots", |s| selected_roots(s).unwrap()), + ("the roots to transform", |s| selected_roots_to_transform(s).unwrap()), + ("Copy's targets", |s| copy_cut_targets(s).unwrap().1), + ]; + for (what, find) in finds { + let walks = tree_walks(); + assert!(find(&s) == all, "{what} in paint order"); + assert_eq!(tree_walks() - walks, 1, "finding {what} walked the tree {} times", tree_walks() - walks); + } + s.execute("object.group", &json!({})).unwrap(); + let group = s.doc().unwrap().doc.layers[0].children().unwrap()[0].id; + s.execute("select.set", &json!({"ids": reversed})).unwrap(); + // The first call also builds the lookup cache that the isolation check reads. + assert!(selected_roots_inside(&s, group, false).unwrap() == all, "the roots inside the group in paint order"); + let walks = tree_walks(); + assert!(selected_roots_inside(&s, group, false).unwrap() == all); + assert_eq!(tree_walks() - walks, 1, "finding the roots inside the group walked the tree {} times", tree_walks() - walks); +} + /// The selected roots are found once for a document version and its selected objects, however many enabled checks /// read them, and found again after the selection changes, after an edit, and for another selection. #[test] diff --git a/crates/engine/src/cmd/object/pixelgrid.rs b/crates/engine/src/cmd/object/pixelgrid.rs index 81909da76f..220ed30099 100644 --- a/crates/engine/src/cmd/object/pixelgrid.rs +++ b/crates/engine/src/cmd/object/pixelgrid.rs @@ -142,6 +142,18 @@ pub(crate) fn keep_compound_aligned(d: &mut Document, id: NodeId, sc: Scaling) { } } +/// [`keep_compound_aligned`] for the object at `path` in `d`'s tree, found already: the compound +/// path is read at the parent's place, without looking either object up by id. +pub(crate) fn keep_compound_aligned_at(d: &mut Document, path: &[usize], sc: Scaling) { + let Some((_, up)) = path.split_last() else { return }; + if up.is_empty() || !d.node_at(up).is_some_and(|n| matches!(n.kind, NodeKind::Compound { .. }) && n.extras().pixel_aligned) { + return; + } + if let Some(n) = d.node_mut_at(up) { + snap_object(n, sc); + } +} + /// After any edit ([`Session::edit`]): snap each pixel-aligned object that the edit changed or added /// (its node in `doc` is not the one in `before`), with the pixel-aligned art of its linked opacity /// mask, to the pixel grid. Objects the edit did not touch are not visited. diff --git a/crates/engine/src/cmd/object/transform.rs b/crates/engine/src/cmd/object/transform.rs index 1a15e44aa3..3f471a00fe 100644 --- a/crates/engine/src/cmd/object/transform.rs +++ b/crates/engine/src/cmd/object/transform.rs @@ -66,10 +66,15 @@ pub(super) fn scaling_options(s: &Session, p: &Value) -> Scaling { /// param, else General › Transform Pattern Tiles)? Noted in the journal when they or the art of /// their linked opacity masks use a pattern, so a replay moves their tiles alike whatever the preference is then. pub(crate) fn transform_patterns(s: &mut Session, p: &Value, ids: &[NodeId]) -> Result { + let paths = s.doc()?.doc.index_paths(ids.iter().copied()); + transform_patterns_at(s, p, ids, &paths) +} + +/// [`transform_patterns`] with `paths`, the places of `ids` in the document's tree, found already. +fn transform_patterns_at(s: &mut Session, p: &Value, ids: &[NodeId], paths: &std::collections::HashMap>) -> Result { let on = bool_or(p, "patterns", s.prefs.transform_pattern_tiles); let d = &s.doc()?.doc; let mut uses = false; - let paths = d.index_paths(ids.iter().copied()); for n in ids.iter().filter_map(|id| paths.get(id)).filter_map(|p| d.node_at(p)) { uses |= uses_pattern_with_masks(n); } @@ -152,7 +157,9 @@ fn apply_transform_moving_guides( let areas = bool_or(p, "typeAreas", false); let objects = transforms_objects(p); let mut sc = if Scaling::factor(xf).is_some() { scaling(s, p) } else { Scaling::default() }; - sc.patterns = transform_patterns(s, p, &ids)?; + // The places of `ids`, found in one walk for Transform Patterns and for the edit below. + let paths = s.doc()?.doc.index_paths(ids.iter().copied()); + sc.patterns = transform_patterns_at(s, p, &ids, &paths)?; let c = xf.as_coeffs(); let is_translation = (c[0] - 1.0).abs() < 1e-9 && c[1].abs() < 1e-9 && c[2].abs() < 1e-9 && (c[3] - 1.0).abs() < 1e-9; let delta = guides.unwrap_or(Vec2::new(c[4], c[5])); @@ -174,8 +181,6 @@ fn apply_transform_moving_guides( // An edit normally preserves the tree positions already found here. Settling an active // typing session can change the document before the edit closure runs, so look up again then. let reindex = copy || (!s.previewing && crate::cmd::typing_in_progress(s)); - let d = &s.doc()?.doc; - let paths = d.index_paths(ids.iter().copied()); let none = paths.is_empty() && !has_guides; // A move of direct-selected anchors may re-map the handles beside them (`interpolate`). let mut interpolate = None; @@ -230,8 +235,9 @@ fn apply_transform_moving_guides( } } if objects { - for id in &targets { - super::pixelgrid::keep_compound_aligned(d, *id, sc); + // The transforms above leave every object at its place, so `paths` still holds them. + for p in targets.iter().filter_map(|id| paths.get(id)) { + super::pixelgrid::keep_compound_aligned_at(d, p, sc); } // Moving all of the tile art moves the tile as far. if let Some(before) = tile_art { diff --git a/crates/engine/src/tests/large_edits.rs b/crates/engine/src/tests/large_edits.rs index 0394fb18fa..2806cdd925 100644 --- a/crates/engine/src/tests/large_edits.rs +++ b/crates/engine/src/tests/large_edits.rs @@ -253,6 +253,24 @@ fn transform_each_with_copy_of_50000_objects_takes_few_tree_walks() { undo_gives_back(&mut s, &before); } +/// A move of 10,000 selected objects walks the tree once for the paint order and the top-level +/// objects, once for Transform Patterns and the edit, and once for the selection's check after the +/// edit. It reads each object's compound path at the object's place, so the only lookups by id are +/// the range check's, one per object. +#[test] +fn moving_10000_selected_objects_walks_the_tree_three_times() { + let n = 10_000; + let mut s = session(n, square); + let ids = layer(&s, 0); + let (walks, lookups) = (vectorcraft_doc::tree_walks(), vectorcraft_doc::path_lookups()); + s.execute("object.move", &json!({"dx": 3, "dy": 0})).unwrap(); + let (walks, lookups) = (vectorcraft_doc::tree_walks() - walks, vectorcraft_doc::path_lookups() - lookups); + assert_eq!(walks, 3, "walked the tree {walks} times"); + assert!(lookups <= n as u64, "{lookups} lookups by id for {n} objects"); + assert_eq!(bounds(&s, ids[n - 1]), square_at(n - 1) + vectorcraft_geom::Vec2::new(3.0, 0.0)); + assert!(selected(&s, &ids)); +} + #[test] fn offset_path_of_50000_objects_takes_few_tree_walks() { let s = session(50_000, square); From 42f973a5bc04d84293c9896edde56e70adc2920e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 16:50:38 -0800 Subject: [PATCH 16/42] xtask: the cache warm builds integration tests too `cargo xtask ci warm` built each test shard with `--lib --bins --no-run`, while the shards run `--lib --bins --tests`. The warm build left out the integration test executables the shards then build, and cargo warned `unused dependency vectorcraft-testkit` for apps/vectorcraft-cli, whose only use is in tests/it. The warm build now selects the same targets as the test shards, through one `TARGETS` list that both use. --- xtask/src/main.rs | 45 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 08a55df09a..5484c0d3e9 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -267,12 +267,14 @@ fn cmd_test() -> Result<(), String> { test_packages(&["--workspace".to_owned()], "--workspace", None) } +/// The test targets that [`test_packages`] runs and `ci warm` builds. +const TARGETS: [&str; 3] = ["--lib", "--bins", "--tests"]; + /// [`cmd_test`] for the packages `select` picks (`--workspace` or `-p` ids), shown as `shown`; /// with `part`, only that part's share of their tests (xtask/src/shards.rs), which needs nextest. /// A part runs its counted share, then its pinned tests, each with nextest's default thread count. /// Every run finishes before the first error is returned. fn test_packages(select: &[String], shown: &str, part: Option) -> Result<(), String> { - const TARGETS: [&str; 3] = ["--lib", "--bins", "--tests"]; if let Some(part) = part { if !has_nextest() { return Err(format!("cargo nextest run {shown}: a shard that runs part of a crate's tests needs cargo-nextest")); @@ -393,11 +395,13 @@ fn cmd_ci_shard() -> Result<(), String> { run_steps(&steps) } -/// `cargo xtask ci warm`: for each test shard, builds its crates' library and binary tests without -/// running them, then builds what the checks shard builds, so one dependency-cache entry holds the -/// dependencies of every shard with the features that shard builds them with (cargo resolves -/// features over the packages each command selects). The integration tests are left out: they -/// build no dependency that the library tests do not, since both take the crate's dev-dependencies. +/// `cargo xtask ci warm`: for each test shard, builds its crates' library, binary and integration +/// tests without running them, then builds what the checks shard builds, so one dependency-cache +/// entry holds the dependencies of every shard with the features that shard builds them with (cargo +/// resolves features over the packages each command selects). The test builds select the same +/// targets as the test shards ([`TARGETS`]), so the cache also holds the test executables the +/// shards run, and cargo does not warn (`cargo::unused_dependencies`) about a dev-dependency that +/// only an integration test uses. /// /// In a leg that saves the cache, every build records its units in `CRAFT_CACHE_UNITS` /// (xtask/src/cache_units.rs), xtask's own build included. @@ -414,9 +418,8 @@ fn cmd_ci_warm() -> Result<(), String> { steps.push(( "build tests", Box::new(move || { - let mut c = cargo(); - c.arg("test").args(shards::select(&crates)).args(["--lib", "--bins", "--no-run"]); - cache_units::run(c, &format!("cargo test --lib --bins --no-run ({})", shards::names(&crates))) + let (c, what) = warm_tests(&crates); + cache_units::run(c, &what) }), )); } @@ -447,6 +450,13 @@ fn cmd_ci_warm() -> Result<(), String> { run_steps(&steps) } +/// The command `ci warm` builds one test shard's tests with, and its description. +fn warm_tests(crates: &[shards::Member]) -> (Command, String) { + let mut c = cargo(); + c.arg("test").args(shards::select(crates)).args(TARGETS).arg("--no-run"); + (c, format!("cargo test {} --no-run ({})", TARGETS.join(" "), shards::names(crates))) +} + /// Runs `steps` in turn, stopping at the first that fails; the summary names the steps that passed /// and, after a failure, the one that failed and those skipped. fn run_steps(steps: &[Step]) -> Result<(), String> { @@ -588,3 +598,20 @@ fn i18n_report_packages(select: &[String], shown: &str) -> Result<(), String> { c.arg("test").args(select).args(["--lib", "--bins", "--tests", "--", "i18n::tests::untranslated_report", "--exact", "--nocapture"]); run(c, &format!("cargo test {shown} --lib --bins --tests -- i18n::tests::untranslated_report --exact --nocapture")) } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn warm_builds_the_test_targets_the_shards_run() { + let crates = [shards::Member { name: "a".into(), id: "path+file:///w/a#0.1.0".into(), version: "0.1.0".into(), doctests: true }]; + let (c, what) = warm_tests(&crates); + let args: Vec = c.get_args().map(|a| a.to_string_lossy().into_owned()).collect(); + assert_eq!(args, ["test", "-p", "path+file:///w/a#0.1.0", "--lib", "--bins", "--tests", "--no-run"]); + for target in TARGETS { + assert!(args.iter().any(|a| a == target), "ci warm does not build {target}"); + } + assert_eq!(what, "cargo test --lib --bins --tests --no-run (a)"); + } +} From dc597fbc13bc2bb07906187fe21b3e53956e8d76 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 16:55:30 -0800 Subject: [PATCH 17/42] Tests: the selection-move rebuild count holds the font and plug-in catalogs steady a_selection_move_rebuilds_the_menus_for_its_press_and_release_only counts the menus' rebuilds in each frame. A font or plug-in that a test running alongside adds, or the installed fonts' scan ending, also rebuilds the menus, and the exact count then failed. The test now holds the fonts and plug-ins steady for the whole run, and runs the move again on a new app, at most 20 times, until the script and proof-setup revisions held still through it. It asserts the same counts. --- crates/ui-egui/Cargo.toml | 1 + crates/ui-egui/src/canvas/tests.rs | 65 ++++++++++++++++++++---------- 2 files changed, 45 insertions(+), 21 deletions(-) diff --git a/crates/ui-egui/Cargo.toml b/crates/ui-egui/Cargo.toml index 95487e91c0..3e979ac08f 100644 --- a/crates/ui-egui/Cargo.toml +++ b/crates/ui-egui/Cargo.toml @@ -104,6 +104,7 @@ vectorcraft-testkit = { workspace = true } vectorcraft-tools = { workspace = true, features = ["testing"] } # A variable font built in code (no font file is committed). vectorcraft-text = { workspace = true, features = ["test-fonts"] } +vectorcraft-plugins = { workspace = true, features = ["test-steady"] } wat = { workspace = true } [build-dependencies] diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index 223dd83d0b..ab21113b8a 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -867,29 +867,52 @@ fn the_move_of_a_releasing_frame_counts_for_the_tool_drag() { /// A Selection tool move builds the menus' states again twice, in the frame of its press and in the frame of its /// release, which commits the move. The frame the move begins in and the frames of its previews, which change the -/// document's revision, keep them. +/// document's revision, keep them. The menus are also built again when a process-wide catalog changes, so the fonts +/// and plug-ins are held steady against tests running alongside for the whole run, and the move runs again on a new +/// app, at most 20 times, until the other catalogs held still through it. #[test] fn a_selection_move_rebuilds_the_menus_for_its_press_and_release_only() { - let (mut app, ctx, xf) = rectangle_tool(); - let id = app.session.execute("shape.rectangle", &json!({"x": 100, "y": 100, "width": 60, "height": 30})).unwrap()["id"].as_u64().unwrap(); - app.select_tool("selection"); - app.session.execute("select.set", &json!({"ids": [id]})).unwrap(); - let (from, to) = (xf.to_screen(Point::new(130.0, 115.0)), xf.to_screen(Point::new(170.0, 135.0))); - app_step(&mut app, &ctx, vec![egui::Event::PointerMoved(from)]); - for _ in 0..2 { - app_step(&mut app, &ctx, vec![]); - } - let none = egui::Modifiers::NONE; - let mut steps = vec![vec![primary(from, true, none)]]; - steps.extend((1..=8).map(|i| vec![egui::Event::PointerMoved(from.lerp(to, i as f32 / 8.0))])); - steps.push(vec![primary(to, false, none)]); - steps.extend([vec![], vec![], vec![]]); - let mut rebuilt = vec![]; - for events in steps { - let before = app.menus.rebuilds; - app_step(&mut app, &ctx, events); - rebuilt.push(app.menus.rebuilds - before); - } + let fonts = vectorcraft_text::FontDb::global(); + let _steady = (vectorcraft_text::test_fonts::steady_fonts(fonts), vectorcraft_plugins::steady::steady_plugins()); + let catalogs = || { + ( + crate::menus::plugin_revision(), + fonts.generation(), + fonts.installed_fonts_ready(), + crate::scripts_menu::revision(), + crate::dialogs::proof_setup::saved_revision(), + ) + }; + let run = || { + let (mut app, ctx, xf) = rectangle_tool(); + let id = app.session.execute("shape.rectangle", &json!({"x": 100, "y": 100, "width": 60, "height": 30})).unwrap()["id"].as_u64().unwrap(); + app.select_tool("selection"); + app.session.execute("select.set", &json!({"ids": [id]})).unwrap(); + let (from, to) = (xf.to_screen(Point::new(130.0, 115.0)), xf.to_screen(Point::new(170.0, 135.0))); + app_step(&mut app, &ctx, vec![egui::Event::PointerMoved(from)]); + for _ in 0..2 { + app_step(&mut app, &ctx, vec![]); + } + let none = egui::Modifiers::NONE; + let mut steps = vec![vec![primary(from, true, none)]]; + steps.extend((1..=8).map(|i| vec![egui::Event::PointerMoved(from.lerp(to, i as f32 / 8.0))])); + steps.push(vec![primary(to, false, none)]); + steps.extend([vec![], vec![], vec![]]); + let mut rebuilt = vec![]; + for events in steps { + let before = app.menus.rebuilds; + app_step(&mut app, &ctx, events); + rebuilt.push(app.menus.rebuilds - before); + } + (app, rebuilt) + }; + let (app, rebuilt) = (0..20) + .find_map(|_| { + let before = catalogs(); + let out = run(); + (catalogs() == before).then_some(out) + }) + .unwrap_or_else(|| panic!("tests running alongside kept changing the font and plug-in catalogs")); assert_eq!(drawn_paths(&app), vec![Rect::new(140.0, 120.0, 200.0, 150.0)], "the drag moves the rectangle"); assert_eq!(rebuilt, [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], "rebuilds in each frame: press, 8 moves, release, 3 idle"); } From 8e68c5edcf092ecd8993ea6aed7c630c2f921903 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 17:43:37 -0800 Subject: [PATCH 18/42] Shape Builder: Pick Color From defaults to Color Swatches While the Shape Builder is active, a fill picked from a swatch or a color changes only the current fill, and the selected art keeps its own. With Pick Color From set to Artwork, a merge takes the look of the art, so the picked color never reached the merged shape and the tool looked as if it could not fill. Pick Color From now defaults to Color Swatches: a merge fills with the picked color, and the Left and Right arrow keys step through the color swatches. A pickColorFrom saved with the preferences is kept, so a saved Artwork stays Artwork; preferences saved without one take Color Swatches. The shapeBuilder.merge command still defaults to artwork when its pickColorFrom is left out. Docs: docs/mcp.md and the tool options params text. --- crates/engine/src/tests/build.rs | 30 ++++++++++++++++++++++- crates/engine/src/tests/toolsettings.rs | 25 +++++++++++++++++++ crates/mcp/src/ui_catalog.rs | 2 +- crates/tools/src/builder.rs | 6 ++--- crates/ui-egui/src/dialogs/option_form.rs | 2 +- crates/ui-egui/src/menus/ui_commands.rs | 2 +- docs/mcp.md | 9 ++++--- 7 files changed, 65 insertions(+), 11 deletions(-) diff --git a/crates/engine/src/tests/build.rs b/crates/engine/src/tests/build.rs index 6ccdfad0a5..adb5d04af5 100644 --- a/crates/engine/src/tests/build.rs +++ b/crates/engine/src/tests/build.rs @@ -1753,7 +1753,8 @@ fn shape_builder_swatches_keep_the_current_fill_and_the_first_covered_objects_lo } /// The Shape Builder tool sends the point where the drag started first and the point where it -/// ended last, so a drag from the hole into the square takes the square's look. +/// ended last, so with Pick Color From Artwork a drag from the hole into the square takes the +/// square's look. #[test] fn shape_builder_tool_drag_from_the_hole_takes_the_look_where_it_ends() { let mut s = session(); @@ -1762,6 +1763,7 @@ fn shape_builder_tool_drag_from_the_hole_takes_the_look_where_it_ends() { select_ids(&mut s, &bars.iter().copied().chain([red]).collect::>()); let v = ViewInfo::default(); s.select_tool("shapeBuilder", v).unwrap(); + s.set_tool_option_cmd(&json!({"tool": "shapeBuilder", "values": {"pickColorFrom": "artwork"}})).unwrap(); s.pointer(&PointerEvent::new(PointerKind::Down, 50.0, 50.0), v).unwrap(); s.pointer(&PointerEvent::new(PointerKind::Drag, 85.0, 50.0), v).unwrap(); s.pointer(&PointerEvent::new(PointerKind::Drag, 120.0, 50.0), v).unwrap(); @@ -1853,6 +1855,7 @@ fn shape_builder_arrow_keys_step_the_current_fill_through_the_swatches() { let v = ViewInfo::default(); s.select_tool("shapeBuilder", v).unwrap(); let chips = |s: &mut Session| s.overlays(v).iter().filter(|o| matches!(o, vectorcraft_tools::Overlay::Swatch { .. })).count(); + s.set_tool_option_cmd(&json!({"tool": "shapeBuilder", "values": {"pickColorFrom": "artwork"}})).unwrap(); assert!(!s.tool_claims_key(ToolKey::Right, v), "Artwork leaves the arrows to nudging"); let values = json!({"pickColorFrom": "swatches", "cursorSwatchPreview": true}); s.set_tool_option_cmd(&json!({"tool": "shapeBuilder", "values": values})).unwrap(); @@ -2071,6 +2074,31 @@ fn shape_builder_fill_preview_is_put_back_by_a_cancel() { assert_eq!(s.paint.fill, before, "the cancel puts the fill back"); } +/// With the Shape Builder's default options, a fill picked while it is active (a swatch or a +/// color) fills the next merge: the tool sends `pickColorFrom: "swatches"`, and the merged shape +/// is not the red or blue of the art. +#[test] +fn shape_builder_default_merge_fills_with_the_picked_fill() { + let v = ViewInfo::default(); + for pick in [json!({"swatch": "Leaf"}), json!({"color": "#ff8800"})] { + let mut s = session(); + two(&mut s); + s.execute("swatch.new", &json!({"name": "Leaf", "color": "#00ff00"})).unwrap(); + s.select_tool("shapeBuilder", v).unwrap(); + s.execute("paint.setFill", &pick).unwrap(); + let picked = s.paint.fill.clone(); + s.pointer(&PointerEvent::new(PointerKind::Down, 25.0, 50.0), v).unwrap(); + s.pointer(&PointerEvent::new(PointerKind::Drag, 75.0, 50.0), v).unwrap(); + s.pointer(&PointerEvent::new(PointerKind::Drag, 125.0, 50.0), v).unwrap(); + s.pointer(&PointerEvent::new(PointerKind::Up, 125.0, 50.0), v).unwrap(); + let (cmd, params) = s.journal.last().unwrap().clone(); + assert_eq!((cmd.as_str(), ¶ms["pickColorFrom"]), ("shapeBuilder.merge", &json!("swatches")), "{pick}"); + let d = &s.doc().unwrap().doc; + let fills: Vec = d.children(d.default_layer()).into_iter().flatten().map(|n| n.appearance.fill_paint()).collect(); + assert_eq!(fills, vec![picked], "{pick}: the two squares merged into one shape with the picked fill"); + } +} + /// With Pick Color From Color Swatches, a merge fills with the fill chosen while the Shape Builder /// is active, and the Gradient panel's eyedropper samples into a stop of that fill's gradient. #[test] diff --git a/crates/engine/src/tests/toolsettings.rs b/crates/engine/src/tests/toolsettings.rs index 7a28a84ec7..76fda42a5b 100644 --- a/crates/engine/src/tests/toolsettings.rs +++ b/crates/engine/src/tests/toolsettings.rs @@ -698,3 +698,28 @@ fn a_parametric_shape_kind_and_its_values_set_together() { assert_eq!(s.tool_options_of("parametricShape")["kind"], json!("star"), "a refused call sets nothing"); } } + +/// The Shape Builder picks colors from the color swatches by default: a fresh session, and saved +/// preferences that hold other Shape Builder options but no `pickColorFrom`, give `swatches`. A +/// saved `artwork` (or `swatches`) is kept. +#[test] +fn shape_builder_pick_color_from_defaults_to_swatches_and_keeps_a_saved_choice() { + let mut s = session(); + select(&mut s, "shapeBuilder"); + assert_eq!(s.tool_options()["pickColorFrom"], json!("swatches"), "a fresh session"); + for (saved, want) in [ + (json!({"highlightFill": false}), "swatches"), + (json!({"pickColorFrom": "artwork"}), "artwork"), + (json!({"pickColorFrom": "swatches"}), "swatches"), + ] { + let mut prefs = s.prefs.clone(); + prefs.tool_settings.insert("shapeBuilder".into(), saved.as_object().unwrap().clone()); + let saved_text = serde_json::to_string(&prefs).unwrap(); + let mut next = session(); + next.apply_prefs(serde_json::from_str(&saved_text).unwrap()); + select(&mut next, "shapeBuilder"); + assert_eq!(next.tool_options()["pickColorFrom"], json!(want), "saved {saved}"); + select(&mut next, "selection"); + assert_eq!(next.prefs.tool_settings["shapeBuilder"]["pickColorFrom"], json!(want), "stored again: {saved}"); + } +} diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 9730bd7853..b6f0866d96 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1192,7 +1192,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "tool.options", "Tool Options…", "", - "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), curvatureCircle → Curvature Circle Tool Options (dialog `curvatureCircleOptions`, fields snapTolerance (screen points, 1–40; 5), snapWithoutGuides, annotateRadius, standardAnchors and constantRadius (all on); OK runs tool.setOption {tool: \"curvatureCircle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (artwork), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), fillArea → the same Shape Builder Tool Options (Fill Area uses their gapDetection, gapLength and openFilledAsClosed), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", + "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), curvatureCircle → Curvature Circle Tool Options (dialog `curvatureCircleOptions`, fields snapTolerance (screen points, 1–40; 5), snapWithoutGuides, annotateRadius, standardAnchors and constantRadius (all on); OK runs tool.setOption {tool: \"curvatureCircle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (swatches; a saved artwork is kept), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), fillArea → the same Shape Builder Tool Options (Fill Area uses their gapDetection, gapLength and openFilledAsClosed), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", ), ( "ui.colorGuideOptions", diff --git a/crates/tools/src/builder.rs b/crates/tools/src/builder.rs index cdc7f6f7dc..42886ec013 100644 --- a/crates/tools/src/builder.rs +++ b/crates/tools/src/builder.rs @@ -66,11 +66,11 @@ pub struct ShapeBuilderOptions { /// region as if an invisible edge closed it. When it is off, the path cuts the regions it crosses /// as a line does. pub open_filled_as_closed: bool, - /// Pick Color From Color Swatches (`pickColorFrom: "swatches"`; off: `"artwork"`): a merge + /// Pick Color From Color Swatches (`pickColorFrom: "swatches"`, on; off: `"artwork"`): a merge /// fills the new shape with the current fill, and the Left and Right arrow keys step the current /// fill through the document's color swatches. With Artwork, the shape takes the look of the /// object where the drag starts, else of the one where it ends, else of the front-most selected - /// object. + /// object. A saved `pickColorFrom` is kept; preferences without one take Color Swatches. pub swatches: bool, /// Cursor Swatch Preview (`cursorSwatchPreview`, off): with Color Swatches, the current fill /// and the swatches before and after it show as chips above the pointer while no drag is on. @@ -105,7 +105,7 @@ impl Default for ShapeBuilderOptions { fn default() -> Self { Self { open_filled_as_closed: true, - swatches: false, + swatches: true, cursor_swatch_preview: false, straight_line: false, highlight_fill: true, diff --git a/crates/ui-egui/src/dialogs/option_form.rs b/crates/ui-egui/src/dialogs/option_form.rs index fde3f40932..7b1bf40418 100644 --- a/crates/ui-egui/src/dialogs/option_form.rs +++ b/crates/ui-egui/src/dialogs/option_form.rs @@ -631,7 +631,7 @@ pub(super) mod tests { tool: "shapeBuilder", opens_on: vec![ ("openFilledAsClosed", json!(true)), - ("pickColorFrom", json!("artwork")), + ("pickColorFrom", json!("swatches")), ("cursorSwatchPreview", json!(false)), ("selection", json!("freeform")), ("highlightFill", json!(true)), diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index f5e6908a8a..e76772d154 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -1193,7 +1193,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "tool.options", "Tool Options…", "", - "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), curvatureCircle → Curvature Circle Tool Options (dialog `curvatureCircleOptions`, fields snapTolerance (screen points, 1–40; 5), snapWithoutGuides, annotateRadius, standardAnchors and constantRadius (all on); OK runs tool.setOption {tool: \"curvatureCircle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (artwork), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), fillArea → the same Shape Builder Tool Options (Fill Area uses their gapDetection, gapLength and openFilledAsClosed), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", + "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), curvatureCircle → Curvature Circle Tool Options (dialog `curvatureCircleOptions`, fields snapTolerance (screen points, 1–40; 5), snapWithoutGuides, annotateRadius, standardAnchors and constantRadius (all on); OK runs tool.setOption {tool: \"curvatureCircle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (swatches; a saved artwork is kept), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), fillArea → the same Shape Builder Tool Options (Fill Area uses their gapDetection, gapLength and openFilledAsClosed), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", ), ( "ui.colorGuideOptions", diff --git a/docs/mcp.md b/docs/mcp.md index a9e9d9649a..5ec8ceafd4 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -15725,10 +15725,11 @@ a flare into a plain group of its parts. The document saves a flare's settings. The Shape Builder tool's options are its Shape Builder Tool Options (dialog `shapeBuilderOptions`): `openFilledAsClosed` (on: a filled open path bounds a region as if an invisible edge closed it; a path counts as filled when any of its fill rows is shown, painted and above 0% opacity, whichever row is on top; off: it cuts regions -as an unfilled path does), `pickColorFrom` (`artwork`, the default: a merged shape takes the appearance, opacity and -blending mode of the front-most selected object under the drag's first point, else of the one under its last point, -else of the front-most selected object; `swatches`: the current fill, and the Left and Right arrow keys without -Shift, Alt or Cmd/Ctrl step the current fill through the document's color swatches), `cursorSwatchPreview` (off; with `swatches`, chips above the +as an unfilled path does), `pickColorFrom` (`swatches`, the default: a merged shape fills with the current fill, and +the Left and Right arrow keys without Shift, Alt or Cmd/Ctrl step the current fill through the document's color +swatches; `artwork`: a merged shape takes the appearance, opacity and blending mode of the front-most selected object +under the drag's first point, else of the one under its last point, else of the front-most selected object; a +`pickColorFrom` saved with the preferences is kept, and preferences saved without one take `swatches`), `cursorSwatchPreview` (off; with `swatches`, chips above the pointer show the current fill and the swatches before and after it), `selection` (`freeform`, the default, or `straightLine`: a drag touches what the line from its first point to the pointer crosses), `highlightFill` (on by default; when it is off, merge mode shades no regions), `gapDetection` (off) with `gapLength` (pt, 0 to 72; 3), `clickStrokeSplitsPath` (In Merge Mode, From 80b15ed8d15eaaad0156eed1fc7aba6956855197 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 19:46:29 -0800 Subject: [PATCH 19/42] Swatches: idle frames replay the swatch rows The panel's browser has a row menu, drop rules and a drag payload of its own, and without a version for what they read it ran its rows in every frame. The panel now passes SwatchesPanel::host_version with a version of the document, its revision, its File > Revert count and its newest undo and redo steps, which are what those closures read. The craft-libs pin moves to current main (891f4060c), which has SwatchesPanel::host_version (storytold/craft-libs#4320), with the winit revision that craft-libs revision uses (0dfcec0e). --- Cargo.lock | 211 ++++++++++---------- Cargo.toml | 76 +++---- apps/vectorcraft-web/Cargo.toml | 2 +- crates/ui-egui/src/panels/swatches.rs | 4 + crates/ui-egui/src/panels/swatches/dnd.rs | 10 + crates/ui-egui/src/panels/swatches/tests.rs | 33 +++ xtask/src/pdf_deps.rs | 2 +- 7 files changed, 191 insertions(+), 147 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3cb674e4ae..2a52380c8b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -626,12 +626,6 @@ dependencies = [ "cpufeatures 0.3.1", ] -[[package]] -name = "block" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" - [[package]] name = "block-buffer" version = "0.10.4" @@ -725,6 +719,17 @@ dependencies = [ "brotli-decompressor 5.0.3", ] +[[package]] +name = "brotli" +version = "9.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9071f285ed78f04f37d675abaaef5de7689e2f30a216c8dc6795465d81910a13" +dependencies = [ + "alloc-no-stdlib 3.0.0", + "alloc-stdlib 0.3.0", + "brotli-decompressor 6.3.2", +] + [[package]] name = "brotli-decompressor" version = "5.0.3" @@ -1184,19 +1189,6 @@ dependencies = [ "libc", ] -[[package]] -name = "core-graphics2" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b65858d95344d2711161cd92196732f67d6c5fea238cf12f994584828731a5c" -dependencies = [ - "bitflags 2.13.2", - "block", - "cfg-if", - "core-foundation 0.10.1", - "libc", -] - [[package]] name = "core_detect" version = "1.0.0" @@ -1239,7 +1231,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-automation", "craft-behavior", @@ -1280,7 +1272,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "crc32fast", "flate2", @@ -1291,18 +1283,19 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "block2 0.6.2", "objc2 0.6.5", "objc2-app-kit 0.3.2", + "objc2-core-graphics", "objc2-foundation 0.3.2", ] [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "rustix 1.1.6", ] @@ -1310,7 +1303,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1335,7 +1328,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1353,7 +1346,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-docpath", @@ -1371,7 +1364,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "crc32fast", "flate2", @@ -1380,7 +1373,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "egui", ] @@ -1388,7 +1381,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "md-5", "rayon", @@ -1397,12 +1390,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-cms", @@ -1422,7 +1415,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-control-protocol", "craft-platform", @@ -1433,7 +1426,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1443,7 +1436,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "rayon", ] @@ -1451,7 +1444,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1477,7 +1470,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "blake3", "craft-ecproj-format", @@ -1493,7 +1486,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "serde", ] @@ -1501,7 +1494,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1520,7 +1513,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-codepage", "encoding_rs", @@ -1532,7 +1525,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "serde", "serde_json", @@ -1542,12 +1535,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1562,7 +1555,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1581,7 +1574,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1590,7 +1583,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "cap-primitives", "craft-atomic", @@ -1613,12 +1606,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "gif", ] @@ -1626,7 +1619,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "flate2", ] @@ -1634,7 +1627,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1647,8 +1640,10 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ + "brotli 9.1.3", + "brotli-decompressor 6.3.2", "chrono", "fixed_decimal", "icu_calendar", @@ -1675,7 +1670,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-dds", "craft-jpeg", @@ -1702,7 +1697,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1720,7 +1715,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "thiserror 2.0.21", ] @@ -1728,7 +1723,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1739,7 +1734,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-host", "craft-i18n", @@ -1754,7 +1749,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-i18n", @@ -1768,7 +1763,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-host", @@ -1786,7 +1781,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1798,7 +1793,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "encoding_rs", "image", @@ -1809,7 +1804,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "chrono", "craft-codepage", @@ -1819,7 +1814,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-keymap", @@ -1835,7 +1830,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "flate2", "serde", @@ -1846,7 +1841,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1858,12 +1853,12 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "async-channel", "async-io", "async-process", - "core-graphics2", + "craft-appkit", "craft-atomic", "craft-docpath", "craft-host", @@ -1873,6 +1868,8 @@ dependencies = [ "js-sys", "log", "objc2-app-kit 0.3.2", + "objc2-core-foundation", + "objc2-core-graphics", "rfd", "serde", "serde_json", @@ -1889,7 +1886,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1898,7 +1895,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-host", @@ -1922,7 +1919,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1933,7 +1930,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-eps", "flate2", @@ -1947,7 +1944,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "encoding_rs", "flate2", @@ -1958,7 +1955,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "dispatch2", "egui", @@ -1971,7 +1968,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1990,7 +1987,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-atomic", "craft-host", @@ -2007,7 +2004,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "fax", "hayro-ccitt", @@ -2018,7 +2015,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2039,7 +2036,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-keymap", @@ -2051,7 +2048,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2076,7 +2073,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2091,7 +2088,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-atomic", "craft-behavior", @@ -2106,7 +2103,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "serde", "thiserror 2.0.21", @@ -2116,7 +2113,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "serde", "thiserror 2.0.21", @@ -2125,7 +2122,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-keymap", @@ -2140,12 +2137,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2159,7 +2156,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-i18n", @@ -2175,7 +2172,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "accesskit", "craft-behavior", @@ -2213,7 +2210,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2224,7 +2221,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-host", @@ -2242,7 +2239,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-host", @@ -2263,7 +2260,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-host", @@ -2284,7 +2281,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-behavior", "craft-host", @@ -2303,7 +2300,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "base64 0.22.1", "chrono", @@ -2335,7 +2332,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "flate2", "serde", @@ -2346,7 +2343,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2356,7 +2353,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "js-sys", "serde_json", @@ -2367,7 +2364,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "winsafe", ] @@ -2375,7 +2372,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "craft-appkit", "craft-atomic", @@ -2407,7 +2404,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3762,16 +3759,16 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ - "brotli", + "brotli 8.0.4", "hayro-postscript", ] [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3789,7 +3786,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3807,12 +3804,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "flate2", "hayro-ccitt", @@ -4795,7 +4792,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4952,7 +4949,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" dependencies = [ "arrayvec", "kurbo 0.13.1", @@ -10067,7 +10064,7 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winit" version = "0.30.13" -source = "git+https://github.com/storytold/winit.git?rev=a517b3846ee8457d84ee4975110bfda6797c44dc#a517b3846ee8457d84ee4975110bfda6797c44dc" +source = "git+https://github.com/storytold/winit.git?rev=0dfcec0eb62fda5904137a63a6dd0c3d83295f45#0dfcec0eb62fda5904137a63a6dd0c3d83295f45" dependencies = [ "ahash", "android-activity", diff --git a/Cargo.toml b/Cargo.toml index 7ad3e4cfeb..0c7e739fb5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,49 +10,49 @@ license = "MIT OR Apache-2.0" rust-version = "1.95" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # Language packs: the Craft apps' shared font store installs them (#4936). -craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON. -craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names # the members it imports. -craft = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui # without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes. -craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -192,13 +192,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } emath = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } epaint = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } @@ -210,4 +210,4 @@ egui_glow = { git = "https://github.com/storytold/egui.git", rev = "14c39fed1817 egui_extras = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } eframe = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } -winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" } +winit = { git = "https://github.com/storytold/winit.git", rev = "0dfcec0eb62fda5904137a63a6dd0c3d83295f45" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index ce4d1d3d44..0e50690b98 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -28,7 +28,7 @@ egui_extras = { workspace = true } # `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback. eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] } # The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft. -craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/crates/ui-egui/src/panels/swatches.rs b/crates/ui-egui/src/panels/swatches.rs index 515456cad8..ca2b52c605 100644 --- a/crates/ui-egui/src/panels/swatches.rs +++ b/crates/ui-egui/src/panels/swatches.rs @@ -421,6 +421,9 @@ fn body(app: &mut VectorcraftApp, ui: &mut Ui) { let lit: Vec = highlighted(&st.doc, &base).into_iter().map(str::to_string).collect(); let doc = Arc::clone(&st.doc); let start = dnd::DragStart::of(st); + // The row menu, the drop rules and the drag payload read the document, its reverts and the drag start alone, so + // the browser's rows replay while this version holds. + let host = start.version(st.revision); let document = st.uid; let reverts = st.reverts; let foot = Footer::of(app, &model, held); @@ -448,6 +451,7 @@ fn body(app: &mut VectorcraftApp, ui: &mut Ui) { .row_items(|key| row_items(shown_app, key)) .takes_drop::(DropPlace::Between, |drag, _| dnd::accepts(drag, document, reverts)) .takes_drop::(DropPlace::Onto, |drag, _| dnd::accepts(drag, document, reverts)) + .host_version(host) .select(SelectMode::Multi) .search(search) .reveal(focus.clone().map(SwatchKey::Swatch)) diff --git a/crates/ui-egui/src/panels/swatches/dnd.rs b/crates/ui-egui/src/panels/swatches/dnd.rs index df967e9700..4b68266bf1 100644 --- a/crates/ui-egui/src/panels/swatches/dnd.rs +++ b/crates/ui-egui/src/panels/swatches/dnd.rs @@ -1,3 +1,4 @@ +use std::hash::{DefaultHasher, Hash, Hasher}; use std::sync::{Arc, Weak}; use super::{Document, Paint, PanelDrag, REGISTRATION, Swatch, Value, VectorcraftApp, json, name_of, swatch_params}; @@ -126,6 +127,15 @@ impl DragStart { DragStart { uid: st.uid, reverts: st.reverts, doc: Arc::clone(&st.doc), steps: steps(st), back } } + /// A version of this start in the document's `revision` ([`DocState::revision`]): it changes with + /// the document, its count of File › Revert and its newest undo and redo steps, which are what the + /// panel's row menu, drop rules and drag payload read. + pub(super) fn version(&self, revision: u64) -> u64 { + let mut h = DefaultHasher::new(); + (self.uid, self.reverts, revision, self.steps).hash(&mut h); + h.finish() + } + /// Rows `names` as this document holds them. fn rows(&self, names: &[String]) -> HeldRows { let rows: Vec<_> = names.iter().map(|n| (n.clone(), HeldRow::of(&self.doc, n))).collect(); diff --git a/crates/ui-egui/src/panels/swatches/tests.rs b/crates/ui-egui/src/panels/swatches/tests.rs index f20c725ac0..df72fa25e1 100644 --- a/crates/ui-egui/src/panels/swatches/tests.rs +++ b/crates/ui-egui/src/panels/swatches/tests.rs @@ -1623,3 +1623,36 @@ fn the_swatch_libraries_menu_fits_its_rows_like_a_library_panels_menu() { let panel_menu = panel.rect_role("Swatch Libraries Menu", Role::MENU); assert_eq!(footer_menu.width(), panel_menu.width(), "footer menu {footer_menu:?}, library panel menu {panel_menu:?}"); } + +/// Frames that change nothing replay the swatch rows instead of running them again; deleting a swatch and undoing it +/// each run them, the rows show the change, and the frames after replay them again. +#[test] +fn idle_frames_replay_the_swatch_rows() { + use crate::tests::panel_harness::Panel; + use craft::ui::testing::{MemoRun, last_frame_memo_runs}; + let runs = |panel: &Panel| { + last_frame_memo_runs(panel.ctx()).iter().filter(|(name, _, run)| name.contains("ListProps") && *run == MemoRun::Ran).count() + }; + let idle = |panel: &mut Panel, after: &str| { + panel.frame(); + panel.frame(); + for _ in 0..5 { + panel.frame(); + assert_eq!(runs(panel), 0, "an idle frame {after} replays the swatch rows"); + } + }; + let red = "Red, #ed1c24"; + let mut panel = Panel::new(app(), show); + idle(&mut panel, "of a new document"); + assert!(panel.shows(red), "the rows show Red"); + panel.app().run("swatch.delete", json!({"names": ["Red"]})).unwrap(); + panel.frame(); + assert!(runs(&panel) > 0, "deleting a swatch runs the rows"); + assert!(!panel.shows(red), "and they no longer show it"); + idle(&mut panel, "after a delete"); + panel.app().run("edit.undo", json!({})).unwrap(); + panel.frame(); + assert!(runs(&panel) > 0, "an undo runs the rows"); + assert!(panel.shows(red), "and they show the swatch again"); + idle(&mut panel, "after an undo"); +} diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index f4f02f8627..4d937f436f 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "186a229c8da8db5916f8a863dfd894f1879af735"; +const REV: &str = "891f4060c4aefe2679a65afc9e76bb5ce345de31"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV), From 2be42e79864534c8ac43d52e1adaee13f5b17c17 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 19:52:59 -0800 Subject: [PATCH 20/42] Shape Builder: saved Artwork from earlier versions switches to Color Swatches once Leaving the Shape Builder saved every one of its options, so preferences from earlier versions hold pickColorFrom "artwork" whether or not it was picked, and kept the old default after Color Swatches became the default. The preferences now carry toolSettingsVersion, written as 1 once a tool setting is stored. Applying preferences without it changes a saved Shape Builder pickColorFrom "artwork" to "swatches" and writes the version, so Artwork picked after that is kept at the next launch. A saved "swatches" and preferences without a saved pickColorFrom are unchanged. Docs: docs/mcp.md and the tool options params text. --- crates/engine/src/cmd/prefscmds.rs | 2 + crates/engine/src/prefs.rs | 36 ++++++++++++++++ crates/engine/src/tests/toolsettings.rs | 55 ++++++++++++++++++------- crates/engine/src/tooling.rs | 1 + crates/mcp/src/ui_catalog.rs | 2 +- crates/tools/src/builder.rs | 3 +- crates/ui-egui/src/menus/ui_commands.rs | 2 +- docs/mcp.md | 3 +- 8 files changed, 86 insertions(+), 18 deletions(-) diff --git a/crates/engine/src/cmd/prefscmds.rs b/crates/engine/src/cmd/prefscmds.rs index 27d38e158f..8420e67d30 100644 --- a/crates/engine/src/cmd/prefscmds.rs +++ b/crates/engine/src/cmd/prefscmds.rs @@ -725,6 +725,8 @@ impl Session { for e in self.prefs.keep_folders(&mut p) { log::warn!("{e}"); } + // Tool settings saved by an earlier version are updated once. + p.migrate_tool_settings(); // Saved gradient presets get names no built-in preset or other saved one has. for (old, new) in super::gradpresets::rename_clashing_presets(&mut p.gradient_presets) { log::warn!("saved gradient preset {old} is listed as {new}: another preset has its name"); diff --git a/crates/engine/src/prefs.rs b/crates/engine/src/prefs.rs index 1a7b78a91b..3c2f3e3299 100644 --- a/crates/engine/src/prefs.rs +++ b/crates/engine/src/prefs.rs @@ -438,6 +438,12 @@ pub struct Prefs { /// resetting the preferences keeps them; `tool.setOption` edits them. #[serde(skip_serializing_if = "std::collections::BTreeMap::is_empty")] pub tool_settings: std::collections::BTreeMap>, + /// The version of [`Self::tool_settings`]: [`TOOL_SETTINGS_VERSION`] once this version stores + /// or updates a tool setting, 0 while none is stored and in preferences saved without one. + /// [`Prefs::migrate_tool_settings`] updates older tool settings once. Not a Preferences dialog + /// field: resetting the preferences keeps it. + #[serde(default, skip_serializing_if = "is_zero")] + pub tool_settings_version: u32, /// View → Perspective Grid presets: the user's (the built-in ones aren't stored). A local /// library, not a Preferences dialog field: resetting the preferences keeps it; /// `perspective.presets.*` edit it. @@ -464,7 +470,36 @@ pub const KEY_HOLD_DELAY: f64 = 0.35; /// The range of the Hold Shortcut Delay, in seconds. pub const KEY_HOLD_DELAY_RANGE: (f64, f64) = (0.2, 1.0); +/// The version of the tool settings these preferences write ([`Prefs::tool_settings_version`]). +/// Version 1 makes Color Swatches the Shape Builder's Pick Color From. +pub const TOOL_SETTINGS_VERSION: u32 = 1; + +fn is_zero(v: &u32) -> bool { + *v == 0 +} + impl Prefs { + /// Update tool settings saved by an earlier version to [`TOOL_SETTINGS_VERSION`], once. Before + /// version 1, leaving the Shape Builder saved its `pickColorFrom` whether or not it was + /// changed, so a saved `artwork` becomes `swatches`. Without tool settings, nothing changes; a + /// version newer than this one is kept. + pub fn migrate_tool_settings(&mut self) { + if self.tool_settings_version < 1 + && let Some(saved) = self.tool_settings.get_mut("shapeBuilder") + && saved.get("pickColorFrom").and_then(Value::as_str) == Some("artwork") + { + saved.insert("pickColorFrom".into(), Value::from("swatches")); + } + self.mark_tool_settings_current(); + } + + /// Record that [`Self::tool_settings`], when any is stored, is in this version's form. + pub(crate) fn mark_tool_settings_current(&mut self) { + if !self.tool_settings.is_empty() { + self.tool_settings_version = self.tool_settings_version.max(TOOL_SETTINGS_VERSION); + } + } + /// The `document.open` / place params `p` with `embeddedFonts: false` added when Preferences /// › File Handling › Use fonts embedded in imported PDFs is off and `p` gives no choice of its own. pub fn with_pdf_font_choice(&self, p: &serde_json::Value) -> serde_json::Value { @@ -672,6 +707,7 @@ impl Default for Prefs { use_registration_point_for_symbol: false, show_on_shape_creation: false, tool_settings: Default::default(), + tool_settings_version: 0, perspective_presets: vec![], blend_options: None, perspective_widget: Default::default(), diff --git a/crates/engine/src/tests/toolsettings.rs b/crates/engine/src/tests/toolsettings.rs index 76fda42a5b..db1fc01a30 100644 --- a/crates/engine/src/tests/toolsettings.rs +++ b/crates/engine/src/tests/toolsettings.rs @@ -700,26 +700,53 @@ fn a_parametric_shape_kind_and_its_values_set_together() { } /// The Shape Builder picks colors from the color swatches by default: a fresh session, and saved -/// preferences that hold other Shape Builder options but no `pickColorFrom`, give `swatches`. A -/// saved `artwork` (or `swatches`) is kept. +/// preferences that hold other Shape Builder options but no `pickColorFrom`, give `swatches`. +/// Preferences saved without `toolSettingsVersion` read a saved `artwork` as `swatches` once and +/// are then written with the version, so a later `artwork` is kept. A saved `swatches` is kept. #[test] -fn shape_builder_pick_color_from_defaults_to_swatches_and_keeps_a_saved_choice() { +fn shape_builder_pick_color_from_defaults_to_swatches_and_migrates_a_saved_artwork_once() { let mut s = session(); select(&mut s, "shapeBuilder"); assert_eq!(s.tool_options()["pickColorFrom"], json!("swatches"), "a fresh session"); - for (saved, want) in [ - (json!({"highlightFill": false}), "swatches"), - (json!({"pickColorFrom": "artwork"}), "artwork"), - (json!({"pickColorFrom": "swatches"}), "swatches"), - ] { - let mut prefs = s.prefs.clone(); - prefs.tool_settings.insert("shapeBuilder".into(), saved.as_object().unwrap().clone()); - let saved_text = serde_json::to_string(&prefs).unwrap(); + select(&mut s, "selection"); + assert_eq!(s.prefs.to_json()["toolSettingsVersion"], json!(1), "stored settings are written with the version"); + let load = |version: Option, saved: &Value| { + let mut prefs = Prefs::default().to_json(); + prefs["toolSettings"] = json!({ "shapeBuilder": saved }); + let fields = prefs.as_object_mut().unwrap(); + match version { + Some(v) => fields.insert("toolSettingsVersion".into(), json!(v)), + None => fields.remove("toolSettingsVersion"), + }; let mut next = session(); - next.apply_prefs(serde_json::from_str(&saved_text).unwrap()); + next.apply_prefs(serde_json::from_str(&prefs.to_string()).unwrap()); + next + }; + for (version, saved, want) in [ + (None, json!({"highlightFill": false}), "swatches"), + (None, json!({"pickColorFrom": "artwork"}), "swatches"), + (None, json!({"pickColorFrom": "swatches"}), "swatches"), + (Some(1), json!({"pickColorFrom": "artwork"}), "artwork"), + (Some(1), json!({"pickColorFrom": "swatches"}), "swatches"), + (Some(1), json!({"highlightFill": false}), "swatches"), + ] { + let mut next = load(version, &saved); + assert_eq!(next.prefs.tool_settings_version, 1, "the version is written: {version:?} {saved}"); select(&mut next, "shapeBuilder"); - assert_eq!(next.tool_options()["pickColorFrom"], json!(want), "saved {saved}"); + assert_eq!(next.tool_options()["pickColorFrom"], json!(want), "saved {version:?} {saved}"); select(&mut next, "selection"); - assert_eq!(next.prefs.tool_settings["shapeBuilder"]["pickColorFrom"], json!(want), "stored again: {saved}"); + assert_eq!(next.prefs.tool_settings["shapeBuilder"]["pickColorFrom"], json!(want), "stored again: {version:?} {saved}"); + } + // Artwork picked after the update, or in a session that started without saved settings, is + // kept at the next launch. + for mut next in [load(None, &json!({"pickColorFrom": "artwork"})), session()] { + select(&mut next, "shapeBuilder"); + next.set_tool_option("pickColorFrom", &json!("artwork")); + select(&mut next, "selection"); + let saved_text = serde_json::to_string(&next.prefs).unwrap(); + let mut later = session(); + later.apply_prefs(serde_json::from_str(&saved_text).unwrap()); + select(&mut later, "shapeBuilder"); + assert_eq!(later.tool_options()["pickColorFrom"], json!("artwork"), "picked after the update: {saved_text}"); } } diff --git a/crates/engine/src/tooling.rs b/crates/engine/src/tooling.rs index 422caab5ec..94f72f6441 100644 --- a/crates/engine/src/tooling.rs +++ b/crates/engine/src/tooling.rs @@ -581,6 +581,7 @@ impl Session { } } } + prefs.mark_tool_settings_current(); } /// Keep the active tool's persistent options for the next time it, or a tool sharing them, is diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index b6f0866d96..e933df1e5f 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1192,7 +1192,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "tool.options", "Tool Options…", "", - "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), curvatureCircle → Curvature Circle Tool Options (dialog `curvatureCircleOptions`, fields snapTolerance (screen points, 1–40; 5), snapWithoutGuides, annotateRadius, standardAnchors and constantRadius (all on); OK runs tool.setOption {tool: \"curvatureCircle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (swatches; a saved artwork is kept), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), fillArea → the same Shape Builder Tool Options (Fill Area uses their gapDetection, gapLength and openFilledAsClosed), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", + "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), curvatureCircle → Curvature Circle Tool Options (dialog `curvatureCircleOptions`, fields snapTolerance (screen points, 1–40; 5), snapWithoutGuides, annotateRadius, standardAnchors and constantRadius (all on); OK runs tool.setOption {tool: \"curvatureCircle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (swatches; a saved artwork is kept, except that preferences saved by an earlier version read it as swatches once), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), fillArea → the same Shape Builder Tool Options (Fill Area uses their gapDetection, gapLength and openFilledAsClosed), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", ), ( "ui.colorGuideOptions", diff --git a/crates/tools/src/builder.rs b/crates/tools/src/builder.rs index 42886ec013..7451fd0226 100644 --- a/crates/tools/src/builder.rs +++ b/crates/tools/src/builder.rs @@ -70,7 +70,8 @@ pub struct ShapeBuilderOptions { /// fills the new shape with the current fill, and the Left and Right arrow keys step the current /// fill through the document's color swatches. With Artwork, the shape takes the look of the /// object where the drag starts, else of the one where it ends, else of the front-most selected - /// object. A saved `pickColorFrom` is kept; preferences without one take Color Swatches. + /// object. A saved `pickColorFrom` is kept, except that preferences saved by an earlier version + /// read a saved Artwork as Color Swatches once; preferences without one take Color Swatches. pub swatches: bool, /// Cursor Swatch Preview (`cursorSwatchPreview`, off): with Color Swatches, the current fill /// and the swatches before and after it show as chips above the pointer while no drag is on. diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index e76772d154..a4620e2a5b 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -1193,7 +1193,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "tool.options", "Tool Options…", "", - "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), curvatureCircle → Curvature Circle Tool Options (dialog `curvatureCircleOptions`, fields snapTolerance (screen points, 1–40; 5), snapWithoutGuides, annotateRadius, standardAnchors and constantRadius (all on); OK runs tool.setOption {tool: \"curvatureCircle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (swatches; a saved artwork is kept), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), fillArea → the same Shape Builder Tool Options (Fill Area uses their gapDetection, gapLength and openFilledAsClosed), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", + "{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), curvatureCircle → Curvature Circle Tool Options (dialog `curvatureCircleOptions`, fields snapTolerance (screen points, 1–40; 5), snapWithoutGuides, annotateRadius, standardAnchors and constantRadius (all on); OK runs tool.setOption {tool: \"curvatureCircle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's Tool Options (dialog `liquifyOptions`, fields tool, width, height, angle, intensity %, usePressure, detail, simplify, simplifyOn, rate, complexity, horizontal %, vertical %, affectAnchors, affectIn, affectOut, showBrush; OK runs tool.setOption {tool, values}), pencil|paintbrush|smooth|blobBrush|eraser → that tool's Tool Options (dialog `freehandOptions`, fields tool and the options the tool keeps: fidelity (px for pencil, paintbrush and smooth, the same at any zoom; pt for blobBrush), fill, keepSelected (on for pencil and paintbrush, off for blobBrush), mergeOnlySelection (off), closeWithin and editWithin (px, 0 is off), livePreview (pencil, on: off draws a thin line while the stroke is drawn, and the path's fill and stroke on release), size (pt), angle (°, −180–180; 0) and roundness (%, 1–100; 100) of the eraser's tip; OK runs tool.setOption {tool, values}), livePaintSelection → Live Paint Selection Tool Options (dialog `livePaintSelectionOptions`, fields selectFills and selectStrokes (both on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the highlight's width, 1–20 px; 4); OK runs tool.setOption {tool: \"livePaintSelection\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), livePaintBucket → Live Paint Bucket Options (dialog `livePaintBucketOptions`, fields paintFills (on) and paintStrokes (off), cursorSwatchPreview (on: the active fill or stroke shows above the pointer between the color swatches before and after it; Left and Right without modifiers step it through the color swatches whether it is on or off), highlight (on), color (the highlight color, #rrggbb or a layer color's name; #ff2a2a), width (the face highlight's width, 1–20 px; 4; an edge's highlight is half as wide); OK runs tool.setOption {tool: \"livePaintBucket\", values}; a color with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), shapeBuilder → Shape Builder Tool Options (dialog `shapeBuilderOptions`, fields gapDetection (off), gapLength (pt, 0–72; 3), openFilledAsClosed (on), clickStrokeSplitsPath (off), pickColorFrom: artwork|swatches (swatches; a saved artwork is kept, except that preferences saved by an earlier version read it as swatches once), cursorSwatchPreview (off), selection: freeform|straightLine (freeform), highlightFill (on), highlightStroke (on), highlightColor (#rrggbb or a layer color's name; #ff4f4f); OK runs tool.setOption {tool: \"shapeBuilder\", values}; a highlightColor with an alpha part (#rrggbbaa or #rgba) is an error and OK changes nothing), fillArea → the same Shape Builder Tool Options (Fill Area uses their gapDetection, gapLength and openFilledAsClosed), objectsOnPath → Objects on Path Tool Options (dialog `objectsOnPathOptions`, fields pivot (0–8, row by row from the top left; 4, the center) and rotate (°, −360–360; 0); Reset puts 4 and 0 back; Save runs tool.setOption {tool: \"objectsOnPath\", values}: the objects attached next use them, groups attached before keep theirs)", ), ( "ui.colorGuideOptions", diff --git a/docs/mcp.md b/docs/mcp.md index 5ec8ceafd4..d2c7096762 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -15729,7 +15729,8 @@ as an unfilled path does), `pickColorFrom` (`swatches`, the default: a merged sh the Left and Right arrow keys without Shift, Alt or Cmd/Ctrl step the current fill through the document's color swatches; `artwork`: a merged shape takes the appearance, opacity and blending mode of the front-most selected object under the drag's first point, else of the one under its last point, else of the front-most selected object; a -`pickColorFrom` saved with the preferences is kept, and preferences saved without one take `swatches`), `cursorSwatchPreview` (off; with `swatches`, chips above the +`pickColorFrom` saved with the preferences is kept, except that preferences saved by an earlier version, without +`toolSettingsVersion`, read a saved `artwork` as `swatches` once; preferences saved without one take `swatches`), `cursorSwatchPreview` (off; with `swatches`, chips above the pointer show the current fill and the swatches before and after it), `selection` (`freeform`, the default, or `straightLine`: a drag touches what the line from its first point to the pointer crosses), `highlightFill` (on by default; when it is off, merge mode shades no regions), `gapDetection` (off) with `gapLength` (pt, 0 to 72; 3), `clickStrokeSplitsPath` (In Merge Mode, From 932d579a02a751d2ab35a7023ce85e31d7627d09 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 20:08:36 -0800 Subject: [PATCH 21/42] Swatches: rustfmt the idle replay test --- crates/ui-egui/src/panels/swatches/tests.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/panels/swatches/tests.rs b/crates/ui-egui/src/panels/swatches/tests.rs index df72fa25e1..7e17c305a5 100644 --- a/crates/ui-egui/src/panels/swatches/tests.rs +++ b/crates/ui-egui/src/panels/swatches/tests.rs @@ -1630,9 +1630,8 @@ fn the_swatch_libraries_menu_fits_its_rows_like_a_library_panels_menu() { fn idle_frames_replay_the_swatch_rows() { use crate::tests::panel_harness::Panel; use craft::ui::testing::{MemoRun, last_frame_memo_runs}; - let runs = |panel: &Panel| { - last_frame_memo_runs(panel.ctx()).iter().filter(|(name, _, run)| name.contains("ListProps") && *run == MemoRun::Ran).count() - }; + let runs = + |panel: &Panel| last_frame_memo_runs(panel.ctx()).iter().filter(|(name, _, run)| name.contains("ListProps") && *run == MemoRun::Ran).count(); let idle = |panel: &mut Panel, after: &str| { panel.frame(); panel.frame(); From 72825d55a6f5cc1a962d469b1ea1b1793fb7524e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 20:10:22 -0800 Subject: [PATCH 22/42] Dependencies: craft-libs pin to 6a4729d5, current main --- Cargo.lock | 172 ++++++++++++++++---------------- Cargo.toml | 76 +++++++------- apps/vectorcraft-web/Cargo.toml | 2 +- xtask/src/pdf_deps.rs | 2 +- 4 files changed, 126 insertions(+), 126 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 318a40b796..02efc93f98 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1231,7 +1231,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-automation", "craft-behavior", @@ -1272,7 +1272,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "crc32fast", "flate2", @@ -1283,7 +1283,7 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "block2 0.6.2", "objc2 0.6.5", @@ -1295,7 +1295,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "rustix 1.1.6", ] @@ -1303,7 +1303,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1328,7 +1328,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1346,7 +1346,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-docpath", @@ -1364,7 +1364,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "crc32fast", "flate2", @@ -1373,7 +1373,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "egui", ] @@ -1381,7 +1381,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "md-5", "rayon", @@ -1390,12 +1390,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-cms", @@ -1415,7 +1415,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-control-protocol", "craft-platform", @@ -1426,7 +1426,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1436,7 +1436,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "rayon", ] @@ -1444,7 +1444,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1470,7 +1470,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "blake3", "craft-ecproj-format", @@ -1486,7 +1486,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "serde", ] @@ -1494,7 +1494,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1513,7 +1513,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-codepage", "encoding_rs", @@ -1525,7 +1525,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "serde", "serde_json", @@ -1535,12 +1535,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1555,7 +1555,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1574,7 +1574,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1583,7 +1583,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "cap-primitives", "craft-atomic", @@ -1606,12 +1606,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "gif", ] @@ -1619,7 +1619,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "flate2", ] @@ -1627,7 +1627,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1640,7 +1640,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "brotli 9.1.3", "brotli-decompressor 6.3.2", @@ -1670,7 +1670,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-dds", "craft-jpeg", @@ -1697,7 +1697,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1715,7 +1715,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "thiserror 2.0.21", ] @@ -1723,7 +1723,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1734,7 +1734,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-host", "craft-i18n", @@ -1749,7 +1749,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-i18n", @@ -1763,7 +1763,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-host", @@ -1781,7 +1781,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1793,7 +1793,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "encoding_rs", "image", @@ -1804,7 +1804,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "chrono", "craft-codepage", @@ -1814,7 +1814,7 @@ dependencies = [ [[package]] name = "craft-nightly" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "uds_windows", "winsafe", @@ -1823,7 +1823,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-keymap", @@ -1839,7 +1839,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "flate2", "serde", @@ -1850,7 +1850,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1862,7 +1862,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "async-channel", "async-io", @@ -1895,7 +1895,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1904,7 +1904,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-host", @@ -1928,7 +1928,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1939,7 +1939,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-eps", "flate2", @@ -1953,7 +1953,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "encoding_rs", "flate2", @@ -1964,7 +1964,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "dispatch2", "egui", @@ -1977,7 +1977,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1996,7 +1996,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-atomic", "craft-host", @@ -2013,7 +2013,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "fax", "hayro-ccitt", @@ -2024,7 +2024,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2045,7 +2045,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-keymap", @@ -2057,7 +2057,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2082,7 +2082,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2097,7 +2097,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-atomic", "craft-behavior", @@ -2112,7 +2112,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "serde", "thiserror 2.0.21", @@ -2122,7 +2122,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "serde", "thiserror 2.0.21", @@ -2131,7 +2131,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-keymap", @@ -2146,12 +2146,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2165,7 +2165,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-i18n", @@ -2181,7 +2181,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "accesskit", "craft-behavior", @@ -2219,7 +2219,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2230,7 +2230,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-host", @@ -2248,7 +2248,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-host", @@ -2269,7 +2269,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-host", @@ -2290,7 +2290,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-behavior", "craft-host", @@ -2309,7 +2309,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "base64 0.22.1", "chrono", @@ -2341,7 +2341,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "flate2", "serde", @@ -2352,7 +2352,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2362,7 +2362,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "js-sys", "serde_json", @@ -2373,7 +2373,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "winsafe", ] @@ -2381,7 +2381,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "craft-appkit", "craft-atomic", @@ -2413,7 +2413,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3768,7 +3768,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "brotli 8.0.4", "hayro-postscript", @@ -3777,7 +3777,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3795,7 +3795,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3813,12 +3813,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "flate2", "hayro-ccitt", @@ -4801,7 +4801,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4958,7 +4958,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=891f4060c4aefe2679a65afc9e76bb5ce345de31#891f4060c4aefe2679a65afc9e76bb5ce345de31" +source = "git+https://github.com/storytold/craft-libs?rev=6a4729d5afaea4470bdfe2e8e4f3474d768d7059#6a4729d5afaea4470bdfe2e8e4f3474d768d7059" dependencies = [ "arrayvec", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index dc46672d51..f7fc21065d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,51 +10,51 @@ license = "MIT OR Apache-2.0" rust-version = "1.95" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # Language packs: the Craft apps' shared font store installs them (#4936). -craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON. -craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names # the members it imports. -craft = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui # without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes. -craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # Nightly profile isolation, launch protocol, and security fence. -craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -194,13 +194,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } emath = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } epaint = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index 0e50690b98..cb731d92aa 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -28,7 +28,7 @@ egui_extras = { workspace = true } # `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback. eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] } # The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft. -craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "891f4060c4aefe2679a65afc9e76bb5ce345de31", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index 4d937f436f..43f0122072 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "891f4060c4aefe2679a65afc9e76bb5ce345de31"; +const REV: &str = "6a4729d5afaea4470bdfe2e8e4f3474d768d7059"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV), From e94496b42f6d05068eab6bc934f9f54207aacb88 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 22:16:18 -0800 Subject: [PATCH 23/42] Asset Export: the settings scroll in a short panel With assets in the panel and many format rows, the Export Settings section grew past the top of the panel, so its heading and the first format rows could not be reached. The settings now sit in a scrolling stack that takes at most half the panel's height, as the CSS Properties panel does, and the preset name row, Export and the footer bar stay below it. --- crates/ui-egui/src/panels/asset_export.rs | 25 ++++++++----- .../ui-egui/src/panels/tests_asset_export.rs | 36 +++++++++++++++++++ docs/mcp.md | 4 ++- docs/target-app-parity.md | 1 + 4 files changed, 57 insertions(+), 9 deletions(-) diff --git a/crates/ui-egui/src/panels/asset_export.rs b/crates/ui-egui/src/panels/asset_export.rs index 048d8dcfb0..26828a967d 100644 --- a/crates/ui-egui/src/panels/asset_export.rs +++ b/crates/ui-egui/src/panels/asset_export.rs @@ -34,8 +34,8 @@ use craft::theme::Variant; use craft::theme::variant::Tone; use craft::ui::buttons::{Button, IconButton}; use craft::ui::contract::{ - Bind, CollectionEvent, Entry, Props as _, RowAlign, SelectMode, Show as _, ShowCollection as _, ShowContainer as _, Sizing, TooltipSpec, clicked, - request_rename, + Bind, CollectionEvent, Entry, Props as _, RowAlign, Scroll, SelectMode, Show as _, ShowCollection as _, ShowContainer as _, Sizing, TooltipSpec, + clicked, request_rename, }; use craft::ui::dialog::StackDialog as _; use craft::ui::display::{Divider, Shade, Text}; @@ -524,13 +524,22 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { let (selection, saving) = (&mut model.selection, &mut model.saving); let (mut export_clicked, mut footer, mut screens) = (false, None, false); // The grid takes the room the settings, Export and the footer bar leave. + // The settings scroll in at most half the panel's height, so a long list of format rows stays reachable. + // The preset name row stays below them, in view when Save As Preset opens it. + let settings_room = ui.available_height() / 2.0; + let settings_id = ui.scope_id().with(("asset-export-settings", uid)); let footed = Stack::new().fill().footer(|ui, _| { - crate::panels::section(tl!("Export Settings")).show(ui, |ui, _| { - let (change, files_each) = settings(ui, st); - (seen.change, seen.files_each) = (change, files_each); - seen.format_3d = format_3d(ui, st, &sel_or_all(&shown_sel, &all)); - seen.save = save_row(ui, saving); - }); + Stack::new().id(settings_id).label(tl!("Export Settings")).fill_width().scroll(Scroll::vertical()).room_height(settings_room).show( + ui, + |ui, _| { + crate::panels::section(tl!("Export Settings")).show(ui, |ui, _| { + let (change, files_each) = settings(ui, st); + (seen.change, seen.files_each) = (change, files_each); + seen.format_3d = format_3d(ui, st, &sel_or_all(&shown_sel, &all)); + }); + }, + ); + seen.save = save_row(ui, saving); Row::new().fill_width().align(RowAlign::End).show(ui, |ui, _| { let label = if shown_sel.is_empty() || shown_sel.len() == all.len() { tl!("Export").to_string() diff --git a/crates/ui-egui/src/panels/tests_asset_export.rs b/crates/ui-egui/src/panels/tests_asset_export.rs index 369006b699..b71ca788a9 100644 --- a/crates/ui-egui/src/panels/tests_asset_export.rs +++ b/crates/ui-egui/src/panels/tests_asset_export.rs @@ -1016,6 +1016,42 @@ fn the_scale_row_fits_the_panel_width() { } } +/// In a short panel with many format rows, the Export Settings heading and the first row stay inside the panel, and +/// the settings scroll above Export and the footer bar. +#[test] +fn the_settings_scroll_inside_a_short_panel() { + use craft::ui::contract::Role; + let (mut app, _, [a, _]) = app(true); + app.run("assets.add", json!({"ids": [a]})).unwrap(); + let mut p = panel(app); + p.room(egui::vec2(300.0, 1600.0)); + p.frame(); + for _ in 0..7 { + p.click("+ Add Scale"); + } + assert_eq!(settings(&p)["formats"].as_array().unwrap().len(), 8); + p.room(egui::vec2(300.0, 280.0)); + p.frame(); + p.frame(); + let heading = p.painted("Export Settings"); + assert!(!heading.is_empty(), "the Export Settings heading is painted"); + for rect in heading { + assert!(rect.top() >= -0.5 && rect.bottom() <= 280.5, "the Export Settings heading at {rect:?} is outside a 280 pt panel"); + } + let scale = p.rect_role("Scale", Role::COMBO_BOX); + assert!(p.in_view("Scale") && scale.top() >= -0.5, "the first format row at {scale:?} is outside the panel"); + let export = p.rect("Export"); + assert!(export.top() >= -0.5 && export.bottom() <= 280.5, "Export at {export:?} is outside a 280 pt panel"); + // The wheel over the settings brings the last row's Add Scale into view, and Export stays where it was. + for _ in 0..20 { + p.scroll_at(scale.center(), -120.0); + p.frame(); + } + let add = p.rect("+ Add Scale"); + assert!(p.in_view("+ Add Scale") && add.bottom() <= 280.5, "Add Scale at {add:?} is not reachable"); + assert_eq!(p.rect("Export"), export, "Export moved while the settings scrolled"); +} + /// The menu adds the selected artwork as one asset or one per object (an object that is an asset already keeps its /// asset), and is off with no artwork selected. #[test] diff --git a/docs/mcp.md b/docs/mcp.md index a9e9d9649a..a7fec3009e 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -12490,7 +12490,9 @@ Open Location after Export run these two (sub-folders sort the pictures; `assets folder itself), and its Format Settings… opens Export for Screens on the first row's format settings. `document.exportForScreens {assets: [id…]}` does the same with its own params (the dialog's Assets tab). An asset's crop, and the crop of `export` with `selection: true`, is the bounds the -renderer measures for what the art draws, its effects included. +renderer measures for what the art draws, its effects included. In the panel, Export Settings takes at most half the +panel's height and scrolls on its own, so every format row can be reached in a short panel while Export and the footer +bar stay in place. ```json {"name":"run_command","arguments":{"command":"assets.add","params":{"multiple":true}}} diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 4df379b998..9469046bc4 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1086,6 +1086,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Batch… over data sets offers None, Save and Close and Folder as the destination, as for a folder source. Save and Close saves the open document over its own file after each data set, so the file keeps only the last data set, unless a recorded Save step that Override Save points into the destination folder first makes each data set's file the document's own. A recorded Save, Save a Copy, Save as Template or export step that writes a file and that the batch does not point into the destination folder (destination None, Override Save or Override Export off, or a copy, template, PDF, EPS, DXF, Save for Web or Save for Office Documents step) also writes the same file for every data set. In either case the dialog shows a warning and `action.batch` returns a `warning`. Unless a recorded Save or Save As step writes a file and makes it the document's own first, `action.batch` refuses Save and Close over the data sets of a document that was never saved, was converted from an older version or was restored by Data Recovery. - Export for Screens: the dialog's Example line shows the path of the file the export writes first, sub-folder included, named as the export names it, for the first chosen artboard, asset, layer or object (`document.exportForScreens`). - Export presets: the Asset Export panel menu lists the export presets of Export for Screens, with Import Preset… and Export Preset…, which read and write `.vcexportpresets` files (`document.exportPresets.import`, `document.exportPresets.export`). An imported preset whose name is taken gets a number. In the panel, a preset applies to the shared export settings (`assets.settings.set {exportPreset}`), and Save Preset… saves them. With Create Sub-folders off, the panel's Export writes every file into the folder itself, mobile and density rows included. + - Export Settings in the Asset Export panel scroll on their own in a short panel. - Export for Screens artboard names can be double-clicked to rename them in grid or list view (#7275). Enter, a click outside the field or switching to Assets commits the name; Escape cancels the edit. The dialog stays open, checked artboards stay selected and the rename is undoable. The typed name goes to the artboard that was double-clicked even when the artboards change order while it is typed; the field closes when its artboard is deleted or another document becomes active. Evidence: `dialogs::tests_screens::double_clicking_an_artboard_name_in_export_for_screens_renames_it`, `dialogs::tests_screens::switching_export_tabs_commits_an_artboard_name`, `dialogs::tests_screens::an_artboard_name_follows_its_artboard_while_it_is_typed` and `dialogs::tests_screens::an_artboard_name_stays_with_its_document`. - Asset Export tile context menus (2026-11-20): Export / Remove operate on the selected assets, with plural labels; Rename edits the clicked tile inline; Select Artwork on Canvas selects its source nodes; collecting selected artwork as one or multiple assets is enabled only with canvas selection. Right-click selects an unselected tile and preserves an existing multi-selection. Export shares the raster/3D path; removal is one undo step without removing art. Headless regressions: `panels::tests_asset_export` (selection, export targets, removal/Undo/Redo, source artwork, rename and collection). This reduces G12; UI parity scores and estimates are unchanged. - Asset Export panel menu: Create Sub-folders (on by default) and Open Location after Export are check items that set the dialog's two checkboxes (`assets.settings.set {subfolders, openLocation}`), and the panel's Export follows them, including a folder per format or item that Export for Screens remembers (3D assets' mesh files go in the folder itself); Format Settings… opens Export for Screens on the first row's format settings ([Asset Export panel](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/collect-and-export-assets-from-asset-export-panel.html)). Tests: `panels::tests_asset_export`. From bc9e7c912426ad63e4d612553acbd94c0204ff29 Mon Sep 17 00:00:00 2001 From: jmverges Date: Mon, 30 Nov 2026 07:06:19 +0000 Subject: [PATCH 24/42] .ai import: a word the page draws from two text objects in a row is their type Where the text document makes the type of every text object that shows, each piece of the page's type is matched with the made type that holds it, and a word of the piece is that type's when its spelling contains the word. The page can draw two text objects as one word: a word and a letter set apart from it (a swash "h" after "Spirit") come out of the page as one piece, "Spirith". Both text objects hold the piece, but neither spells the word, so it was counted as type with no text object, with the note "some of the page's type has no text object in the layers, so it is left out" (a loss, so `convert` wouldn't write over the file), though both text objects come in and draw it. A word still left is now the type of the text objects holding the piece when it is the last word of one of them joined to the first word of another that draws after it along the first one's lines. Each part is a whole word of its text object, so bits of words don't make up a piece, and the two the other way round don't make the word. In our garment files (used locally, never committed) this takes the note off one file of 424 and changes nothing else. Co-Authored-By: Claude Opus 5.5 --- crates/eps/src/import/native/plan.rs | 38 +++++++++++++++++++++++++-- crates/eps/src/import/tests_native.rs | 32 ++++++++++++++++++++++ docs/file-format-parity.md | 1 + 3 files changed, 69 insertions(+), 2 deletions(-) diff --git a/crates/eps/src/import/native/plan.rs b/crates/eps/src/import/native/plan.rs index 6d4799721e..487cae27b4 100644 --- a/crates/eps/src/import/native/plan.rs +++ b/crates/eps/src/import/native/plan.rs @@ -338,6 +338,12 @@ fn made_content(infos: &[SlotInfo], made: Vec>, laid: bool) -> Vec< /// it, as far as strokes round type reach) as type the page draws. How many of the page's text /// objects no made type takes, shown or not: none that holds a piece of the object has its words /// ([`spelling`]). Past `MAX_PAIRS` comparisons nothing is marked or counted (`None`). +/// +/// The page can draw two text objects as one word: a word and a letter set apart from it (a swash +/// "h" after "Spirit") come out of the page as one piece, "Spirith", that neither spells. A word +/// left that is the last word of one text object holding the piece joined to the first word of +/// another that holds it and draws after it, along the first one's lines, is theirs +/// ([`joined_by_two`]). fn see_page_type(content: &mut [Content], shown: &[Vec>]) -> Option { let texts = |o: &[Arc]| o.iter().filter_map(|n| if let NodeKind::Text(_) = &n.kind { Some(n.clone()) } else { None }).collect::>(); // Each object's pieces of type, and the words of them that no made type holding it has yet. @@ -348,22 +354,50 @@ fn see_page_type(content: &mut [Content], shown: &[Vec>]) -> Option= 0.5 * r.area().max(1e-9); + // The made type holding each object, in order: where it draws and its words. + let mut holders: Vec> = vec![vec![]; objects.len()]; for c in content { let Content::Made(node, region, seen) = c else { continue }; // Hidden made type has no region: where it draws, shown, is its own box. let Some(drawn) = region.or_else(|| node.visual_bounds()) else { continue }; - let spelled = if let NodeKind::Text(t) = &node.kind { spelling(&t.plain_text()) } else { String::new() }; - for (rects, words, held) in &mut objects { + let (spelled, holder) = match &node.kind { + NodeKind::Text(t) => { + let text = t.plain_text(); + let [a, b, ..] = t.xf.as_coeffs(); + (spelling(&text), Some((drawn.center(), (a, b), word_pieces(&text).map(spelling).filter(|w| !w.is_empty()).collect()))) + } + _ => (String::new(), None), + }; + for ((rects, words, held), by) in objects.iter_mut().zip(&mut holders) { if rects.iter().any(|r| holds(drawn, r)) { *held = true; *seen |= region.is_some(); words.retain(|w| !spelled.contains(w.as_str())); + by.extend(holder.clone()); } } } + for ((_, words, _), by) in objects.iter_mut().zip(&holders) { + words.retain(|w| !joined_by_two(w, by)); + } Some(objects.iter().filter(|(_, words, held)| !held || !words.is_empty()).count()) } +/// A made text object that holds a piece of the page's type: the centre of where it draws, the +/// way its lines run (the first column of its transform) and its words ([`spelling`]). +type Holder = (Point, (f64, f64), Vec); + +/// Is `word` (a [`spelling`]) the last word of one of `by` joined to the first word of another of +/// them that draws after it, along the first one's lines? Each part is a whole word of its text +/// object, so a piece is never made up of bits of words. +fn joined_by_two(word: &str, by: &[Holder]) -> bool { + by.iter().any(|(at, (a, b), first)| { + let Some(head) = first.last().filter(|h| word.len() > h.len() && word.starts_with(h.as_str())) else { return false }; + let tail = &word[head.len()..]; + by.iter().any(|(next, _, second)| (next.x - at.x) * a + (next.y - at.y) * b > 0.0 && second.first().is_some_and(|w| w == tail)) + }) +} + /// What goes into each of `infos`' slots when the file's text document can't make the type of every /// slot that shows: type made from the text document (`made`) where it can, else the page's type that /// the text document puts where the page has it, else the page's type in a copy that a layer's or diff --git a/crates/eps/src/import/tests_native.rs b/crates/eps/src/import/tests_native.rs index 2d8d270cc7..28faccac69 100644 --- a/crates/eps/src/import/tests_native.rs +++ b/crates/eps/src/import/tests_native.rs @@ -8663,3 +8663,35 @@ fn trusted_editing_data_keeps_an_artboard_taller_than_its_pdf_page() { let (_, w, read) = crate::layered_ai(&private(&art), Document::new(12000.0, 14400.0), vec![], false, true, 1.0); assert!(!read, "the uncapped dimension must still match: {w:?}"); } + +/// The page's "2014" drawn as one piece 20 points across the art, and two text objects "20" and +/// "14" anchored at `twenty` and `fourteen`, set in the bundled Source Sans 3 at 14 points (a digit +/// 6.958 points wide) so that where they draw doesn't hang on the fonts installed. +fn word_of_two_text_objects(fourteen: f64, twenty: f64) -> crate::import::Imported { + let stories = [("20\r", 0, (twenty, 8180.0), (0.0, 0.0), 0.0), ("14\r", 0, (fourteen, 8180.0), (0.0, 0.0), 0.0)]; + let doc = text_document(&stories).replacen("/0 (Helvetica)", "/0 (SourceSans3-Regular)", 1); + let art = native_with_text(&layer("Art", true, &(text_object(0) + &text_object(1))), &doc); + let page = "0 1 0 0 setcmykcolor /SourceSans3-Regular findfont 14 scalefont setfont 20 61.5 moveto (2014) show"; + import(&eps(page, &art)).unwrap() +} + +/// The page can draw two text objects as one word: "20" and "14" set one after the other come out +/// of the page as one piece, "2014", that neither spells. The word is the last word of the one +/// joined to the first word of the one after it, so the page's type is theirs and nothing is noted +/// as left out. +#[test] +fn a_word_the_page_draws_from_two_text_objects_in_a_row_is_their_type() { + let r = word_of_two_text_objects(8161.5 + 13.916, 8161.5); + assert_eq!(names(&r.document), ["Art"], "{:?}", r.warnings); + let texts: Vec = text_of(&r.document.layers[0]).iter().map(|t| t.plain_text()).collect(); + assert_eq!(texts, ["20", "14"], "{:?}", r.warnings); + assert!(!r.warnings.iter().any(|w| crate::is_loss(w)), "{:?}", r.warnings); +} + +/// The two text objects the other way round ("14" before "20") don't make the page's "2014": its +/// word keeps the loss note. +#[test] +fn two_text_objects_the_other_way_round_arent_the_word_the_page_draws() { + let r = word_of_two_text_objects(8161.5, 8161.5 + 13.916); + assert!(r.warnings.iter().any(|w| w.contains("some of the page's type has no text object in the layers")), "{:?}", r.warnings); +} diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index a22db526d1..b4c9a92410 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -425,6 +425,7 @@ Stop opacity on translated artboards remains outside this regression coverage. | Date | Change | Summary | |---|---|---| +| 2026-11-30 | minor | `.ai` and EPS import: a word the page draws from two text objects in a row is their type. Where the text document makes the type of every text object that shows, a word of the page's type is the type of the made type holding its piece when that type spells it. The page can draw two text objects as one word: a word and a letter set apart from it (a swash "h" after "Spirit") come out of the page as one piece, "Spirith", that neither spells. It was counted as type with no text object, with the note "some of the page's type has no text object in the layers, so it is left out" (a loss, so `convert` wouldn't write over the file), though both text objects come in and draw it. Now a word left that is the last word of one text object holding the piece joined to the first word of another holding it that draws after it, along the first one's lines, is theirs (`joined_by_two` in `see_page_type`). Each part is a whole word of its text object, and the two the other way round don't make the word. Tests: `a_word_the_page_draws_from_two_text_objects_in_a_row_is_their_type`, `two_text_objects_the_other_way_round_arent_the_word_the_page_draws`. | | 2026-11-27 | minor | `.ai` save: type in a spot ink, a global process colour or Registration keeps its swatch link and its tint. Its fill and stroke in the text document name (key 5 of the paint) an art style of one paint, `0 1 Xd`, whose paint is the colour as a path's fill writes it (`x`, `Xx`, `Xk`, `Xs`), the form `.ai` import reads since the change below; key 0 still holds the process values at the tint. Each style is read back before it is written and kept only when the reader gives the same swatch and tint, so such type no longer counts among the attributes of type left out; a link to a process swatch that isn't global still does. Test `ai_editing::tests::type_in_spot_and_global_colors_reads_back_linked_at_its_tint` | | 2026-11-27 | minor | `.ai` and EPS import: type set in a spot ink or a global process colour keeps its ink. In the text document a character's fill or stroke is a colour (key 0: grey, RGB or CMYK) and the name of an art style (key 5). In users' files (used locally, never committed) that style is one paint (`/SimpleStyle`), always its fill's, for a stroke too; for a spot ink or a global process colour it is `c m y k (name) tint x`, `Xx` or `Xk`, and key 0 keeps only the ink's process values at that tint. Such type came in as that process colour, so it separated onto the process plates, and white type in a white ink onto none. It now takes the style's paint: the colour at its tint, linked to the document's swatch of that name, which the style's colour makes when the art doesn't (after the art's colours, before the header's custom colours). A style whose paint is a process colour or a gradient, one that also sets a stroke's colour or pattern (before or after the fill's) or another fill paint after it, one whose `Xd` doesn't turn on its fill alone, and a paint that names no style of the file, keep the colour of key 0 as before; type filled with a gradient still comes in black. Tests `type_set_in_a_spot_ink_takes_it_from_the_art_style_its_paint_names` in `crates/eps/src/import/tests_native.rs`, `a_run_painted_by_a_swatch_colours_art_style_takes_the_swatch` in `crates/eps/src/import/ate.rs` and `only_a_style_of_one_swatch_colour_holds_it_for_type` in `crates/eps/src/import/ai/style/tests.rs`. Scores and estimates unchanged. | | 2026-11-26 | minor | `.ai` and EPS import: where the text document makes the type of every text object that shows, point type made from it is matched with the page's type where it draws. Made type has no layout when it is matched, and its box was the estimate of type without one (0.55 em a character, running right from its anchor): beside right-aligned type, over half of centered type, across vertical type, and too short for a wide font. The page's type there was counted as type with no text object, with the note "some of the page's type has no text object in the layers, so it is left out" (a loss, so `convert` wouldn't write over the file), and the made type went on to be weighed against the page as type the page may not draw, and could be taken out. The box of made point type that shows now comes from its layout in the fonts the import has; the text object keeps no layout, so the document measures it when it opens, as before. Files where some text object's type isn't made keep the estimate: there the page's pieces where made type draws can belong to text objects stacked on it. The page comparison takes the same box for the layers' type areas (`type_areas` in `compare.rs`): made point type that differs from the page (laid out again, or in another font) counts as type where it draws, whatever its alignment. Counted as art beside the estimate, it could send the file to its PDF part or page, or be noted as art that differs. A file whose layers failed the comparison that way and opened without it now passes it and shows its notes. Tests `right_aligned_and_centered_point_type_takes_the_pages_type_where_it_draws`, `centered_point_type_at_a_heading_s_size_takes_the_pages_type_where_it_draws` and `right_aligned_point_type_that_differs_from_the_page_differs_as_type` in `crates/eps/src/import/tests_native.rs`, and `made_point_type_s_box_is_where_its_alignment_and_orientation_draw_it` in `crates/eps/src/import/native/slots.rs`. Scores and estimates unchanged. | From bbe091e791f9e500b28ab43e3d1afa46538829a2 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 02:13:29 -0800 Subject: [PATCH 25/42] Fields: the wheel steps a focused number field only while the pointer is over it With a number field focused, a wheel notch anywhere in the window stepped that field. In Pattern Options at 220 by 320 points, with Width focused at 10 pt, a notch over Size Tile to Art changed Width to 9 pt. `root_env` now turns on the framework's pointer-scoped field wheel (`RootEnv::pointer_scoped_field_wheel`, storytold/craft-libs#3805). The desktop and web hosts both take their root from it. A notch over the focused field still steps it. Elsewhere the wheel scrolls what is under the pointer, and an unfocused number field under the pointer is not stepped. --- crates/ui-egui/src/app.rs | 3 ++ crates/ui-egui/src/panels/pattern_options.rs | 40 ++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 84ab44d769..730f2eec08 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -823,6 +823,9 @@ pub(crate) fn root_env(prefs: &vectorcraft_engine::Prefs, native_ppp: f32, print root.escape_leaves_fields = true; // A held key repeats its command (Cmd+= keeps zooming in). root.shortcuts_repeat = true; + // The wheel steps a focused number field only while the pointer is over it; elsewhere it scrolls what is under the + // pointer. + root.pointer_scoped_field_wheel = true; root } diff --git a/crates/ui-egui/src/panels/pattern_options.rs b/crates/ui-egui/src/panels/pattern_options.rs index 93e93681f2..e811df4c17 100644 --- a/crates/ui-egui/src/panels/pattern_options.rs +++ b/crates/ui-egui/src/panels/pattern_options.rs @@ -309,4 +309,44 @@ mod tests { assert_eq!(panel.value("Name").as_deref(), Some("Dots")); assert!(panel.app().session.active().unwrap().doc.pattern("Dots").is_some()); } + + /// The tile's width and height of the pattern "Dots". + fn tile_size(panel: &Panel) -> (f64, f64) { + let app = panel.app(); + let tile = &app.session.active().unwrap().doc.pattern("Dots").unwrap().tile; + (tile.width(), tile.height()) + } + + /// With the Width field focused, a wheel notch steps it only while the pointer is over it: over another control, + /// or over the unfocused Height field, the wheel scrolls the panel and the tile keeps its size. + #[test] + fn the_wheel_steps_the_focused_number_field_only_under_the_pointer() { + use craft::ui::contract::Role; + let mut panel = editing_panel(); + panel.room(egui::vec2(220.0, 320.0)); + panel.frame(); + assert_eq!(tile_size(&panel), (10.0, 10.0)); + panel.click_role("Width", Role::SPIN_BUTTON); + assert!(panel.focused("Width"), "the click focuses Width"); + + // One notch at `at`, then the frame after the wheel gesture's gap, which ends the gesture. + let notch = |panel: &mut Panel, at: egui::Pos2| { + panel.scroll_at(at, -30.0); + panel.advance(1.0); + panel.frame(); + }; + + let check = panel.rect("Size Tile to Art").center(); + notch(&mut panel, check); + assert_eq!(tile_size(&panel), (10.0, 10.0), "a notch over Size Tile to Art leaves the focused Width alone"); + assert!(panel.focused("Width"), "Width keeps the focus"); + + let height = panel.rect_role("Height", Role::SPIN_BUTTON).center(); + notch(&mut panel, height); + assert_eq!(tile_size(&panel), (10.0, 10.0), "a notch over the unfocused Height steps neither field"); + + let width = panel.rect_role("Width", Role::SPIN_BUTTON).center(); + notch(&mut panel, width); + assert_eq!(tile_size(&panel), (9.0, 10.0), "a notch over the focused Width steps it"); + } } From 04ced9bee734f216ee55ac13316932b5e501184c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 03:33:26 -0800 Subject: [PATCH 26/42] Performance: the check of a moved selection reads the objects at their places After a move, the check that a view can move the selection's marks instead of building them again looked each moved object up by id three times: the object, its parent's id and the parent. With 10,000 objects selected that was 30,000 lookups after the edit. The check now keeps each object's place from the transform and reads the object and its parent there, so the move looks each object up once, as before. --- crates/engine/src/cmd/object/transform.rs | 26 ++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/crates/engine/src/cmd/object/transform.rs b/crates/engine/src/cmd/object/transform.rs index c3ce0107f0..4212588f1b 100644 --- a/crates/engine/src/cmd/object/transform.rs +++ b/crates/engine/src/cmd/object/transform.rs @@ -200,7 +200,7 @@ fn apply_transform_moving_guides( // A move of whole objects, not of copies (which `reindex` covers): the document before it, // and the moved objects as the transform left them, for [`moved_by`] to check after the edit. let from = (objects && !areas && !reindex && c[..4] == [1.0, 0.0, 0.0, 1.0]).then(|| s.doc().map(|st| st.doc.clone())).transpose()?; - let mut held: Vec<(NodeId, Arc)> = vec![]; + let mut held: Vec<(Vec, Arc)> = vec![]; let targets = s.edit(label, |d, sel| { let mut targets = match &kept { // The document becomes the snapshot with the kept copies, untransformed, and the @@ -240,7 +240,7 @@ fn apply_transform_moving_guides( } // Holding them makes any later change to them copy them first, which `moved_by` sees. if from.is_some() { - held = targets.iter().filter_map(|id| Some((*id, node_arc(d, paths.get(id)?)?))).collect(); + held = targets.iter().filter_map(|id| paths.get(id)).filter_map(|p| Some((p.clone(), node_arc(d, p)?))).collect(); } if objects { // The transforms above leave every object at its place, so `paths` still holds them. @@ -294,20 +294,22 @@ fn node_arc(d: &Document, path: &[usize]) -> Option> { } /// The [`crate::Moved`] of a move by `by` that took `from` to the document of `st`, given the moved -/// objects as the transform left them (`held`). `None` unless every moved object is still that -/// node, none is a member of a blend (whose spine follows its members), and every object the -/// selection shows, the key object and the key anchor's object included, is a moved object or -/// inside one. A pass after the transform that changes a moved object, such as the one that snaps -/// moved pixel-aligned objects to the pixel grid again ([`super::pixelgrid::refresh`]), copies it -/// first, so it is no longer that node. -fn moved_by(from: &Arc, st: &crate::DocState, held: &[(NodeId, Arc)], by: Vec2) -> Option { +/// objects as the transform left them (`held`, each with its index path). `None` unless every moved +/// object is still that node at its path, none is a member of a blend (whose spine follows its +/// members), and every object the selection shows, the key object and the key anchor's object +/// included, is a moved object or inside one. A pass after the transform that changes a moved +/// object, such as the one that snaps moved pixel-aligned objects to the pixel grid again +/// ([`super::pixelgrid::refresh`]), copies it first, so it is no longer that node. The checks read +/// the nodes at their paths and look nothing up by id. +fn moved_by(from: &Arc, st: &crate::DocState, held: &[(Vec, Arc)], by: Vec2) -> Option { let d = &st.doc; - let unchanged = |(id, n): &(NodeId, Arc)| d.node(*id).is_some_and(|now| std::ptr::eq(now, Arc::as_ptr(n))); + let unchanged = |(p, n): &(Vec, Arc)| d.node_at(p).is_some_and(|now| std::ptr::eq(now, Arc::as_ptr(n))); if held.is_empty() || !held.iter().all(unchanged) { return None; } - let in_blend = |id: NodeId| d.parent_of(id).and_then(|p| d.node(p)).is_some_and(|p| matches!(p.kind, NodeKind::Blend { .. })); - if held.iter().any(|(id, _)| in_blend(*id)) { + // The node at each path is the moved object, so its parent is the node one level up. + let in_blend = |p: &[usize]| p.split_last().and_then(|(_, up)| d.node_at(up)).is_some_and(|parent| matches!(parent.kind, NodeKind::Blend { .. })); + if held.iter().any(|(p, _)| in_blend(p)) { return None; } let mut moved = std::collections::HashSet::new(); From 39ab91529711d50ed81194abcc5b335c0aba7941 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 03:39:10 -0800 Subject: [PATCH 27/42] =?UTF-8?q?Tests:=20Expand=E2=80=A6=20keeps=20the=20?= =?UTF-8?q?general=20tooltip=20with=20nothing=20selected?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The walk-count test now checks that Object › Expand…, dimmed with nothing selected, shows the general reason as its tooltip, as on main, instead of only checking that the tooltip is not the appearance one. --- crates/ui-egui/src/menus/model.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/menus/model.rs b/crates/ui-egui/src/menus/model.rs index 37de6908c2..31f20688fc 100644 --- a/crates/ui-egui/src/menus/model.rs +++ b/crates/ui-egui/src/menus/model.rs @@ -736,6 +736,8 @@ mod tests { assert_eq!(tooltip(&app).as_deref(), Some(crate::dialogs::expand::appearance_first())); app.run("select.none", json!({})).unwrap(); assert_eq!(walks(&mut app), 0, "nothing selected"); - assert_ne!(tooltip(&app).as_deref(), Some(crate::dialogs::expand::appearance_first())); + // Dimmed with nothing selected, the row keeps the general reason as its tooltip, as before. + let tip = tooltip(&app); + assert!(tip.as_deref().is_some_and(|t| t != crate::dialogs::expand::appearance_first()), "{tip:?}"); } } From 98e5003ec31d4db5dca005a809cb9b5b12a367a6 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 13:21:47 +0100 Subject: [PATCH 28/42] Commit hovered font rows and avoid native clock calls in web character controls --- crates/ui-egui/src/panels/character.rs | 28 +++++++++++++++----------- crates/ui-egui/src/tests/font_menu.rs | 1 + 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/crates/ui-egui/src/panels/character.rs b/crates/ui-egui/src/panels/character.rs index 9415a7e50f..677eec516a 100644 --- a/crates/ui-egui/src/panels/character.rs +++ b/crates/ui-egui/src/panels/character.rs @@ -6,7 +6,6 @@ use std::cell::RefCell; use std::collections::HashSet; use std::rc::Rc; use std::sync::{Arc, Mutex, Weak}; -use std::time::SystemTime; // PLAN: assumed the framework paths below (craft::text::ui re-exports, craft_ui widgets and runtime, craft::font_manager). use craft::behavior::EditEvent; @@ -47,12 +46,15 @@ use crate::font_menu; /// attributes of the paragraph the selection starts in (else of the first paragraph). /// Font/paragraph controls and named-style capture use this; dimensional fields use `shared_effective`. pub(crate) fn text_style(app: &VectorcraftApp) -> Option<(CharStyle, vectorcraft_doc::ParaStyle)> { + let state = app.session.active()?; + // Hover changes the canvas, but the picker compares its next row click against the committed font. + let doc = state.interaction.as_ref().filter(|_| app.font_preview_owner.is_some()).map_or(&state.doc, |preview| &preview.doc); if let Some((id, a, b)) = text_editing(app) - && let Some(NodeKind::Text(t)) = app.session.active().and_then(|d| d.doc.node(id)).map(|n| &n.kind) + && let Some(NodeKind::Text(t)) = doc.node(id).map(|n| &n.kind) { return Some((vectorcraft_text::edit::insertion_style(&t.runs, a, b), t.para_at(t.paragraphs_in(a, a).start).clone())); } - let t = first_selected_text(app)?; + let NodeKind::Text(t) = &first_selected_text_node_in(state, doc)?.kind else { return None }; Some((t.first_style(), t.para_at(0).clone())) } @@ -68,7 +70,11 @@ pub(crate) fn first_selected_text(app: &VectorcraftApp) -> Option<&vectorcraft_d /// their descendants, in selection order, then paint order within each selected object. pub(crate) fn first_selected_text_node(app: &VectorcraftApp) -> Option<&vectorcraft_doc::Node> { let st = app.session.active()?; - for node in st.selection.objects.iter().filter_map(|id| st.doc.node(*id)) { + first_selected_text_node_in(st, &st.doc) +} + +fn first_selected_text_node_in<'a>(state: &DocState, doc: &'a vectorcraft_doc::Document) -> Option<&'a vectorcraft_doc::Node> { + for node in state.selection.objects.iter().filter_map(|id| doc.node(*id)) { let mut text = None; node.walk(&mut |n| { if text.is_none() && matches!(n.kind, NodeKind::Text(_)) { @@ -1219,16 +1225,14 @@ pub(crate) fn controls(app: &mut VectorcraftApp, ui: &mut Ui, rows: CharacterRow let languages: Option> = rows.contains(CharacterRows::STYLE_TOGGLES).then(|| LANGUAGES.iter().map(|(name, _, _)| (name.to_string(), name.to_string())).collect()); let catalog = vectorcraft_text::FontDb::global().catalog(); - let before = font_menu::picker_settings(app); - let mut settings = before.clone(); - let document = font_menu::document_family_set(app); - let recent = font_menu::recently_added_set(app, SystemTime::now()); - let sets = font_menu::family_sets(Some(&document[..]), &recent[..]); + let mut hold = font_menu::hold(app); + let before = hold.settings.clone(); + let sets = font_menu::family_sets(hold.document.as_deref(), &hold.recently_added); let sample = font_menu::sample_text(app); let unit = type_unit(app); let mut source = FontPickerSource::new(catalog) - .settings(Bind::bound(&mut settings)) - .filters(Bind::bound(&mut app.ui.font_filters)) + .settings(Bind::bound(&mut hold.settings)) + .filters(Bind::bound(&mut hold.filters)) .sets(&sets) .scripts(&FontScript::ALL) .filter_layout(FilterLayout::Toolbar); @@ -1248,7 +1252,7 @@ pub(crate) fn controls(app: &mut VectorcraftApp, ui: &mut Ui, rows: CharacterRow controls = controls.axes(FaceAxes::new(axes, instances).italic(face_of(¤t.font_style).2)); } let out = controls.show(ui); - font_menu::store_picker_settings(app, &before, settings); + hold.store(app, &before); let CharacterControlsOutput { picker, preview_family, edits, .. } = out; if let Some(owner) = picker { font_menu::apply_preview(app, owner, preview_family); diff --git a/crates/ui-egui/src/tests/font_menu.rs b/crates/ui-egui/src/tests/font_menu.rs index 9a6ce5421c..9a4b7323db 100644 --- a/crates/ui-egui/src/tests/font_menu.rs +++ b/crates/ui-egui/src/tests/font_menu.rs @@ -86,6 +86,7 @@ fn preview_changes_the_text_live_and_only_a_choice_is_a_step() { let before = steps(&app); apply_preview(&mut app, owner(), Preview::Shows("Source Serif 4".into())); assert_eq!(font_of(&app, id), "Source Serif 4", "previewed on the text"); + assert_eq!(crate::panels::character::values(&mut app).family.as_deref(), Some("Inter"), "the picker must still be able to commit the previewed row"); apply_preview(&mut app, owner(), Preview::Shows("Source Sans 3".into())); assert_eq!(font_of(&app, id), "Source Sans 3"); apply_preview(&mut app, owner(), Preview::Ended); From aeae489395db6947f4e99b072bed996f6f96c709 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 13:25:54 +0100 Subject: [PATCH 29/42] Bound text-object joins within the import comparison budget --- crates/eps/src/import/native/plan.rs | 34 ++++++++++++++++++---------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/crates/eps/src/import/native/plan.rs b/crates/eps/src/import/native/plan.rs index 487cae27b4..e4eec8cdc5 100644 --- a/crates/eps/src/import/native/plan.rs +++ b/crates/eps/src/import/native/plan.rs @@ -350,35 +350,45 @@ fn see_page_type(content: &mut [Content], shown: &[Vec>]) -> Option, Vec, bool)> = shown.iter().map(|o| (texts(o).iter().filter_map(|n| n.visual_bounds()).collect(), object_words(o), false)).collect(); let pieces: usize = objects.iter().map(|o| o.0.len()).sum(); - if content.len().saturating_mul(pieces) > MAX_PAIRS { - return None; - } + let mut budget = MAX_PAIRS.checked_sub(content.len().checked_mul(pieces)?)?; let holds = |drawn: Rect, r: &Rect| drawn.inflate(OUTLINE_REACH, OUTLINE_REACH).intersect(*r).area() >= 0.5 * r.area().max(1e-9); // The made type holding each object, in order: where it draws and its words. - let mut holders: Vec> = vec![vec![]; objects.len()]; - for c in content { - let Content::Made(node, region, seen) = c else { continue }; + let mut holders: Vec>> = vec![vec![]; objects.len()]; + let mut seen_slots = Vec::new(); + for (slot, c) in content.iter().enumerate() { + let Content::Made(node, region, _) = c else { continue }; // Hidden made type has no region: where it draws, shown, is its own box. let Some(drawn) = region.or_else(|| node.visual_bounds()) else { continue }; let (spelled, holder) = match &node.kind { NodeKind::Text(t) => { let text = t.plain_text(); let [a, b, ..] = t.xf.as_coeffs(); - (spelling(&text), Some((drawn.center(), (a, b), word_pieces(&text).map(spelling).filter(|w| !w.is_empty()).collect()))) + (spelling(&text), Some(Arc::new((drawn.center(), (a, b), word_pieces(&text).map(spelling).filter(|w| !w.is_empty()).collect())))) } _ => (String::new(), None), }; for ((rects, words, held), by) in objects.iter_mut().zip(&mut holders) { if rects.iter().any(|r| holds(drawn, r)) { *held = true; - *seen |= region.is_some(); + if region.is_some() && seen_slots.last() != Some(&slot) { + seen_slots.push(slot); + } words.retain(|w| !spelled.contains(w.as_str())); by.extend(holder.clone()); } } } for ((_, words, _), by) in objects.iter_mut().zip(&holders) { - words.retain(|w| !joined_by_two(w, by)); + if !words.is_empty() && !by.is_empty() { + // Each unmatched word can visit every ordered pair of holders, plus the first-holder scan. + budget = budget.checked_sub(words.len().checked_mul(by.len())?.checked_mul(by.len().checked_add(1)?)?)?; + words.retain(|w| !joined_by_two(w, by)); + } + } + for slot in seen_slots { + if let Content::Made(_, _, seen) = &mut content[slot] { + *seen = true; + } } Some(objects.iter().filter(|(_, words, held)| !held || !words.is_empty()).count()) } @@ -390,11 +400,11 @@ type Holder = (Point, (f64, f64), Vec); /// Is `word` (a [`spelling`]) the last word of one of `by` joined to the first word of another of /// them that draws after it, along the first one's lines? Each part is a whole word of its text /// object, so a piece is never made up of bits of words. -fn joined_by_two(word: &str, by: &[Holder]) -> bool { - by.iter().any(|(at, (a, b), first)| { +fn joined_by_two(word: &str, by: &[Arc]) -> bool { + by.iter().map(Arc::as_ref).any(|(at, (a, b), first)| { let Some(head) = first.last().filter(|h| word.len() > h.len() && word.starts_with(h.as_str())) else { return false }; let tail = &word[head.len()..]; - by.iter().any(|(next, _, second)| (next.x - at.x) * a + (next.y - at.y) * b > 0.0 && second.first().is_some_and(|w| w == tail)) + by.iter().map(Arc::as_ref).any(|(next, _, second)| (next.x - at.x) * a + (next.y - at.y) * b > 0.0 && second.first().is_some_and(|w| w == tail)) }) } From 80ceb782aafa0e8f5c65e9e483c79e58051ac71a Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 13:27:12 +0100 Subject: [PATCH 30/42] Measure copied art from the active source artboard for Paste in Place --- crates/engine/src/cmd/edit.rs | 11 +++++++++-- crates/engine/src/command_sets.rs | 8 ++++++-- crates/ui-egui/src/app/commands.rs | 3 ++- crates/ui-egui/src/canvas/tests.rs | 17 +++++++++++++++++ 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index 4fc1b83c29..84f28ab942 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -162,7 +162,7 @@ pub fn specs() -> Vec { "Cut", ["Edit"], Some("Cmd+X"), - "{selectedArtboards?: [n…], art?: bool, lockedAndHidden?: bool (the Artboard tool chosen, as artboard.cut)} (as edit.copy) removes the objects it copies, in one undo step: a compound-path member selected on its own leaves the compound's other members in the compound (selected ruler guides go too; the Artboard tool chosen, or selectedArtboards given: artboard.cut); refused while an object of a symbol instance's art is selected", + "{artboard?: index (the source artboard for copied objects), selectedArtboards?: [n…], art?: bool, lockedAndHidden?: bool (the Artboard tool chosen, as artboard.cut)} (as edit.copy) removes the objects it copies, in one undo step: a compound-path member selected on its own leaves the compound's other members in the compound (selected ruler guides go too; the Artboard tool chosen, or selectedArtboards given: artboard.cut); refused while an object of a symbol instance's art is selected", has_selection_guides_or_artboard_tool, cut ), @@ -171,7 +171,7 @@ pub fn specs() -> Vec { "Copy", ["Edit"], Some("Cmd+C"), - "{selectedArtboards?: [n…] (the artboards the Artboard tool had selected, which the journal records for a replay; it runs artboard.copy with any tool chosen), art?: bool (default: the Artboard tool's moveArt option; the journal records it beside selectedArtboards), lockedAndHidden?: bool (the Artboard tool chosen, as artboard.copy)} the selection with what it uses (a compound-path member selected on its own, whole or in part, with Direct or Group Selection, is copied as an ordinary path with the compound's paint, transparency, opacity mask, fill rule and graphic style link (while it has that style's look), a gradient keeping the compound's fit; the compound is copied when it is selected, or when every member is selected whole outside isolation mode), and the selected ruler guides (pasted on the layer new art goes to, moved as the objects are; alone, where they were); the Artboard tool chosen: artboard.copy; with an object of a symbol instance's art selected, the instance is copied whole → {copied, guides}", + "{artboard?: index (the source artboard for copied objects; without it, the artboard containing the selection center), selectedArtboards?: [n…] (the artboards the Artboard tool had selected, which the journal records for a replay; it runs artboard.copy with any tool chosen), art?: bool (default: the Artboard tool's moveArt option; the journal records it beside selectedArtboards), lockedAndHidden?: bool (the Artboard tool chosen, as artboard.copy)} the selection with what it uses (a compound-path member selected on its own, whole or in part, with Direct or Group Selection, is copied as an ordinary path with the compound's paint, transparency, opacity mask, fill rule and graphic style link (while it has that style's look), a gradient keeping the compound's fit; the compound is copied when it is selected, or when every member is selected whole outside isolation mode), and the selected ruler guides (pasted on the layer new art goes to, moved as the objects are; alone, where they were); the Artboard tool chosen: artboard.copy; with an object of a symbol instance's art selected, the instance is copied whole → {copied, guides}", has_selection_guides_or_artboard_tool, copy ), @@ -1163,6 +1163,13 @@ fn copy(s: &mut Session, p: &Value) -> Result { }); clip.source_artboard = board.map(|a| a.rect); } + if let Some(value) = p.get("artboard") { + let board = value + .as_u64() + .and_then(|v| st.doc.artboards.get(index(v))) + .ok_or_else(|| bad("edit.copy", "`artboard` must be the index of an artboard of the document"))?; + clip.source_artboard = Some(board.rect); + } clip.guides = guides; s.clipboard = clip; Ok(json!({ "copied": s.clipboard.nodes.len(), "guides": s.clipboard.guides.len() })) diff --git a/crates/engine/src/command_sets.rs b/crates/engine/src/command_sets.rs index 1346dc40c5..893c4f78e9 100644 --- a/crates/engine/src/command_sets.rs +++ b/crates/engine/src/command_sets.rs @@ -5,7 +5,9 @@ use super::{NodeId, Value, cmd, find_command}; /// Objects and Distribute Spacing with Align to Artboard distribute objects across it, All on /// Active Artboard selects on it, and Edit Symbol from the Symbols panel centers the symbol's art /// on it. A `command.batch` given `artboard` passes it on to each of their steps that names none. -pub const ON_ACTIVE_ARTBOARD: [&str; 8] = [ +pub const ON_ACTIVE_ARTBOARD: [&str; 10] = [ + "edit.copy", + "edit.cut", "edit.pasteInPlace", "edit.pasteInFront", "edit.pasteInBack", @@ -35,7 +37,9 @@ pub const DRAWS_SHAPE: [&str; 5] = ["shape.rectangle", "shape.ellipse", "shape.p /// Artboard tool had selected for its commands and for Paste in Place, in Front and in Back; the artboards and art Cut and Copy took with that /// tool chosen; the view's center the app passes to Edit Symbol); an action leaves them out /// ([`Session::journal_for_action`]). -const REPLAY_ONLY: [(&str, &str); 35] = [ +const REPLAY_ONLY: [(&str, &str); 37] = [ + ("edit.copy", "artboard"), + ("edit.cut", "artboard"), ("file.new", "created"), ("edit.newDocumentFromState", "created"), ("document.save", "modified"), diff --git a/crates/ui-egui/src/app/commands.rs b/crates/ui-egui/src/app/commands.rs index b7ff421414..1452288749 100644 --- a/crates/ui-egui/src/app/commands.rs +++ b/crates/ui-egui/src/app/commands.rs @@ -129,11 +129,12 @@ impl VectorcraftApp { /// document without artboards they get neither. fn add_active_artboard(&self, id: &str, params: &mut Value) { let paste = matches!(id, "edit.pasteInPlace" | "edit.pasteInFront" | "edit.pasteInBack"); + let clipboard_command = paste || matches!(id, "edit.copy" | "edit.cut"); if (vectorcraft_engine::ON_ACTIVE_ARTBOARD.contains(&id) || id == "command.batch") && params.get("artboard").is_none() && !(paste && params.get("artboards").is_some()) && self.view().is_some() - && let Some(n) = self.session.active().map(|d| d.doc.artboards.len()).filter(|n| *n > 0 || !paste) + && let Some(n) = self.session.active().map(|d| d.doc.artboards.len()).filter(|n| *n > 0 || !clipboard_command) && let Some(p) = params.as_object_mut() { let picked = panels::artboards::picked(self, n); diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index d441c59316..e8b26555e2 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -426,6 +426,23 @@ fn a_click_activates_its_artboard_and_paste_in_place_goes_onto_it() { assert_eq!((b.x0, b.y0), (boards[2].x0 + 10.0, boards[2].y0 + 15.0)); } +/// Copy uses the active board as its origin even when selected art lies on a different board. +#[test] +fn copy_and_paste_use_the_active_source_and_destination_artboards() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 200, "height": 100, "artboards": 3})).unwrap(); + let boards: Vec<_> = app.session.active().unwrap().doc.artboards.iter().map(|a| a.rect).collect(); + let origin = Point::new(boards[1].x0 + 10.0, boards[1].y0 + 15.0); + app.run("shape.rectangle", json!({"x": origin.x, "y": origin.y, "width": 20, "height": 20})).unwrap(); + app.views[0].artboard = 0; + app.run("edit.copy", json!({})).unwrap(); + app.views[0].artboard = 2; + let pasted = app.run("edit.pasteInPlace", json!({})).unwrap(); + let id = vectorcraft_doc::NodeId(pasted["ids"][0].as_u64().unwrap()); + let bounds = app.session.active().unwrap().doc.bounds_of(&[id], false).unwrap(); + assert_eq!(bounds.origin(), origin + (boards[2].origin() - boards[0].origin())); +} + /// A Shift-click with the Selection tool on an empty spot inside an artboard makes it the active /// one and keeps the selection, and Align to Artboard then aligns the objects to it unless the /// call names another artboard. From dc5958913555e422e649d5662320cfa0ef5ee175 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 13:39:42 +0100 Subject: [PATCH 31/42] Format the import budget check --- crates/eps/src/import/native/plan.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/eps/src/import/native/plan.rs b/crates/eps/src/import/native/plan.rs index e4eec8cdc5..a23e8ea324 100644 --- a/crates/eps/src/import/native/plan.rs +++ b/crates/eps/src/import/native/plan.rs @@ -404,7 +404,9 @@ fn joined_by_two(word: &str, by: &[Arc]) -> bool { by.iter().map(Arc::as_ref).any(|(at, (a, b), first)| { let Some(head) = first.last().filter(|h| word.len() > h.len() && word.starts_with(h.as_str())) else { return false }; let tail = &word[head.len()..]; - by.iter().map(Arc::as_ref).any(|(next, _, second)| (next.x - at.x) * a + (next.y - at.y) * b > 0.0 && second.first().is_some_and(|w| w == tail)) + by.iter() + .map(Arc::as_ref) + .any(|(next, _, second)| (next.x - at.x) * a + (next.y - at.y) * b > 0.0 && second.first().is_some_and(|w| w == tail)) }) } From 274983176d72baf531faa284ebcd47ac10609ff3 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 13:39:47 +0100 Subject: [PATCH 32/42] Format the font preview regression test --- crates/ui-egui/src/tests/font_menu.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/tests/font_menu.rs b/crates/ui-egui/src/tests/font_menu.rs index 9a4b7323db..28d573d09b 100644 --- a/crates/ui-egui/src/tests/font_menu.rs +++ b/crates/ui-egui/src/tests/font_menu.rs @@ -86,7 +86,11 @@ fn preview_changes_the_text_live_and_only_a_choice_is_a_step() { let before = steps(&app); apply_preview(&mut app, owner(), Preview::Shows("Source Serif 4".into())); assert_eq!(font_of(&app, id), "Source Serif 4", "previewed on the text"); - assert_eq!(crate::panels::character::values(&mut app).family.as_deref(), Some("Inter"), "the picker must still be able to commit the previewed row"); + assert_eq!( + crate::panels::character::values(&mut app).family.as_deref(), + Some("Inter"), + "the picker must still be able to commit the previewed row" + ); apply_preview(&mut app, owner(), Preview::Shows("Source Sans 3".into())); assert_eq!(font_of(&app, id), "Source Sans 3"); apply_preview(&mut app, owner(), Preview::Ended); From 8df3fd17ac54c05e22c870be04d72891723bd2b7 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 13:53:24 +0100 Subject: [PATCH 33/42] Restore white artboards in Outline and the selection arrow over selected art --- crates/tools/src/cursor.rs | 2 ++ crates/tools/src/select.rs | 6 +++--- crates/tools/src/select/tests.rs | 18 +++++++++--------- crates/ui-egui/src/canvas/artboards.rs | 4 ++-- crates/ui-egui/src/canvas/artboards/tests.rs | 4 ++-- crates/ui-egui/src/cursors.rs | 2 ++ 6 files changed, 20 insertions(+), 16 deletions(-) diff --git a/crates/tools/src/cursor.rs b/crates/tools/src/cursor.rs index 0f654340fe..657287124c 100644 --- a/crates/tools/src/cursor.rs +++ b/crates/tools/src/cursor.rs @@ -17,6 +17,8 @@ pub enum Cursor { GroupSelection, /// Alt-dragging a copy with the Selection or Direct Selection tool: a double arrowhead. SelectionCopy, + /// The Selection arrow over movable artwork. + SelectionMove, Move, Crosshair, ResizeH, diff --git a/crates/tools/src/select.rs b/crates/tools/src/select.rs index 4e3f2c16f9..1d7bd558e0 100644 --- a/crates/tools/src/select.rs +++ b/crates/tools/src/select.rs @@ -1552,7 +1552,7 @@ impl Tool for SelectionTool { // take the pointer too (on a thin box the centre lies within a handle's reach), and with // Cmd/Ctrl held the press selects the object behind instead. if near_selected && !m.cmd && hit_center(cx, p, cx.point_tol()).is_some() { - return Cursor::Move; + return Cursor::SelectionMove; } // View → Snap to Point: over an anchor a press would grab the object by, the arrow turns // hollow. @@ -1560,11 +1560,11 @@ impl Tool for SelectionTool { return Cursor::ArrowHollow; } if selected_source_hit(cx, p).is_some() { - return Cursor::Move; + return Cursor::SelectionMove; } if let Some(h) = hit_test(cx.doc, p, cx.selection_hit_options()) { if selected_under(cx, &h, h.top_object(cx.isolation)).is_some() || m.alt { - return Cursor::Move; + return Cursor::SelectionMove; } return Cursor::Arrow; } diff --git a/crates/tools/src/select/tests.rs b/crates/tools/src/select/tests.rs index 45bc30b47e..0ebda2c719 100644 --- a/crates/tools/src/select/tests.rs +++ b/crates/tools/src/select/tests.rs @@ -17,7 +17,7 @@ fn a_press_on_a_selected_shaper_source_moves_it_while_a_mask_is_edited() { let c = ToolContext { isolation: Some(layer), ..cx(&d, &s, &p) }; for x in [75.0, 125.0] { let mut t = SelectionTool::default(); - assert_eq!(t.cursor(&c, Point::new(x, 350.0), Mods::default()), Cursor::Move, "at {x}"); + assert_eq!(t.cursor(&c, Point::new(x, 350.0), Mods::default()), Cursor::SelectionMove, "at {x}"); let down = t.pointer(&c, &ev(PointerKind::Down, x, 350.0)); assert!(!down.iter().any(|a| matches!(a, Action::Exec(c, _) if c == "select.set")), "at {x}: {down:?}"); let drag = t.pointer(&c, &ev(PointerKind::Drag, x + 20.0, 350.0)); @@ -45,7 +45,7 @@ fn a_selected_shaper_source_moves_after_other_objects_and_behind_front_art() { s.set([rect, ids[1]]); let c = ToolContext { isolation: Some(layer), ..cx(&d, &s, &p) }; let mut t = SelectionTool::default(); - assert_eq!(t.cursor(&c, Point::new(125.0, 350.0), Mods::default()), Cursor::Move); + assert_eq!(t.cursor(&c, Point::new(125.0, 350.0), Mods::default()), Cursor::SelectionMove); let down = t.pointer(&c, &ev(PointerKind::Down, 125.0, 350.0)); assert!(!down.iter().any(|a| matches!(a, Action::Exec(c, _) if c == "select.set")), "{down:?}"); let drag = t.pointer(&c, &ev(PointerKind::Drag, 145.0, 350.0)); @@ -55,7 +55,7 @@ fn a_selected_shaper_source_moves_after_other_objects_and_behind_front_art() { d.insert(Some(layer), 2, Node::path(front, square, Appearance::default_art())).unwrap(); s.set([ids[1]]); let c = ToolContext { isolation: Some(layer), ..cx(&d, &s, &p) }; - assert_ne!(SelectionTool::default().cursor(&c, Point::new(125.0, 350.0), Mods::default()), Cursor::Move); + assert_ne!(SelectionTool::default().cursor(&c, Point::new(125.0, 350.0), Mods::default()), Cursor::SelectionMove); let down = SelectionTool::default().pointer(&c, &ev(PointerKind::Down, 125.0, 350.0)); assert!(down.iter().any(|a| matches!(a, Action::Exec(c, v) if c == "select.set" && v["ids"] == json!([front.0]))), "{down:?}"); } @@ -1042,7 +1042,7 @@ fn hidden_box_handles_take_no_press_while_anchors_are_selected() { s.anchors.entry(id).or_default().insert((0, 1)); let c = cx(&d, &s, &p); let mut t = SelectionTool::default(); - assert_eq!(t.cursor(&c, top_middle, Mods::default()), Cursor::Move); + assert_eq!(t.cursor(&c, top_middle, Mods::default()), Cursor::SelectionMove); let down = t.pointer(&c, &ev(PointerKind::Down, 150.0, 100.0)); assert!(!down.contains(&Action::Begin("Scale".into())), "{down:?}"); assert!(!crate::select::bbox_handle_at(&c, top_middle)); @@ -3006,9 +3006,9 @@ fn a_press_on_the_centre_point_moves_an_unfilled_shape() { let c = ToolContext { path_only: true, ..cx(&d, &s, &p) }; let centre = Point::new(150.0, 150.0); let mut t = SelectionTool::default(); - assert_eq!(t.cursor(&c, centre, Mods::default()), Cursor::Move); + assert_eq!(t.cursor(&c, centre, Mods::default()), Cursor::SelectionMove); // Cmd/Ctrl selects the object behind, not the centre point, so the pointer says neither. - assert_ne!(t.cursor(&c, centre, Mods { cmd: true, ..Mods::default() }), Cursor::Move); + assert_ne!(t.cursor(&c, centre, Mods { cmd: true, ..Mods::default() }), Cursor::SelectionMove); assert!(t.pointer(&c, &ev(PointerKind::Down, centre.x, centre.y)).is_empty()); let a = t.pointer(&c, &ev(PointerKind::Drag, 170.0, 160.0)); assert_eq!(a.first(), Some(&Action::Begin("Move".into())), "{a:?}"); @@ -3102,7 +3102,7 @@ fn a_ruler_guide_under_the_centre_point_keeps_the_pointer() { assert!(hit_center(&c, centre, c.point_tol()).is_some()); let mut t = SelectionTool::default(); let cursor = t.cursor(&c, centre, Mods::default()); - assert_ne!(cursor, Cursor::Move, "the guide's cursor, not the move arrow"); + assert_ne!(cursor, Cursor::SelectionMove, "the guide's cursor, not the move arrow"); let down = t.pointer(&c, &ev(PointerKind::Down, centre.x, centre.y)); let drag = t.pointer(&c, &ev(PointerKind::Drag, 170.0, 150.0)); assert!(drag.iter().any(|a| matches!(a, Action::Preview(cmd, _) if cmd == "guide.move")), "the guide drags: {down:?} {drag:?}"); @@ -3177,7 +3177,7 @@ fn a_press_on_a_selected_member_of_a_group_moves_the_selected_members() { s.set(picked.iter().copied()); let c = cx(&d, &s, &p); let mut t = SelectionTool::default(); - assert_eq!(t.cursor(&c, Point::new(125.0, 125.0), Mods::default()), Cursor::Move, "{picked:?}"); + assert_eq!(t.cursor(&c, Point::new(125.0, 125.0), Mods::default()), Cursor::SelectionMove, "{picked:?}"); let down = t.pointer(&c, &ev(PointerKind::Down, 125.0, 125.0)); assert!(!is_select(&down), "{picked:?}: {down:?}"); let drag = t.pointer(&c, &ev(PointerKind::Drag, 145.0, 125.0)); @@ -3218,7 +3218,7 @@ fn a_press_on_a_selected_member_of_a_group_moves_the_selected_members() { s.anchors.insert(a, [(0, 0), (0, 1), (0, 2), (0, 3)].into_iter().collect()); let c = cx(&d, &s, &p); let mut t = SelectionTool::default(); - assert_eq!(t.cursor(&c, Point::new(125.0, 125.0), Mods::default()), Cursor::Move, "every anchor"); + assert_eq!(t.cursor(&c, Point::new(125.0, 125.0), Mods::default()), Cursor::SelectionMove, "every anchor"); let down = t.pointer(&c, &ev(PointerKind::Down, 125.0, 125.0)); assert!(!is_select(&down), "every anchor: {down:?}"); } diff --git a/crates/ui-egui/src/canvas/artboards.rs b/crates/ui-egui/src/canvas/artboards.rs index 605e7108d2..a6181ea805 100644 --- a/crates/ui-egui/src/canvas/artboards.rs +++ b/crates/ui-egui/src/canvas/artboards.rs @@ -31,7 +31,7 @@ pub(super) fn checker_of(setup: &vectorcraft_doc::DocSetup) -> Checker { } /// The page frames of document `st` seen through `view`: one per artboard, named "01 - name" with the -/// Artboard tool or several boards, filled with its paper or the transparency grid (nothing in Outline). +/// Artboard tool or several boards, filled with its paper or the transparency grid (white in Outline). /// Empty while the artboards are hidden. pub(super) fn frames(app: &VectorcraftApp, st: &vectorcraft_engine::DocState, view: &View, outline: bool) -> Vec { if !shows_artboards(app) { @@ -51,7 +51,7 @@ pub(super) fn frames(app: &VectorcraftApp, st: &vectorcraft_engine::DocState, vi frame = frame.name(format!("{:02} - {}", i + 1, ab.name)); } if outline { - frame + frame.fill(DataColor::new(Color32::WHITE)) } else if grid { frame.checker(checker_of(setup)) } else { diff --git a/crates/ui-egui/src/canvas/artboards/tests.rs b/crates/ui-egui/src/canvas/artboards/tests.rs index 742e798e63..662f46db4a 100644 --- a/crates/ui-egui/src/canvas/artboards/tests.rs +++ b/crates/ui-egui/src/canvas/artboards/tests.rs @@ -47,13 +47,13 @@ fn shift_clicking_a_name_toggles_selection_and_a_plain_click_activates() { } #[test] -fn outline_has_a_white_canvas_line_edges_and_no_paper() { +fn outline_has_white_artboards_on_a_white_canvas_with_line_edges() { let _view = crate::testing::DefaultProofView::new(); let app = app_with(2); let st = app.session.active().unwrap(); assert_eq!(pasteboard_color(&app, st, true), PasteboardColor::Custom(DataColor::new(Color32::WHITE))); assert_eq!(border(true), PageBorder::Line); - assert!(frames_of(&app, true).iter().all(|f| f.fill.is_none())); + assert!(frames_of(&app, true).iter().all(|f| f.fill == Some(PageFill::Color(DataColor::new(Color32::WHITE))))); assert_eq!(pasteboard_color(&app, st, false), PasteboardColor::Default); assert_eq!(border(false), PageBorder::DropShadow); assert!(frames_of(&app, false).iter().all(|f| f.fill.is_some())); diff --git a/crates/ui-egui/src/cursors.rs b/crates/ui-egui/src/cursors.rs index 2f9c594ab7..e97016dff1 100644 --- a/crates/ui-egui/src/cursors.rs +++ b/crates/ui-egui/src/cursors.rs @@ -89,6 +89,7 @@ pub fn tool_cursor(c: Cursor) -> cb::Cursor { Cursor::DirectAnchorSelected => tool("cursor-direct-anchor-selected", TIP, None), Cursor::ReshapeSegment => tool("cursor-reshape-segment", TIP, None), Cursor::GroupSelection => badged(CursorBadge::Add), + Cursor::SelectionMove => badged(CursorBadge::Move), Cursor::SelectionCopy => badged(CursorBadge::Copy), Cursor::Move => system(CursorIcon::Move), Cursor::Crosshair => PaintedCursor::Crosshair.into(), @@ -207,6 +208,7 @@ const GLYPHS: [Cursor; 99] = [ Cursor::ReshapeSegment, Cursor::GroupSelection, Cursor::SelectionCopy, + Cursor::SelectionMove, Cursor::Move, Cursor::Crosshair, Cursor::ResizeH, From b06d1d9af3ca832f61ce4ca65bae5e838442da76 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 13:59:34 +0100 Subject: [PATCH 34/42] Preview plug-in parameter edits from the visible dialog controls --- crates/ui-egui/src/app.rs | 6 ++++++ crates/ui-egui/src/dialogs/plugin.rs | 18 ++++++++++++++---- crates/ui-egui/src/tests/plugins.rs | 22 +++++++++++++++++++++- 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 8ddfe99310..65b6916d55 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -717,7 +717,13 @@ impl VectorcraftApp { export_progress::show(self, ui); // After every window this pass may open, and before the palette's field takes the keyboard. panel_docking::close_overlays_for_modal(self, &ctx); + let drawn_document = self.session.active().map(|st| (st.uid, st.revision)); dialogs::host::pump(self, &ctx); + // The canvas has already painted. A dialog can apply or roll back its preview + // on the final input frame, with no further mouse movement to wake the window. + if self.session.active().map(|st| (st.uid, st.revision)) != drawn_document { + ctx.request_repaint(); + } prefs_dialog::show(self, ui); crate::shortcut_editor::show(self, ui); credits::open_taken_link(self); diff --git a/crates/ui-egui/src/dialogs/plugin.rs b/crates/ui-egui/src/dialogs/plugin.rs index 8b6606e068..d7fb438d2c 100644 --- a/crates/ui-egui/src/dialogs/plugin.rs +++ b/crates/ui-egui/src/dialogs/plugin.rs @@ -42,7 +42,7 @@ use std::sync::Arc; use std::sync::atomic::{AtomicU64, Ordering}; use craft::menu::Node; -use craft::ui::contract::Show as _; +use craft::ui::contract::{Bind, Show as _}; use craft::ui::dialog::{DialogId, DialogResult, DialogStack, Prompt, StackDialog, dialog_id}; use craft::ui::display::{Shade, Text}; use craft::ui::patterns::form_dialogs::{DialogFields, HostedParamDialog, Param, ParamDialog}; @@ -548,7 +548,13 @@ pub(super) fn heading(plugin: &str, command: Option<&str>, gone: &str) -> String /// The builder of a hosted plug-in dialog over its values: the rows of `all` whose parameter is /// shown for the values (`m.visible`), after the description. The rows are made again in the UI /// language when it changes while the dialog is open; the field values stay as they are. -fn build(key: &'static str, m: Manifest, all: Arc<[Param]>, look: Look) -> impl for<'b> Fn(&'b mut DialogFields) -> ParamDialog<'b> + Send + 'static { +fn build( + key: &'static str, + m: Manifest, + all: Arc<[Param]>, + look: Look, + canvas: Option, +) -> impl for<'b> Fn(&'b mut DialogFields) -> ParamDialog<'b> + Send + 'static { let rows_in = std::sync::Mutex::new((lang(), all)); move |fields| { let all = { @@ -564,7 +570,10 @@ fn build(key: &'static str, m: Manifest, all: Arc<[Param]>, look: Look) -> impl rows.push(Param::read_only_text("description", "", look.description.clone()).full_width()); } rows.extend(all.iter().filter(|p| shown.contains(p.key.as_str())).cloned()); - let mut dialog = ParamDialog::new(key, look.heading(), Cow::Owned(rows)).previews(look.previews); + let mut dialog = ParamDialog::new(key, look.heading(), Cow::Owned(rows)).previews(look.previews).values(Bind::bound(fields)); + if let Some(canvas) = canvas.filter(|_| look.previews) { + dialog = dialog.canvas(canvas); + } if let Some(ok) = look.ok { dialog = dialog.ok_label(ok.into()); } @@ -592,7 +601,8 @@ fn open_hosted( close_open(app); let all: Arc<[Param]> = form::plugin_params(&m, &values).into(); let fields = form::fields_of(&all, &values); - let dialog = HostedParamDialog::new(&ctx, key, fields, build(key, m, Arc::clone(&all), look)).instance(instance.to_string()); + let canvas = crate::doc_windows::current(app).map(crate::canvas::canvas_id); + let dialog = HostedParamDialog::new(&ctx, key, fields, build(key, m, Arc::clone(&all), look, canvas)).instance(instance.to_string()); let id = dialogs.with(|host| host.open(dialog)); Ok((id, all)) } diff --git a/crates/ui-egui/src/tests/plugins.rs b/crates/ui-egui/src/tests/plugins.rs index ff7c9e71ee..c2a72c626d 100644 --- a/crates/ui-egui/src/tests/plugins.rs +++ b/crates/ui-egui/src/tests/plugins.rs @@ -181,7 +181,9 @@ fn plugins_are_listed_in_the_object_and_effect_menus() { #[test] fn filter_dialog_previews_and_commits_one_undo_step() { - let mut h = window(app()); + let mut app = app(); + app.canvas.worker_started = true; // Canvas uploads finish within the frame being asserted. + let mut h = window(app); h.state_mut().run("plugin.install", json!({"dataBase64": vectorcraft_format::base64_encode(DESATURATE)})).unwrap(); let id = red_rect(h.state_mut()); let undo = h.state().session.doc().unwrap().history.undo.len(); @@ -189,12 +191,30 @@ fn filter_dialog_previews_and_commits_one_undo_step() { step(&mut h); assert!(top(h.state()).is_some(), "dialog open"); assert_eq!(fields(h.state())["amount"], json!(100.0)); + // A click in the visible slider must reach the same values the live preview reads. + use egui_kittest::kittest::Queryable as _; + let at = h.get_by_role(egui::accesskit::Role::Dialog).get_by_role(egui::accesskit::Role::Slider).rect().center(); + h.input_mut().events.push(egui::Event::PointerMoved(at)); + for pressed in [true, false] { + h.input_mut().events.push(egui::Event::PointerButton { + pos: at, + button: egui::PointerButton::Primary, + pressed, + modifiers: Default::default(), + }); + step(&mut h); + } + assert!(fields(h.state())["amount"].as_f64().is_some_and(|amount| amount > 0.0 && amount < 100.0)); // Agents set fields like `ui.dialog.set` does; the frame previews them. set_field(&mut h, "amount", json!(50)).unwrap(); step(&mut h); assert!(h.state().session.in_interaction(), "previewing"); let [r, g, _] = fill_rgb(h.state(), id); assert!(r < 1.0 && g > 0.0, "half desaturated on the canvas: {r} {g}"); + step(&mut h); + let (shown, _) = h.state().canvas.shown.as_ref().expect("a rendered canvas frame"); + let shown_fill = shown.node(id).unwrap().appearance.fill_paint().color().unwrap().to_rgb_uncalibrated(); + assert_eq!(shown_fill, fill_rgb(h.state(), id), "the canvas showed the preview before OK"); answer(&mut h, true); assert!(top(h.state()).is_none()); let st = h.state().session.doc().unwrap(); From 7c8d4ea5a78faac1cdbfc51d51248d5b9693fe5a Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 14:08:52 +0100 Subject: [PATCH 35/42] Keep large PDF previews and confirmed page imports off the desktop UI thread --- crates/ui-egui/src/dialogs/import_pdf.rs | 69 ++++++++++++++++--- .../ui-egui/src/dialogs/tests_import_pdf.rs | 14 ++++ 2 files changed, 74 insertions(+), 9 deletions(-) diff --git a/crates/ui-egui/src/dialogs/import_pdf.rs b/crates/ui-egui/src/dialogs/import_pdf.rs index f539897c25..8bf7e37874 100644 --- a/crates/ui-egui/src/dialogs/import_pdf.rs +++ b/crates/ui-egui/src/dialogs/import_pdf.rs @@ -114,11 +114,19 @@ pub(super) fn render_preview( app: &mut VectorcraftApp, ctx: &egui::Context, doc: &vectorcraft_engine::doc::Document, +) -> Option> { + render_page_preview(&mut app.canvas.renderer, ctx.pixels_per_point(), doc) +} + +fn render_page_preview( + renderer: &mut vectorcraft_render::Renderer, + pixels_per_point: f32, + doc: &vectorcraft_engine::doc::Document, ) -> Option> { let region = doc.artboards.first()?.rect; - let px = PREVIEW_PX * ctx.pixels_per_point() as f64; + let px = PREVIEW_PX * pixels_per_point as f64; let scale = px / region.width().max(region.height()).max(1.0); - let img = app.canvas.renderer.render_region(doc, region, scale, true); + let img = renderer.render_region(doc, region, scale, true); Some(Arc::new(crate::canvas::color_image(&img))) } @@ -286,6 +294,8 @@ pub(super) struct ImportPdfDialog { /// The preview shown for a (page, crop, text) revision; `None` for a page that could not be read, which is /// not asked for again. preview: Option<(Revision, Option>)>, + /// One preview at a time. Page changes coalesce while the worker finishes. + pending_preview: Option<(Revision, std::sync::mpsc::Receiver>>)>, /// Why the last password did not open the file. password_error: Option, /// The OK the pump has not answered. @@ -294,7 +304,7 @@ pub(super) struct ImportPdfDialog { impl ImportPdfDialog { fn new(s: State) -> Self { - ImportPdfDialog { id: dialog_id(KIND), s, preview: None, password_error: None, held: HeldAnswer::new() } + ImportPdfDialog { id: dialog_id(KIND), s, preview: None, pending_preview: None, password_error: None, held: HeldAnswer::new() } } /// The preview to render next: the revision of the shown page, crop and text, when the stored one differs. @@ -700,7 +710,14 @@ fn confirm(app: &mut VectorcraftApp, s: &State) -> Result<(), String> { if s.links_on() { p["linkPages"] = json!(true); } - io::open_document(app, &s.name, &s.file.bytes, s.path.clone(), &p).map(|_| ()) + if crate::opening::available() + && let Some(path) = s.path.as_deref() + { + crate::opening::start_with(app, path, s.file.bytes.clone(), p); + Ok(()) + } else { + io::open_document(app, &s.name, &s.file.bytes, s.path.clone(), &p).map(|_| ()) + } }; // Asked only for the password, the dialog showed no Text choice to keep; the choice for a `.ai` // or `.ait` file is not kept for PDFs. @@ -711,10 +728,10 @@ fn confirm(app: &mut VectorcraftApp, s: &State) -> Result<(), String> { } /// The preview of the page and boxes `s` shows; `None` for a page that can't be read. -fn preview_image(app: &mut VectorcraftApp, ctx: &egui::Context, s: &State) -> Option> { +fn preview_image(renderer: &mut vectorcraft_render::Renderer, pixels_per_point: f32, s: &State) -> Option> { let opts = fileio::LoadOptions { crop: s.crop, password: s.password(), text_as: s.preview_text_as(), ..Default::default() }; let (doc, _) = fileio::page_document(&s.file.bytes, s.page().saturating_sub(1), &opts).ok()?; - render_preview(app, ctx, &doc) + render_page_preview(renderer, pixels_per_point, &doc) } /// The host pump: judges the OK the dialog holds (opening or placing the file; a refusal keeps the dialog open with @@ -730,10 +747,44 @@ pub(crate) fn pump(app: &mut VectorcraftApp, ctx: &egui::Context) { dialog.answer_ok(answer); } }); + return; } - let wanted = dialogs.with(|host| host.get::().and_then(|d| Some((d.wanted_preview()?, d.s.clone())))); - if let Some((revision, s)) = wanted { - let image = preview_image(app, ctx, &s); + let wanted = dialogs.with(|host| { + let dialog = host.get_mut::()?; + if let Some((revision, pending)) = &dialog.pending_preview { + let image = match pending.try_recv() { + Ok(image) => image, + Err(std::sync::mpsc::TryRecvError::Disconnected) => None, + Err(std::sync::mpsc::TryRecvError::Empty) => return None, + }; + if dialog.wanted_preview() == Some(*revision) { + dialog.set_preview(*revision, image); + } + dialog.pending_preview = None; + } + Some((dialog.wanted_preview()?, dialog.s.clone())) + }); + let Some((revision, state)) = wanted else { return }; + let pixels_per_point = ctx.pixels_per_point(); + if crate::opening::available() { + let (sender, pending) = std::sync::mpsc::channel(); + dialogs.with(|host| { + if let Some(dialog) = host.get_mut::() { + dialog.pending_preview = Some((revision, pending)); + } + }); + let wake = ctx.clone(); + let scope = vectorcraft_engine::file_access::ScopeHandle::capture(); + app.jobs().spawn( + "vectorcraft-pdf-preview", + Box::new(move || { + let image = scope.run(|| preview_image(&mut vectorcraft_render::Renderer::new(), pixels_per_point, &state)); + let _ = sender.send(image); + wake.request_repaint(); + }), + ); + } else { + let image = preview_image(&mut app.canvas.renderer, pixels_per_point, &state); dialogs.with(|host| { if let Some(dialog) = host.get_mut::() { dialog.set_preview(revision, image); diff --git a/crates/ui-egui/src/dialogs/tests_import_pdf.rs b/crates/ui-egui/src/dialogs/tests_import_pdf.rs index 3b96687a49..c9383d0f44 100644 --- a/crates/ui-egui/src/dialogs/tests_import_pdf.rs +++ b/crates/ui-egui/src/dialogs/tests_import_pdf.rs @@ -117,6 +117,20 @@ fn pdf_page_footer_ok_opens_the_chosen_range() { assert_eq!(artboard_widths(h.state()), [200.0, 300.0]); } +#[test] +fn confirming_a_desktop_pdf_import_queues_the_read_and_closes_the_dialog() { + crate::opening::tests::with_threads(|| { + let mut app = app(); + io::open_bytes(&mut app, "three.pdf", &three_pages(), Some("three.pdf".into())).unwrap(); + set(&mut app, "allPages", json!(false)); + set(&mut app, "range", json!("2-3")); + confirm(&mut app).unwrap(); + assert!(!is_open(&app)); + assert_eq!(app.opening.pending.len(), 1); + assert_eq!(app.opening.pending[0].path, "three.pdf"); + }); +} + #[test] fn opening_a_multi_page_pdf_asks_for_the_pages() { let mut app = app(); From 3575fa6d2b4ecd77d8337169a9b6cd51c51ff280 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 14:18:14 +0100 Subject: [PATCH 36/42] Leave the artwork visible while previewing a transform --- crates/ui-egui/src/dialogs/transform.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/ui-egui/src/dialogs/transform.rs b/crates/ui-egui/src/dialogs/transform.rs index 7437183918..d0618d050a 100644 --- a/crates/ui-egui/src/dialogs/transform.rs +++ b/crates/ui-egui/src/dialogs/transform.rs @@ -150,11 +150,16 @@ pub(crate) fn open(app: &mut VectorcraftApp, kind: Kind, tool: &Value) { let document = app.session.active().map(|doc| (doc.uid, doc.reverts)); let rows = rows(app, kind, &opening); let fields = fields_of(&rows, &opening); + let canvas = crate::doc_windows::current(app).map(crate::canvas::canvas_id); let dialog = HostedParamDialog::new(&ctx, kind.command(), fields, move |f| { if kind == Kind::Move { link_distance_and_angle(f); } let dialog = ParamDialog::new(kind.command(), kind.title(), rows.clone()).previews(true).values(Bind::bound(f)); + let dialog = match canvas { + Some(canvas) => dialog.canvas(canvas), + None => dialog, + }; if kind == Kind::Move { dialog.remember(MOVE_KEY) } else { dialog } }); // A dialog this one replaces leaves its preview behind otherwise. From e7a2662ee1e1c85f5b3b7695f8c401fcbf6d6a51 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 14:21:56 +0100 Subject: [PATCH 37/42] Count the selected-art pointer in the cursor catalog --- crates/ui-egui/src/cursors.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/cursors.rs b/crates/ui-egui/src/cursors.rs index e97016dff1..6af53f1028 100644 --- a/crates/ui-egui/src/cursors.rs +++ b/crates/ui-egui/src/cursors.rs @@ -71,7 +71,7 @@ fn badged(badge: CursorBadge) -> cb::Cursor { PaintedCursor::badged(CursorIcon::Default, badge).into() } -/// The rotate pointer beside a box, at `octant` from the box's centre (0 up, clockwise in 45° steps). +/// The rotate pointer beside a box, at `octant` from the box's centre (0 up, clockwise in 45° steps). /// Its arc bends round the corner it is at, so it opens toward the centre: opposite the octant. fn turn_toward(octant: u8) -> cb::Cursor { let angle = f32::from(octant % 8) * std::f32::consts::FRAC_PI_4; @@ -196,7 +196,7 @@ pub(crate) fn request_busy(app: &crate::VectorcraftApp, ctx: &egui::Context) { /// Every cursor with a look: its own, or the one it borrows. #[cfg(test)] -const GLYPHS: [Cursor; 99] = [ +const GLYPHS: [Cursor; 100] = [ Cursor::Hand, Cursor::HandGrab, Cursor::ZoomIn, From 42187cdbdf45d9d5bc7a75a554964e9b0611dda6 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 14:22:21 +0100 Subject: [PATCH 38/42] Exercise playback using the active source artboard at copy time --- crates/ui-egui/src/panels/actions/tests_playback.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/ui-egui/src/panels/actions/tests_playback.rs b/crates/ui-egui/src/panels/actions/tests_playback.rs index f566eb22fc..d81c005ef1 100644 --- a/crates/ui-egui/src/panels/actions/tests_playback.rs +++ b/crates/ui-egui/src/panels/actions/tests_playback.rs @@ -89,7 +89,9 @@ fn actions_play_on_the_artboard_active_when_they_play() { app.ui.actions.push(Action { set, ..Action::new(name, steps) }).unwrap(); set_actions(app, 0).len() - 1 }; + app.view_mut().unwrap().artboard = 1; app.run("edit.copy", json!({})).unwrap(); + app.view_mut().unwrap().artboard = 0; let align = record(&mut app, "Align Left", "object.align", json!({"horizontal": "left", "to": "artboard"})); assert_eq!(bounds(&app, &[rect]).x0, boards[0].x0, "aligned to artboard 0 while recording"); let paste = record(&mut app, "Paste in Place", "edit.pasteInPlace", json!({})); From 0e9b1e8dd162852519d6c4a30fa41aa118fd8eba Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 14:28:10 +0100 Subject: [PATCH 39/42] Preserve the degree symbol in the cursor documentation --- crates/ui-egui/src/cursors.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/cursors.rs b/crates/ui-egui/src/cursors.rs index 6af53f1028..b120d35c4a 100644 --- a/crates/ui-egui/src/cursors.rs +++ b/crates/ui-egui/src/cursors.rs @@ -71,7 +71,7 @@ fn badged(badge: CursorBadge) -> cb::Cursor { PaintedCursor::badged(CursorIcon::Default, badge).into() } -/// The rotate pointer beside a box, at `octant` from the box's centre (0 up, clockwise in 45° steps). +/// The rotate pointer beside a box, at `octant` from the box's centre (0 up, clockwise in 45° steps). /// Its arc bends round the corner it is at, so it opens toward the centre: opposite the octant. fn turn_toward(octant: u8) -> cb::Cursor { let angle = f32::from(octant % 8) * std::f32::consts::FRAC_PI_4; From 3fe7b276016f6b31f7d13923e4477f2385e55817 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 14:38:21 +0100 Subject: [PATCH 40/42] Wait for the plug-in dialog to settle before clicking its slider --- crates/ui-egui/src/tests/plugins.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/tests/plugins.rs b/crates/ui-egui/src/tests/plugins.rs index c2a72c626d..6dc9853a2a 100644 --- a/crates/ui-egui/src/tests/plugins.rs +++ b/crates/ui-egui/src/tests/plugins.rs @@ -193,8 +193,13 @@ fn filter_dialog_previews_and_commits_one_undo_step() { assert_eq!(fields(h.state())["amount"], json!(100.0)); // A click in the visible slider must reach the same values the live preview reads. use egui_kittest::kittest::Queryable as _; + // Let the modal finish its opening placement before reading a widget's screen bounds. + for _ in 0..3 { + step(&mut h); + } let at = h.get_by_role(egui::accesskit::Role::Dialog).get_by_role(egui::accesskit::Role::Slider).rect().center(); h.input_mut().events.push(egui::Event::PointerMoved(at)); + step(&mut h); for pressed in [true, false] { h.input_mut().events.push(egui::Event::PointerButton { pos: at, @@ -204,7 +209,8 @@ fn filter_dialog_previews_and_commits_one_undo_step() { }); step(&mut h); } - assert!(fields(h.state())["amount"].as_f64().is_some_and(|amount| amount > 0.0 && amount < 100.0)); + let clicked = fields(h.state()); + assert!(clicked["amount"].as_f64().is_some_and(|amount| amount > 0.0 && amount < 100.0), "slider at {at:?}: {clicked}"); // Agents set fields like `ui.dialog.set` does; the frame previews them. set_field(&mut h, "amount", json!(50)).unwrap(); step(&mut h); From 99a5b6cdc4215109818dee527577c63d8a838533 Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 14:54:47 +0100 Subject: [PATCH 41/42] Describe the selected-art pointer in the cursor reference --- crates/tools/src/cursors.toml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/tools/src/cursors.toml b/crates/tools/src/cursors.toml index 0b19e3e4c0..fd528eaeef 100644 --- a/crates/tools/src/cursors.toml +++ b/crates/tools/src/cursors.toml @@ -129,11 +129,20 @@ shown_when = [ hotspot = "The arrow's tip." look = "Arrow with a small x badge (nothing to select)." +[[cursor]] +id = "SelectionMove" +group = "Selection" +shown_when = [ + "The Selection tool over a selected object, its movable source artwork, or its visible centre point.", + "The Selection tool over artwork while Alt is held, before the copy drag begins.", +] +hotspot = "The arrow's tip." +look = "The Selection arrow with a small move badge." + [[cursor]] id = "Move" group = "Selection" shown_when = [ - "The Selection tool over a selected object, or over any object with Alt held (once an Alt-drag starts, SelectionCopy shows).", "The shape tools over a selected object's centre point (Attributes › Show Center), before a press there moves it (while the drag runs the arrow is plain, SelectionCopy with Alt, ArrowHollow while it snaps).", "Reshape over a path or while dragging.", "Inside the Free Transform and Crop Image boxes.", From 98026915ab97e38ce28c7eb8c3afca0c5cfe67ee Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 30 Nov 2026 15:26:38 +0100 Subject: [PATCH 42/42] Check the Selection move pointer over source art and document the centre-point modifier --- crates/engine/src/tests/select_effects.rs | 2 +- crates/tools/src/cursors.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/tests/select_effects.rs b/crates/engine/src/tests/select_effects.rs index 055711cb43..07feda9d7c 100644 --- a/crates/engine/src/tests/select_effects.rs +++ b/crates/engine/src/tests/select_effects.rs @@ -235,7 +235,7 @@ fn shift_click_direct_selection_and_hover_on_a_drop_shadow_pass_through_it() { run(&mut s, "select.set", json!({"ids": [a.0]})); let v = ViewInfo::default(); s.select_tool("selection", v).unwrap(); - assert_eq!(s.cursor(Point::new(50.0, 50.0), Mods::default(), v), Cursor::Move); + assert_eq!(s.cursor(Point::new(50.0, 50.0), Mods::default(), v), Cursor::SelectionMove); assert_eq!(s.cursor(Point::new(110.0, 50.0), Mods::default(), v), Cursor::Arrow); assert_eq!(s.cursor(Point::new(92.0, 50.0), Mods::default(), v), Cursor::Arrow); } diff --git a/crates/tools/src/cursors.toml b/crates/tools/src/cursors.toml index fd528eaeef..5528b7cd97 100644 --- a/crates/tools/src/cursors.toml +++ b/crates/tools/src/cursors.toml @@ -133,7 +133,7 @@ look = "Arrow with a small x badge (nothing to select)." id = "SelectionMove" group = "Selection" shown_when = [ - "The Selection tool over a selected object, its movable source artwork, or its visible centre point.", + "The Selection tool over a selected object or its movable source artwork, or over its visible centre point without Cmd/Ctrl held.", "The Selection tool over artwork while Alt is held, before the copy drag begins.", ] hotspot = "The arrow's tip."