From d2aede7c6ecc4b575492f86c0fd88578249e6e3e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 21:44:13 -0800 Subject: [PATCH 01/32] Eyedropper: Object Highlighting outlines the object a click would act on With Smart Guides' Object Highlighting on, the Eyedropper now outlines the object under the pointer that a click there would act on, with the 1.5 px layer-color outline the selection tools draw. It follows the keys held: a plain click's source (locked and template art included, as the Eyedropper reads them), the selected gradient mesh a click recolors, the editable object an Alt-click gives the selection's attributes to, and for a Shift-click the object whose color is sampled (a blend or an envelope where its art is drawn, the art below where it leaves a gap). Empty canvas and hidden art show no outline. The tool finds that object with the same code its click uses: the click is planned once (Tool::hover_object, Session::hover_object) and the color sampler returns the object the color came from. The canvas keeps the object found until the pointer, the keys, the document, the selection or the tool's settings change, since finding it can sample a color. With Space held, a press pans the view, so no tool outlines an object under the pointer; the selection tools showed one before. --- crates/engine/src/tooling.rs | 12 +- crates/tools/src/lib.rs | 6 + crates/tools/src/xform/eyedropper.rs | 258 +++++++++++++++++++------- crates/ui-egui/src/app.rs | 1 + crates/ui-egui/src/caches.rs | 4 + crates/ui-egui/src/canvas.rs | 4 +- crates/ui-egui/src/canvas/overlays.rs | 87 ++++++++- crates/ui-egui/src/canvas/tests.rs | 136 ++++++++++++++ docs/target-app-parity.md | 1 + 9 files changed, 427 insertions(+), 82 deletions(-) diff --git a/crates/engine/src/tooling.rs b/crates/engine/src/tooling.rs index 7b1caffb7c..9642718bf7 100644 --- a/crates/engine/src/tooling.rs +++ b/crates/engine/src/tooling.rs @@ -1,7 +1,7 @@ //! Hosting the active tool: pointer/key events → actions → commands. use serde_json::{Map, Value}; -use vectorcraft_doc::Selection; +use vectorcraft_doc::{NodeId, Selection}; use vectorcraft_geom::Point; use vectorcraft_tools::distort::perspective::widget::WidgetPlace; use vectorcraft_tools::draw2::FEEDBACK; @@ -1323,6 +1323,16 @@ impl Session { if self.precise_cursors() { c.precise() } else { c } } + /// The object a click of the active tool at `p` with `mods` would act on + /// ([`vectorcraft_tools::Tool::hover_object`]), for Smart Guides › Object Highlighting. None + /// while Cmd lends a selection tool to the press. + pub fn hover_object(&mut self, p: Point, mods: Mods, view: ViewInfo) -> Option { + if mods.cmd && self.lender.is_none() && !self.tool_editing() && self.lent_tool(self.tool.id(), &mods).is_some() { + return None; + } + self.with_tool_cx(view, |t, cx| t.hover_object(cx, p, mods)) + } + /// General › Use Precise Cursors is on, or Caps Lock is. fn precise_cursors(&self) -> bool { self.prefs.use_precise_cursors || self.caps_lock diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs index 688f295478..08fba91aa3 100644 --- a/crates/tools/src/lib.rs +++ b/crates/tools/src/lib.rs @@ -305,6 +305,12 @@ pub trait Tool: Send { fn wants_rehover(&self) -> bool { false } + /// The object a click at `p` with `mods` would act on, which Smart Guides › Object + /// Highlighting outlines while the pointer rests there (the Eyedropper's source). None when a + /// click there acts on no object, or the tool does not name one. + fn hover_object(&self, _cx: &ToolContext, _p: Point, _mods: Mods) -> Option { + None + } /// What the Info panel shows for the tool as it is now: the drag in progress (a move of the /// selection, a gradient vector, a handle the Pen pulls out, a Scale, Rotate, Reflect or Shear /// tool drag), or the Paintbrush's brush. None for a tool with nothing of its own to show. diff --git a/crates/tools/src/xform/eyedropper.rs b/crates/tools/src/xform/eyedropper.rs index d45dff84ed..3448991367 100644 --- a/crates/tools/src/xform/eyedropper.rs +++ b/crates/tools/src/xform/eyedropper.rs @@ -34,6 +34,9 @@ //! Image Trace's Ignore Color eyedropper passes its bound document point to the panel, which //! samples the original image pixels and ends the pick only when a color is accepted. A miss //! stays armed; this tool changes neither paint nor selection. +//! +//! The object a click at the pointer would act on, with the keys held, is the tool's hover object +//! ([`Tool::hover_object`]), which Smart Guides › Object Highlighting outlines. use std::collections::HashSet; @@ -165,6 +168,12 @@ pub(crate) fn sample_source(cx: &ToolContext, p: Point) -> Option<(vectorcraft_d /// The visible color under `p`, including image pixels, pattern tiles, mesh colors, intermediate /// gradient colors, the steps a blend draws and an envelope's distorted contents. pub(crate) fn sample_color_at(cx: &ToolContext, p: Point) -> Option { + sample_at(cx, p).map(|(c, _)| c) +} + +/// [`sample_color_at`] with the object of the document that gives the color: the object hit, the +/// blend or envelope whose art is sampled, or an object below them that was passed over to. +fn sample_at(cx: &ToolContext, p: Point) -> Option<(Color, NodeId)> { let (doc, opts, raster_sample) = (cx.doc, sample_options(cx), cx.raster_sample); vectorcraft_doc::depth::with_deep_stack(|| { let symbol_nodes = doc.symbols.iter().map(|s| s.art.count()).sum(); @@ -175,13 +184,13 @@ pub(crate) fn sample_color_at(cx: &ToolContext, p: Point) -> Option { }) } -/// The color the front-most object of `doc` hit at `p` with `opts` shows there. Where a stroke +/// The color the front-most object of `doc` hit at `p` with `opts` shows there, and that object. Where a stroke /// gives no color at `p` (a gap between its pattern's tiles), the object's own fill there does; /// an object that gives none at all is passed over for the ones below it. A hit on a blend or an /// envelope, or on an object it holds, samples the art it draws ([`live_color_at`]), and where /// that art leaves `p` empty the whole blend or envelope is passed over. `levels` holds the /// scratch documents for art inside art, one for each level deeper. -fn color_under(s: &mut Sampler, doc: &Document, levels: &mut [Option], p: Point, opts: HitOptions) -> Option { +fn color_under(s: &mut Sampler, doc: &Document, levels: &mut [Option], p: Point, opts: HitOptions) -> Option<(Color, NodeId)> { let mut passed: HashSet = HashSet::new(); let mut size = None; loop { @@ -197,7 +206,7 @@ fn color_under(s: &mut Sampler, doc: &Document, levels: &mut [Option], let h = hit_test_visible_skipping(doc, p, opts, &|id| passed.contains(&id))?; if let Some(live) = drawn_live(doc, &h.ancestry) { if let Some(c) = live_color_at(s, levels, live, p) { - return Some(c); + return Some((c, live.id)); } if !passed.insert(live.id) { return None; @@ -208,13 +217,13 @@ fn color_under(s: &mut Sampler, doc: &Document, levels: &mut [Option], let n = doc.node(id)?; let on_stroke = h.kind == HitKind::Stroke; if let Some(c) = node_color_at(s, levels, n, on_stroke, p) { - return Some(c); + return Some((c, id)); } if on_stroke && fill_covers(n, p) && let Some(c) = node_color_at(s, levels, n, false, p) { - return Some(c); + return Some((c, id)); } if !passed.insert(id) { return None; @@ -464,7 +473,7 @@ fn art_color_at(s: &mut Sampler, levels: &mut [Option], art: impl Into scratch.insert(Some(layer), usize::MAX, n).ok()?; } let opts = HitOptions { scope: None, tol: 0.0, outline: false, ..s.opts }; - color_under(s, scratch, deeper, p, opts) + color_under(s, scratch, deeper, p, opts).map(|(c, _)| c) } /// Gives `n` and everything in it new ids from `doc` (pattern instances all have id 0). @@ -524,72 +533,50 @@ impl Tool for EyedropperTool { if ev.kind != PointerKind::Down { return vec![]; } - if let Some(binding) = &self.image_trace_ignore_color { - // The panel knows whether this hits an opaque source pixel. It clears the binding - // and restores the previous tool only after accepting a color, not on a miss. - return vec![Action::Dialog("imageTraceIgnoreColor".into(), json!({ "binding": binding, "point": [ev.pos.x, ev.pos.y] }))]; + let Some(click) = self.click(cx, ev.pos, ev.mods) else { return vec![] }; + match click { + Click::ImageTrace(binding) => { + // The panel knows whether this hits an opaque source pixel. It clears the binding + // and restores the previous tool only after accepting a color, not on a miss. + vec![Action::Dialog("imageTraceIgnoreColor".into(), json!({ "binding": binding, "point": [ev.pos.x, ev.pos.y] }))] + } + Click::BrushKeyColor(c, _) => { + let back = self.stop.take().unwrap_or_else(|| "selection".to_string()); + self.brush_key_color = false; + vec![Action::Dialog("brushKeyColor".into(), json!({ "color": color_json(&c) })), Action::SwitchTool(back)] + } + Click::BackToBucket => { + self.stop = None; + vec![Action::SwitchTool("livePaintBucket".into())] + } + Click::MeshPoints(id, points, color) => { + let params = json!({ "id": id.0, "points": points, "color": color_json(&color), "keepModel": true }); + vec![Action::Exec("object.mesh.setPointColor".into(), params)] + } + Click::CopyFrom(src, how) => { + let params = match how { + Some(how) => json!({ "source": src.0, how: true }), + None => json!({ "source": src.0 }), + }; + vec![Action::Exec("appearance.copyFrom".into(), params)] + } + Click::Sample { color, meshes, stop, .. } => { + let color = color_json(&color); + if !meshes.is_empty() { + let ids: Vec = meshes.iter().map(|id| id.0).collect(); + return vec![Action::Exec("paint.sampleColor".into(), json!({ "color": color, "stroke": false, "ids": ids }))]; + } + let Some((back, i)) = stop else { return vec![Action::Exec("paint.sampleColor".into(), json!({ "color": color }))] }; + self.stop = None; + vec![Action::Exec("paint.sampleColor".into(), json!({ "color": color, "stop": i })), Action::SwitchTool(back)] + } } - let opts = sample_options(cx); - if self.brush_key_color { - let Some(c) = sample_color_at(cx, ev.pos) else { return vec![] }; - let back = self.stop.clone().unwrap_or_else(|| "selection".to_string()); - self.brush_key_color = false; - self.stop = None; - return vec![Action::Dialog("brushKeyColor".into(), json!({ "color": color_json(&c) })), Action::SwitchTool(back)]; - } - // A pick for a stop of the Live Paint Bucket's gradient (the default paint's) ends without - // sampling once that stop is no longer selected (a Cmd-click selected another object) or no - // longer there (another paint was chosen): the click switches back. - let bucket_paint = if cx.fill_active { &cx.paint.fill } else { &cx.paint.stroke }; - let bucket_stop = cx.gradient_stop.filter(|i| matches!(bucket_paint, Paint::Gradient(g) if *i < g.gradient.stops.len())); - if self.stop.as_deref() == Some("livePaintBucket") && bucket_stop.is_none() { - self.stop = None; - return vec![Action::SwitchTool("livePaintBucket".into())]; - } - let stop = self.stop.as_ref().zip(cx.gradient_stop); - // A plain click on a selected gradient mesh gives the fill color to the point there, else - // to the four points of the patch there. - if stop.is_none() - && !ev.mods.alt - && !ev.mods.shift - && let Paint::Solid { color, .. } = &cx.paint.fill - && let Some((id, points)) = selected_mesh_points(cx, ev.pos) - { - let params = json!({ "id": id.0, "points": points, "color": color_json(color), "keepModel": true }); - return vec![Action::Exec("object.mesh.setPointColor".into(), params)]; - } - // Reading a source is independent of its editability. Only Alt's reverse operation - // writes to the clicked object; Shift+Alt appends its appearance to the selection. - let source = if ev.mods.alt && !ev.mods.shift && stop.is_none() { - hit_test(cx.doc, ev.pos, opts).map(|h| (paint_owner(cx.doc, h.leaf), h.kind)) - } else { - sample_source(cx, ev.pos) - }; - let Some((src, _)) = source else { return vec![] }; - let Some(n) = cx.doc.node(src) else { return vec![] }; - if ev.mods.alt && stop.is_none() { - let how = if ev.mods.shift { "append" } else { "reverse" }; - return vec![Action::Exec("appearance.copyFrom".into(), json!({ "source": src.0, how: true }))]; - } - let image = matches!(n.kind, NodeKind::Image(_)); - // Picked mesh points take only a color sampled from other art or an image: the sample goes - // to them as a fill, and to nothing else that is selected. A click on a mesh with picked - // points is handled as before. - let meshes = if stop.is_none() { picked_meshes(cx, &self.mesh_points) } else { vec![] }; - let meshes = if meshes.contains(&src) { vec![] } else { meshes }; - if !(ev.mods.shift || stop.is_some() || image || !meshes.is_empty()) { - return vec![Action::Exec("appearance.copyFrom".into(), json!({ "source": src.0 }))]; - } - let Some(c) = sample_color_at(cx, ev.pos) else { return vec![] }; - let color = color_json(&c); - if !meshes.is_empty() { - let ids: Vec = meshes.iter().map(|id| id.0).collect(); - return vec![Action::Exec("paint.sampleColor".into(), json!({ "color": color, "stroke": false, "ids": ids }))]; - } - let Some((back, i)) = stop else { return vec![Action::Exec("paint.sampleColor".into(), json!({ "color": color }))] }; - let out = vec![Action::Exec("paint.sampleColor".into(), json!({ "color": color, "stop": i })), Action::SwitchTool(back.clone())]; - self.stop = None; - out + } + + /// The object a click there samples, recolors or copies attributes to, as [`Self::click`] + /// finds it. + fn hover_object(&self, cx: &ToolContext, p: Point, mods: Mods) -> Option { + self.click(cx, p, mods)?.object() } /// Expose a transient text range alongside gradient-stop and brush-key sampling state. @@ -684,11 +671,92 @@ impl Tool for EyedropperTool { } } +/// What a click with the Eyedropper does, which [`EyedropperTool::pointer`] carries out. +enum Click { + /// Image Trace's Ignore Color pick: the panel samples the image with this binding. + ImageTrace(Value), + /// Brush Options › Key Color: this color, sampled from this object. + BrushKeyColor(Color, NodeId), + /// A pick for a Live Paint Bucket stop that is no longer selected switches back unsampled. + BackToBucket, + /// The fill color goes to these points of this selected gradient mesh. + MeshPoints(NodeId, Vec, Color), + /// `appearance.copyFrom` this source, with `reverse` or `append` or neither. + CopyFrom(NodeId, Option<&'static str>), + /// This color, sampled from `source`, goes to the picked points of `meshes`, else to the + /// gradient stop of `stop` (the tool to switch back to and the stop), else to the active fill + /// or stroke. + Sample { color: Color, source: NodeId, meshes: Vec, stop: Option<(String, usize)> }, +} + +impl Click { + /// The object of the document the click reads from or writes to. + fn object(&self) -> Option { + match self { + Click::ImageTrace(_) | Click::BackToBucket => None, + Click::BrushKeyColor(_, id) | Click::MeshPoints(id, ..) | Click::CopyFrom(id, _) | Click::Sample { source: id, .. } => Some(*id), + } + } +} + impl EyedropperTool { /// Is a gradient stop, Brush Key Color or Image Trace Ignore Color pick armed? fn picking(&self) -> bool { self.stop.is_some() || self.brush_key_color || self.image_trace_ignore_color.is_some() } + + /// What a click at `p` with `mods` does, or None when it does nothing. + fn click(&self, cx: &ToolContext, p: Point, mods: Mods) -> Option { + if let Some(binding) = &self.image_trace_ignore_color { + return Some(Click::ImageTrace(binding.clone())); + } + if self.brush_key_color { + let (c, source) = sample_at(cx, p)?; + return Some(Click::BrushKeyColor(c, source)); + } + // A pick for a stop of the Live Paint Bucket's gradient (the default paint's) ends without + // sampling once that stop is no longer selected (a Cmd-click selected another object) or no + // longer there (another paint was chosen): the click switches back. + let bucket_paint = if cx.fill_active { &cx.paint.fill } else { &cx.paint.stroke }; + let bucket_stop = cx.gradient_stop.filter(|i| matches!(bucket_paint, Paint::Gradient(g) if *i < g.gradient.stops.len())); + if self.stop.as_deref() == Some("livePaintBucket") && bucket_stop.is_none() { + return Some(Click::BackToBucket); + } + let stop = self.stop.clone().zip(cx.gradient_stop); + // A plain click on a selected gradient mesh gives the fill color to the point there, else + // to the four points of the patch there. + if stop.is_none() + && !mods.alt + && !mods.shift + && let Paint::Solid { color, .. } = &cx.paint.fill + && let Some((id, points)) = selected_mesh_points(cx, p) + { + return Some(Click::MeshPoints(id, points, *color)); + } + // Reading a source is independent of its editability. Only Alt's reverse operation + // writes to the clicked object; Shift+Alt appends its appearance to the selection. + let source = if mods.alt && !mods.shift && stop.is_none() { + hit_test(cx.doc, p, sample_options(cx)).map(|h| (paint_owner(cx.doc, h.leaf), h.kind)) + } else { + sample_source(cx, p) + }; + let (src, _) = source?; + let n = cx.doc.node(src)?; + if mods.alt && stop.is_none() { + return Some(Click::CopyFrom(src, Some(if mods.shift { "append" } else { "reverse" }))); + } + let image = matches!(n.kind, NodeKind::Image(_)); + // Picked mesh points take only a color sampled from other art or an image: the sample goes + // to them as a fill, and to nothing else that is selected. A click on a mesh with picked + // points is handled as before. + let meshes = if stop.is_none() { picked_meshes(cx, &self.mesh_points) } else { vec![] }; + let meshes = if meshes.contains(&src) { vec![] } else { meshes }; + if !(mods.shift || stop.is_some() || image || !meshes.is_empty()) { + return Some(Click::CopyFrom(src, None)); + } + let (color, source) = sample_at(cx, p)?; + Some(Click::Sample { color, source, meshes, stop }) + } } #[cfg(test)] @@ -1824,7 +1892,7 @@ mod tests { let opts = sample_options(&cx); let mut s = Sampler { doc: &d, opts, raster_sample: cx.raster_sample, symbol_nodes: 0, work: 1_000, exhausted: false, patterns: 0 }; let mut levels: Vec> = (0..MAX_NESTING).map(|_| None).collect(); - assert_eq!(color_under(&mut s, &d, &mut levels, Point::new(150.0, 150.0), opts).map(|c| c.to_hex()), None); + assert_eq!(color_under(&mut s, &d, &mut levels, Point::new(150.0, 150.0), opts).map(|(c, _)| c.to_hex()), None); assert!(s.exhausted); } @@ -1917,6 +1985,52 @@ mod tests { assert_eq!(sampled_hex(&below), "#00ff00"); } + /// The object the hover names for a Shift-click is the one whose color the click samples: the + /// blend where a step is drawn, and the rectangle below it in a gap between the steps. Away + /// from all art it names none. + #[test] + fn shift_hover_names_the_object_the_sample_comes_from() { + use vectorcraft_doc::live::{BlendSpacing, BlendSpec}; + use vectorcraft_geom::Rect; + let d = doc_with_live_over_green(|d| { + let red = solid_rect(d, Rect::new(300.0, 300.0, 320.0, 320.0), Color::rgb(1.0, 0.0, 0.0)); + let blue = solid_rect(d, Rect::new(400.0, 300.0, 420.0, 320.0), Color::rgb(0.0, 0.0, 1.0)); + let spec = BlendSpec { spacing: BlendSpacing::Steps(1), ..Default::default() }; + Node::new(d.alloc_id(), NodeKind::Blend { children: vec![std::sync::Arc::new(red), std::sync::Arc::new(blue)], spec: Box::new(spec) }) + }); + let ids: Vec = d.layers[0].children().unwrap().iter().map(|n| n.id).collect(); + let [.., green, blend] = ids[..] else { panic!("two objects over the rectangle expected") }; + let (s, p) = (Selection::default(), paint()); + let shift = Mods { shift: true, ..Default::default() }; + let t = EyedropperTool::default(); + let names = |x: f64, y: f64| t.hover_object(&cx(&d, &s, &p), Point::new(x, y), shift); + assert_eq!(names(360.0, 310.0), Some(blend), "a blend step"); + assert_eq!(names(335.0, 310.0), Some(green), "a gap between the steps"); + assert_eq!(names(480.0, 480.0), None, "no art"); + } + + /// A plain click on a selected gradient mesh recolors its points, and the hover names that + /// mesh; Image Trace's Ignore Color pick, which the panel samples, names nothing. + #[test] + fn hover_names_the_selected_mesh_a_click_recolors() { + use vectorcraft_doc::{Document, GradientMesh}; + let mut d = Document::new(500.0, 500.0); + let l = d.layers[0].id; + let mesh = d.alloc_id(); + let grid = GradientMesh::from_surface(1, 1, &|u, v| Point::new(100.0 + 100.0 * u, 100.0 + 100.0 * v), &|_, _| Color::WHITE); + d.insert(Some(l), 0, Node::new(mesh, NodeKind::Mesh(grid))).unwrap(); + let p = paint(); + let mut s = Selection::default(); + s.set([mesh]); + let mut t = EyedropperTool::default(); + let at = Point::new(150.0, 150.0); + let a = t.pointer(&cx(&d, &s, &p), &PointerEvent::new(PointerKind::Down, at.x, at.y)); + assert!(matches!(a.first(), Some(Action::Exec(id, _)) if id == "object.mesh.setPointColor"), "{a:?}"); + assert_eq!(t.hover_object(&cx(&d, &s, &p), at, Mods::default()), Some(mesh)); + t.set_option("imageTraceIgnoreColor", &json!({"binding": 1})); + assert_eq!(t.hover_object(&cx(&d, &s, &p), at, Mods::default()), None); + } + /// A blend of two instances of one symbol draws its steps as instances too: Shift-click on a /// step samples the symbol's art there, and where that art leaves the point empty, what lies /// below. diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index bba6a5d83d..320c5b0f3c 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -98,6 +98,7 @@ impl VectorcraftApp { cursors: Default::default(), view_moved: None, hover_cursor: None, + hover_object: None, presented: None, opening_fit: None, panes: Default::default(), diff --git a/crates/ui-egui/src/caches.rs b/crates/ui-egui/src/caches.rs index 6e1d229023..5c8e1f3a11 100644 --- a/crates/ui-egui/src/caches.rs +++ b/crates/ui-egui/src/caches.rs @@ -87,6 +87,10 @@ pub struct CanvasCache { /// The cursor the active tool last gave over the canvas, with the tool and the modifier keys /// it was for: kept while the view moves. pub hover_cursor: Option<(&'static str, vectorcraft_tools::Mods, vectorcraft_tools::Cursor)>, + /// The object the Eyedropper's click at the pointer would act on, which Object Highlighting + /// outlines, with what it was found for: finding it again, which can sample a color, waits + /// until one of those changes. + pub hover_object: Option<(canvas::HoverObjectKey, Option)>, /// In Presentation Mode, the canvas rect the active artboard was last fitted to: it is fitted /// again when the rect changes (the window going full screen). pub presented: Option, diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 8b366665d4..53a1d373f8 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -61,12 +61,12 @@ use input::handle_input; use outline::KEY_OUTLINE; #[cfg(test)] use outline::{OVERLAY_MAX_ANCHORS, c32, node_outline, walk_drawn}; -pub use overlays::SharedPaths; #[cfg(test)] use overlays::selected_anchor; use overlays::{ HandleLook, blend_widgets_overlay, draw_inside_overlay, draw_overlays, hover_highlight, ime_geometry, overlay_hover_text, selection_overlay, }; +pub use overlays::{HoverObjectKey, SharedPaths}; pub use panes::{Layout as TileLayout, Panes}; pub(crate) use panes::{consolidate, note_drop, noted_cursor, pane, release_on_noted, tile, tiled_area}; pub(crate) use quick_pen_bar::quick_pen_bar_rect; @@ -1670,7 +1670,7 @@ fn selection_visuals( overlays.extend(crate::dialogs::live_paint_gaps::overlays(app)); if app.ui.view.edges && !revolve_edit { if hover_still { - hover_highlight(app, painter, xf); + hover_highlight(app, painter, xf, view_info); } selection_overlay(app, painter, xf, overlays.iter().any(|o| matches!(o, Overlay::CurvePoint { .. })), &mut marks); app.canvas.selection_marks = marks; diff --git a/crates/ui-egui/src/canvas/overlays.rs b/crates/ui-egui/src/canvas/overlays.rs index b4d2d44aac..79d3195eaf 100644 --- a/crates/ui-egui/src/canvas/overlays.rs +++ b/crates/ui-egui/src/canvas/overlays.rs @@ -10,27 +10,100 @@ use super::outline::{KEY_OUTLINE, c32, node_outline, selection_hit_at, stroke_pa use super::selection_marks::{MarkOptions, SelectionMarks}; use super::{BezPath, Color32, CornerRadius, NodeKind, Overlay, Pos2, Shape, Stroke, StrokeKind, Tokens, VectorcraftApp, Xf, vec2}; -pub(super) fn hover_highlight(app: &VectorcraftApp, p: &egui::Painter, xf: &Xf) { +pub(super) fn hover_highlight(app: &mut VectorcraftApp, p: &egui::Painter, xf: &Xf, view: vectorcraft_engine::ViewInfo) { let Some(h) = app.hover_doc else { return }; // Smart Guides › Object Highlighting: a Smart Guides display option, so it needs them on and Snap to Grid and Pixel Preview off. if !app.ui.view.smart_guides || !app.session.prefs.object_highlighting || app.ui.view.snap_to_grid || app.ui.view.pixel_preview { return; } - if app.session.tool_busy() || !matches!(app.session.tool_id(), "selection" | "directSelection" | "groupSelection") { + if app.session.tool_busy() || !matches!(app.session.tool_id(), "selection" | "directSelection" | "groupSelection" | "eyedropper") { return; } + // With Space lending the view tools, a press pans the view and acts on no object. + let (m, space) = p.ctx().input(|i| (i.modifiers, i.key_down(egui::Key::Space))); + if super::drag::space_lends_view_tools(app, m, space) { + return; + } + let id = if app.session.tool_id() == "eyedropper" { + // The object the Eyedropper's click there samples, recolors or copies to, with the keys + // held now. A selected one is outlined too: a click on it still acts on it. + let mods = super::drag::mods(m, false); + let Some(id) = eyedropper_hover_object(app, h, mods, view) else { return }; + id + } else { + let Some(st) = app.session.active() else { return }; + let Some(hit) = selection_hit_at(app, h, xf.zoom) else { return }; + let id = if app.session.tool_id() == "selection" { hit.top_object(st.isolation) } else { hit.leaf }; + if st.selection.contains(id) { + return; + } + id + }; let Some(st) = app.session.active() else { return }; - let Some(hit) = selection_hit_at(app, h, xf.zoom) else { return }; - let id = if app.session.tool_id() == "selection" { hit.top_object(st.isolation) } else { hit.leaf }; - if st.selection.contains(id) { - return; - } if let Some(n) = st.doc.node(id).filter(|n| !too_many_anchors([*n])) { let color = c32(st.doc.layer_color(id)); stroke_path(p, &node_outline(n, &st.doc.symbol_boxes()), xf, Stroke::new(1.5, color)); } } +/// What the Eyedropper's hover object depends on: the point, the keys held, the document as it is, +/// the selection and isolation, the tool's options (an armed pick), the paint defaults and the +/// selected gradient stop, the selection tolerance, Eyedropper Options (the raster sample size), +/// whether guides show and are locked, and the view's zoom and Outline mode: everything the +/// tool's context gives a click that can change what it acts on. +#[derive(Clone, Debug, PartialEq)] +pub struct HoverObjectKey { + at: vectorcraft_geom::Point, + mods: vectorcraft_tools::Mods, + doc: (u64, u64), + selection: vectorcraft_doc::Selection, + isolation: Option, + options: serde_json::Value, + paint: vectorcraft_tools::PaintDefaults, + fill_active: bool, + stop: Option, + tolerance: f64, + eyedropper: vectorcraft_engine::EyedropperOptions, + guides: (bool, bool), + zoom: f64, + outline: bool, +} + +/// [`vectorcraft_engine::Session::hover_object`] at `at`, found again only when its +/// [`HoverObjectKey`] changes: over an image, or with Shift held, finding it samples a color. +fn eyedropper_hover_object( + app: &mut VectorcraftApp, + at: vectorcraft_geom::Point, + mods: vectorcraft_tools::Mods, + view: vectorcraft_engine::ViewInfo, +) -> Option { + let st = app.session.active()?; + let key = HoverObjectKey { + at, + mods, + doc: (st.uid, st.revision), + selection: st.selection.clone(), + isolation: st.isolation, + options: app.session.tool_options(), + paint: app.session.paint.clone(), + fill_active: app.session.fill_active, + stop: app.session.selected_stop(), + tolerance: app.session.prefs.selection_tolerance, + eyedropper: app.session.prefs.eyedropper, + guides: (view.guides, app.session.guides_locked()), + zoom: view.zoom, + outline: view.outline, + }; + if let Some((k, id)) = &app.canvas.hover_object + && *k == key + { + return *id; + } + let id = app.session.hover_object(at, mods, view); + app.canvas.hover_object = Some((key, id)); + id +} + /// Draw Inside (Shift+D): while the mode lasts, a dotted open rectangle round the corners of the /// object drawn into, selected or not (#4319). pub(super) fn draw_inside_overlay(app: &VectorcraftApp, p: &egui::Painter, xf: &Xf) { diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index d5244aa234..1a714ccfe6 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -6096,6 +6096,142 @@ fn object_highlighting_preference_hides_the_hover_outline() { assert_eq!(outlines(&mut app), 0, "Smart Guides off"); } +/// The screen points of the 1.5 px hover outlines in `color` that one frame with `held` keys down +/// draws, the pointer where the last frame left it. +fn hover_outline_points(app: &mut VectorcraftApp, ctx: &egui::Context, color: Color32, held: egui::Modifiers) -> Vec { + fn flat(s: Shape, out: &mut Vec) { + match s { + Shape::Vec(v) => v.into_iter().for_each(|s| flat(s, out)), + s => out.push(s), + } + } + app.canvas.selection_marks = Default::default(); + let events = vec![egui::Event::ModifiersChanged(held)]; + let raw = egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0))), events, ..Default::default() }; + let mut out = ctx.run_ui(raw, |ui| show(app, ui)); + // The art's raster lands in some frame when the render worker is done with it. + out.textures_delta.clear(); + let mut shapes = vec![]; + out.shapes.into_iter().for_each(|c| flat(c.shape, &mut shapes)); + let solid = egui::epaint::ColorMode::Solid(color); + let mut at = vec![]; + for s in shapes { + if let Shape::Path(ps) = s + && ps.stroke.width == 1.5 + && ps.stroke.color == solid + { + at.extend(ps.points); + } + } + at +} + +/// The screen box around `points`. +fn screen_box(points: &[Pos2]) -> egui::Rect { + points.iter().fold(egui::Rect::NOTHING, |r, p| r.union(egui::Rect::from_min_max(*p, *p))) +} + +/// Whether two screen boxes agree to within a pixel. +fn same_box(a: egui::Rect, b: egui::Rect) -> bool { + (a.min - b.min).length() < 1.0 && (a.max - b.max).length() < 1.0 +} + +/// With the Eyedropper, Smart Guides › Object Highlighting outlines the object under the pointer +/// as the selection tools do (1.5 px in its layer color), and nothing over empty canvas. +#[test] +fn eyedropper_hover_outlines_the_object_under_the_pointer() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + let id = app.session.execute("shape.rectangle", &json!({"x": 100, "y": 100, "width": 100, "height": 100})).unwrap()["id"].as_u64().unwrap(); + app.session.execute("select.none", &json!({})).unwrap(); + app.select_tool("eyedropper"); + let ctx = egui::Context::default(); + frame(&mut app, &ctx, vec![]); + let xf = Xf::new(app.canvas_rect.unwrap(), app.view().unwrap()); + let color = c32(app.session.active().unwrap().doc.layer_color(vectorcraft_doc::NodeId(id))); + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(xf.to_screen(Point::new(150.0, 150.0)))]); + let at = hover_outline_points(&mut app, &ctx, color, egui::Modifiers::NONE); + let rect = egui::Rect::from_two_pos(xf.to_screen(Point::new(100.0, 100.0)), xf.to_screen(Point::new(200.0, 200.0))); + assert!(!at.is_empty() && same_box(screen_box(&at), rect), "the rectangle under the pointer is outlined: {:?}", screen_box(&at)); + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(xf.to_screen(Point::new(300.0, 50.0)))]); + assert!(hover_outline_points(&mut app, &ctx, color, egui::Modifiers::NONE).is_empty(), "nothing over empty canvas"); + // Space lends the view tools: a press pans, so no object is outlined, with any tool. + let space = |pressed| egui::Event::Key { key: egui::Key::Space, physical_key: None, pressed, repeat: false, modifiers: egui::Modifiers::NONE }; + for tool in ["eyedropper", "selection"] { + app.select_tool(tool); + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(xf.to_screen(Point::new(150.0, 150.0)))]); + assert!(!hover_outline_points(&mut app, &ctx, color, egui::Modifiers::NONE).is_empty(), "{tool}: outlined"); + frame(&mut app, &ctx, vec![space(true)]); + assert!(hover_outline_points(&mut app, &ctx, color, egui::Modifiers::NONE).is_empty(), "{tool}: Space held"); + frame(&mut app, &ctx, vec![space(false)]); + assert!(!hover_outline_points(&mut app, &ctx, color, egui::Modifiers::NONE).is_empty(), "{tool}: Space let go"); + } +} + +/// The Eyedropper's hover outline follows Smart Guides › Object Highlighting. +#[test] +fn eyedropper_hover_outline_follows_object_highlighting() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + let id = app.session.execute("shape.rectangle", &json!({"x": 100, "y": 100, "width": 100, "height": 100})).unwrap()["id"].as_u64().unwrap(); + app.session.execute("select.none", &json!({})).unwrap(); + app.select_tool("eyedropper"); + let ctx = egui::Context::default(); + frame(&mut app, &ctx, vec![]); + let xf = Xf::new(app.canvas_rect.unwrap(), app.view().unwrap()); + let color = c32(app.session.active().unwrap().doc.layer_color(vectorcraft_doc::NodeId(id))); + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(xf.to_screen(Point::new(150.0, 150.0)))]); + app.session.execute("prefs.set", &json!({"key": "objectHighlighting", "value": false})).unwrap(); + assert!(hover_outline_points(&mut app, &ctx, color, egui::Modifiers::NONE).is_empty(), "the option off"); + app.session.execute("prefs.set", &json!({"key": "objectHighlighting", "value": true})).unwrap(); + assert!(!hover_outline_points(&mut app, &ctx, color, egui::Modifiers::NONE).is_empty(), "the option on"); +} + +/// The Eyedropper outlines the object its click there then acts on: the front object a plain +/// click copies attributes from, a locked one included (the Eyedropper reads locked art), and with +/// Alt the unlocked object below it that an Alt-click gives the selection's attributes to. +#[test] +fn eyedropper_hover_outline_is_the_object_the_click_acts_on() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + let rect = |app: &mut VectorcraftApp, x: f64, y: f64, size: f64, color: &str| { + let id = app.session.execute("shape.rectangle", &json!({"x": x, "y": y, "width": size, "height": size})).unwrap()["id"].as_u64().unwrap(); + app.session.execute("paint.setFill", &json!({"ids": [id], "color": color})).unwrap(); + id + }; + let back = rect(&mut app, 100.0, 100.0, 100.0, "#0000ff"); + let front = rect(&mut app, 150.0, 150.0, 100.0, "#ff0000"); + let target = rect(&mut app, 20.0, 20.0, 40.0, "#00ff00"); + app.session.execute("select.set", &json!({"ids": [target]})).unwrap(); + app.select_tool("eyedropper"); + let ctx = egui::Context::default(); + frame(&mut app, &ctx, vec![]); + let xf = Xf::new(app.canvas_rect.unwrap(), app.view().unwrap()); + let color = c32(app.session.active().unwrap().doc.layer_color(vectorcraft_doc::NodeId(front))); + let boxed = |x: f64, y: f64, size: f64| egui::Rect::from_two_pos(xf.to_screen(Point::new(x, y)), xf.to_screen(Point::new(x + size, y + size))); + let fill = |app: &VectorcraftApp, id: u64| app.session.active().unwrap().doc.node(vectorcraft_doc::NodeId(id)).unwrap().appearance.fill_paint(); + let over = xf.to_screen(Point::new(175.0, 175.0)); + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(over)]); + let at = hover_outline_points(&mut app, &ctx, color, egui::Modifiers::NONE); + assert!(same_box(screen_box(&at), boxed(150.0, 150.0, 100.0)), "the front rectangle is outlined: {:?}", screen_box(&at)); + click_at(&mut app, &ctx, over); + assert_eq!(fill(&app, target), fill(&app, front), "the click copied the outlined rectangle's fill"); + + app.session.execute("object.lock", &json!({"ids": [front]})).unwrap(); + app.session.execute("select.set", &json!({"ids": [target]})).unwrap(); + app.session.execute("paint.setFill", &json!({"ids": [target], "color": "#00ff00"})).unwrap(); + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(over)]); + let at = hover_outline_points(&mut app, &ctx, color, egui::Modifiers::NONE); + assert!(same_box(screen_box(&at), boxed(150.0, 150.0, 100.0)), "the locked front rectangle is still the source: {:?}", screen_box(&at)); + let at = hover_outline_points(&mut app, &ctx, color, egui::Modifiers::ALT); + assert!(same_box(screen_box(&at), boxed(100.0, 100.0, 100.0)), "with Alt, the unlocked rectangle below: {:?}", screen_box(&at)); + let button = |pressed| egui::Event::PointerButton { pos: over, button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::ALT }; + frame(&mut app, &ctx, vec![egui::Event::ModifiersChanged(egui::Modifiers::ALT), button(true)]); + frame(&mut app, &ctx, vec![button(false), egui::Event::ModifiersChanged(egui::Modifiers::NONE)]); + assert_eq!(fill(&app, back), fill(&app, target), "the Alt-click gave the outlined rectangle the selection's fill"); + assert_ne!(fill(&app, front), fill(&app, target)); +} + /// Hide Corner Widget for angles greater than (#394): a rectangle's 90° corners lose their /// widgets below 90°. #[test] diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index b1d981428a..143f215fcd 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -2015,6 +2015,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Pasting into hex color fields:** in the hex fields of the Color Picker, Swatch Options, Recolor Artwork, the Color panel, Document Setup, Duotone, Color Themes and Perspective Grid, a click or keyboard focus selects the digits. A pasted code of six digits, with or without `#`, replaces them wherever the caret is. A pasted code of three digits also replaces them, unless the paste holds only those digits and exactly three digits stay; those digits then edit the text in place. A press on another field commits the text as Tab and Enter do. As VectorCraft's own rule, a paste that is not a color leaves the field as it was. Tests: `a_hex_code_pasted_into_the_hex_field_replaces_its_digits` in `crates/ui-egui/src/dialogs/tests.rs`, `define_grid_takes_a_three_digit_color` in `crates/ui-egui/src/dialogs/tests_perspective.rs` and `a_paste_into_a_hex_field_replaces_or_edits_its_digits` in `crates/ui-egui/src/tests/numfields.rs`. - **Color Picker layout (#2008):** a centered draggable header, equal-width actions above aligned HSB/RGB/Hex and Lab/CMYK fields, compact field and slider, and warnings below the preview. No horizontal scrolling; narrow windows stack the sections with vertical scrolling. Tests in `dialogs/color_picker.rs` cover actual pointer/key input, typed values before OK/Enter, Cancel/Escape rollback, one Undo step, mode-size stability, warnings and layout at two UI scales. The screen sampler sits above the field and the upstream two-grid Tab order is retained. AccessKit regressions check the action names and each channel slider's displayed value, units and range. German and enlarged English UI renders were reviewed locally; no reference images are shipped. This is a layout improvement, with no change to scores or remaining-hour estimates. - **Eyedropper sources (#1251):** ordinary and Shift clicks, Shift+Alt appearance append, raster pixels and gradient-stop sampling can read visible locked/template art and sources outside isolation. Sampling leaves the source and selection intact; Alt reverse still uses editable hits, and hidden art stays excluded. Engine/tool/hit regressions cover the editing boundary, color models and one-step Undo/Redo. The general object/image workflow is described in [public HelpX](https://helpx.adobe.com/illustrator/using/tool-techniques/eyedropper-tool.html); the lock/isolation expectations come from the user report and these regressions, without a new full-parity measurement. + - **Eyedropper hover outline:** as VectorCraft's own behavior, with Smart Guides › Object Highlighting on, the Eyedropper outlines the object a click at the pointer would act on, in the selection tools' 1.5 px layer-color outline: the source a click copies from (locked and template art included), the selected gradient mesh a click recolors, the object below a locked one that an Alt-click gives the selection's attributes to, and for a Shift-click the object whose color is sampled (a blend or envelope where its art is drawn, the art below where it leaves a gap). A selected object is outlined too. Empty canvas, hidden art and a Cmd-click that borrows a selection tool show no outline, and with the Eyedropper or a selection tool, Space held for the view tools hides the outline. Tests: `crates/ui-egui/src/canvas/tests.rs`, `crates/tools/src/xform/eyedropper.rs`. - **Eyedropper colors in a CMYK document (#2276):** a CMYK image (a four-component JPEG, or an 8- or 16-bit chunky CMYK TIFF) gives its ink amounts as they are, and an RGB image's pixel or an RGB color given to `paint.setFill`, `paint.setStroke`, `paint.sampleColor` or `swatch.new {color}` (hex input and gradient stops included) is separated through the color settings' CMYK working space and intent, as Document Color Mode converts it. With the default Generic CMYK, RGB 83/170/223 separates to C62 M19 Y0 K0, where the profile-free formula gave C63 M24 Y0 K13. - **RGB input to other commands in a CMYK document:** type colors (`text.create`, `text.setStyle`, `text.setRangeStyle`), a Shape Builder hex fill, `paint.editGradient` stops, freeform gradient points, gradient mesh points (the Mesh tool gives a new point the fill's color in its own model), the Symbol Stainer's color and the swatch commands (`swatch.new {colors}`, `swatch.newGroup`, `swatch.editGroup`, `swatch.edit`) separate RGB through the color settings as `paint.setFill` does: with Generic CMYK, `text.setStyle {fill: "#53aadf"}` gives C62 M19 Y0 K0. A color a swatch already has keeps its model, and a swatch color given with `mode` is converted into that mode only. - **Generic CMYK (SWOP-like):** each ink's 40% and 50% tints gain as [CGATS TR 001](https://registry.color.org/cmyk-registry/cgats_tr_001) gives for SWOP printing, and separations stay within SWOP's [300% total ink limit](https://en.wikipedia.org/wiki/Specifications_for_Web_Offset_Publications). The paper, solid and overprint colors, the black-generation curve and the black point are VectorCraft's own values: RGB black separates to 90% black under neutral cyan, magenta and yellow that fill the ink limit (C75 M68 Y67 K90). The ICC profile written for it (embedded in exports) gives the paper as its media white point, and its colorimetric Lab → CMYK table is the inverse of its CMYK → Lab table, without black-point compensation; the perceptual and saturation tables keep compensation. From 8d0a50ffa0bff71fe9a8a6994af2fd19ef835c22 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 20 Nov 2026 16:10:38 -0800 Subject: [PATCH 02/32] Type: Show Hidden Characters and Auto Spell Check list the type once per revision Both overlays visited every object of the document in every frame to find its type. They now draw from one list of the active document's text objects, kept for the document's uid and revision, so a frame that changes nothing visits only the type. An edit, Undo, Redo or a switch to another document makes a new list, and the canvas drops the list while it draws neither overlay. Show Hidden Characters no longer draws marks over type in a hidden group or layer, which the canvas does not draw. Auto Spell Check already left such type out. --- crates/ui-egui/src/app.rs | 1 + crates/ui-egui/src/caches.rs | 4 + crates/ui-egui/src/canvas.rs | 17 +- crates/ui-egui/src/canvas/tests.rs | 192 +++++++++++++++++++++ crates/ui-egui/src/canvas/tool_overlays.rs | 87 +++++++--- docs/target-app-parity.md | 3 +- docs/type-parity.md | 2 +- 7 files changed, 272 insertions(+), 34 deletions(-) diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index bba6a5d83d..458da81741 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -85,6 +85,7 @@ impl VectorcraftApp { find_font: None, hidden_chars: Default::default(), spelling: Default::default(), + text_nodes: Default::default(), selection_marks: Default::default(), shared_paths: Default::default(), selection_box: None, diff --git a/crates/ui-egui/src/caches.rs b/crates/ui-egui/src/caches.rs index 6e1d229023..01b0a2b6f7 100644 --- a/crates/ui-egui/src/caches.rs +++ b/crates/ui-egui/src/caches.rs @@ -52,6 +52,10 @@ pub struct CanvasCache { /// The words Edit › Spelling › Auto Spell Check underlined on each text object in the last /// frame; dropped while it is off. pub spelling: canvas::SpellingMarks, + /// The active document's text objects for (document uid, revision), which Show Hidden + /// Characters and Auto Spell Check draw over. A frame that draws neither drops them + /// ([`canvas::show`]). + pub text_nodes: canvas::TextNodes, /// The selected objects' outlines, anchors and handles as drawn in the last frame. A frame that /// does not draw them drops them ([`canvas::show`]). pub selection_marks: canvas::SelectionMarks, diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 8b366665d4..128af6f67f 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -80,7 +80,7 @@ pub(crate) use task_bar::{bar_action_name, chip_paints, images_with_other_art, t pub(crate) use task_bar::{has_colors, task_bar_rect, task_bar_shows_fonts, task_bar_shows_type}; #[cfg(test)] use tool_overlays::{DIAL_RADIUS, HiddenMarks}; -pub use tool_overlays::{HiddenChars, SpellingMarks}; +pub use tool_overlays::{HiddenChars, SpellingMarks, TextNodes}; use tool_overlays::{ grid_repeat_overlay, hidden_chars_overlay, live_paint_gap_overlays, mirror_axis_overlay, nine_slice_overlay, original_path_overlay, print_tiling_overlay, radial_repeat_overlay, rotate_view_dial, shaper_widget_overlay, slice_overlay, spelling_overlay, thread_overlays, @@ -249,6 +249,9 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { // that does not draw the overlay drops them, for example with the option off, with the edges // hidden, on the Home screen or with no document open. let hidden_chars = std::mem::take(&mut app.canvas.hidden_chars); + // The text objects those marks and Auto Spell Check's lines are drawn over. Likewise, a frame + // that draws neither drops them. + let text_nodes = std::mem::take(&mut app.canvas.text_nodes); // The selection's kept marks. Likewise, a frame that does not draw them drops them. let selection_marks = std::mem::take(&mut app.canvas.selection_marks); // The meshes of the tools' shared paths. Likewise, a frame that does not draw the tools' @@ -431,7 +434,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { } original_path_overlay(app, &painter, &xf); - let overlays = selection_visuals(app, &painter, &xf, (hidden_chars, selection_marks, hover_still), revolve_edit, view_info); + let overlays = selection_visuals(app, &painter, &xf, (hidden_chars, text_nodes, selection_marks, hover_still), revolve_edit, view_info); draw_overlays(&painter, &xf, &overlays, &t, HandleLook::of(&app.session.prefs), &mut shared_paths); app.canvas.shared_paths = shared_paths; crate::panels::tabs::paint_stop_guide(app, &painter, &xf); @@ -1652,10 +1655,16 @@ fn selection_visuals( app: &mut VectorcraftApp, painter: &egui::Painter, xf: &Xf, - (hidden_chars, mut marks, hover_still): (HiddenChars, SelectionMarks, bool), + (hidden_chars, text_nodes, mut marks, hover_still): (HiddenChars, TextNodes, SelectionMarks, bool), revolve_edit: bool, view_info: vectorcraft_engine::ViewInfo, ) -> Vec { + // Show Hidden Characters (with the edges shown) and Auto Spell Check draw over the same text + // objects: their list is kept while either is drawn. + let draws_hidden_chars = app.ui.view.edges && !revolve_edit && app.ui.view.hidden_chars; + if draws_hidden_chars || (app.ui.view.auto_spell_check && !revolve_edit) { + app.canvas.text_nodes = text_nodes; + } // View → Hide Gradient Annotator hides the Gradient tool's annotator. let mut overlays = if !revolve_edit && (app.session.tool_id() != "gradient" || app.ui.view.gradient_annotator) { app.session.overlays(view_info) @@ -1688,7 +1697,7 @@ fn selection_visuals( if app.ui.view.live_paint_gaps { overlays.extend(live_paint_gap_overlays(app)); } - if app.ui.view.hidden_chars { + if draws_hidden_chars { app.canvas.hidden_chars = hidden_chars; hidden_chars_overlay(app, painter, xf); } diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index d5244aa234..4c98f2df4e 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -7530,9 +7530,11 @@ fn show_hidden_characters_off_releases_the_text_nodes() { after.inputs == inputs && std::sync::Arc::ptr_eq(&after.marks[&id].1, &marks) }); assert!(kept, "a frame keeps the marks of the frame before"); + assert!(app.canvas.text_nodes.list.is_some(), "the list of the text objects is kept"); app.run("type.hiddenCharacters", json!({})).unwrap(); assert!(hidden_char_marks(&mut app, &ctx).is_empty(), "off"); assert!(app.canvas.hidden_chars.marks.is_empty(), "no node is kept"); + assert!(app.canvas.text_nodes.list.is_none(), "no list of the text objects is kept"); app.run("type.hiddenCharacters", json!({})).unwrap(); assert_eq!(hidden_char_marks(&mut app, &ctx), on, "on again: the same marks"); } @@ -7556,9 +7558,199 @@ fn show_hidden_characters_releases_the_text_nodes_of_a_closed_document() { app.session.execute("file.close", &json!({})).unwrap(); assert!(hidden_char_marks(&mut app, &ctx).is_empty(), "the Home screen"); assert!(app.canvas.hidden_chars.marks.is_empty(), "no node of the closed document is kept"); + assert!(app.canvas.text_nodes.list.is_none(), "no list of the closed document's text objects is kept"); assert_eq!(open(&mut app), first, "the same type in a new document"); } +/// `paths` small rectangles and three point type objects with hidden characters and words no +/// dictionary knows: the first on the first layer, the second in a group on that layer and the +/// third on a second layer. Returns the type objects, the group, the second layer and a view. +fn type_among_paths(paths: usize) -> (VectorcraftApp, [vectorcraft_doc::NodeId; 3], vectorcraft_doc::NodeId, vectorcraft_doc::NodeId, Xf) { + use std::sync::Arc; + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + let id = |v: serde_json::Value| vectorcraft_doc::NodeId(v["id"].as_u64().unwrap()); + let path = id(app.session.execute("shape.rectangle", &json!({"x": 300, "y": 250, "width": 5, "height": 5})).unwrap()); + { + let st = app.session.active_mut().unwrap(); + let doc = Arc::make_mut(&mut st.doc); + let template = doc.node(path).unwrap().clone(); + let more: Vec<_> = (1..paths) + .map(|_| { + let mut p = template.clone(); + p.id = doc.alloc_id(); + Arc::new(p) + }) + .collect(); + Arc::make_mut(&mut doc.layers[0]).children_mut().unwrap().extend(more); + doc.drop_lookup_cache(); + } + let text = + |app: &mut VectorcraftApp, y: u32, text: &str| id(app.session.execute("text.create", &json!({"x": 20, "y": y, "text": text})).unwrap()); + let a = text(&mut app, 40, "one\ttwo\u{00A0}the\nthree\u{2028}four"); + let b = text(&mut app, 110, "Qzvbtrw the\u{2003}cat"); + app.session.execute("select.set", &json!({"ids": [b.0]})).unwrap(); + let group = id(app.session.execute("object.group", &json!({})).unwrap()); + let layer = id(app.session.execute("layer.new", &json!({})).unwrap()); + let c = text(&mut app, 180, "Zvqtrbx the\u{202F}cat\n"); + assert_eq!(app.session.active().unwrap().doc.layers.iter().find(|l| l.id == layer).and_then(|l| l.children()).map(|c| c.len()), Some(1)); + let xf = Xf { rect: egui::Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0)), zoom: 1.0, center: Point::new(200.0, 150.0), rot: 0.0 }; + (app, [a, b, c], group, layer, xf) +} + +/// The list of text objects Show Hidden Characters and Auto Spell Check last drew over. +fn listed_type(app: &VectorcraftApp) -> super::tool_overlays::TextList { + app.canvas.text_nodes.list.as_ref().map(|(_, l)| l.clone()).unwrap() +} + +/// Show Hidden Characters and Auto Spell Check find the type among the document's other objects +/// once for each revision, in one list both draw from: frames that change nothing draw from the +/// same list, and draw the marks and lines a frame drawing from a new list draws. The list holds +/// the visible type in the order the overlays drew it before they shared it. +#[test] +fn hidden_characters_and_auto_spell_check_share_one_list_of_the_type() { + let (mut app, ids, _, _, xf) = type_among_paths(2_000); + let ctx = egui::Context::default(); + // Each visible text object in `Document::walk` order, with no group or layer hidden. + let mut walked = vec![]; + app.session.active().unwrap().doc.walk(|n| { + if matches!(n.kind, vectorcraft_doc::NodeKind::Text(_)) && n.visible { + walked.push(n.id); + } + }); + assert_eq!(walked.len(), 3); + let marks = hidden_chars(&mut app, &ctx, &xf); + let list = listed_type(&app); + assert_eq!(list.iter().filter(|t| t.shown).map(|t| t.node.id).collect::>(), walked); + assert!(list.iter().all(|t| ids.contains(&t.node.id)), "only type"); + let lines = spelling_lines(&mut app, &ctx, &xf); + assert_eq!(lines.len(), 2, "{lines:?}"); + assert!(std::sync::Arc::ptr_eq(&list, &listed_type(&app)), "Auto Spell Check draws from the same list"); + for _ in 0..3 { + assert_eq!(hidden_chars(&mut app, &ctx, &xf), marks); + assert_eq!(spelling_lines(&mut app, &ctx, &xf), lines); + assert!(std::sync::Arc::ptr_eq(&list, &listed_type(&app)), "a frame that changes nothing lists no type"); + } + app.canvas.text_nodes = TextNodes::default(); + app.canvas.hidden_chars = HiddenChars::default(); + app.canvas.spelling = SpellingMarks::default(); + assert_eq!(hidden_chars(&mut app, &ctx, &xf), marks, "the marks drawn from a new list"); + assert_eq!(spelling_lines(&mut app, &ctx, &xf), lines, "the lines drawn from a new list"); + assert!(!std::sync::Arc::ptr_eq(&list, &listed_type(&app))); +} + +/// The list follows the document: a new text object, an edit, Undo, Redo and a switch to another +/// document each list the type again, and the marks are those of the type the document holds. +#[test] +fn the_list_of_type_follows_edits_undo_redo_and_the_active_document() { + use std::sync::Arc; + let (mut app, ids, _, _, xf) = type_among_paths(50); + let ctx = egui::Context::default(); + // Each listed object's id and node. + let nodes = |app: &VectorcraftApp| listed_type(app).iter().map(|t| (t.node.id, Arc::as_ptr(&t.node))).collect::>(); + hidden_chars(&mut app, &ctx, &xf); + let first = nodes(&app); + assert_eq!(first.len(), 3); + let added = + vectorcraft_doc::NodeId(app.session.execute("text.create", &json!({"x": 200, "y": 40, "text": "g h"})).unwrap()["id"].as_u64().unwrap()); + hidden_chars(&mut app, &ctx, &xf); + let with_new = nodes(&app); + assert_eq!(with_new.len(), 4); + assert!(with_new.iter().any(|(id, _)| *id == added), "the new object"); + assert!(app.canvas.hidden_chars.marks.contains_key(&added), "has marks"); + app.session.execute("text.setText", &json!({"id": ids[0].0, "text": "x\ty"})).unwrap(); + hidden_chars(&mut app, &ctx, &xf); + let edited = nodes(&app); + let node_of = |list: &[(vectorcraft_doc::NodeId, *const vectorcraft_doc::Node)], id| list.iter().find(|(i, _)| *i == id).map(|(_, n)| *n); + assert_ne!(node_of(&edited, ids[0]), node_of(&with_new, ids[0]), "the edited object's new node"); + assert_eq!(node_of(&edited, ids[1]), node_of(&with_new, ids[1]), "the others' nodes"); + assert_eq!(app.canvas.hidden_chars.marks[&ids[0]].1.chars.len(), 1, "the marks of the edited text: one tab"); + app.session.execute("edit.undo", &json!({})).unwrap(); + hidden_chars(&mut app, &ctx, &xf); + assert_eq!(nodes(&app), with_new, "Undo"); + assert_eq!(app.canvas.hidden_chars.marks[&ids[0]].1.chars.len(), 2, "the marks of the text before: a tab and a nonbreaking space"); + app.session.execute("edit.redo", &json!({})).unwrap(); + hidden_chars(&mut app, &ctx, &xf); + assert_eq!(nodes(&app), edited, "Redo"); + app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + assert!(hidden_chars(&mut app, &ctx, &xf).is_empty(), "another document: none of the first one's marks"); + assert!(nodes(&app).is_empty() && app.canvas.hidden_chars.marks.is_empty()); + app.session.execute("document.activate", &json!({"index": 0})).unwrap(); + hidden_chars(&mut app, &ctx, &xf); + assert_eq!(nodes(&app), edited, "back to the first document"); +} + +/// Neither overlay draws over type that the canvas does not draw: a hidden text object, or one in +/// a hidden group or layer. Shown again, its marks and lines come back. +#[test] +fn hidden_characters_and_auto_spell_check_leave_out_type_in_hidden_groups_and_layers() { + let (mut app, [a, b, c], group, layer, xf) = type_among_paths(10); + let ctx = egui::Context::default(); + let drawn = |app: &mut VectorcraftApp| { + let marks = hidden_chars(app, &ctx, &xf).len(); + let lines = spelling_lines(app, &ctx, &xf).len(); + let mut ids: Vec<_> = app.canvas.hidden_chars.marks.keys().copied().collect(); + ids.sort(); + let mut spelled: Vec<_> = app.canvas.spelling.lines.keys().copied().collect(); + spelled.sort(); + (ids, spelled, marks, lines) + }; + let all = drawn(&mut app); + assert_eq!((all.0.clone(), all.1.clone(), all.3), (vec![a, b, c], vec![a, b, c], 2)); + app.session.execute("object.setProps", &json!({"ids": [group.0], "visible": false})).unwrap(); + let (ids, spelled, marks, lines) = drawn(&mut app); + assert_eq!((ids, spelled, lines), (vec![a, c], vec![a, c], 1), "a hidden group"); + assert!(marks < all.2, "fewer marks: {marks} of {}", all.2); + assert!(listed_type(&app).iter().any(|t| t.node.id == b && !t.shown), "listed, not shown"); + app.session.execute("object.setProps", &json!({"ids": [group.0], "visible": true})).unwrap(); + assert_eq!(drawn(&mut app), all, "the group shown again"); + app.session.execute("layer.setProps", &json!({"id": layer.0, "visible": false})).unwrap(); + let (ids, spelled, _, lines) = drawn(&mut app); + assert_eq!((ids, spelled, lines), (vec![a, b], vec![a, b], 1), "a hidden layer"); + app.session.execute("layer.setProps", &json!({"id": layer.0, "visible": true})).unwrap(); + assert_eq!(drawn(&mut app), all, "the layer shown again"); + app.session.execute("object.setProps", &json!({"ids": [a.0], "visible": false})).unwrap(); + let (ids, spelled, _, _) = drawn(&mut app); + assert_eq!((ids, spelled), (vec![b, c], vec![b, c]), "a hidden text object"); + app.session.execute("object.setProps", &json!({"ids": [a.0], "visible": true})).unwrap(); + assert_eq!(drawn(&mut app), all, "the text object shown again"); +} + +/// An ignored diagnostic for the overlays' cost on a document of many paths and a little type: +/// frames of both overlays drawing from the kept list, and frames that list the type again each +/// time. There is no timing threshold; run on an idle machine and compare the printed cases. +#[test] +#[ignore = "manual performance diagnostic; no stable timing threshold"] +fn type_overlays_on_many_paths_diagnostic() { + use std::time::Instant; + const FRAMES: usize = 50; + for paths in [10_000, 100_000] { + let (mut app, _, _, _, xf) = type_among_paths(paths); + let ctx = egui::Context::default(); + let both = |app: &mut VectorcraftApp| { + hidden_chars(app, &ctx, &xf); + spelling_lines(app, &ctx, &xf); + }; + both(&mut app); + let t = Instant::now(); + for _ in 0..FRAMES { + both(&mut app); + } + let kept = t.elapsed(); + let t = Instant::now(); + for _ in 0..FRAMES { + app.canvas.text_nodes = TextNodes::default(); + both(&mut app); + } + let listed = t.elapsed(); + eprintln!( + "{paths} paths: {:?} a frame from the kept list, {:?} a frame listing the type again", + kept / FRAMES as u32, + listed / FRAMES as u32 + ); + } +} + /// General › Zoom with Mouse Wheel (#394), through the control channel's `ui.wheel`: off, /// the wheel scrolls and Cmd-wheel scrolls sideways (Scroll Sideways with Cmd/Ctrl + Wheel is on /// by default); on, the wheel zooms about the pointer, Shift-wheel diff --git a/crates/ui-egui/src/canvas/tool_overlays.rs b/crates/ui-egui/src/canvas/tool_overlays.rs index 958872d6b0..81215d883b 100644 --- a/crates/ui-egui/src/canvas/tool_overlays.rs +++ b/crates/ui-egui/src/canvas/tool_overlays.rs @@ -22,21 +22,13 @@ pub(super) fn hidden_chars_overlay(app: &mut VectorcraftApp, p: &egui::Painter, last.clear(); kept.inputs = inputs; } - // `walk` visits each node's `Arc` in the order `Document::walk` visits the nodes (depth first, - // in paint order). - fn walk(nodes: &[std::sync::Arc], f: &mut impl FnMut(&std::sync::Arc)) { - for n in nodes { - f(n); - if let Some(children) = n.children() { - walk(children, f); - } - } - } - walk(&st.doc.layers, &mut |n| { - let NodeKind::Text(tx) = &n.kind else { return }; + // Leaving out hidden objects and what is inside hidden groups and layers, as the canvas does. + for t in text_nodes(&mut app.canvas.text_nodes, st).iter().filter(|t| t.shown) { + let n = &t.node; + let NodeKind::Text(tx) = &n.kind else { continue }; // The box round the object's corners on screen, turned with the view. - if !n.visible || n.geometric_bounds().is_none_or(|b| !egui::Rect::from_points(&xf.quad(b)).intersects(clip)) { - return; + if n.geometric_bounds().is_none_or(|b| !egui::Rect::from_points(&xf.quad(b)).intersects(clip)) { + continue; } let marks = match last.remove(&n.id) { Some((was, marks)) if std::sync::Arc::ptr_eq(&was, n) => marks, @@ -62,7 +54,53 @@ pub(super) fn hidden_chars_overlay(app: &mut VectorcraftApp, p: &egui::Painter, p.text(xf.to_screen(at), align, glyph, font.clone(), color); } kept.marks.insert(n.id, (n.clone(), marks)); - }); + } +} + +/// One text object of the active document ([`TextNodes`]). +pub(super) struct TextNode { + pub(super) node: std::sync::Arc, + /// The object and every group and layer that holds it are visible: the canvas draws it. + pub(super) shown: bool, +} + +/// The text objects of the active document, for (document uid, revision): Show Hidden Characters +/// and Auto Spell Check draw over them every frame ([`crate::CanvasCache::text_nodes`]). A frame +/// that draws neither drops them ([`super::show`]). +#[derive(Default)] +pub struct TextNodes { + pub(super) list: Option<((u64, u64), TextList)>, +} + +/// The text objects of a document, in paint order ([`TextNodes`]). +pub(super) type TextList = std::sync::Arc>; + +/// The text objects of `st`'s document in the order `Document::walk` visits the nodes (depth +/// first, in paint order), hidden ones included. `kept` holds the list while the document and its +/// revision are those it was made for. +pub(super) fn text_nodes(kept: &mut TextNodes, st: &vectorcraft_engine::DocState) -> TextList { + let key = (st.uid, st.revision); + if let Some((k, list)) = &kept.list + && *k == key + { + return list.clone(); + } + fn walk(nodes: &[std::sync::Arc], shown: bool, out: &mut Vec) { + for n in nodes { + let shown = shown && n.visible; + if matches!(n.kind, NodeKind::Text(_)) { + out.push(TextNode { node: n.clone(), shown }); + } + if let Some(children) = n.children() { + walk(children, shown, out); + } + } + } + let mut list = Vec::new(); + walk(&st.doc.layers, true, &mut list); + let list = std::sync::Arc::new(list); + kept.list = Some((key, list.clone())); + list } /// `v` scaled to length 1, or `or` when `v` has no length. @@ -265,19 +303,12 @@ pub(super) fn spelling_overlay(app: &mut VectorcraftApp, p: &egui::Painter, xf: kept.inputs = Some(inputs); } let stroke = Stroke::new(1.0, Color32::from_rgb(0xe0, 0x20, 0x20)); - // Depth first in paint order, leaving out hidden objects and what is inside them. - fn walk(nodes: &[std::sync::Arc], f: &mut impl FnMut(&std::sync::Arc)) { - for n in nodes.iter().filter(|n| n.visible) { - f(n); - if let Some(children) = n.children() { - walk(children, f); - } - } - } - walk(&st.doc.layers, &mut |n| { - let NodeKind::Text(tx) = &n.kind else { return }; + // Leaving out hidden objects and what is inside hidden groups and layers. + for t in text_nodes(&mut app.canvas.text_nodes, st).iter().filter(|t| t.shown) { + let n = &t.node; + let NodeKind::Text(tx) = &n.kind else { continue }; if !auto_spell_checks(n) || n.geometric_bounds().is_none_or(|b| !egui::Rect::from_points(&xf.quad(b)).intersects(clip)) { - return; + continue; } let lines = match last.remove(&n.id) { Some((was, lines)) if std::sync::Arc::ptr_eq(&was, n) => lines, @@ -287,7 +318,7 @@ pub(super) fn spelling_overlay(app: &mut VectorcraftApp, p: &egui::Painter, xf: wavy_line(p, xf.to_screen(a), xf.to_screen(b), stroke); } kept.lines.insert(n.id, (n.clone(), lines)); - }); + } } /// Whether Auto Spell Check marks `n`'s words: not with an effect shown (the Appearance panel's diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 57ac87a396..5ce1ca2497 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -840,7 +840,7 @@ since 2026-10-01. - **Justification… on type on a path:** each paragraph's Desired Word Spacing, Letter Spacing and Glyph Scaling set its glyphs on type on a path as on point and area type, so the text after a wider gap starts further along the path, alignment and overflow use the spaced length, and a list marker keeps its width. Minimum and Maximum are not used on a path, and vertical type is not glyph scaled. SVG export writes such type as outlines with a warning. Tests `tests::justify::type_on_a_path_takes_desired_spacing_and_scaling`, `type_on_a_path_is_aligned_and_fitted_at_desired_spacing`, `vertical_type_and_list_markers_on_a_path_are_not_glyph_scaled` and the SVG test `text_layout::justification_spacing_on_a_path_is_outlined`. Public reference: the help page (). - **Letter spacing and Full Justify between shaped clusters:** Desired Letter Spacing on any line, the letter spacing range of a justified line, and Single Word Justification's Full Justify add space only between shaped clusters, in horizontal, right-to-left and vertical type, so a combining mark stays on its letter and a Devanagari syllable's glyphs stay together. They add no space next to a zero-width format control (a soft hyphen, a bidi mark, embedding, override or isolate, a zero-width space, a joiner or non-joiner, a word joiner, a variation selector, a tag, the byte order mark), so a word wrapped in an override still reaches both edges of a justified line, and a Kinsoku push-in counts no gap at one either. A zero-width space is a line break opportunity but not a word separator ([CSS Text Level 3](https://www.w3.org/TR/css-text-3/#word-separator) does not list it), so a justified line gives it no share of its room. Desired Letter Spacing between the letters on either side of a zero-width space goes after the zero-width space, so a line that breaks there ends at its last letter, and the line breaker does not measure a gap after it. A line that Full Justify spreads and that ends in a drawn hyphen puts the same gap between its last letter and the hyphen. The cluster boundary is VectorCraft's own rule, based on the typographic character unit of [CSS Text Level 3](https://www.w3.org/TR/css-text-3/#typographic-character-unit). Tests `tests::justify::single_word_full_justify_keeps_combining_mark_with_base`, `desired_and_fitted_letter_spacing_skip_shaped_cluster`, `rtl_single_word_cluster_gap_follows_drawn_order`, `vertical_single_word_cluster_gap_follows_drawn_order`, `single_word_full_justify_keeps_conjunct_cluster`, `desired_letter_spacing_skips_bidi_format_controls`, `letter_spacing_and_full_justify_skip_joiners_and_soft_hyphens`, `format_controls_are_the_zero_width_default_ignorables`, `zero_width_space_takes_no_word_space_room`, `desired_letter_spacing_ends_a_line_broken_at_a_zero_width_space_without_a_gap`, `single_word_full_justify_spreads_up_to_the_drawn_hyphen` and `layout::wrapping_tests::kinsoku_shori_type_counts_no_gap_at_a_format_control`. Public reference: the help page (). - **Justified lines with tabs:** a tab is not a word space, so a justified area type line no longer gives it a share of its room that no glyph draws. On a justified line with a tab, the text up to the last tab keeps its spacing, each tab keeps its stop and its leader stays in its gap, and the text after the last tab takes the room (word spaces first, then letter spacing, glyph scaling and the gaps between its letters), so the line ends on the far edge. A tab separates two words, so Single Word Justification does not align a word-tab-word line. Right-to-left lines take the text drawn after the last tab drawn, and vertical lines work down the column. Spreading the room after the last tab is VectorCraft's own rule. Tests `tests::justify::a_justified_line_with_a_tab_spreads_the_text_after_it_to_the_edge`, `a_justified_tab_keeps_its_leader_inside_its_gap`, `a_justified_word_tab_word_line_reaches_the_edge`, `the_last_line_with_a_tab_fills_the_measure_only_with_justify_all`, `a_justified_line_takes_its_room_after_its_last_tab`, `a_justified_vertical_line_with_a_tab_reaches_the_end_of_its_column`, `a_justified_right_to_left_line_with_a_tab_spans_its_measure` and `justified_point_type_with_a_tab_keeps_its_width`. Public reference: the help pages (, ). -- **Show Hidden Characters marks every character that prints no ink:** [the help page](https://helpx.adobe.com/illustrator/desktop/design-with-text/special-characters-glyphs/insert-white-space-and-break-characters.html) lists the characters that Type › Show Hidden Characters makes visible: paragraph returns, forced line breaks, tabs, spaces, nonbreaking spaces, discretionary hyphens and the end of the text. Besides the dot over a space, ¶ at a paragraph's end and # at the story's end, the canvas draws an arrow across each tab's advance to its stop, a ring over a nonbreaking space (U+00A0) and a smaller one over a narrow nonbreaking space (U+202F), a short tick over the spaces of a set width (U+2000 to U+200A, U+205F, U+3000), ¬ at a discretionary hyphen (U+00AD) whether or not the line breaks there, and a bent arrow after a line that a forced line break (U+2028) ends, which gets no ¶. The marks follow the baseline of vertical type and of type on a path, ¶ goes at the left end of a right-to-left line, and type on a path gets # after its last character when the path shows all of its text. The shapes of the marks, and marking U+202F and the spaces of a set width, are VectorCraft's own rules. The marks are drawn only on the canvas and are not saved or exported. Tests: `canvas::tests::hidden_characters_mark_tabs_nonbreaking_spaces_and_discretionary_hyphens`, `hidden_characters_mark_forced_line_breaks`, `hidden_characters_mark_a_discretionary_hyphen_at_a_break_once`, `hidden_characters_follow_vertical_type`, `hidden_characters_end_a_right_to_left_line_at_its_left`, `hidden_characters_mark_type_on_a_path` and `show_hidden_characters_draws_every_kind_of_mark`. +- **Show Hidden Characters marks every character that prints no ink:** [the help page](https://helpx.adobe.com/illustrator/desktop/design-with-text/special-characters-glyphs/insert-white-space-and-break-characters.html) lists the characters that Type › Show Hidden Characters makes visible: paragraph returns, forced line breaks, tabs, spaces, nonbreaking spaces, discretionary hyphens and the end of the text. Besides the dot over a space, ¶ at a paragraph's end and # at the story's end, the canvas draws an arrow across each tab's advance to its stop, a ring over a nonbreaking space (U+00A0) and a smaller one over a narrow nonbreaking space (U+202F), a short tick over the spaces of a set width (U+2000 to U+200A, U+205F, U+3000), ¬ at a discretionary hyphen (U+00AD) whether or not the line breaks there, and a bent arrow after a line that a forced line break (U+2028) ends, which gets no ¶. The marks follow the baseline of vertical type and of type on a path, ¶ goes at the left end of a right-to-left line, and type on a path gets # after its last character when the path shows all of its text. The shapes of the marks, and marking U+202F and the spaces of a set width, are VectorCraft's own rules. The marks are drawn only on the canvas and are not saved or exported. Type that the canvas does not draw, because it or a group or layer holding it is hidden, gets no marks; this is VectorCraft's own rule. Tests: `canvas::tests::hidden_characters_mark_tabs_nonbreaking_spaces_and_discretionary_hyphens`, `hidden_characters_and_auto_spell_check_leave_out_type_in_hidden_groups_and_layers`, `hidden_characters_mark_forced_line_breaks`, `hidden_characters_mark_a_discretionary_hyphen_at_a_break_once`, `hidden_characters_follow_vertical_type`, `hidden_characters_end_a_right_to_left_line_at_its_left`, `hidden_characters_mark_type_on_a_path` and `show_hidden_characters_draws_every_kind_of_mark`. - **The text style panel menus' Duplicate and Delete:** in the Character Styles and Paragraph Styles panel menus, Duplicate highlights the copy, as Create New Style highlights the new style, and Delete leaves no style highlighted, as the Delete button does, so Duplicate, Clear Overrides, Redefine and Style Options are disabled until another style is clicked. A highlighted style that is renamed in Style Options or deleted by a command is no longer highlighted either. The tests `panels::text_styles::tests::panel_menu_duplicate_and_delete_update_the_highlighted_style` and `a_highlighted_style_that_is_no_longer_listed_is_not_highlighted` cover this. Public reference: [Character and paragraph styles](https://web.archive.org/web/20261015081534/https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html). - **Item context menus in the Character Styles and Paragraph Styles panels:** right-clicking a style row displays a context menu ({Kind} Style Options…, Duplicate {Kind} Style, Delete {Kind} Style, Redefine {Kind} Style, Clear Overrides). Right-clicking an unselected row highlights it before displaying the menu; right-clicking an item in an existing multi-selection preserves the selection. Style Options and Delete are disabled for the built-in Normal style; Redefine is enabled when active text has styling; Clear Overrides is enabled when text is selected. Duplicate creates ` copy` and highlights it; Delete removes non-Normal styles in one undo step. Tests `panels::text_styles::tests::right_click_context_menu_in_character_styles_panel`, `right_click_context_menu_in_paragraph_styles_panel`, `right_click_context_menu_normal_style_disables_options_and_delete`, and `right_click_context_menu_preserves_multiselection`. Public reference: [Character and paragraph styles](https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html). - **Names of new styles and symbols:** `charStyle.new` and `paraStyle.new` trim the white space around the name they are given, as `charStyle.rename` and `paraStyle.rename` do, and refuse a name that is then empty; Duplicate names its copy from the trimmed name. `symbol.new` and `symbol.duplicate` trim the name as Symbol Options does, and `library.use` adds a library's text style under its trimmed name. Public reference: [Character and paragraph styles](https://web.archive.org/web/20260825113735/https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html). @@ -2507,6 +2507,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur A subpath keeps its anchors in chunks of up to 256 anchors, and the versions of a path share the chunks they have not changed. Editing one anchor copies only the chunk that holds it, so its undo step keeps that chunk instead of a copy of every anchor; adding or deleting an anchor copies the chunk it is in and rebuilds the subpath's table of chunks. When the renderer looks for the anchors that moved, it compares only the chunks the edit copied. Moving one anchor of a selected open path of 10,000 or 200,000 anchors (`path.moveAnchor`, `path.setHandle`, `path.moveAnchors` or a nudge) keeps at most 48 KiB in the undo step and in the redo step, where it kept a copy of every anchor at 56 bytes each (counted in the engine's tests). Files are written and read as before, each subpath's anchors as one list. Opening a document keeps the layouts it makes for its type objects, up to 128 MiB, and the first frame uses them instead of laying those objects out again. It does not keep a layout with bitmap or color glyphs or a text object with a gradient. The frame uses a layout only for a text object equal to the one laid out, and only while the fonts and the hyphenation exceptions have not changed. It uses each layout once. The renderer drops the rest when a frame that used one ends, and all of them after eight frames that use none. The frames of a threaded story are laid out while the file is read, and the first frame lays them out again. The pixels are the same. On Windows at 1600 × 1200, in medians of seven interleaved rounds of a local example, counted in the main thread's CPU cycles because other builds were running: with 5,000 point type objects in view the first frame takes 409 million cycles instead of 894 million and the open 816 million instead of 665 million, so the two together take 1,225 million instead of 1,559 million; with one area type object of 500 paragraphs the first frame takes 697 million instead of 1,193 million and the open 535 million instead of 568 million. Type › Show Hidden Characters keeps the marks it places on each text object from one frame to the next. The canvas lays a text object out again when an edit changes it or its threaded story, or when the last frame that showed the marks did not draw it, and it lays out all type in view again when the fonts or the hyphenation exceptions change. With 1,000 two-line labels in view, drawing the marks takes 0.8 ms per frame in a release build instead of 19.7 ms. + Show Hidden Characters and Auto Spell Check find the document's text objects among its other objects once for each change to the document, in one list that both draw from, instead of visiting every object in every frame. An edit, Undo, Redo or a switch to another document makes a new list, and the canvas drops the list while it draws neither overlay. With a Type tool active, the in and out ports of the selected area type and type on a path, and the highlight of a selected story's other frames after Select All, use each frame's layout from the last frame instead of laying the frame out again. A frame is laid out again when its text object changes, or when the fonts or the hyphenation exceptions change. With 200 selected area type frames of about 400 characters, one of them being edited, the Type tool's overlays take 0.27 ms per frame instead of 121 ms; with a 5-frame story selected they take 0.016 ms instead of 2.0 ms (release build on Linux, medians of seven runs, measured while other builds were running). A selection with more than 100,000 points to outline shows its bounds instead of each object's outline and anchors. Paths count their anchors. Area type and type on a path count the anchors of their frame or path, and point type counts six: its box's corners and the ends of its baseline marker. Images, symbol instances, placed documents, and area type or type on a path in perspective count the four corners of their box, and gradient meshes and envelopes count their points and the ends of their mesh lines. The hover highlight leaves out an object past that count, and such an object shows its bounds as the key object. With 32,768 type objects, images, symbol instances, gradient meshes or envelopes selected, the selection's outlines and anchors add fewer than 100 vertices to the canvas's mesh (#2460). The canvas keeps the selected objects' outlines, anchors and handles from one frame to the next as one mesh. It builds an object's marks again when the object, its layer color or its selected anchors change. A pan moves the kept outlines and handles and places the anchor squares again. Each subpath and handle gets its triangles the first time it is in view. A frame with a new zoom or rotation draws the marks one shape at a time and keeps nothing, and the next frame at that view builds them. The pixels are the same, apart from two small differences: a kept outline's corner of exactly 90 degrees in a rotated view can keep its miter or cut corner after a pan, and kept vertices can move by rounding errors. On Windows at 1440 × 900, in a release build, with 2,000 selected circles of 50 anchors each in 10 fill colors, an idle frame takes 12.8 ms instead of 59.9 ms with the Selection tool and 29.8 ms instead of 192.1 ms with Direct Selection (medians of five runs). A frame during a zoom takes about what it did: 86.7 ms instead of 80.0 ms with the Selection tool. diff --git a/docs/type-parity.md b/docs/type-parity.md index 111ee5d838..7f142cb60f 100644 --- a/docs/type-parity.md +++ b/docs/type-parity.md @@ -50,7 +50,7 @@ against Illustrator's public documentation; **estimated** unless noted. | Roman Hanging Punctuation | done | Paragraph panel menu › Roman Hanging Punctuation, `text.setFormat {romanHangingPunctuation}` (#2756): per paragraph, Optical Margin Alignment's punctuation and amounts without the letters; paragraph styles carry it. Evidence: `tests::roman_hanging_punctuation_hangs_punctuation_but_not_letters`, `typecmd::area_tests::roman_hanging_punctuation_is_set_per_paragraph_and_saved_only_when_on` | | Hyphenation… and Justification… options | done | Eleven Indian languages use attributed patterns and preserve syllables in both composers (#4947). Hyphenation… (`ui.hyphenation`, `text.setFormat`) sets each paragraph's Words Longer Than, After First, Before Last, Hyphen Limit, Hyphenation Zone (Single-line Composer only) and Hyphenate Capitalized Words, and paragraph styles carry them (#2310). Justification… (`ui.justification`, `text.setFormat`, #2755) sets Word Spacing, Letter Spacing and Glyph Scaling (Minimum, Desired, Maximum), Auto Leading and Single Word Justification; Desired applies to every line, justified lines and the Every-line Composer use the ranges. Vertical type isn't glyph scaled. Auto Leading also sets the Leading the Character panel shows for Auto type, the leading Alt+↑/↓ (`type.step`) steps from, per paragraph, and the lines Fill with Placeholder Text counts. Evidence: `crates/text/src/tests/justify.rs`, `dialogs::justification::tests`, `tests_prefs::auto_leading_steps_and_fills_from_the_paragraph_auto_leading`, `panels::character` test `leading_field_shows_the_paragraph_auto_leading` | | Tab stops and leaders; Tabs panel | partial | Tabs panel and stops with leaders in the model (`text.tabs.set`); a stop drags from where the press landed (#1458); leaders fill the tab's gap, repeated on a grid so they line up from line to line (#1877); Ctrl-dragging a stop (Command on macOS) moves all the stops together; in right-aligned area type the text before a line's last tab sits at its stops, from the left edge, and the text after it against the right edge, as Illustrator's own layout in a user's `.ai` sets a price list (evidence: `tests::right_aligned_area_type_sets_the_text_after_its_last_tab_against_the_edge`; centred lines are still aligned as a whole); in justified area type the text up to a line's last tab keeps its spacing and its tabs their stops, and the text after the last tab takes the line's room to the far edge, VectorCraft's own rule (evidence: `tests::justify::a_justified_line_with_a_tab_spreads_the_text_after_it_to_the_edge` and the other tab tests in `crates/text/src/tests/justify.rs`) | -| Hidden characters (Show Hidden Characters) | done | `type.hiddenCharacters`: marks spaces, tabs, nonbreaking and narrow nonbreaking spaces, the spaces of a set width, discretionary hyphens, forced line breaks, paragraph ends and the story's end, in horizontal, vertical and right-to-left type and on a path; the mark shapes are VectorCraft's own. Evidence: `canvas::tests::hidden_characters_*` | +| Hidden characters (Show Hidden Characters) | done | `type.hiddenCharacters`: marks spaces, tabs, nonbreaking and narrow nonbreaking spaces, the spaces of a set width, discretionary hyphens, forced line breaks, paragraph ends and the story's end, in horizontal, vertical and right-to-left type and on a path, and none on type in a hidden group or layer; the mark shapes are VectorCraft's own. Evidence: `canvas::tests::hidden_characters_*` | | Spell check (Check Spelling, Auto Spell Check, custom dictionary) | done | the engine (#4936): `text.spelling.check` lists the unknown words of the document's type, each run in its Language, at the bytes `text.editRange` changes, and `text.spelling.suggest` gives suggestions, both from craft-proof, each paragraph on its own (English from the first dictionary it finds: a Hunspell dictionary in the user's dictionaries folder, the SCOWL dictionary built in from craft-i18n, a system Hunspell dictionary, and last the public-domain Moby word list built into it; other languages from the dictionaries craft-proof finds for them). The custom dictionary commands are done: `text.spelling.addWord`, `removeWord` and `changeWord` (Add, and Edit Custom Dictionary's Add, Delete and Change), and `text.spelling.dictionary` lists the words, saved to `Custom Dictionary.txt` beside the preferences; Ignore All: `text.spelling.ignoreAll` skips a word in the active document while it is open. Auto Spell Check is done: Edit › Spelling › Auto Spell Check (`edit.autoSpellCheck`, off at first, saved with the view settings) draws a red wavy line under the unknown words of the visible type, leaves out type with effects, and follows edits, the custom dictionary and Ignore All. A right-click on an underlined word lists the words its dictionary suggests (each replaces it in one undo step, `text.editRange`), or No Suggestions, then Ignore All and Add to Dictionary, and a right-click on type has Spelling › Auto Spell Check, checked while it is on. Edit › Edit Custom Dictionary… lists the custom dictionary's words, with an Entry field and Add, Delete and Change, applied on Done (Cancel leaves the dictionary as it was). The modal Check Spelling dialog is done: Edit › Spelling › Check Spelling… (`Cmd+I`, `ui.checkSpelling`) opens a modal dialog displaying the unrecognized word in sentence context ("Not in Dictionary"), a list of suggestions with double-click or selection to replace ("Change to" field), and action buttons: Ignore, Ignore All, Change (one-step Undo/Redo via `text.editRange`), Change All (batched across occurrences in a single undo step), Add to Dictionary (`text.spelling.addWord`), Done and Cancel, with keyboard navigation (Tab between controls, Enter to Change or Done, Escape to close). Evidence: `crates/engine/src/tests/spelling.rs`, `crates/ui-egui/src/canvas/tests.rs` (`auto_spell_check_*`), `crates/ui-egui/src/tests/contextmenu.rs` (the right-click), `crates/ui-egui/src/dialogs/custom_dictionary.rs` (the dialog), `crates/ui-egui/src/dialogs/check_spelling.rs` (the Check Spelling dialog). | | Smart Punctuation, Change Case, Find & Replace | done | Type › Smart Punctuation… opens a dialog with the ff, fi, ffi and ff, fl, ffl ligatures, Smart Quotes, Smart Spaces, En, Em Dashes, Ellipses and Expert Fractions, Replace In and Report Results, which lists the count of each replacement; ligatures and fractions are written only where the font has a glyph for them. Evidence: `tests::menucmds::smart_punctuation_ligatures_spaces_and_fractions_are_counted`, `smart_punctuation_skips_ligatures_and_fractions_the_font_lacks`, `smart_spaces_keeps_one_space_after_a_period`, `dialogs::smart_punctuation::tests::menu_item_opens_the_dialog_and_ok_reports_the_counts` | | Alt + numeric-keypad codes while typing (Windows: `Alt+0176` → °) | partial | #5108: on Windows the character Windows posts when Alt comes up after keypad digits is typed at the caret like any other, in the typing's undo step, and the keypad digits typed with Alt run no shortcut. With NumLock off the keypad keys (Insert, End, arrows, Clear, Home, Page Up/Down without the extended-key flag) count as digits too and don't move the caret (`windows_alt_codes` unit tests; neither NumLock on nor off has been tried on a Windows machine yet). `type.insert {code}` (Windows Alt+0 code, Windows-1252 for 128–159) and `{unicode}` (hex code point) insert a character by its code (`menucmds::insert_a_character_by_its_code`). macOS and Linux have no such system convention and egui reports a keypad digit as the top-row digit, so there it does nothing; a floating panel window doesn't receive the character | From 76127a13b685dd434f5c9d45f108cfc7dffe6cad Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 20 Nov 2026 16:54:49 -0800 Subject: [PATCH 03/32] Canvas: Color Settings and a reloaded profile render the art again Edit > Color Settings, a profile in use loaded again under its name, a removed profile and a change to the document's assigned profiles only raise the documents' revisions. The art and the render options stay the same, so the canvas kept the frame drawn through the previous color conversion. The canvas's frame key now holds the active color settings and the loaded profiles' generation, so a change to either renders the frame again through the new conversion. --- crates/ui-egui/src/caches.rs | 5 ++ crates/ui-egui/src/canvas.rs | 1 + crates/ui-egui/src/canvas/tests.rs | 91 ++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+) diff --git a/crates/ui-egui/src/caches.rs b/crates/ui-egui/src/caches.rs index 6e1d229023..ec50e4c8a4 100644 --- a/crates/ui-egui/src/caches.rs +++ b/crates/ui-egui/src/caches.rs @@ -225,6 +225,11 @@ pub struct CacheKey { /// The paper under the art that translucent art is blended with before the conversion /// ([`crate::display_profile::convert_over`]). None without a display profile, and in Outline. pub backdrop: Option>, + /// The active color settings ([`vectorcraft_color::cms::active_settings`]) and the loaded + /// profiles' generation ([`vectorcraft_color::cms::profiles_generation`]) the frame's colors + /// were converted with: Edit › Color Settings, a profile loaded again under its name or removed, + /// and the front document's assigned profiles change them without changing the document. + pub color: (vectorcraft_color::cms::ColorSettings, u64), } impl CacheKey { diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 8b366665d4..f9a49a3e18 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -923,6 +923,7 @@ fn cache_key( // Preferences › Performance › Use Monitor Profile for Canvas. display: app.display_profile.key(app.session.prefs.monitor_profile_display), backdrop: backdrop(app, st, app.outline_view()), + color: (vectorcraft_color::cms::active_settings(), vectorcraft_color::cms::profiles_generation()), } } diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index d5244aa234..fa9a6b813e 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -4801,6 +4801,97 @@ fn appearance_of_black_on_screen_shows_pure_black_as_rgb_black() { assert!(near(middle(&mut app).expect("re-rendered"), accurate), "accurate again"); } +/// A change of the color settings, and a profile in use loaded again under its name, re-render the +/// canvas through the new conversion. They raise the documents' revisions but leave the art as it +/// is, so [`changed_pixels`] finds no part of the frame shown that changed: the frame's +/// key holds the color settings and the loaded profiles' generation. A frame with nothing changed +/// renders nothing. +#[test] +fn color_settings_and_a_reloaded_profile_render_the_canvas_again() { + const CHILD: &str = "VECTORCRAFT_TEST_CANVAS_COLOR_SETTINGS"; + if std::env::var_os(CHILD).is_none() { + // Color settings and loaded profiles are process-wide: change them in a separate test process. + let output = std::process::Command::new(std::env::current_exe().unwrap()) + .args(["--exact", "canvas::tests::color_settings_and_a_reloaded_profile_render_the_canvas_again", "--nocapture"]) + .env(CHILD, "1") + .output() + .unwrap(); + let stdout = String::from_utf8_lossy(&output.stdout); + assert!( + output.status.success() && stdout.contains("test result: ok. 1 passed; 0 failed;"), + "isolated canvas color test failed:\n{stdout}\n{}", + String::from_utf8_lossy(&output.stderr), + ); + return; + } + use vectorcraft_color::cms; + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.session.execute("file.new", &json!({"width": 400, "height": 300, "colorMode": "cmyk"})).unwrap(); + app.canvas.worker_started = true; // render on this thread + // Larger than the view: the middle of the art's raster is its fill. + let id = app.run("shape.rectangle", json!({"x": -5000, "y": -5000, "width": 10000, "height": 10000})).unwrap()["id"].clone(); + app.run("paint.setFill", json!({"ids": [id], "color": {"c": 60, "m": 10, "y": 80, "k": 0}})).unwrap(); + let ctx = egui::Context::default(); + // The middle pixel of the art's raster uploaded by one frame, None when it was not re-rendered. + let middle = |app: &mut VectorcraftApp| -> Option<[u8; 4]> { + let (_, mut delta) = frame_output(app, &ctx); + let art = app.canvas.texture.as_ref().unwrap().id(); + let px = delta.set.iter().find(|e| e.0.eq(&art)).and_then(|e| e.1.last()).map(|d| { + let egui::ImageData::Color(img) = &d.image; + let [w, h] = img.size; + img.pixels[h / 2 * w + w / 2].to_array() + }); + delta.clear(); + px + }; + let ink = vectorcraft_color::Color::cmyk(0.6, 0.1, 0.8, 0.0); + let through = |cmyk: &str| { + let c = cms::Cms::new(&cms::ColorSettings { cmyk: cmyk.into(), ..cms::working_settings() }).unwrap().display_rgb(&ink); + c.map(|v| (v.clamp(0.0, 1.0) * 255.0).round() as u8) + }; + let near = |a: [u8; 4], b: [u8; 3]| a[..3].iter().zip(b).all(|(x, y)| x.abs_diff(y) <= 3); + let (generic, device) = (through(cms::GENERIC_CMYK), through(cms::DEVICE_CMYK)); + assert!(!near([generic[0], generic[1], generic[2], 255], device), "the two CMYK spaces draw the ink differently: {generic:?}, {device:?}"); + + let first = middle(&mut app).expect("the first frame renders the art"); + assert!(near(first, generic), "through the working CMYK space: {first:?}, not {generic:?}"); + assert_eq!(middle(&mut app), None, "nothing changed: no re-render"); + app.run("edit.colorSettings", json!({"cmyk": cms::DEVICE_CMYK})).unwrap(); + let shown = middle(&mut app).expect("Color Settings re-render the canvas"); + assert!(near(shown, device), "through the new working CMYK space: {shown:?}, not {device:?}"); + assert_eq!(middle(&mut app), None, "nothing changed since: no re-render"); + app.run("edit.colorSettings", json!({"cmyk": cms::GENERIC_CMYK})).unwrap(); + assert!(near(middle(&mut app).expect("re-rendered"), generic), "back to the first working space"); + + // A built-in CMYK profile's file renamed `name`: padded with spaces, which names drop. + let renamed = |builtin: &str, name: &str| { + let utf16 = |s: &str| s.encode_utf16().flat_map(u16::to_be_bytes).collect::>(); + let mut bytes = cms::icc_bytes(builtin).unwrap().to_vec(); + let (from, to) = (utf16(builtin), utf16(&format!("{name: Date: Fri, 20 Nov 2026 20:24:36 -0800 Subject: [PATCH 04/32] Canvas: a new working CMYK space renders a Working CMYK proof again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A proof of the working CMYK space converts through the working color settings. With a profile assigned to the document in place of the working CMYK space, Edit › Color Settings changes the working settings while the active settings stay the same, and the canvas kept showing the proof through the previous working space. - The canvas's frame key also holds the working color settings (`cms::working_settings`). - The test now requires a re-render after `edit.assignProfile`, and checks that a new working CMYK space re-renders a Working CMYK proof while the active settings stay the same. --- crates/ui-egui/src/caches.rs | 13 ++++++++----- crates/ui-egui/src/canvas.rs | 2 +- crates/ui-egui/src/canvas/tests.rs | 16 +++++++++++++++- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/crates/ui-egui/src/caches.rs b/crates/ui-egui/src/caches.rs index ec50e4c8a4..244f69f9df 100644 --- a/crates/ui-egui/src/caches.rs +++ b/crates/ui-egui/src/caches.rs @@ -225,11 +225,14 @@ pub struct CacheKey { /// The paper under the art that translucent art is blended with before the conversion /// ([`crate::display_profile::convert_over`]). None without a display profile, and in Outline. pub backdrop: Option>, - /// The active color settings ([`vectorcraft_color::cms::active_settings`]) and the loaded - /// profiles' generation ([`vectorcraft_color::cms::profiles_generation`]) the frame's colors - /// were converted with: Edit › Color Settings, a profile loaded again under its name or removed, - /// and the front document's assigned profiles change them without changing the document. - pub color: (vectorcraft_color::cms::ColorSettings, u64), + /// The active color settings ([`vectorcraft_color::cms::active_settings`]), the working color + /// settings ([`vectorcraft_color::cms::working_settings`]) and the loaded profiles' generation + /// ([`vectorcraft_color::cms::profiles_generation`]) the frame's colors were converted with: + /// Edit › Color Settings, a profile loaded again under its name or removed, and the front + /// document's assigned profiles change them without changing the document. A proof of the + /// working CMYK space converts through the working settings, which can change while the active + /// settings stay the same. + pub color: (vectorcraft_color::cms::ColorSettings, vectorcraft_color::cms::ColorSettings, u64), } impl CacheKey { diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index f9a49a3e18..dc422b125c 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -923,7 +923,7 @@ fn cache_key( // Preferences › Performance › Use Monitor Profile for Canvas. display: app.display_profile.key(app.session.prefs.monitor_profile_display), backdrop: backdrop(app, st, app.outline_view()), - color: (vectorcraft_color::cms::active_settings(), vectorcraft_color::cms::profiles_generation()), + color: (vectorcraft_color::cms::active_settings(), vectorcraft_color::cms::working_settings(), vectorcraft_color::cms::profiles_generation()), } } diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index fa9a6b813e..c80546d29c 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -4882,7 +4882,7 @@ fn color_settings_and_a_reloaded_profile_render_the_canvas_again() { }; load(&mut app, cms::GENERIC_CMYK); app.run("edit.assignProfile", json!({"cmyk": name})).unwrap(); - let assigned = middle(&mut app).unwrap_or(first); + let assigned = middle(&mut app).expect("assigning a profile re-renders the canvas"); assert!(near(assigned, generic), "through the assigned copy of the working space: {assigned:?}, not {generic:?}"); assert_eq!(middle(&mut app), None, "nothing changed: no re-render"); // The same name, the settings as they were: only the profile's file is new. @@ -4890,6 +4890,20 @@ fn color_settings_and_a_reloaded_profile_render_the_canvas_again() { let reloaded = middle(&mut app).expect("the profile loaded again re-renders the canvas"); assert!(near(reloaded, device), "through the profile's new file: {reloaded:?}, not {device:?}"); assert_eq!(middle(&mut app), None, "nothing changed since: no re-render"); + + // A proof of the working CMYK space converts through the working settings. With the document's + // assigned profile in place of the working CMYK space, a new working CMYK space leaves the + // active settings as they were and changes only the proof. + app.run("view.proofSetup", json!({"target": "workingCmyk"})).unwrap(); + app.run("view.proofColors", json!({"on": true})).unwrap(); + let proofed = middle(&mut app).expect("Proof Colors re-renders the canvas"); + assert_eq!(middle(&mut app), None, "nothing changed: no re-render"); + let active = cms::active_settings(); + app.run("edit.colorSettings", json!({"cmyk": cms::DEVICE_CMYK})).unwrap(); + let reproofed = middle(&mut app).expect("a new working CMYK space re-renders the proof"); + assert_eq!(cms::active_settings(), active, "the assigned profile keeps the active settings"); + assert!(!near(reproofed, [proofed[0], proofed[1], proofed[2]]), "the proof through the new working CMYK space: {reproofed:?}, not {proofed:?}"); + assert_eq!(middle(&mut app), None, "nothing changed since: no re-render"); } /// Guides & Grid › Show Pixel Grid (Above 600% Zoom) (#394): in Pixel Preview at 600% zoom and From d03a34977a60685244fee6eae02afb4f0f4c01e3 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 20 Nov 2026 21:40:40 -0800 Subject: [PATCH 05/32] Canvas: a worker frame of other color settings is not shown The render worker converts colors with the settings in force while it renders, and the frame it returns carries the key captured when it was asked for. A change of the color settings during the render could store the new settings' colors under the old key, and a return to the old settings then matched that key and kept the frame. The canvas now drops a worker frame whose color key is not the current one and asks for the frame again. --- crates/ui-egui/src/canvas.rs | 15 ++++++++-- crates/ui-egui/src/canvas/tests.rs | 46 ++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index dc422b125c..2803558a11 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -923,10 +923,16 @@ fn cache_key( // Preferences › Performance › Use Monitor Profile for Canvas. display: app.display_profile.key(app.session.prefs.monitor_profile_display), backdrop: backdrop(app, st, app.outline_view()), - color: (vectorcraft_color::cms::active_settings(), vectorcraft_color::cms::working_settings(), vectorcraft_color::cms::profiles_generation()), + color: color_key(), } } +/// [`CacheKey::color`] now: the active color settings, the working color settings and the loaded +/// profiles' generation. +fn color_key() -> (vectorcraft_color::cms::ColorSettings, vectorcraft_color::cms::ColorSettings, u64) { + (vectorcraft_color::cms::active_settings(), vectorcraft_color::cms::working_settings(), vectorcraft_color::cms::profiles_generation()) +} + /// [`CacheKey::plugins`] of document `st`, one of the documents open in `session`. `keys` holds each /// document's value and the plug-in revision it was checked at, so a document is looked through only /// once after each change of the plug-in revision. @@ -1053,10 +1059,13 @@ fn poll_worker(app: &mut VectorcraftApp, ui: &Ui, key_doc: usize) { /// Upload frame `done` from the render worker when it is of document `key_doc` and not older than /// the frame shown. This prevents canvas freezes during continuous edits (drags, arrow nudges, MCP -/// command bursts) while ensuring obsolete out-of-order frames are dropped. +/// command bursts) while ensuring obsolete out-of-order frames are dropped. A frame whose color key +/// ([`CacheKey::color`]) is not the current one is dropped too: the worker converted its colors +/// with the settings in force while it rendered, which may not be the ones in its key, and the next +/// frame renders again with the current ones. fn show_worker_frame(app: &mut VectorcraftApp, ctx: &egui::Context, done: crate::render_worker::Done, key_doc: usize) { let not_older = app.canvas.key.as_ref().filter(|k| k.doc == done.key.doc).is_none_or(|k| done.key.revision >= k.revision); - if done.key.doc != key_doc || !not_older { + if done.key.doc != key_doc || !not_older || done.key.color != color_key() { return; } upload(app, ctx, done.img, done.key.pixel.is_some()); diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index c80546d29c..a6ea9defbd 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -4906,6 +4906,52 @@ fn color_settings_and_a_reloaded_profile_render_the_canvas_again() { assert_eq!(middle(&mut app), None, "nothing changed since: no re-render"); } +/// A frame from the render worker whose color key is not the current one is not shown, and the +/// canvas asks for the frame again. The worker converts colors with the settings in force while it +/// renders, so a frame asked for before a change of the color settings may hold colors of the new +/// settings under the old key, and a return to the old settings would keep it. +#[test] +fn a_worker_frame_of_other_color_settings_is_not_shown() { + keeping_color_settings(a_worker_frame_of_other_color_settings); +} + +fn a_worker_frame_of_other_color_settings() { + use vectorcraft_color::cms; + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + app.canvas.worker_started = true; + let (worker, jobs, done_tx) = crate::render_worker::Worker::test_channel(); + app.canvas.worker = Some(worker); + let ctx = egui::Context::default(); + let frame = |app: &mut VectorcraftApp| { + let raw = + egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0))), time: Some(1.0), ..Default::default() }; + ctx.run_ui(raw, |ui| show(app, ui)).textures_delta.clear(); + }; + frame(&mut app); + done_tx.send(finished(&jobs.try_recv().expect("the first frame"))).unwrap(); + frame(&mut app); + let first = app.canvas.key.clone().expect("the first frame is shown"); + + // A pan's frame goes to the worker, and the color settings change before it is finished. + app.view_mut().unwrap().center.x += 5.0; + frame(&mut app); + let pan = jobs.try_recv().expect("the pan's frame goes to the worker"); + let settings = cms::ColorSettings { cmyk: cms::DEVICE_CMYK.into(), ..cms::active_settings() }; + assert_ne!(settings, cms::active_settings(), "other color settings"); + cms::with_active(std::sync::Arc::new(cms::Cms::new(&settings).unwrap()), || { + done_tx.send(finished(&pan)).unwrap(); + frame(&mut app); + assert_eq!(app.canvas.key.as_ref(), Some(&first), "the pan's frame, of other color settings, is not shown"); + let again = jobs.try_recv().expect("the pan's frame is asked for with the current color settings"); + assert_ne!(again.key.color, pan.key.color); + }); + // Back to the settings in the pan's key: the pan's frame is asked for again. + frame(&mut app); + let back = jobs.try_recv().expect("the pan's frame is asked for again"); + assert_eq!(back.key, pan.key); +} + /// Guides & Grid › Show Pixel Grid (Above 600% Zoom) (#394): in Pixel Preview at 600% zoom and /// above, a line at every document pixel over the art; none below 600%, out of Pixel Preview, /// or with the option off. From 05762dba5b17b18118bc61b1d0d8386f4c1f0763 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 20 Nov 2026 20:45:39 -0800 Subject: [PATCH 06/32] Eyedropper: Cmd hover outlines what the lent selection tool selects With Cmd held, a click with the Eyedropper selects with the selection tool lent to it. The hover outline is now that tool's outline: the object under the pointer, or none when that object is already selected. Before, Cmd hid the outline. While the pointer rests, the canvas compares the state its cached outline was found for with the current state field by field. It copies the selection, the paint defaults and the tool's options into a new key only when some part of that state changed. The progress-doc line states the Alt case as the front editable object (the one below when locked art covers it) and names the tests. New tests cover a selected object, Cmd, hidden art, an armed Ignore Color pick, Shift over a blend on the canvas, and Shift over an envelope. --- crates/tools/src/xform/eyedropper.rs | 25 +++++++++++ crates/ui-egui/src/canvas.rs | 3 +- crates/ui-egui/src/canvas/overlays.rs | 57 +++++++++++++++++++----- crates/ui-egui/src/canvas/tests.rs | 64 +++++++++++++++++++++++++++ docs/target-app-parity.md | 2 +- 5 files changed, 139 insertions(+), 12 deletions(-) diff --git a/crates/tools/src/xform/eyedropper.rs b/crates/tools/src/xform/eyedropper.rs index 3448991367..0eb5008fc8 100644 --- a/crates/tools/src/xform/eyedropper.rs +++ b/crates/tools/src/xform/eyedropper.rs @@ -2009,6 +2009,31 @@ mod tests { assert_eq!(names(480.0, 480.0), None, "no art"); } + /// For a Shift-click on an envelope, the hover names the envelope where its distorted contents + /// are drawn, and the rectangle below where they leave the point empty. + #[test] + fn shift_hover_names_the_envelope_where_its_art_is_drawn() { + use vectorcraft_geom::{Affine, Rect}; + let d = doc_with_live_over_green(|d| { + let red = solid_rect(d, Rect::new(300.0, 300.0, 420.0, 320.0), Color::rgb(1.0, 0.0, 0.0)); + let kind = vectorcraft_doc::EnvelopeKind::Warp { style: "arc".into(), bend: 50.0, h: 0.0, v: 0.0, horizontal: true, version: 0 }; + let content = vec![std::sync::Arc::new(red)]; + let options = Default::default(); + Node::new( + d.alloc_id(), + NodeKind::Envelope { content, kind: Box::new(kind), fidelity: 50.0, editing: false, options, frame: Box::new(Affine::IDENTITY) }, + ) + }); + let ids: Vec = d.layers[0].children().unwrap().iter().map(|n| n.id).collect(); + let [.., green, envelope] = ids[..] else { panic!("two objects over the rectangle expected") }; + let (s, p) = (Selection::default(), paint()); + let shift = Mods { shift: true, ..Default::default() }; + let t = EyedropperTool::default(); + let names = |x: f64, y: f64| t.hover_object(&cx(&d, &s, &p), Point::new(x, y), shift); + assert_eq!(names(360.0, 310.0), Some(envelope), "the distorted contents"); + assert_eq!(names(360.0, 332.0), Some(green), "a point the contents leave empty"); + } + /// A plain click on a selected gradient mesh recolors its points, and the hover names that /// mesh; Image Trace's Ignore Color pick, which the panel samples, names nothing. #[test] diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 53a1d373f8..c1eaf41980 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -61,12 +61,13 @@ use input::handle_input; use outline::KEY_OUTLINE; #[cfg(test)] use outline::{OVERLAY_MAX_ANCHORS, c32, node_outline, walk_drawn}; +pub use overlays::HoverObjectKey; +pub use overlays::SharedPaths; #[cfg(test)] use overlays::selected_anchor; use overlays::{ HandleLook, blend_widgets_overlay, draw_inside_overlay, draw_overlays, hover_highlight, ime_geometry, overlay_hover_text, selection_overlay, }; -pub use overlays::{HoverObjectKey, SharedPaths}; pub use panes::{Layout as TileLayout, Panes}; pub(crate) use panes::{consolidate, note_drop, noted_cursor, pane, release_on_noted, tile, tiled_area}; pub(crate) use quick_pen_bar::quick_pen_bar_rect; diff --git a/crates/ui-egui/src/canvas/overlays.rs b/crates/ui-egui/src/canvas/overlays.rs index 79d3195eaf..736bfb999e 100644 --- a/crates/ui-egui/src/canvas/overlays.rs +++ b/crates/ui-egui/src/canvas/overlays.rs @@ -19,21 +19,25 @@ pub(super) fn hover_highlight(app: &mut VectorcraftApp, p: &egui::Painter, xf: & if app.session.tool_busy() || !matches!(app.session.tool_id(), "selection" | "directSelection" | "groupSelection" | "eyedropper") { return; } - // With Space lending the view tools, a press pans the view and acts on no object. let (m, space) = p.ctx().input(|i| (i.modifiers, i.key_down(egui::Key::Space))); + let mods = super::drag::mods(m, false); + // With Space lending the view tools, a press pans the view and acts on no object. if super::drag::space_lends_view_tools(app, m, space) { return; } - let id = if app.session.tool_id() == "eyedropper" { + // With the Eyedropper, Cmd lends a selection tool, whose click acts on what that tool outlines. + let eyedropper = app.session.tool_id() == "eyedropper"; + let lent = if eyedropper && !app.session.tool_editing() { app.session.lent_tool_id(&mods) } else { None }; + let id = if eyedropper && lent.is_none() { // The object the Eyedropper's click there samples, recolors or copies to, with the keys // held now. A selected one is outlined too: a click on it still acts on it. - let mods = super::drag::mods(m, false); let Some(id) = eyedropper_hover_object(app, h, mods, view) else { return }; id } else { + let tool = lent.unwrap_or(app.session.tool_id()); let Some(st) = app.session.active() else { return }; let Some(hit) = selection_hit_at(app, h, xf.zoom) else { return }; - let id = if app.session.tool_id() == "selection" { hit.top_object(st.isolation) } else { hit.leaf }; + let id = if tool == "selection" { hit.top_object(st.isolation) } else { hit.leaf }; if st.selection.contains(id) { return; } @@ -70,7 +74,9 @@ pub struct HoverObjectKey { } /// [`vectorcraft_engine::Session::hover_object`] at `at`, found again only when its -/// [`HoverObjectKey`] changes: over an image, or with Shift held, finding it samples a color. +/// [`HoverObjectKey`] changes: over an image, or with Shift held, finding it samples a color. The +/// cached key is compared field by field, the cheap fields first, and the key is copied only +/// when it changed. fn eyedropper_hover_object( app: &mut VectorcraftApp, at: vectorcraft_geom::Point, @@ -78,6 +84,42 @@ fn eyedropper_hover_object( view: vectorcraft_engine::ViewInfo, ) -> Option { let st = app.session.active()?; + let s = &app.session; + let cached = app.canvas.hover_object.as_ref().filter(|(k, _)| { + let HoverObjectKey { + at: k_at, + mods: k_mods, + doc, + selection, + isolation, + options, + paint, + fill_active, + stop, + tolerance, + eyedropper, + guides, + zoom, + outline, + } = k; + *k_at == at + && *k_mods == mods + && *doc == (st.uid, st.revision) + && *isolation == st.isolation + && *fill_active == s.fill_active + && *stop == s.selected_stop() + && *tolerance == s.prefs.selection_tolerance + && *eyedropper == s.prefs.eyedropper + && *guides == (view.guides, s.guides_locked()) + && *zoom == view.zoom + && *outline == view.outline + && *selection == st.selection + && *paint == s.paint + && *options == s.tool_options() + }); + if let Some((_, id)) = cached { + return *id; + } let key = HoverObjectKey { at, mods, @@ -94,11 +136,6 @@ fn eyedropper_hover_object( zoom: view.zoom, outline: view.outline, }; - if let Some((k, id)) = &app.canvas.hover_object - && *k == key - { - return *id; - } let id = app.session.hover_object(at, mods, view); app.canvas.hover_object = Some((key, id)); id diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index 1a714ccfe6..c17f11629a 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -6168,6 +6168,70 @@ fn eyedropper_hover_outlines_the_object_under_the_pointer() { } } +/// The Eyedropper outlines a selected object too, since its click still acts on it. With Cmd held, +/// a click selects with the selection tool lent to it, so the outline is that tool's: none on a +/// selected object, and the object under the pointer otherwise. Hiding the object under the +/// pointer, or arming Image Trace's Ignore Color pick (which acts on no object), removes the +/// outline without the pointer moving. +#[test] +fn eyedropper_hover_outline_follows_the_selection_cmd_and_the_document() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + let id = app.session.execute("shape.rectangle", &json!({"x": 100, "y": 100, "width": 100, "height": 100})).unwrap()["id"].as_u64().unwrap(); + app.select_tool("eyedropper"); + let ctx = egui::Context::default(); + frame(&mut app, &ctx, vec![]); + let xf = Xf::new(app.canvas_rect.unwrap(), app.view().unwrap()); + let color = c32(app.session.active().unwrap().doc.layer_color(vectorcraft_doc::NodeId(id))); + let rect = egui::Rect::from_two_pos(xf.to_screen(Point::new(100.0, 100.0)), xf.to_screen(Point::new(200.0, 200.0))); + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(xf.to_screen(Point::new(150.0, 150.0)))]); + assert!(app.session.active().unwrap().selection.contains(vectorcraft_doc::NodeId(id))); + let at = hover_outline_points(&mut app, &ctx, color, egui::Modifiers::NONE); + assert!(!at.is_empty() && same_box(screen_box(&at), rect), "a selected object: {:?}", screen_box(&at)); + assert!(hover_outline_points(&mut app, &ctx, color, egui::Modifiers::COMMAND).is_empty(), "Cmd over a selected object"); + app.session.execute("select.none", &json!({})).unwrap(); + let at = hover_outline_points(&mut app, &ctx, color, egui::Modifiers::COMMAND); + assert!(!at.is_empty() && same_box(screen_box(&at), rect), "Cmd over an unselected object: {:?}", screen_box(&at)); + assert!(!hover_outline_points(&mut app, &ctx, color, egui::Modifiers::NONE).is_empty(), "Cmd let go"); + app.session.set_tool_option("imageTraceIgnoreColor", &json!({"binding": 1})); + assert!(hover_outline_points(&mut app, &ctx, color, egui::Modifiers::NONE).is_empty(), "an armed Ignore Color pick"); + app.session.set_tool_option("imageTraceIgnoreColor", &serde_json::Value::Null); + assert!(!hover_outline_points(&mut app, &ctx, color, egui::Modifiers::NONE).is_empty(), "the pick disarmed"); + app.session.execute("object.hide", &json!({"ids": [id]})).unwrap(); + assert!(hover_outline_points(&mut app, &ctx, color, egui::Modifiers::NONE).is_empty(), "hidden art"); +} + +/// For a Shift-click the Eyedropper outlines the object whose color the click samples: the blend +/// where one of its steps is drawn, and the rectangle below it in a gap between the steps. +#[test] +fn eyedropper_shift_hover_outlines_the_object_sampled() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + let rect = |app: &mut VectorcraftApp, x: f64, y: f64, w: f64, h: f64, color: &str| { + let id = app.session.execute("shape.rectangle", &json!({"x": x, "y": y, "width": w, "height": h})).unwrap()["id"].as_u64().unwrap(); + app.session.execute("paint.setFill", &json!({"ids": [id], "color": color})).unwrap(); + id + }; + let back = rect(&mut app, 20.0, 50.0, 360.0, 150.0, "#00ff00"); + let a = rect(&mut app, 100.0, 100.0, 20.0, 20.0, "#ff0000"); + let b = rect(&mut app, 200.0, 100.0, 20.0, 20.0, "#0000ff"); + app.session.execute("object.blend.make", &json!({"ids": [a, b], "steps": 1})).unwrap(); + app.session.execute("select.none", &json!({})).unwrap(); + app.select_tool("eyedropper"); + let ctx = egui::Context::default(); + frame(&mut app, &ctx, vec![]); + let xf = Xf::new(app.canvas_rect.unwrap(), app.view().unwrap()); + let color = c32(app.session.active().unwrap().doc.layer_color(vectorcraft_doc::NodeId(back))); + let boxed = |x0: f64, y0: f64, x1: f64, y1: f64| egui::Rect::from_two_pos(xf.to_screen(Point::new(x0, y0)), xf.to_screen(Point::new(x1, y1))); + // One step, halfway: (150, 100) to (170, 120). + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(xf.to_screen(Point::new(160.0, 110.0)))]); + let at = hover_outline_points(&mut app, &ctx, color, egui::Modifiers::SHIFT); + assert!(!at.is_empty() && same_box(screen_box(&at), boxed(100.0, 100.0, 220.0, 120.0)), "a blend step: {:?}", screen_box(&at)); + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(xf.to_screen(Point::new(135.0, 110.0)))]); + let at = hover_outline_points(&mut app, &ctx, color, egui::Modifiers::SHIFT); + assert!(!at.is_empty() && same_box(screen_box(&at), boxed(20.0, 50.0, 380.0, 200.0)), "a gap between the steps: {:?}", screen_box(&at)); +} + /// The Eyedropper's hover outline follows Smart Guides › Object Highlighting. #[test] fn eyedropper_hover_outline_follows_object_highlighting() { diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 143f215fcd..a061ec8a59 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -2015,7 +2015,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Pasting into hex color fields:** in the hex fields of the Color Picker, Swatch Options, Recolor Artwork, the Color panel, Document Setup, Duotone, Color Themes and Perspective Grid, a click or keyboard focus selects the digits. A pasted code of six digits, with or without `#`, replaces them wherever the caret is. A pasted code of three digits also replaces them, unless the paste holds only those digits and exactly three digits stay; those digits then edit the text in place. A press on another field commits the text as Tab and Enter do. As VectorCraft's own rule, a paste that is not a color leaves the field as it was. Tests: `a_hex_code_pasted_into_the_hex_field_replaces_its_digits` in `crates/ui-egui/src/dialogs/tests.rs`, `define_grid_takes_a_three_digit_color` in `crates/ui-egui/src/dialogs/tests_perspective.rs` and `a_paste_into_a_hex_field_replaces_or_edits_its_digits` in `crates/ui-egui/src/tests/numfields.rs`. - **Color Picker layout (#2008):** a centered draggable header, equal-width actions above aligned HSB/RGB/Hex and Lab/CMYK fields, compact field and slider, and warnings below the preview. No horizontal scrolling; narrow windows stack the sections with vertical scrolling. Tests in `dialogs/color_picker.rs` cover actual pointer/key input, typed values before OK/Enter, Cancel/Escape rollback, one Undo step, mode-size stability, warnings and layout at two UI scales. The screen sampler sits above the field and the upstream two-grid Tab order is retained. AccessKit regressions check the action names and each channel slider's displayed value, units and range. German and enlarged English UI renders were reviewed locally; no reference images are shipped. This is a layout improvement, with no change to scores or remaining-hour estimates. - **Eyedropper sources (#1251):** ordinary and Shift clicks, Shift+Alt appearance append, raster pixels and gradient-stop sampling can read visible locked/template art and sources outside isolation. Sampling leaves the source and selection intact; Alt reverse still uses editable hits, and hidden art stays excluded. Engine/tool/hit regressions cover the editing boundary, color models and one-step Undo/Redo. The general object/image workflow is described in [public HelpX](https://helpx.adobe.com/illustrator/using/tool-techniques/eyedropper-tool.html); the lock/isolation expectations come from the user report and these regressions, without a new full-parity measurement. - - **Eyedropper hover outline:** as VectorCraft's own behavior, with Smart Guides › Object Highlighting on, the Eyedropper outlines the object a click at the pointer would act on, in the selection tools' 1.5 px layer-color outline: the source a click copies from (locked and template art included), the selected gradient mesh a click recolors, the object below a locked one that an Alt-click gives the selection's attributes to, and for a Shift-click the object whose color is sampled (a blend or envelope where its art is drawn, the art below where it leaves a gap). A selected object is outlined too. Empty canvas, hidden art and a Cmd-click that borrows a selection tool show no outline, and with the Eyedropper or a selection tool, Space held for the view tools hides the outline. Tests: `crates/ui-egui/src/canvas/tests.rs`, `crates/tools/src/xform/eyedropper.rs`. + - **Eyedropper hover outline:** as VectorCraft's own behavior, with Smart Guides › Object Highlighting on, the Eyedropper outlines the object a click at the pointer would act on, in the selection tools' 1.5 px layer-color outline: the source a click copies from (locked and template art included), the selected gradient mesh a click recolors, the front editable object an Alt-click gives the selection's attributes to (the one below when locked art covers it), and for a Shift-click the object whose color is sampled (a blend or envelope where its art is drawn, the art below where it leaves a gap). A selected object is outlined too. With Cmd held, a click selects with the selection tool lent to the Eyedropper, and the outline is that tool's. Empty canvas and hidden art show no outline, and with the Eyedropper or a selection tool, Space held for the view tools hides the outline. Tests: `eyedropper_hover_outlines_the_object_under_the_pointer`, `eyedropper_hover_outline_follows_object_highlighting`, `eyedropper_hover_outline_is_the_object_the_click_acts_on`, `eyedropper_hover_outline_follows_the_selection_cmd_and_the_document` and `eyedropper_shift_hover_outlines_the_object_sampled` in `crates/ui-egui/src/canvas/tests.rs`, and `shift_hover_names_the_object_the_sample_comes_from`, `shift_hover_names_the_envelope_where_its_art_is_drawn` and `hover_names_the_selected_mesh_a_click_recolors` in `crates/tools/src/xform/eyedropper.rs`. - **Eyedropper colors in a CMYK document (#2276):** a CMYK image (a four-component JPEG, or an 8- or 16-bit chunky CMYK TIFF) gives its ink amounts as they are, and an RGB image's pixel or an RGB color given to `paint.setFill`, `paint.setStroke`, `paint.sampleColor` or `swatch.new {color}` (hex input and gradient stops included) is separated through the color settings' CMYK working space and intent, as Document Color Mode converts it. With the default Generic CMYK, RGB 83/170/223 separates to C62 M19 Y0 K0, where the profile-free formula gave C63 M24 Y0 K13. - **RGB input to other commands in a CMYK document:** type colors (`text.create`, `text.setStyle`, `text.setRangeStyle`), a Shape Builder hex fill, `paint.editGradient` stops, freeform gradient points, gradient mesh points (the Mesh tool gives a new point the fill's color in its own model), the Symbol Stainer's color and the swatch commands (`swatch.new {colors}`, `swatch.newGroup`, `swatch.editGroup`, `swatch.edit`) separate RGB through the color settings as `paint.setFill` does: with Generic CMYK, `text.setStyle {fill: "#53aadf"}` gives C62 M19 Y0 K0. A color a swatch already has keeps its model, and a swatch color given with `mode` is converted into that mode only. - **Generic CMYK (SWOP-like):** each ink's 40% and 50% tints gain as [CGATS TR 001](https://registry.color.org/cmyk-registry/cgats_tr_001) gives for SWOP printing, and separations stay within SWOP's [300% total ink limit](https://en.wikipedia.org/wiki/Specifications_for_Web_Offset_Publications). The paper, solid and overprint colors, the black-generation curve and the black point are VectorCraft's own values: RGB black separates to 90% black under neutral cyan, magenta and yellow that fill the ink limit (C75 M68 Y67 K90). The ICC profile written for it (embedded in exports) gives the paper as its media white point, and its colorimetric Lab → CMYK table is the inverse of its CMYK → Lab table, without black-point compensation; the perceptual and saturation tables keep compensation. From 91bfcc7455a794c1c42da64bd8ffef0535e2b17c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 21 Nov 2026 00:04:25 -0800 Subject: [PATCH 07/32] Eyedropper: count a blend's steps before sampling it; hover skips a selected group member Before the Eyedropper evaluates a blend to sample its color, it now counts the steps of every blend the art holds against the work left. When the steps alone exceed it, the blend is not evaluated and the sample gives no color. Hover runs this lookup on every pointer move with Shift held. The Selection tool's hover outline, and the one it shows when lent to the Eyedropper with Cmd, now outlines nothing over a selected group member, where a press keeps the selection. It uses the same rule as the press (select::selected_under_in). Tests: blend_steps_count_before_the_blend_is_evaluated and selection_hover_outline_skips_a_selected_group_member. --- crates/tools/src/select.rs | 15 ++++++-- crates/tools/src/xform/eyedropper.rs | 54 ++++++++++++++++++++++++++- crates/ui-egui/src/canvas/overlays.rs | 9 ++++- crates/ui-egui/src/canvas/tests.rs | 25 +++++++++++++ docs/target-app-parity.md | 2 +- 5 files changed, 98 insertions(+), 7 deletions(-) diff --git a/crates/tools/src/select.rs b/crates/tools/src/select.rs index fc18a978e6..0ccb8499ed 100644 --- a/crates/tools/src/select.rs +++ b/crates/tools/src/select.rs @@ -1473,15 +1473,22 @@ fn object_behind(cx: &ToolContext, p: Point) -> Option { /// member with only some anchors or segments selected does not count: the press selects `top`. /// A member with every anchor selected (as `select.anchors` and `select.key` leave a path) counts. fn selected_under(cx: &ToolContext, h: &Hit, top: NodeId) -> Option { - if cx.selection.contains(top) { + selected_under_in(cx.doc, cx.selection, h, top) +} + +/// [`selected_under`] in `doc` with `selection`: the selected object a Selection tool press on +/// `h` lands on, where `top` is the object the press would select. The canvas's hover outline +/// outlines nothing where this finds an object. +pub fn selected_under_in(doc: &vectorcraft_doc::Document, selection: &vectorcraft_doc::Selection, h: &Hit, top: NodeId) -> Option { + if selection.contains(top) { return Some(top); } let every_anchor = |id: NodeId| { - cx.selection + selection .partial(id) - .is_none_or(|picked| cx.doc.node(id).and_then(|n| n.path_data()).is_some_and(|p| p.anchors().all(|(s, i, _)| picked.contains(&(s, i))))) + .is_none_or(|picked| doc.node(id).and_then(|n| n.path_data()).is_some_and(|p| p.anchors().all(|(s, i, _)| picked.contains(&(s, i))))) }; - let whole = |id: NodeId| cx.selection.contains(id) && every_anchor(id) && !cx.selection.segments.contains_key(&id); + let whole = |id: NodeId| selection.contains(id) && every_anchor(id) && !selection.segments.contains_key(&id); let below = h.ancestry.iter().position(|id| *id == top).map_or(&[][..], |i| h.ancestry.get(i..).unwrap_or_default()); below.iter().copied().chain(std::iter::once(h.leaf)).find(|id| whole(*id)) } diff --git a/crates/tools/src/xform/eyedropper.rs b/crates/tools/src/xform/eyedropper.rs index 0eb5008fc8..38a6b8cf58 100644 --- a/crates/tools/src/xform/eyedropper.rs +++ b/crates/tools/src/xform/eyedropper.rs @@ -249,14 +249,31 @@ fn drawn_live<'d>(doc: &'d Document, ancestry: &[NodeId]) -> Option<&'d Node> { /// The color the art blend or envelope `n` draws shows at `p`, sampled as [`art_color_at`] samples /// art: a blend's keys and steps, an envelope's distorted contents, symbol instances in them by /// their symbols' art. Evaluating it counts the objects it holds, and the art made counts its -/// objects. +/// objects. When less work is left than the steps of its blends make, it is not evaluated. fn live_color_at(s: &mut Sampler, levels: &mut [Option], n: &Node, p: Point) -> Option { + let steps = blend_steps_in(n); + if s.work < steps { + // Too little work is left for the steps the blends make. + s.spend(steps)?; + } s.spend(n.count())?; let art = vectorcraft_effects::expand_live_deep(Some(s.doc), n); s.spend(art.count())?; art_color_at(s, levels, [art], p) } +/// The steps the blends in `n` and its subtree make between their keys, at the least: a blend +/// inside another blend's keys is counted once, not once for each step that copies it. +fn blend_steps_in(n: &Node) -> usize { + let mut steps = 0usize; + n.walk(&mut |c| { + if let NodeKind::Blend { children, spec } = &c.kind { + steps = vectorcraft_doc::blend::blend_steps(children, spec).into_iter().fold(steps, usize::saturating_add); + } + }); + steps +} + /// The color `n` shows at `p`: an image's pixels, a mesh's interpolated patch color, a symbol /// instance's art, or the color of its fill (or its stroke, when the stroke was hit or there is no /// fill) there. Images, symbols and patterns are looked up in the sampled document. @@ -2009,6 +2026,41 @@ mod tests { assert_eq!(names(480.0, 480.0), None, "no art"); } + /// A blend's steps count as work before it is evaluated: the steps of every blend it holds + /// are counted, and with less work left than that the sample gives no color. + #[test] + fn blend_steps_count_before_the_blend_is_evaluated() { + use vectorcraft_doc::Document; + use vectorcraft_doc::live::{BlendSpacing, BlendSpec}; + use vectorcraft_geom::Rect; + let blend = |d: &mut Document, steps: u32| { + let red = solid_rect(d, Rect::new(300.0, 300.0, 320.0, 320.0), Color::rgb(1.0, 0.0, 0.0)); + let blue = solid_rect(d, Rect::new(400.0, 300.0, 420.0, 320.0), Color::rgb(0.0, 0.0, 1.0)); + let spec = BlendSpec { spacing: BlendSpacing::Steps(steps), ..Default::default() }; + Node::new(d.alloc_id(), NodeKind::Blend { children: vec![std::sync::Arc::new(red), std::sync::Arc::new(blue)], spec: Box::new(spec) }) + }; + let mut scratch = Document::new(500.0, 500.0); + let (big, small) = (blend(&mut scratch, 1000), blend(&mut scratch, 3)); + let rect = solid_rect(&mut scratch, Rect::new(0.0, 0.0, 10.0, 10.0), Color::rgb(0.0, 1.0, 0.0)); + assert_eq!(blend_steps_in(&big), 1000); + assert_eq!(blend_steps_in(&rect), 0); + let group = + Node::new(scratch.alloc_id(), NodeKind::Group { children: vec![std::sync::Arc::new(big), std::sync::Arc::new(small)], clip: false }); + assert_eq!(blend_steps_in(&group), 1003, "every blend in the group"); + + let d = doc_with_live_over_green(|d| blend(d, 1000)); + let (sel, p) = (Selection::default(), paint()); + let cx = cx(&d, &sel, &p); + let opts = sample_options(&cx); + let mut levels: Vec> = (0..MAX_NESTING).map(|_| None).collect(); + let at = Point::new(360.0, 310.0); + let mut s = Sampler { doc: &d, opts, raster_sample: cx.raster_sample, symbol_nodes: 0, work: 900, exhausted: false, patterns: 0 }; + assert_eq!(color_under(&mut s, &d, &mut levels, at, opts).map(|(c, _)| c.to_hex()), None); + assert!(s.exhausted, "less work left than the blend's 1,000 steps"); + let mut s = Sampler { doc: &d, opts, raster_sample: cx.raster_sample, symbol_nodes: 0, work: MAX_WORK, exhausted: false, patterns: 0 }; + assert!(color_under(&mut s, &d, &mut levels, at, opts).is_some(), "a step is drawn at the point"); + } + /// For a Shift-click on an envelope, the hover names the envelope where its distorted contents /// are drawn, and the rectangle below where they leave the point empty. #[test] diff --git a/crates/ui-egui/src/canvas/overlays.rs b/crates/ui-egui/src/canvas/overlays.rs index 736bfb999e..351f3b070e 100644 --- a/crates/ui-egui/src/canvas/overlays.rs +++ b/crates/ui-egui/src/canvas/overlays.rs @@ -38,7 +38,14 @@ pub(super) fn hover_highlight(app: &mut VectorcraftApp, p: &egui::Painter, xf: & let Some(st) = app.session.active() else { return }; let Some(hit) = selection_hit_at(app, h, xf.zoom) else { return }; let id = if tool == "selection" { hit.top_object(st.isolation) } else { hit.leaf }; - if st.selection.contains(id) { + // A Selection tool press on selected art inside `id`, such as a group member picked with + // Group Selection, keeps the selection and selects nothing new. + let kept = if tool == "selection" { + vectorcraft_tools::select::selected_under_in(&st.doc, &st.selection, &hit, id).is_some() + } else { + st.selection.contains(id) + }; + if kept { return; } id diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index c17f11629a..534dbc5562 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -6201,6 +6201,31 @@ fn eyedropper_hover_outline_follows_the_selection_cmd_and_the_document() { assert!(hover_outline_points(&mut app, &ctx, color, egui::Modifiers::NONE).is_empty(), "hidden art"); } +/// With a group member selected (as Group Selection leaves it), the Selection tool outlines +/// nothing over that member, where a press keeps the selection, and the group over its other +/// member, where a press selects the group. +#[test] +fn selection_hover_outline_skips_a_selected_group_member() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + let a = app.session.execute("shape.rectangle", &json!({"x": 100, "y": 100, "width": 50, "height": 50})).unwrap()["id"].as_u64().unwrap(); + let b = app.session.execute("shape.rectangle", &json!({"x": 200, "y": 100, "width": 50, "height": 50})).unwrap()["id"].as_u64().unwrap(); + app.session.execute("select.set", &json!({"ids": [a, b]})).unwrap(); + app.session.execute("object.group", &json!({})).unwrap(); + app.session.execute("select.set", &json!({"ids": [a]})).unwrap(); + app.select_tool("selection"); + let ctx = egui::Context::default(); + frame(&mut app, &ctx, vec![]); + let xf = Xf::new(app.canvas_rect.unwrap(), app.view().unwrap()); + let color = c32(app.session.active().unwrap().doc.layer_color(vectorcraft_doc::NodeId(a))); + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(xf.to_screen(Point::new(125.0, 125.0)))]); + assert!(hover_outline_points(&mut app, &ctx, color, egui::Modifiers::NONE).is_empty(), "the selected member"); + frame(&mut app, &ctx, vec![egui::Event::PointerMoved(xf.to_screen(Point::new(225.0, 125.0)))]); + let group = egui::Rect::from_two_pos(xf.to_screen(Point::new(100.0, 100.0)), xf.to_screen(Point::new(250.0, 150.0))); + let at = hover_outline_points(&mut app, &ctx, color, egui::Modifiers::NONE); + assert!(!at.is_empty() && same_box(screen_box(&at), group), "the other member: {:?}", screen_box(&at)); +} + /// For a Shift-click the Eyedropper outlines the object whose color the click samples: the blend /// where one of its steps is drawn, and the rectangle below it in a gap between the steps. #[test] diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index a061ec8a59..eaa809b5f2 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -2015,7 +2015,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Pasting into hex color fields:** in the hex fields of the Color Picker, Swatch Options, Recolor Artwork, the Color panel, Document Setup, Duotone, Color Themes and Perspective Grid, a click or keyboard focus selects the digits. A pasted code of six digits, with or without `#`, replaces them wherever the caret is. A pasted code of three digits also replaces them, unless the paste holds only those digits and exactly three digits stay; those digits then edit the text in place. A press on another field commits the text as Tab and Enter do. As VectorCraft's own rule, a paste that is not a color leaves the field as it was. Tests: `a_hex_code_pasted_into_the_hex_field_replaces_its_digits` in `crates/ui-egui/src/dialogs/tests.rs`, `define_grid_takes_a_three_digit_color` in `crates/ui-egui/src/dialogs/tests_perspective.rs` and `a_paste_into_a_hex_field_replaces_or_edits_its_digits` in `crates/ui-egui/src/tests/numfields.rs`. - **Color Picker layout (#2008):** a centered draggable header, equal-width actions above aligned HSB/RGB/Hex and Lab/CMYK fields, compact field and slider, and warnings below the preview. No horizontal scrolling; narrow windows stack the sections with vertical scrolling. Tests in `dialogs/color_picker.rs` cover actual pointer/key input, typed values before OK/Enter, Cancel/Escape rollback, one Undo step, mode-size stability, warnings and layout at two UI scales. The screen sampler sits above the field and the upstream two-grid Tab order is retained. AccessKit regressions check the action names and each channel slider's displayed value, units and range. German and enlarged English UI renders were reviewed locally; no reference images are shipped. This is a layout improvement, with no change to scores or remaining-hour estimates. - **Eyedropper sources (#1251):** ordinary and Shift clicks, Shift+Alt appearance append, raster pixels and gradient-stop sampling can read visible locked/template art and sources outside isolation. Sampling leaves the source and selection intact; Alt reverse still uses editable hits, and hidden art stays excluded. Engine/tool/hit regressions cover the editing boundary, color models and one-step Undo/Redo. The general object/image workflow is described in [public HelpX](https://helpx.adobe.com/illustrator/using/tool-techniques/eyedropper-tool.html); the lock/isolation expectations come from the user report and these regressions, without a new full-parity measurement. - - **Eyedropper hover outline:** as VectorCraft's own behavior, with Smart Guides › Object Highlighting on, the Eyedropper outlines the object a click at the pointer would act on, in the selection tools' 1.5 px layer-color outline: the source a click copies from (locked and template art included), the selected gradient mesh a click recolors, the front editable object an Alt-click gives the selection's attributes to (the one below when locked art covers it), and for a Shift-click the object whose color is sampled (a blend or envelope where its art is drawn, the art below where it leaves a gap). A selected object is outlined too. With Cmd held, a click selects with the selection tool lent to the Eyedropper, and the outline is that tool's. Empty canvas and hidden art show no outline, and with the Eyedropper or a selection tool, Space held for the view tools hides the outline. Tests: `eyedropper_hover_outlines_the_object_under_the_pointer`, `eyedropper_hover_outline_follows_object_highlighting`, `eyedropper_hover_outline_is_the_object_the_click_acts_on`, `eyedropper_hover_outline_follows_the_selection_cmd_and_the_document` and `eyedropper_shift_hover_outlines_the_object_sampled` in `crates/ui-egui/src/canvas/tests.rs`, and `shift_hover_names_the_object_the_sample_comes_from`, `shift_hover_names_the_envelope_where_its_art_is_drawn` and `hover_names_the_selected_mesh_a_click_recolors` in `crates/tools/src/xform/eyedropper.rs`. + - **Eyedropper hover outline:** as VectorCraft's own behavior, with Smart Guides › Object Highlighting on, the Eyedropper outlines the object a click at the pointer would act on, in the selection tools' 1.5 px layer-color outline: the source a click copies from (locked and template art included), the selected gradient mesh a click recolors, the front editable object an Alt-click gives the selection's attributes to (the one below when locked art covers it), and for a Shift-click the object whose color is sampled (a blend or envelope where its art is drawn, the art below where it leaves a gap). A selected object is outlined too. With Cmd held, a click selects with the selection tool lent to the Eyedropper, and the outline is that tool's. The Selection tool's outline, lent or not, leaves out a group whose selected member is under the pointer, where a press keeps the selection. Finding a Shift-click's sample counts a blend's steps before the blend is evaluated. Empty canvas and hidden art show no outline, and with the Eyedropper or a selection tool, Space held for the view tools hides the outline. Tests: `eyedropper_hover_outlines_the_object_under_the_pointer`, `eyedropper_hover_outline_follows_object_highlighting`, `eyedropper_hover_outline_is_the_object_the_click_acts_on`, `eyedropper_hover_outline_follows_the_selection_cmd_and_the_document`, `selection_hover_outline_skips_a_selected_group_member` and `eyedropper_shift_hover_outlines_the_object_sampled` in `crates/ui-egui/src/canvas/tests.rs`, and `shift_hover_names_the_object_the_sample_comes_from`, `shift_hover_names_the_envelope_where_its_art_is_drawn`, `hover_names_the_selected_mesh_a_click_recolors` and `blend_steps_count_before_the_blend_is_evaluated` in `crates/tools/src/xform/eyedropper.rs`. - **Eyedropper colors in a CMYK document (#2276):** a CMYK image (a four-component JPEG, or an 8- or 16-bit chunky CMYK TIFF) gives its ink amounts as they are, and an RGB image's pixel or an RGB color given to `paint.setFill`, `paint.setStroke`, `paint.sampleColor` or `swatch.new {color}` (hex input and gradient stops included) is separated through the color settings' CMYK working space and intent, as Document Color Mode converts it. With the default Generic CMYK, RGB 83/170/223 separates to C62 M19 Y0 K0, where the profile-free formula gave C63 M24 Y0 K13. - **RGB input to other commands in a CMYK document:** type colors (`text.create`, `text.setStyle`, `text.setRangeStyle`), a Shape Builder hex fill, `paint.editGradient` stops, freeform gradient points, gradient mesh points (the Mesh tool gives a new point the fill's color in its own model), the Symbol Stainer's color and the swatch commands (`swatch.new {colors}`, `swatch.newGroup`, `swatch.editGroup`, `swatch.edit`) separate RGB through the color settings as `paint.setFill` does: with Generic CMYK, `text.setStyle {fill: "#53aadf"}` gives C62 M19 Y0 K0. A color a swatch already has keeps its model, and a swatch color given with `mode` is converted into that mode only. - **Generic CMYK (SWOP-like):** each ink's 40% and 50% tints gain as [CGATS TR 001](https://registry.color.org/cmyk-registry/cgats_tr_001) gives for SWOP printing, and separations stay within SWOP's [300% total ink limit](https://en.wikipedia.org/wiki/Specifications_for_Web_Offset_Publications). The paper, solid and overprint colors, the black-generation curve and the black point are VectorCraft's own values: RGB black separates to 90% black under neutral cyan, magenta and yellow that fill the ink limit (C75 M68 Y67 K90). The ICC profile written for it (embedded in exports) gives the paper as its media white point, and its colorimetric Lab → CMYK table is the inverse of its CMYK → Lab table, without black-point compensation; the perceptual and saturation tables keep compensation. From a935af00151607b160fa477bc6d903aaa5c0c9d6 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 21 Nov 2026 00:34:42 -0800 Subject: [PATCH 08/32] Eyedropper: count the steps that copy a nested blend before sampling it Each step of a blend whose keys are blends is a copy of one of them, which makes its own steps when drawn. The work check before a blend is evaluated now counts those steps too, with the same count the blend uses to fit its steps (`vectorcraft_doc::blend::blend_steps_made`), so a nested blend with more steps than the work left is not evaluated. Tests check that the blend is not evaluated when the work left is too little, for a plain blend and for an outer blend of nested blends. --- crates/doc/src/blend.rs | 7 +++ crates/tools/src/xform/eyedropper.rs | 74 ++++++++++++++++++++++------ 2 files changed, 65 insertions(+), 16 deletions(-) diff --git a/crates/doc/src/blend.rs b/crates/doc/src/blend.rs index 02458af8c5..64545d1bcf 100644 --- a/crates/doc/src/blend.rs +++ b/crates/doc/src/blend.rs @@ -2186,6 +2186,13 @@ pub fn blend_steps(keys: &[Arc], spec: &BlendSpec) -> Vec { StepCount::default().blend(keys, spec, Rail::new(keys, spec).as_ref()).0 } +/// Most steps the blends in `n` and its subtree make in all when drawn: a step that copies a +/// blend counts that blend's steps again, and each instance of a repeat counts its source's +/// steps again. Objects that are not blend steps count 0. +pub fn blend_steps_made(n: &Node) -> usize { + StepCount::default().node(n, false) +} + /// Does each pair of `keys` blended with `spec` ask for the same number of steps /// ([`blend_step_count`]) when each coordinate it counts from moves by up to `length` points and, /// for Smooth Color, the difference between keys of different colors by up to `color` (0 to 1)? diff --git a/crates/tools/src/xform/eyedropper.rs b/crates/tools/src/xform/eyedropper.rs index 38a6b8cf58..0c63f2f21c 100644 --- a/crates/tools/src/xform/eyedropper.rs +++ b/crates/tools/src/xform/eyedropper.rs @@ -249,29 +249,26 @@ fn drawn_live<'d>(doc: &'d Document, ancestry: &[NodeId]) -> Option<&'d Node> { /// The color the art blend or envelope `n` draws shows at `p`, sampled as [`art_color_at`] samples /// art: a blend's keys and steps, an envelope's distorted contents, symbol instances in them by /// their symbols' art. Evaluating it counts the objects it holds, and the art made counts its -/// objects. When less work is left than the steps of its blends make, it is not evaluated. +/// objects. When less work is left than the steps of its blends make in all, the steps that copy +/// a nested blend included ([`vectorcraft_doc::blend::blend_steps_made`]), it is not evaluated. fn live_color_at(s: &mut Sampler, levels: &mut [Option], n: &Node, p: Point) -> Option { - let steps = blend_steps_in(n); + let steps = vectorcraft_doc::blend::blend_steps_made(n); if s.work < steps { // Too little work is left for the steps the blends make. s.spend(steps)?; } s.spend(n.count())?; + #[cfg(test)] + EXPANSIONS.with(|e| e.set(e.get() + 1)); let art = vectorcraft_effects::expand_live_deep(Some(s.doc), n); s.spend(art.count())?; art_color_at(s, levels, [art], p) } -/// The steps the blends in `n` and its subtree make between their keys, at the least: a blend -/// inside another blend's keys is counted once, not once for each step that copies it. -fn blend_steps_in(n: &Node) -> usize { - let mut steps = 0usize; - n.walk(&mut |c| { - if let NodeKind::Blend { children, spec } = &c.kind { - steps = vectorcraft_doc::blend::blend_steps(children, spec).into_iter().fold(steps, usize::saturating_add); - } - }); - steps +#[cfg(test)] +thread_local! { + /// The blends and envelopes [`live_color_at`] has evaluated on this thread. + static EXPANSIONS: std::cell::Cell = const { std::cell::Cell::new(0) }; } /// The color `n` shows at `p`: an image's pixels, a mesh's interpolated patch color, a symbol @@ -2027,10 +2024,12 @@ mod tests { } /// A blend's steps count as work before it is evaluated: the steps of every blend it holds - /// are counted, and with less work left than that the sample gives no color. + /// are counted, and with less work left than that the sample gives no color and the blend is + /// not evaluated. #[test] fn blend_steps_count_before_the_blend_is_evaluated() { use vectorcraft_doc::Document; + use vectorcraft_doc::blend::blend_steps_made; use vectorcraft_doc::live::{BlendSpacing, BlendSpec}; use vectorcraft_geom::Rect; let blend = |d: &mut Document, steps: u32| { @@ -2042,11 +2041,11 @@ mod tests { let mut scratch = Document::new(500.0, 500.0); let (big, small) = (blend(&mut scratch, 1000), blend(&mut scratch, 3)); let rect = solid_rect(&mut scratch, Rect::new(0.0, 0.0, 10.0, 10.0), Color::rgb(0.0, 1.0, 0.0)); - assert_eq!(blend_steps_in(&big), 1000); - assert_eq!(blend_steps_in(&rect), 0); + assert_eq!(blend_steps_made(&big), 1000); + assert_eq!(blend_steps_made(&rect), 0); let group = Node::new(scratch.alloc_id(), NodeKind::Group { children: vec![std::sync::Arc::new(big), std::sync::Arc::new(small)], clip: false }); - assert_eq!(blend_steps_in(&group), 1003, "every blend in the group"); + assert_eq!(blend_steps_made(&group), 1003, "every blend in the group"); let d = doc_with_live_over_green(|d| blend(d, 1000)); let (sel, p) = (Selection::default(), paint()); @@ -2054,11 +2053,54 @@ mod tests { let opts = sample_options(&cx); let mut levels: Vec> = (0..MAX_NESTING).map(|_| None).collect(); let at = Point::new(360.0, 310.0); + let evaluated = || EXPANSIONS.with(std::cell::Cell::get); + let before = evaluated(); let mut s = Sampler { doc: &d, opts, raster_sample: cx.raster_sample, symbol_nodes: 0, work: 900, exhausted: false, patterns: 0 }; assert_eq!(color_under(&mut s, &d, &mut levels, at, opts).map(|(c, _)| c.to_hex()), None); assert!(s.exhausted, "less work left than the blend's 1,000 steps"); + assert_eq!(evaluated(), before, "the blend is not evaluated"); let mut s = Sampler { doc: &d, opts, raster_sample: cx.raster_sample, symbol_nodes: 0, work: MAX_WORK, exhausted: false, patterns: 0 }; assert!(color_under(&mut s, &d, &mut levels, at, opts).is_some(), "a step is drawn at the point"); + assert!(evaluated() > before, "with enough work the blend is evaluated"); + } + + /// Each step of a blend whose keys are blends is a copy of one of them, so the steps it makes + /// in all count before it is evaluated: an outer blend of 20 steps between two blends of 100 + /// steps makes more than 2,000, though its blends have 220 steps between their own keys. + #[test] + fn steps_that_copy_a_nested_blend_count_before_it_is_evaluated() { + use vectorcraft_doc::Document; + use vectorcraft_doc::live::{BlendSpacing, BlendSpec}; + use vectorcraft_geom::Rect; + let blend = |d: &mut Document, keys: Vec, steps: u32| { + let spec = BlendSpec { spacing: BlendSpacing::Steps(steps), ..Default::default() }; + Node::new(d.alloc_id(), NodeKind::Blend { children: keys.into_iter().map(std::sync::Arc::new).collect(), spec: Box::new(spec) }) + }; + let inner = |d: &mut Document, y: f64| { + let red = solid_rect(d, Rect::new(300.0, y, 320.0, y + 10.0), Color::rgb(1.0, 0.0, 0.0)); + let blue = solid_rect(d, Rect::new(400.0, y, 420.0, y + 10.0), Color::rgb(0.0, 0.0, 1.0)); + blend(d, vec![red, blue], 100) + }; + let d = doc_with_live_over_green(|d| { + let (a, b) = (inner(d, 300.0), inner(d, 330.0)); + blend(d, vec![a, b], 20) + }); + let outer = d.layers[0].children().unwrap().last().unwrap(); + assert!(vectorcraft_doc::blend::blend_steps_made(outer) > 2_000, "the copies' steps count"); + let (sel, p) = (Selection::default(), paint()); + let cx = cx(&d, &sel, &p); + let opts = sample_options(&cx); + let mut levels: Vec> = (0..MAX_NESTING).map(|_| None).collect(); + let at = Point::new(310.0, 305.0); + let evaluated = || EXPANSIONS.with(std::cell::Cell::get); + let before = evaluated(); + let mut s = Sampler { doc: &d, opts, raster_sample: cx.raster_sample, symbol_nodes: 0, work: 1_000, exhausted: false, patterns: 0 }; + assert_eq!(color_under(&mut s, &d, &mut levels, at, opts).map(|(c, _)| c.to_hex()), None); + assert!(s.exhausted, "less work left than the steps the outer blend makes"); + assert_eq!(evaluated(), before, "the outer blend is not evaluated"); + let mut s = Sampler { doc: &d, opts, raster_sample: cx.raster_sample, symbol_nodes: 0, work: MAX_WORK, exhausted: false, patterns: 0 }; + assert!(color_under(&mut s, &d, &mut levels, at, opts).is_some(), "a key is drawn at the point"); + assert!(evaluated() > before, "with enough work the outer blend is evaluated"); } /// For a Shift-click on an envelope, the hover names the envelope where its distorted contents From cc3a8775adb6a60831275c07a3821c15291e91cb Mon Sep 17 00:00:00 2001 From: Zaxaerith Date: Sat, 21 Nov 2026 18:46:43 +0800 Subject: [PATCH 09/32] docs(cli): correct artboard color export help (#8850) --- crates/engine/src/cmd/layer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/layer.rs b/crates/engine/src/cmd/layer.rs index 73c92877e9..5ccc441ddd 100644 --- a/crates/engine/src/cmd/layer.rs +++ b/crates/engine/src/cmd/layer.rs @@ -156,7 +156,7 @@ pub fn specs() -> Vec { "Artboard Options…", ["Window", "Artboards"], None, - "{index | artboards: [{index, name?, color?, guideLabel?, locked?, showCenterMark?, showCrossHairs?, showVideoSafeAreas?, videoRulerPixelAspectRatio?, x?, y?, width?, height?}…] (several artboards in one undo step, each with its own fields; the art inside each before any of them changes goes with it, and an object inside several goes with the first listed that moves or scales its art), name?, color?: color (\"#rrggbb\", {c,m,y,k}, … as the paint commands take, #rrggbbaa and #rgba refused: the background color the canvas draws the artboard's paper in, multiplied with the Simulate Colored Paper color while that is on; exports and print leave it out) | null (no background color), guideLabel?: name | \"#rrggbb\" | null (the guide label: the canvas draws the artboard's own guides (guide.add with artboard) in this color instead of the guide color preference, selected ones still in the selection color; a layer color's name spelled exactly as Layer Options lists it (\"Light Blue\", \"Red\", …) or #rrggbb; null for none, which new artboards and older files have; screen-only, so exports and print leave it out; it can change on a locked artboard; an invalid value anywhere in the list changes nothing), locked?: bool (the Artboards panel's lock column: a locked artboard keeps its rectangle (a new x, y, width or height is an error unless locked is false), can't be moved, deleted or cut, and Rearrange and Fit to Artwork Bounds leave it as it is; the art on it (each object of a layer or sublayer whose bounds with strokes overlap it, a group as one object) acts as locked art until it is unlocked: clicks, marquees, select.set, select.all and the tools pass over it (art drawn or pasted onto it stays selected and editable until a selection leaves it out or it is moved off the locked artboards), it is deselected, and when another artboard moves or scales it stays unless lockedAndHidden), showCenterMark?: bool (Artboard Options' Show Center Mark: the canvas draws a mark at the artboard's center), showCrossHairs?: bool (Show Cross Hairs: the canvas draws a line from the middle of each side through the center), showVideoSafeAreas?: bool (Show Video Safe Areas: the canvas draws the action-safe area 3.5% and the title-safe area 5% in from each edge, as EBU R 95 sets them; the three are screen-only, as the artboard's edges are: exports and print leave them out), videoRulerPixelAspectRatio?: number 0.1–10 (Video Ruler Pixel Aspect Ratio: the width of one video pixel over its height, which View › Rulers › Show Video Rulers counts the artboard in; default 1, square pixels), x?, y?, width?, height?, moveArt?: bool (default false; a position-only change moves the contained art with its artboard), scaleArt?: bool (Scale Artwork with Artboard: resized, the artboard takes the art fully inside it (locked and hidden art only with lockedAndHidden?: bool, default prefs moveLockedWithArtboard) and its guides from its old rectangle onto the new one, each side by its own ratio; strokes/corners/patterns as object.scale), strokes?: bool, corners?: bool, patterns?: bool (the three as object.scale, for art that moves or scales with the artboard), lockedAndHidden?: bool (locked and hidden art moves along; default: the preference; recorded in the journal so a replay matches)} → null, or with scaleArt {scaled: the art scaled}; no undo step when nothing changes", + "{index | artboards: [{index, name?, color?, guideLabel?, locked?, showCenterMark?, showCrossHairs?, showVideoSafeAreas?, videoRulerPixelAspectRatio?, x?, y?, width?, height?}…] (several artboards in one undo step, each with its own fields; the art inside each before any of them changes goes with it, and an object inside several goes with the first listed that moves or scales its art), name?, color?: color (\"#rrggbb\", {c,m,y,k}, … as the paint commands take, #rrggbbaa and #rgba refused: the background color the canvas draws the artboard's paper in, multiplied with the Simulate Colored Paper color while that is on. Supported artboard exports and printing include it by default. Set `includeArtboardFill: false` on the export or print command to omit it. Selection exports, exports of non-artboard regions, and unsupported formats omit the background) | null (no background color), guideLabel?: name | \"#rrggbb\" | null (the guide label: the canvas draws the artboard's own guides (guide.add with artboard) in this color instead of the guide color preference, selected ones still in the selection color; a layer color's name spelled exactly as Layer Options lists it (\"Light Blue\", \"Red\", …) or #rrggbb; null for none, which new artboards and older files have; screen-only, so exports and print leave it out; it can change on a locked artboard; an invalid value anywhere in the list changes nothing), locked?: bool (the Artboards panel's lock column: a locked artboard keeps its rectangle (a new x, y, width or height is an error unless locked is false), can't be moved, deleted or cut, and Rearrange and Fit to Artwork Bounds leave it as it is; the art on it (each object of a layer or sublayer whose bounds with strokes overlap it, a group as one object) acts as locked art until it is unlocked: clicks, marquees, select.set, select.all and the tools pass over it (art drawn or pasted onto it stays selected and editable until a selection leaves it out or it is moved off the locked artboards), it is deselected, and when another artboard moves or scales it stays unless lockedAndHidden), showCenterMark?: bool (Artboard Options' Show Center Mark: the canvas draws a mark at the artboard's center), showCrossHairs?: bool (Show Cross Hairs: the canvas draws a line from the middle of each side through the center), showVideoSafeAreas?: bool (Show Video Safe Areas: the canvas draws the action-safe area 3.5% and the title-safe area 5% in from each edge, as EBU R 95 sets them; the three are screen-only, as the artboard's edges are: exports and print leave them out), videoRulerPixelAspectRatio?: number 0.1–10 (Video Ruler Pixel Aspect Ratio: the width of one video pixel over its height, which View › Rulers › Show Video Rulers counts the artboard in; default 1, square pixels), x?, y?, width?, height?, moveArt?: bool (default false; a position-only change moves the contained art with its artboard), scaleArt?: bool (Scale Artwork with Artboard: resized, the artboard takes the art fully inside it (locked and hidden art only with lockedAndHidden?: bool, default prefs moveLockedWithArtboard) and its guides from its old rectangle onto the new one, each side by its own ratio; strokes/corners/patterns as object.scale), strokes?: bool, corners?: bool, patterns?: bool (the three as object.scale, for art that moves or scales with the artboard), lockedAndHidden?: bool (locked and hidden art moves along; default: the preference; recorded in the journal so a replay matches)} → null, or with scaleArt {scaled: the art scaled}; no undo step when nothing changes", has_doc, artboard_set ), From 48e38cdd624ac7175eed197f65fd29050810d18c Mon Sep 17 00:00:00 2001 From: HassanKhan Date: Sun, 22 Nov 2026 12:40:37 +0500 Subject: [PATCH 10/32] docs: ROADMAP Upcoming names G11's remaining bugs (#8314) Shape Builder regions (#937) and Asset Export borders (#983, #1037) are fixed; the item now names what docs/roadmap.md keeps (#864's unit preference, #885) with its 6-13 h estimate. --- ROADMAP.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 90a6100167..83c2ab14c2 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~13 points (ready for real work ~62% → ~75%, and reliable `.ai` exchange) and ~170–270 h away -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-15 · **Change:** minor (G5: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); G5 estimate unchanged (3–13 h); previously: Tech Circuit brush library, G5; previously: docs tidy-up, no content change: stray notes at the top moved into the revision table; scores and estimates unchanged; previously minor: Raster effects 85% → 88%, gallery thumbnails and in-dialog preview in; headline numbers unchanged; Symbols area ~87% → ~88%: dynamic instance parts take opacity, blend, gradient and pattern on the canvas; G5 docs sync for Overlap and Pattern auto corners; previously minor: Tools stays beside the canvas with left-side panels; Hindi catalog draft complete under the translation tests; contributor loanword terminology reviewed; wider proofreading welcome; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; new gradients follow document color mode; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-22 · **Change:** minor (Upcoming: G11 names what is left (#864's unit preference, #885), not the fixed Shape Builder regions and Asset Export borders, with docs/roadmap.md's 6–13 h, #8314; previously: G5: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); G5 estimate unchanged (3–13 h); previously: Tech Circuit brush library, G5; previously: docs tidy-up, no content change: stray notes at the top moved into the revision table; scores and estimates unchanged; previously minor: Raster effects 85% → 88%, gallery thumbnails and in-dialog preview in; headline numbers unchanged; Symbols area ~87% → ~88%: dynamic instance parts take opacity, blend, gradient and pattern on the canvas; G5 docs sync for Overlap and Pattern auto corners; previously minor: Tools stays beside the canvas with left-side panels; Hindi catalog draft complete under the translation tests; contributor loanword terminology reviewed; wider proofreading welcome; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; new gradients follow document color mode; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) VectorCraft is a clean-room, open-source, pure-Rust reimplementation of the Adobe Illustrator workflow. It runs on macOS, Windows, Linux, FreeBSD and the web (WASM), and agents can drive all of it over MCP, the CLI and a JSON @@ -119,7 +119,7 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap 1. **Interaction-fidelity pass** (G1), tool by tool from [ui-parity.md](docs/ui-parity.md): 60–90 h. 2. **`.ai` files from real users** (G9): layer structure, guides, speed: 10–20 h. 3. **Launch and stability on real machines** (G10): 20–35 h. -4. **Core-tool correctness** (G11: Shape Builder regions, Asset Export borders): 8–15 h. +4. **Core-tool correctness** (G11: the unit preference reverting to points, #864, SVG export units fixed; a Transform effect in a fill's or stroke's own effects, #885; Shape Builder regions and Asset Export borders are fixed): 6–13 h. 5. **Then:** type core and advanced type (G4), the Illustrator 2026 additions (G13), 3D (G3). The Effect Gallery's filter thumbnails and in-dialog preview are in (G2). ## Progress log @@ -249,6 +249,7 @@ The full earlier record of what landed is kept in [docs/roadmap.md](docs/roadmap | Date | Change | Summary | |---|---|---| +| 2026-11-22 | minor | Upcoming: the G11 item names what is left, the unit preference reverting to points (#864; SVG export units are fixed) and a Transform effect in a fill's or stroke's own effects (#885), instead of Shape Builder regions and Asset Export borders, which are fixed (#937, #983 / #1037); its estimate follows docs/roadmap.md and docs/gaps.md, 8–15 → 6–13 h, #8314. Headline numbers unchanged. | | 2026-11-15 | minor | Graphic Styles: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); G5 estimate unchanged (3–13 h). | | 2026-11-14 | minor | Tech Circuit adds three original procedural brushes (Circuit Trace, Bus Lines, Terminal Nodes); ten built-in brush libraries. G5 remaining estimate 3–13 h (estimated); parity scores and headline totals unchanged. | | 2026-11-14 | minor | Gujarati (#6613): contributor proofreading completed for all 387 additions, with 11 wording corrections; 4,673 reviewed catalog rows. Status/error messages remain partial; web selection requires a bundled Gujarati face. Scores and estimates unchanged. | From 194cd7972b50696c2228040c30290f2606703588 Mon Sep 17 00:00:00 2001 From: HassanKhan Date: Sun, 22 Nov 2026 12:47:12 +0500 Subject: [PATCH 11/32] docs: Essentials row names Shape Builder's remaining depth (#8314) --- ROADMAP.md | 6 +++--- docs/target-app-parity.md | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 83c2ab14c2..ccb24094d0 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~13 points (ready for real work ~62% → ~75%, and reliable `.ai` exchange) and ~170–270 h away -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-22 · **Change:** minor (Upcoming: G11 names what is left (#864's unit preference, #885), not the fixed Shape Builder regions and Asset Export borders, with docs/roadmap.md's 6–13 h, #8314; previously: G5: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); G5 estimate unchanged (3–13 h); previously: Tech Circuit brush library, G5; previously: docs tidy-up, no content change: stray notes at the top moved into the revision table; scores and estimates unchanged; previously minor: Raster effects 85% → 88%, gallery thumbnails and in-dialog preview in; headline numbers unchanged; Symbols area ~87% → ~88%: dynamic instance parts take opacity, blend, gradient and pattern on the canvas; G5 docs sync for Overlap and Pattern auto corners; previously minor: Tools stays beside the canvas with left-side panels; Hindi catalog draft complete under the translation tests; contributor loanword terminology reviewed; wider proofreading welcome; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; new gradients follow document color mode; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-22 · **Change:** minor (Upcoming: G11 names what is left (#864's unit preference, #885), not the fixed Shape Builder regions and Asset Export borders, with docs/roadmap.md's 6–13 h, and the Essentials row names Shape Builder's remaining depth, #8314; previously: G5: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); G5 estimate unchanged (3–13 h); previously: Tech Circuit brush library, G5; previously: docs tidy-up, no content change: stray notes at the top moved into the revision table; scores and estimates unchanged; previously minor: Raster effects 85% → 88%, gallery thumbnails and in-dialog preview in; headline numbers unchanged; Symbols area ~87% → ~88%: dynamic instance parts take opacity, blend, gradient and pattern on the canvas; G5 docs sync for Overlap and Pattern auto corners; previously minor: Tools stays beside the canvas with left-side panels; Hindi catalog draft complete under the translation tests; contributor loanword terminology reviewed; wider proofreading welcome; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; new gradients follow document color mode; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) VectorCraft is a clean-room, open-source, pure-Rust reimplementation of the Adobe Illustrator workflow. It runs on macOS, Windows, Linux, FreeBSD and the web (WASM), and agents can drive all of it over MCP, the CLI and a JSON @@ -35,7 +35,7 @@ blocking it ([Alpha gate](docs/roadmap.md#alpha-gate)). |---|---:|---:|---:|---| | **Full Illustrator** (ready for real work; decides the stage) | **~62%** (57–67%) | **~340–560 h** | ~95–160 h | the mainstream work below, plus 3D (50–85 h), raster effects (23–39 h), advanced type (20–28 h), generative AI (30–60 h), localization (50–85 h) and ecosystem | | **Mainstream illustrator** | **~65%** (60–70%) | **~230–380 h** | ~65–110 h | the interaction-fidelity pass (60–90 h), hardening and QA (30–50 h), stability (20–35 h), performance budgets (15–25 h), `.ai` exchange (10–20 h), the remaining depth of the everyday areas | -| **Essentials user** | **~75%** (70–80%) | **~60–105 h** | ~25–45 h | launch and stability on Windows (20–35 h), in-app help and onboarding (8–15 h), basic QA (10–15 h), Shape Builder regions (4–8 h), UI polish | +| **Essentials user** | **~75%** (70–80%) | **~60–105 h** | ~25–45 h | launch and stability on Windows (20–35 h), in-app help and onboarding (8–15 h), basic QA (10–15 h), Shape Builder depth (4–8 h; #937's reproduced case is fixed, unconfirmed on the reporter's file), UI polish | Hours are Opus 5.5 agent wall-clock hours, calibrated from this repo's merged-PR timestamps (e.g. 0.7–1.2 h per Photoshop-style filter, ~0.8 h per medium feature); see [calibration](docs/target-app-parity.md#calibration). @@ -249,7 +249,7 @@ The full earlier record of what landed is kept in [docs/roadmap.md](docs/roadmap | Date | Change | Summary | |---|---|---| -| 2026-11-22 | minor | Upcoming: the G11 item names what is left, the unit preference reverting to points (#864; SVG export units are fixed) and a Transform effect in a fill's or stroke's own effects (#885), instead of Shape Builder regions and Asset Export borders, which are fixed (#937, #983 / #1037); its estimate follows docs/roadmap.md and docs/gaps.md, 8–15 → 6–13 h, #8314. Headline numbers unchanged. | +| 2026-11-22 | minor | Upcoming: the G11 item names what is left, the unit preference reverting to points (#864; SVG export units are fixed) and a Transform effect in a fill's or stroke's own effects (#885), instead of Shape Builder regions and Asset Export borders, which are fixed (#937, #983 / #1037); its estimate follows docs/roadmap.md and docs/gaps.md, 8–15 → 6–13 h, #8314. The Essentials readiness row's Shape Builder item names what its 4–8 h still covers (confirming #937's fix on the reporter's file). Headline numbers unchanged. | | 2026-11-15 | minor | Graphic Styles: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); G5 estimate unchanged (3–13 h). | | 2026-11-14 | minor | Tech Circuit adds three original procedural brushes (Circuit Trace, Bus Lines, Terminal Nodes); ten built-in brush libraries. G5 remaining estimate 3–13 h (estimated); parity scores and headline totals unchanged. | | 2026-11-14 | minor | Gujarati (#6613): contributor proofreading completed for all 387 additions, with 11 wording corrections; 4,673 reviewed catalog rows. Status/error messages remain partial; web selection requires a bundled Gujarati face. Scores and estimates unchanged. | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 3da663c191..a746618801 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1,6 +1,6 @@ # Parity with Adobe Illustrator -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (G12: Asset Export tile context menus; scores and estimates unchanged; previously: M14/G12: Appearance panel: right-click item context menus for rows (Duplicate, Delete, Hide/Show, Edit Effect, Clear Appearance, Reduce to Basic Appearance) with selection handling, #8809; previously: Text styles panel: right-click item context menus for Character Styles and Paragraph Styles with Options, Duplicate, Delete, Redefine, Clear Overrides; scores and estimates unchanged; previously: G12: Actions panel item context menus for action sets (New Action…, New Set…, Duplicate Set, Delete Set, Set Options…) and actions (Play, Record, Duplicate, Delete, Action Options…, Batch…) with selection handling; clicking Duplicate on an action duplicates that action; headless tests in `crates/ui-egui/src/panels/actions.rs`; scores and estimates unchanged; previously: Layers: a targeted item with an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the target circle's four looks differ, #8711; scores and estimates unchanged; previously: Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: G12: Brushes panel: item right-click context menu (Brush Options, Duplicate Brush, Delete Brush) with selection handling; scores and estimates unchanged; previously: Graphic Styles panel: right-click item context menu for tiles and rows with Options, Duplicate, Delete, Redefine, Break Link; scores and estimates unchanged; previously: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame, and edits that go on once the view is still don't put off its render (#8688); scores and estimates unchanged; previously: G12: Links panel row context menu (Relink…, Go To Link, Update Link, Edit Original, Show in Folder, Embed Image / Unembed…) with selection handling; scores and estimates unchanged; previously: Artboard tool: Shift held once a move or Alt-copy drag is under way keeps it to the level, upright or 45° line, #8580; scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: #8200: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, its tints linked to the swatch; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: SVG export preserves document units on root width/height for physical units, #864; G11 estimate 8–15 → 6–13 h; previously: Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: #8128: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, so the compound clipping path clips its clipping group; scores and estimates unchanged; previously: import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: PDF export writes the document language as the catalog's `/Lang`, #3644; Layers panel: an Alt-drag copies a row above or below itself, so the top layer dragged up, the bottom layer dragged down and a lone layer are copied, #8237; scores and estimates unchanged; previously: Twist: a strongly twisted path joins its pieces without kinks, #7069; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: Eraser review: hidden Rasterize and Along/Across stroke rows do not block preserving visible gradients; scores and estimates unchanged; previously: Eraser review: ordinary Group/Layer paints and reproducible evaluated gradient placements are preserved; other placements retain existing fitting; scores and estimates unchanged; previously: Eraser: shared fill-only area cutting for fixed and varied tips and the Alt-drag marquee, #6582; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side columns; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-22 · **Change:** minor (Essentials readiness row: Shape Builder item names its remaining depth, #937's fix unconfirmed on the reporter's file, #8314; scores and estimates unchanged; previously: G12: Asset Export tile context menus; scores and estimates unchanged; previously: M14/G12: Appearance panel: right-click item context menus for rows (Duplicate, Delete, Hide/Show, Edit Effect, Clear Appearance, Reduce to Basic Appearance) with selection handling, #8809; previously: Text styles panel: right-click item context menus for Character Styles and Paragraph Styles with Options, Duplicate, Delete, Redefine, Clear Overrides; scores and estimates unchanged; previously: G12: Actions panel item context menus for action sets (New Action…, New Set…, Duplicate Set, Delete Set, Set Options…) and actions (Play, Record, Duplicate, Delete, Action Options…, Batch…) with selection handling; clicking Duplicate on an action duplicates that action; headless tests in `crates/ui-egui/src/panels/actions.rs`; scores and estimates unchanged; previously: Layers: a targeted item with an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the target circle's four looks differ, #8711; scores and estimates unchanged; previously: Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: G12: Brushes panel: item right-click context menu (Brush Options, Duplicate Brush, Delete Brush) with selection handling; scores and estimates unchanged; previously: Graphic Styles panel: right-click item context menu for tiles and rows with Options, Duplicate, Delete, Redefine, Break Link; scores and estimates unchanged; previously: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame, and edits that go on once the view is still don't put off its render (#8688); scores and estimates unchanged; previously: G12: Links panel row context menu (Relink…, Go To Link, Update Link, Edit Original, Show in Folder, Embed Image / Unembed…) with selection handling; scores and estimates unchanged; previously: Artboard tool: Shift held once a move or Alt-copy drag is under way keeps it to the level, upright or 45° line, #8580; scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: #8200: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, its tints linked to the swatch; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: SVG export preserves document units on root width/height for physical units, #864; G11 estimate 8–15 → 6–13 h; previously: Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: #8128: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, so the compound clipping path clips its clipping group; scores and estimates unchanged; previously: import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: PDF export writes the document language as the catalog's `/Lang`, #3644; Layers panel: an Alt-drag copies a row above or below itself, so the top layer dragged up, the bottom layer dragged down and a lone layer are copied, #8237; scores and estimates unchanged; previously: Twist: a strongly twisted path joins its pieces without kinks, #7069; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; Layers panel: Alt over the list shows the copy cursor while rows or the selection square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Properties panel: the Character section shows the font of the Type tool's selection, not the first run's (#8189); scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: Eraser review: hidden Rasterize and Along/Across stroke rows do not block preserving visible gradients; scores and estimates unchanged; previously: Eraser review: ordinary Group/Layer paints and reproducible evaluated gradient placements are preserved; other placements retain existing fitting; scores and estimates unchanged; previously: Eraser: shared fill-only area cutting for fixed and varied tips and the Alt-drag marquee, #6582; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Paragraph composers (#4935): the Paragraph panel menu and paragraph styles offer four composers, the Middle Eastern & South Asian Single-line and Every-line (how all type is set, and the default) and a Standard Single-line and Every-line that set Indic, Arabic and Hebrew type glyph by glyph as the font maps it, for legacy fonts that keep a script on Latin character codes; PDF import: stroked type keeps the line cap, line join and miter limit the file strokes it with, a glyph stroked otherwise than the run it joins coming in as a run of its own, #7741; G5: Neon & Glow joins built-in graphic style libraries (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); scores and estimates unchanged; previously: Pencil ignores Smart Guides and Snap to Point and shows no Smart Guides, #7252; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: G5: Weather Icons joins built-in symbol libraries (Sun, Moon, Cloud, Rain, Thunder, Snow); scores and estimates unchanged; previously: a closed Pencil stroke closes with a straight segment; previously: Snap to Point with Smart Guides off draws no Smart Guides labels or lines, #7250; previously: 3D: the seams of Extrude & Bevel, Inflate and Rotate under a white light, and of the faces of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic), went from miter to round joins, so white-light 3D output is expected to differ from the 2026-10-17 comparison at facet corners (not measured: the scenes were not exported again); previously: `.ai` and EPS import: in layers that don't draw as the page, art that differs away from an envelope of type no longer costs it its editable type; it keeps its drawn art where, in the pixels it and its drawn art ink, the layers with it differ from the page more than its own check allows, or past the envelopes' share of the page check, #7141; Character panel: the Set Font Height Reference dropdown shows an icon before each reference, #6304; scores and estimates unchanged; previously: Envelopes: a top object's side columns; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; scores and estimates unchanged; previously: PDF import: glyphs in a span with an empty ActualText come in as outlines, #6971; scores and estimates unchanged; previously: library panels' lists fill a taller panel, #2992; scores and estimates unchanged; previously: Swatches list fills a taller panel, #1638; scores and estimates unchanged; previously minor: Object › Rasterize with the Grayscale or Bitmap colour model makes a grayscale image, #6969; scores and estimates unchanged; previously minor: `.ai` and EPS import: type in an envelope with Distort Appearance is also tried mapped from the box of what it paints, miter tips and moved strokes included, after its glyphs grown by half its strokes' weight (#6824; #6617: Swatches panel menu: Show Recent Colors; scores unchanged; previously minor: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping the moved top in workspaces (storytold/craft-libs#1094); scores and estimates unchanged; previously: #6865: explicitly requested oversized editing artboard; macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Type tool: kerning at a caret at the start of a line moves the character after it, #5111; scores and estimates unchanged; previously minor: Rulers: the zero point dragged out of the rulers' corner snaps as a drawn point does; previously minor: Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: Envelopes: with Distort Appearance, type's strokes paint along the bent glyph outlines at their own weight, as users' `.ai` files draw them, which changes how VectorCraft's own envelopes of stroked type draw (#6644; scores and estimates unchanged); previously minor: G5: Energy Beams brush library; bundled content ~44% → ~46%; previously minor: G5: Skill Icons symbol library; bundled content ~42% → ~44%; previously minor: `.ai` and EPS import: an envelope saved in Edit Contents whose mesh lies away from its drawn art by a move opens live on that art (#6570; scores and estimates unchanged); previously minor: ruler double-click adds a guide at the pointer, #5239; G5: Status Effects graphic style library; bundled content ~40% → ~42%; MCP symbol libraries list UI Frames and Map Markers; previously minor: G5: Inventory Icons built-in symbol library; bundled content ~38% → ~40%; previously minor: `.ai` and EPS import: stroked type in an envelope maps from its glyphs grown by half its stroke (#3179; scores and estimates unchanged); previously minor: `.ai` and EPS import: warps of type open as mesh envelopes on their saved grid where VectorCraft's warp doesn't draw as their drawn art (#3179; scores and estimates unchanged); G5: Game Trails brush library; bundled content ~36% → ~38%; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: `.ai` and EPS import: envelopes of type open live where they draw as their drawn art and the layers with them draw as the page (#3179; scores and estimates unchanged); G5: Game HUD graphic style library; bundled content ~34% → ~36%; previously minor: Line Arrow arrowhead (#5421; scores and estimates unchanged); G5: Map Markers built-in symbol library; bundled content ~32% → ~34%; previously minor: right-click on type: Spelling › Auto Spell Check, with its check mark, #4936; previously minor: right-click on a word Auto Spell Check underlined: its suggestions, Ignore All and Add to Dictionary, #4936; previously minor: Canvas: a 3D effect changed on type or a group redraws where its solid was; Fit to Artwork Bounds and per-artboard SVG export build each solid once for all artboards; previously minor: Effect Gallery: a thumbnail for each filter and a preview area inside the dialog, on an original drawing; Raster effects 52% → 55%, hours 1–2 → none; headline numbers unchanged; Auto Spell Check: `edit.autoSpellCheck` underlines the unknown words, #4936; previously minor: PDF editable import preserves authored ActualText once, including empty/nested spans and authored ordering (#6165); cross-line/style layout remains approximate; scores and estimates unchanged; PDF marked-text export (#6309): compatible glyphs stay on one layout line with per-glyph offsets; scores and estimates unchanged; G5: UI Frames built-in symbol library with default 9-slice; bundled content ~32%; previously minor: G5: dynamic symbol part on-canvas opacity/blend/gradient/pattern; strokes remaining no longer lists Overlap/auto corners; symbols ~88%; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; previously minor: harakat paint fallback clarified; previously minor: current Guides feature-area rows consolidated using existing ruler evidence; scores and estimates unchanged; previously minor: Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; previously minor: G5 docs: Art brush Overlap and Pattern brush auto corners removed from strokes remaining; symbols remaining lists dynamic on-canvas beyond solid and guides outside the art; previously minor: custom dictionary and Ignore All: `text.spelling.addWord`, `removeWord`, `changeWord`, `dictionary` and `ignoreAll`, #4936; previously minor: EPS import: embedded fonts (composite, Type 42, CID-keyed, Type 1, CFF FontSet) draw their glyphs; spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, #4936; previously minor: floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; `.ai` and EPS import: older Art brush objects read; numeric fields step on wheel hover without taking keyboard focus, and a panel wheel turn cannot seed a canvas zoom glide, #5949; Character Styles panel: a double-click on a style's row opens its Character Style Options; the dialog keeps a fixed width and scrolls its sections, so its buttons stay on screen; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; #3380 deletion-only review follow-up: independent survivors keep gradient placement, owned subpaths avoid discarded copies, and contracts/status/evidence are clarified; endpoint highlighting remains open; scores and estimates unchanged; the canvas keeps selection outlines and anchors between frames; Indian-language hyphenation review and license allowlist, #4947; Stroke gradients: an arrowhead aligned to the tip is painted to the corners of its base, #5964; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Hindi catalog and contributor loanword preferences; full wording review in progress; Properties in Edit Artboards: a Transform section with the reference point above the Artboards section, #5219; the Control bar's Stroke: and Opacity: links scrub their fields, #4088; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window, #4155; Control bar Paragraph section with type selected, #5372; translating unchanged type reuses its glyph and character-stroke outlines; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026; Units › East Asian Type acts, with Q and Ha units; scores unchanged) > > Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5). > @@ -77,6 +77,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard | Date | Change | Summary | |---|---|---| +| 2026-11-22 | minor | Essentials readiness row: the Shape Builder item names what its 4–8 h still covers, confirming #937's fix on the reporter's file (the reproduced case is fixed), #8314. Scores and estimates unchanged. | | 2026-11-20 | minor | G12: Asset Export tiles have item context menus for Export, Remove, Rename, Select Artwork on Canvas and collecting selected artwork; right-click selects an unselected tile and preserves an existing multi-selection. Headless regressions: panels::tests_asset_export. Scores and estimates unchanged. | | 2026-11-20 | minor | G12: Actions panel item context menus for action sets (New Action…, New Set…, Duplicate Set, Delete Set, Set Options…) and actions (Play, Record, Duplicate, Delete, Action Options…, Batch…) with selection handling; clicking Duplicate on an action duplicates that action; headless tests in `crates/ui-egui/src/panels/actions.rs`; scores and estimates unchanged. | | 2026-11-20 | minor | G12: Appearance panel row context menus (Duplicate Stroke/Fill, Delete Stroke/Fill, Hide/Show Stroke/Fill, Edit Effect…, Duplicate Effect, Delete Effect, Hide/Show Effect, Clear Appearance, Reduce to Basic Appearance); right-clicking an unselected row targets that row first. Headless regressions: `panels::tests_appearance`. Scores and estimates unchanged. | @@ -349,7 +350,7 @@ review parallelize less and need humans. |---|---:|---:|---:|---| | **Full Illustrator** (ready for real work; decides the stage) | **~62%** (57–67%) | **~340–560 h** | ~95–160 h | the mainstream work below, plus 3D (50–85 h), raster effects (24–40 h), advanced type (20–28 h), generative AI (30–60 h), localization (55–90 h) and ecosystem | | **Mainstream illustrator** | **~65%** (60–70%) | **~230–380 h** | ~65–110 h | the interaction-fidelity pass (60–90 h), hardening and QA (30–50 h), stability (20–35 h), performance budgets (15–25 h), `.ai` exchange (10–20 h), the remaining depth of the everyday areas | -| **Essentials user** | **~75%** (70–80%) | **~60–105 h** | ~25–45 h | launch and stability on Windows (20–35 h), in-app help and onboarding (8–15 h), basic QA (10–15 h), Shape Builder regions (4–8 h), UI polish | +| **Essentials user** | **~75%** (70–80%) | **~60–105 h** | ~25–45 h | launch and stability on Windows (20–35 h), in-app help and onboarding (8–15 h), basic QA (10–15 h), Shape Builder depth (4–8 h; #937's reproduced case is fixed, unconfirmed on the reporter's file), UI polish | ### Full Illustrator: additive weighted sum over the dimensions @@ -3176,6 +3177,7 @@ Edit › Copy and Cut put the selected ruler guides on the clipboard, with the s | Date | Change | Summary | |---|---|---| +| 2026-11-22 | minor | Essentials readiness row: the Shape Builder item names what its 4–8 h still covers, confirming #937's fix on the reporter's file (the reproduced case is fixed), #8314. Scores and estimates unchanged. | | 2026-11-20 | minor | G12: Asset Export tiles have item context menus for Export, Remove, Rename, Select Artwork on Canvas and collecting selected artwork; right-click selects an unselected tile and preserves an existing multi-selection. Headless regressions: panels::tests_asset_export. Scores and estimates unchanged. | | 2026-11-19 | minor | Layers: a target circle whose item is targeted and has an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the four looks (not targeted, targeted, with an appearance, both) differ (#8711). Scores and estimates unchanged. | | 2026-11-19 | minor | Guides, grids, smart guides, snapping, rulers: View › Trim View hides the ruler guides, guide paths and the grid while it is on and greys out their Show/Hide items; a ruler drag or double-click makes no guide meanwhile (#8363). Scores and estimates unchanged. | From 6327295d28ab00ca65efde1038e643ced1aa967b Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 22 Nov 2026 11:16:59 -0800 Subject: [PATCH 12/32] EPS: white fills and strokes knock out with Discard White Overprint PDF export lets a fill or stroke marked to overprint do so only when it is not white with Discard White Overprint in Output (Document Setup, on by default). EPS export and composite PostScript printing ignored that setting, so an overprinting white fill or stroke was written with "true op" and the inks below it stayed visible. They now apply the same rule to path fills and strokes, character fills and type object fills. The tiles of an overprinting pattern fill overprint with it, as in PDF export. Before, a tile marked to overprint wrote its own "true op" and "false op", which turned overprinting off for the tiles after it. Separated plates are not checked for white, since their colors are already the plate's coverage. Re-exporting or printing to PostScript a document with an overprinting white fill or stroke gives different output: the white knocks out instead of overprinting, unless Discard White Overprint in Output is off. --- crates/engine/src/cmd/fileio/eps.rs | 2 +- crates/engine/src/cmd/fileio/tests_eps.rs | 18 ++++++ crates/eps/src/scene.rs | 39 +++++++++---- crates/eps/src/tests.rs | 71 +++++++++++++++++++++++ docs/mcp.md | 3 +- docs/target-app-parity.md | 1 + 6 files changed, 122 insertions(+), 12 deletions(-) diff --git a/crates/engine/src/cmd/fileio/eps.rs b/crates/engine/src/cmd/fileio/eps.rs index 5067b1c6d5..436a179c4d 100644 --- a/crates/engine/src/cmd/fileio/eps.rs +++ b/crates/engine/src/cmd/fileio/eps.rs @@ -33,7 +33,7 @@ pub fn specs() -> Vec { "Export EPS", [], None, - "{path?, level?: 2|3 (default; PostScript language level: 3 writes smooth gradients and masks transparent image pixels out, 2 steps gradients and writes those pixels white), previewFormat?: none|tiffBw|tiffColor (default: a TIFF preview other apps show), transparentPreview?: true (else on white), overprints?: preserve (default)|discard, flattenerPreset?: \"medium\" (default; high, low or a saved preset: flattener.presets.list), flattener?: {the options of object.flattenTransparency over the preset}, embedFonts?: true (type is always written as outlines, so no fonts are needed), includeLinkedFiles?: false (the embedded document keeps linked images whole, not just their previews), thumbnails?: true (a PNG thumbnail in the file), cmykPostScript?: true (RGB documents written in CMYK), compatibleGradients?: false (stepped gradients at level 3 too), selectedOnly?: false, useArtboards?: true (one file per chosen artboard, artboards?/range?, {stem}_{artboard}.eps, the bounding box the artboard; with two or more, also the central file {stem}.eps first: the whole document, the bounding box the visible art; none when no art shows) | false (one file, the bounding box the visible art, y up from the first artboard's bottom-left corner, even when artboards are named; the default when none are named), format?: \"eps\", artboard?: i | artboards?: [i…] | range?: \"1-3, 5\" (the artboards written; naming them without useArtboards works as useArtboards: true)} → {path, bytes, warnings, files?}; no path → {dataBase64, …}. Transparency is flattened with the preset (EPS has none); the native document rides along in comments, for reopening the file as it was. Same as document.export {format: eps}. A key EPS doesn't take, and an unknown key inside flattener, are refused", + "{path?, level?: 2|3 (default; PostScript language level: 3 writes smooth gradients and masks transparent image pixels out, 2 steps gradients and writes those pixels white), previewFormat?: none|tiffBw|tiffColor (default: a TIFF preview other apps show), transparentPreview?: true (else on white), overprints?: preserve (default; white fills and strokes knock out with document.setup discardWhiteOverprint)|discard, flattenerPreset?: \"medium\" (default; high, low or a saved preset: flattener.presets.list), flattener?: {the options of object.flattenTransparency over the preset}, embedFonts?: true (type is always written as outlines, so no fonts are needed), includeLinkedFiles?: false (the embedded document keeps linked images whole, not just their previews), thumbnails?: true (a PNG thumbnail in the file), cmykPostScript?: true (RGB documents written in CMYK), compatibleGradients?: false (stepped gradients at level 3 too), selectedOnly?: false, useArtboards?: true (one file per chosen artboard, artboards?/range?, {stem}_{artboard}.eps, the bounding box the artboard; with two or more, also the central file {stem}.eps first: the whole document, the bounding box the visible art; none when no art shows) | false (one file, the bounding box the visible art, y up from the first artboard's bottom-left corner, even when artboards are named; the default when none are named), format?: \"eps\", artboard?: i | artboards?: [i…] | range?: \"1-3, 5\" (the artboards written; naming them without useArtboards works as useArtboards: true)} → {path, bytes, warnings, files?}; no path → {dataBase64, …}. Transparency is flattened with the preset (EPS has none); the native document rides along in comments, for reopening the file as it was. Same as document.export {format: eps}. A key EPS doesn't take, and an unknown key inside flattener, are refused", has_doc, export_eps )] diff --git a/crates/engine/src/cmd/fileio/tests_eps.rs b/crates/engine/src/cmd/fileio/tests_eps.rs index e37fd2be37..83037b5f9e 100644 --- a/crates/engine/src/cmd/fileio/tests_eps.rs +++ b/crates/engine/src/cmd/fileio/tests_eps.rs @@ -212,11 +212,29 @@ fn flattening_cropped_art_keeps_the_art_under_its_hidden_part() { fn overprints_are_kept_or_discarded() { let mut s = session(100.0, 100.0, 1); let id = s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 30, "height": 30})).unwrap()["id"].as_u64().unwrap(); + s.execute("paint.setFill", &json!({"ids": [id], "color": {"c": 100, "m": 0, "y": 0, "k": 0}})).unwrap(); s.execute("attributes.set", &json!({"ids": [id], "overprintFill": true})).unwrap(); let kept = postscript(&b64(&s.execute("document.exportEps", &json!({"previewFormat": "none"})).unwrap())); assert!(kept.contains("true op\n"), "{kept}"); let dropped = postscript(&b64(&s.execute("document.exportEps", &json!({"previewFormat": "none", "overprints": "discard"})).unwrap())); assert!(!dropped.contains("true op")); + + // A white fill or stroke that overprints knocks out with Discard White Overprint (on by + // default), and overprints without it, as in PDF export. + let white = json!({"c": 0, "m": 0, "y": 0, "k": 0}); + let filled = [json!({"ids": [id], "color": white}), json!({"ids": [id], "none": true})]; + let stroked = [json!({"ids": [id], "none": true}), json!({"ids": [id], "color": white})]; + for (i, [fill, stroke]) in [filled, stroked].iter().enumerate() { + s.execute("paint.setFill", fill).unwrap(); + s.execute("paint.setStroke", stroke).unwrap(); + s.execute("attributes.set", &json!({"ids": [id], "overprintFill": i == 0, "overprintStroke": i == 1})).unwrap(); + s.execute("document.setup", &json!({"discardWhiteOverprint": true})).unwrap(); + let knocked_out = postscript(&b64(&s.execute("document.exportEps", &json!({"previewFormat": "none"})).unwrap())); + assert!(!knocked_out.contains("true op"), "{i}: {knocked_out}"); + s.execute("document.setup", &json!({"discardWhiteOverprint": false})).unwrap(); + let overprinted = postscript(&b64(&s.execute("document.exportEps", &json!({"previewFormat": "none"})).unwrap())); + assert!(overprinted.contains("true op\n"), "{i}: {overprinted}"); + } } #[test] diff --git a/crates/eps/src/scene.rs b/crates/eps/src/scene.rs index 35a68371b1..5e5350b6c7 100644 --- a/crates/eps/src/scene.rs +++ b/crates/eps/src/scene.rs @@ -287,6 +287,8 @@ pub(crate) struct Scene<'a> { /// The gradient being painted overprints on a plate: where it is paper white it puts none of /// the plate's ink down, and the plate below it is left as it is ([`Self::inked_spans`]). keep_below: bool, + /// Overprinting is on in the page's graphics state ([`Self::overprint_on`]). + overprinting: bool, } impl<'a> Scene<'a> { @@ -317,6 +319,7 @@ impl<'a> Scene<'a> { nest: 0, plate: false, keep_below: false, + overprinting: false, } } @@ -507,11 +510,22 @@ impl<'a> Scene<'a> { } } - /// Turn overprinting on for one paint (when overprints are preserved); `false` when it stays off. + /// Whether a fill or stroke of `paint` marked to overprint (`overprint`) does: not when it is + /// white with Discard White Overprint in Output (Document Setup), as in PDF export. On a plate + /// the colors are already the plate's coverage, and the plate's document already left out or + /// kept each overprinting paint by that setting, so white is not checked there. + fn overprints(&self, overprint: bool, paint: &Paint) -> bool { + let discarded = !self.plate && self.doc.setup.discard_white_overprint && vectorcraft_doc::overprint::is_white(paint); + overprint && !discarded + } + + /// Turn overprinting on for one paint (when overprints are preserved); `false` when it stays off + /// or is already on (a pattern's tiles inside an overprinting pattern fill). fn overprint_on(&mut self, overprint: bool) -> bool { - let on = overprint && self.o.overprint == Overprint::Preserve; + let on = overprint && self.o.overprint == Overprint::Preserve && !self.overprinting; if on { self.line("true op"); + self.overprinting = true; } on } @@ -519,6 +533,7 @@ impl<'a> Scene<'a> { fn overprint_off(&mut self, on: bool) { if on { self.line("false op"); + self.overprinting = false; } } @@ -673,7 +688,8 @@ impl<'a> Scene<'a> { match item { AppearanceItem::Fill(fl) if fl.visible && !fl.paint.is_none() => { self.note_item(fl.opacity, fl.blend); - self.fill(bp, rule, &fl.paint, bounds, fl.overprint); + let overprint = self.overprints(fl.overprint, &fl.paint); + self.fill(bp, rule, &fl.paint, bounds, overprint); } AppearanceItem::Stroke(st) if st.visible && !st.paint.is_none() && st.width > 0.0 && st.width.is_finite() => { self.stroke(bp, rule, st, bounds); @@ -756,6 +772,7 @@ impl<'a> Scene<'a> { return; } self.note_item(st.opacity, st.blend); + let overprint = self.overprints(st.overprint, &st.paint); let paint_bounds = st.paint_bounds(bounds); let area_paint = match &st.paint { Paint::Pattern { .. } => true, @@ -766,7 +783,7 @@ impl<'a> Scene<'a> { // The area the stroke paints, as Outline Stroke makes it, painted with the pattern's // tiles or the freeform's image. let region = stroke::outline_region(&PathData::from_bezpath(bp), rule, st).to_bezpath(); - self.fill(®ion, FillRule::NonZero, &st.paint, paint_bounds, st.overprint); + self.fill(®ion, FillRule::NonZero, &st.paint, paint_bounds, overprint); return; } let w = stroke::for_writer(bp, st); @@ -791,7 +808,7 @@ impl<'a> Scene<'a> { }; match &w.shape { WrittenShape::Stroke { width } => { - let on = self.overprint_on(st.overprint); + let on = self.overprint_on(overprint); self.line_style(st, *width); match &st.paint { Paint::Solid { color, swatch, tint } => { @@ -805,7 +822,7 @@ impl<'a> Scene<'a> { self.line("q"); push_path(&mut self.body, bp); self.line("strokepath W"); - self.paint_overprinting(st.overprint, p, paint_bounds, w.reach(st, bounds)); + self.paint_overprinting(overprint, p, paint_bounds, w.reach(st, bounds)); self.line("Q"); } } @@ -818,14 +835,14 @@ impl<'a> Scene<'a> { push_path(&mut self.body, &ws.clip); self.body.push_str(clip_op(FillRule::NonZero)); for (shape, paint) in &ws.slices { - self.fill(shape, FillRule::NonZero, paint, shape.bounding_box(), st.overprint); + self.fill(shape, FillRule::NonZero, paint, shape.bounding_box(), overprint); } self.line("Q"); } } WrittenShape::Fill(outlines) => { for o in outlines { - self.fill(o, FillRule::NonZero, &st.paint, paint_bounds, st.overprint); + self.fill(o, FillRule::NonZero, &st.paint, paint_bounds, overprint); } } } @@ -920,7 +937,8 @@ impl<'a> Scene<'a> { if bp.elements().is_empty() { continue; } - self.fill(&bp, FillRule::NonZero, &run.style.fill, layout.bounds, run.style.overprint_fill); + let overprint = self.overprints(run.style.overprint_fill, &run.style.fill); + self.fill(&bp, FillRule::NonZero, &run.style.fill, layout.bounds, overprint); if run.style.has_stroke() { // Character strokes are drawn in text space, with their cap, join and dashes. self.stroke(&bp, FillRule::NonZero, &run.style.stroke_layer(), layout.bounds); @@ -938,7 +956,8 @@ impl<'a> Scene<'a> { match item { AppearanceItem::Fill(fl) if fl.visible && !fl.paint.is_none() => { self.note_item(fl.opacity, fl.blend); - self.fill(bp, FillRule::NonZero, &fl.paint, tb, fl.overprint); + let overprint = self.overprints(fl.overprint, &fl.paint); + self.fill(bp, FillRule::NonZero, &fl.paint, tb, overprint); } AppearanceItem::Stroke(st) if st.visible && !st.paint.is_none() && st.width > 0.0 && st.width.is_finite() => { self.stroke(bp, FillRule::NonZero, st, tb); diff --git a/crates/eps/src/tests.rs b/crates/eps/src/tests.rs index e6161da23d..b550d15e0e 100644 --- a/crates/eps/src/tests.rs +++ b/crates/eps/src/tests.rs @@ -448,6 +448,77 @@ fn spot_colours_are_separations_and_overprints_are_kept_or_dropped() { assert!(!page_of(&d, &EpsOptions { overprint: Overprint::Discard, ..opts(&d) }).contains("true op")); } +/// Whether overprinting is on at each fill a page paints, by its `true op` and `false op` lines. +fn overprint_at_fills(page: &str) -> Vec { + let mut on = false; + let mut fills = vec![]; + for line in page.lines() { + match line { + "true op" => on = true, + "false op" => on = false, + l if l == "f" || l.ends_with(" f") || l.ends_with(" f*") || l == "f*" => fills.push(on), + _ => {} + } + } + fills +} + +#[test] +fn tiles_overprint_with_their_overprinting_pattern() { + // A rectangle filled with an overprinting pattern whose tile is a white square marked to + // overprint and then a cyan one that is not. + let mut d = doc_with(|_| vec![]); + let square = |d: &mut Document, paint: Paint, overprint: bool| { + let mut n = path(d, shapes::rectangle(Rect::new(0.0, 0.0, 10.0, 10.0)), paint, Paint::None, 0.0); + if let Some(AppearanceItem::Fill(f)) = n.appearance.items.first_mut() { + f.overprint = overprint; + } + Arc::new(n) + }; + let tile = vec![square(&mut d, Paint::solid(Color::WHITE), true), square(&mut d, Paint::solid(Color::cmyk(1.0, 0.0, 0.0, 0.0)), false)]; + d.patterns.push(vectorcraft_doc::PatternDef::new("tile", tile)); + let mut n = red_rect(&mut d); + if let Some(AppearanceItem::Fill(f)) = n.appearance.items.first_mut() { + f.paint = Paint::Pattern { pattern: "tile".into(), xf: Affine::IDENTITY }; + f.overprint = true; + } + let layer = d.layers[0].id; + d.insert(Some(layer), 0, n).unwrap(); + // The whole pattern overprints, as in PDF export: the white square's own mark does not turn + // overprinting off for the cyan square after it, and Discard White Overprint applies to the + // pattern fill, not to its tiles. + let fills = overprint_at_fills(&page_of(&d, &opts(&d))); + assert!(!fills.is_empty() && fills.iter().all(|&on| on), "{fills:?}"); + // On a plate too. + let plate = crate::scene::Scene::new(&d, &opts(&d)).on_plate(true).run(); + let fills = overprint_at_fills(&plate.body); + assert!(!fills.is_empty() && fills.iter().all(|&on| on), "{fills:?}"); +} + +/// A white character fill, and a white fill of the type object itself, marked to overprint knock +/// out with Discard White Overprint and overprint without it. +#[test] +fn white_type_fills_knock_out_with_discard_white_overprint() { + use vectorcraft_doc::{CharStyle, FillLayer, TextObject}; + let white = Paint::solid(Color::WHITE); + let char_fill = CharStyle { size: 30.0, fill: white.clone(), overprint_fill: true, ..CharStyle::default() }; + let object_fill = CharStyle { size: 30.0, fill: Paint::None, ..CharStyle::default() }; + for (i, style) in [char_fill, object_fill].into_iter().enumerate() { + let mut d = doc_with(|d| { + let mut n = Node::new(d.alloc_id(), NodeKind::Text(Box::new(TextObject::point(Point::new(20.0, 100.0), "AB", style)))); + if i == 1 { + n.appearance.items = vec![AppearanceItem::Fill(FillLayer { overprint: true, ..FillLayer::new(white.clone()) })]; + } + vec![n] + }); + let fills = overprint_at_fills(&page_of(&d, &opts(&d))); + assert!(!fills.is_empty() && fills.iter().all(|&on| !on), "{i}: {fills:?}"); + d.setup.discard_white_overprint = false; + let fills = overprint_at_fills(&page_of(&d, &opts(&d))); + assert!(!fills.is_empty() && fills.iter().all(|&on| on), "{i}: {fills:?}"); + } +} + const GOLD: Color = Color::Cmyk { c: 0.0, m: 0.2, y: 0.8, k: 0.1 }; const LEAF: Color = Color::Cmyk { c: 1.0, m: 0.0, y: 1.0, k: 0.0 }; diff --git a/docs/mcp.md b/docs/mcp.md index 3c577e0356..3fb7a04ef7 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -10222,7 +10222,8 @@ without `useArtboards` (no central file when no art shows). `level: 3` (default) shadings and masks transparent image pixels out; `level: 2` writes gradients as bands of colour (as does `compatibleGradients`) and transparent pixels white. Type is always glyph outlines, so no fonts are needed (`embedFonts` is accepted); spot colours are Separation colour spaces, and overprinting fills and strokes overprint unless -`overprints: "discard"`. RGB documents are written in CMYK unless `cmykPostScript: false`. A freeform gradient is +`overprints: "discard"`. With `discardWhiteOverprint` (`document.setup`, on by default) white ones knock out instead, as +in PDF export. RGB documents are written in CMYK unless `cmykPostScript: false`. A freeform gradient is written as an image, in CMYK when every point is CMYK or when every point is Gray in a file written in CMYK. When the file would hold an image that can't be decoded, the image is left out, and `warnings` carries "an image couldn't be decoded and is missing from the picture" once for all such images. diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 3da663c191..d4b5f35ece 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -802,6 +802,7 @@ since 2026-10-01. - **EPS Save with Use Artboards:** Save As › EPS Options show Use Artboards with All or Range, for a separate file per artboard ([saving in EPS](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/save-artwork-in-eps-format.html)), unchecked by default (the scripting reference's EPS save options list `saveMultipleArtboards` with a default of false, [scripting reference](https://web.archive.org/web/20160803105056/https://wwwimages.adobe.com/content/dam/Adobe/en/devnet/illustrator/sdk/CC2015_3/Illustrator%20JavaScript%20Scripting%20Reference.pdf)). Unchecked, Save writes one file whose bounding box fits all the visible art, as Export does, without the artboards' background colors; when no art shows, the page is the first artboard in its color. An opened EPS saved back this way loses its page margins. Checked with two or more chosen artboards, the file at the path is the central file of the visible art and each artboard is also written to `_.eps` beside it. Checked with one chosen artboard, VectorCraft writes that artboard as the page of the file at the path alone (the behavior Save had since #4293). Evidence: `cmd::fileio::tests_artboard_fill::eps_save_draws_the_color_on_an_artboard_page`, `tests::save::eps_save_without_use_artboards_fits_the_box_to_art_past_the_artboard`, `tests::save::opened_eps_saves_to_its_own_file_around_its_art_or_on_its_page`, `tests::save::eps_save_with_use_artboards_writes_the_central_file_and_one_per_artboard`, `dialogs::save_options::tests::eps_save_as_shows_use_artboards_off_and_writes_the_art_or_the_artboard`. - **EPS Options custom flattener settings:** the help page describes flattening an EPS's transparency with a preset or with custom options, adjusted through Custom ([saving in EPS](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/save-artwork-in-eps-format.html)). EPS Options now has Custom… beside the flattener Preset. It opens Custom Transparency Flattener Options on the settings the export would use: the raster/vector balance, both resolutions, the text and stroke outline switches, Clip Complex Regions and Anti-alias Rasters. OK goes back to EPS Options with the preset shown as [Custom], the export flattens with those settings, and the next EPS Options start from them; choosing a preset drops them, and Cancel goes back to EPS Options unchanged. Preserve Alpha Transparency stays off, and overprints are kept only with Overprints set to Preserve. The [Custom] label, the remembering, the Cancel behavior, Anti-alias Rasters and the ranges (balance 0 to 100, resolutions 1 to 2400 ppi) are VectorCraft's own. Evidence: `dialogs::tests_eps::custom_flattener_options_start_from_the_preset_and_cancel_goes_back_unchanged`, `custom_flattener_options_are_exported_and_remembered_until_a_preset_is_chosen`, `bad_custom_flattener_options_keep_the_dialog_open`. +- **EPS export and Discard White Overprint:** the help page describes Discard White Overprint as taking the overprint attribute off white objects in output, without changing the artwork ([white overprint](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/white-overprint.html)). EPS export and composite PostScript printing now follow Discard White Overprint in Output (Document Setup), as PDF export does: a white fill or stroke marked to overprint knocks out while the setting is on and overprints while it is off. The tiles of an overprinting pattern fill overprint with it. Evidence: `cmd::fileio::tests_eps::overprints_are_kept_or_discarded`, `tests::tiles_overprint_with_their_overprinting_pattern`, `tests::white_type_fills_knock_out_with_discard_white_overprint`. - **Save PDF custom flattener settings:** the help page describes the Advanced section's flattener preset for PDF 1.3 saves of transparent art, with a Custom button for adjusting the flattener settings, and says neither is available at PDF 1.4 and later ([PDF options](https://helpx.adobe.com/illustrator/using/pdf-options.html)). Save PDF › Advanced now has Custom… beside Flattener preset, enabled for PDF 1.3, PDF/X-1a and PDF/X-3. It opens Custom Transparency Flattener Options on the settings the save would use: the raster/vector balance, both resolutions, the text and stroke outline switches and Anti-alias Rasters; Clip Complex Regions shows on, as the PDF 1.3 writer always clips, overprints are kept only with Overprint set to Preserve, and Preserve Alpha Transparency shows off, as PDF 1.3 rasters keep no alpha. OK goes back to Save PDF with the preset shown as [Custom] and the save flattens with those settings; settings equal to the preset's leave its name, choosing a preset drops them, and Cancel goes back unchanged. PDF presets keep the flattener preset but not these settings, and Save Preset… says so while they are set. `ui.savePdfDialog` keeps a `flattener` it is given. The [Custom] label, the Cancel behavior, Anti-alias Rasters, the editor's absence from the PDF preset editor and the ranges (balance 0 to 100, resolutions 1 to 2400 ppi) are VectorCraft's own. Evidence: `dialogs::save_pdf::tests::custom_is_enabled_where_the_save_flattens`, `custom_starts_from_the_preset_and_cancel_goes_back_unchanged`, `custom_options_are_written_until_a_preset_is_chosen`, `custom_options_equal_to_the_preset_leave_its_name`, `custom_shows_alpha_as_the_pdf_1_3_writer_drops_it`, `save_preset_says_it_leaves_the_custom_flattener_options_out`, `save_pdf_opens_with_the_flattener_options_given_and_refuses_bad_ones`. - **Raster export backgrounds (#6125):** a raster export draws its background under the finished art, and blend modes read only the art below them, as on the canvas. An Outer Glow in Screen mode on the bare page shows in a PNG on white and in a JPEG. Flatten Transparency puts its white under the finished art the same way. Evidence: `tests::file::a_screen_outer_glow_is_in_raster_exports`, `tests::objectfx::a_screen_outer_glow_on_the_bare_page_shows_on_a_background`, `tests::knockout::page_knockout_and_isolated_blending`, `tests::knockout::no_blend_mode_reads_the_background`, `tests::cmykflatten::every_blend_mode_flattens_to_the_canvas_pixels_in_cmyk`. From 287a05c857025b45eef536ab193b5be95f90456f Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 24 Nov 2026 09:23:14 -0800 Subject: [PATCH 13/32] EPS: spot white keeps overprinting with Discard White Overprint Discard White Overprint covers process white only. A white fill or stroke linked to a spot swatch at a tint above 0% is written as its own Separation ink and now keeps overprinting. Global process swatches, a 0% tint and a spot swatch without a color still knock out. --- crates/engine/src/cmd/fileio/eps.rs | 2 +- crates/eps/src/scene.rs | 16 ++++++++++++---- crates/eps/src/tests.rs | 29 +++++++++++++++++++++++++++++ docs/mcp.md | 5 +++-- docs/target-app-parity.md | 2 +- 5 files changed, 46 insertions(+), 8 deletions(-) diff --git a/crates/engine/src/cmd/fileio/eps.rs b/crates/engine/src/cmd/fileio/eps.rs index 436a179c4d..105f4deb8a 100644 --- a/crates/engine/src/cmd/fileio/eps.rs +++ b/crates/engine/src/cmd/fileio/eps.rs @@ -33,7 +33,7 @@ pub fn specs() -> Vec { "Export EPS", [], None, - "{path?, level?: 2|3 (default; PostScript language level: 3 writes smooth gradients and masks transparent image pixels out, 2 steps gradients and writes those pixels white), previewFormat?: none|tiffBw|tiffColor (default: a TIFF preview other apps show), transparentPreview?: true (else on white), overprints?: preserve (default; white fills and strokes knock out with document.setup discardWhiteOverprint)|discard, flattenerPreset?: \"medium\" (default; high, low or a saved preset: flattener.presets.list), flattener?: {the options of object.flattenTransparency over the preset}, embedFonts?: true (type is always written as outlines, so no fonts are needed), includeLinkedFiles?: false (the embedded document keeps linked images whole, not just their previews), thumbnails?: true (a PNG thumbnail in the file), cmykPostScript?: true (RGB documents written in CMYK), compatibleGradients?: false (stepped gradients at level 3 too), selectedOnly?: false, useArtboards?: true (one file per chosen artboard, artboards?/range?, {stem}_{artboard}.eps, the bounding box the artboard; with two or more, also the central file {stem}.eps first: the whole document, the bounding box the visible art; none when no art shows) | false (one file, the bounding box the visible art, y up from the first artboard's bottom-left corner, even when artboards are named; the default when none are named), format?: \"eps\", artboard?: i | artboards?: [i…] | range?: \"1-3, 5\" (the artboards written; naming them without useArtboards works as useArtboards: true)} → {path, bytes, warnings, files?}; no path → {dataBase64, …}. Transparency is flattened with the preset (EPS has none); the native document rides along in comments, for reopening the file as it was. Same as document.export {format: eps}. A key EPS doesn't take, and an unknown key inside flattener, are refused", + "{path?, level?: 2|3 (default; PostScript language level: 3 writes smooth gradients and masks transparent image pixels out, 2 steps gradients and writes those pixels white), previewFormat?: none|tiffBw|tiffColor (default: a TIFF preview other apps show), transparentPreview?: true (else on white), overprints?: preserve (default; paper white fills and strokes knock out with document.setup discardWhiteOverprint; white linked to a spot swatch at a tint above 0% still overprints)|discard, flattenerPreset?: \"medium\" (default; high, low or a saved preset: flattener.presets.list), flattener?: {the options of object.flattenTransparency over the preset}, embedFonts?: true (type is always written as outlines, so no fonts are needed), includeLinkedFiles?: false (the embedded document keeps linked images whole, not just their previews), thumbnails?: true (a PNG thumbnail in the file), cmykPostScript?: true (RGB documents written in CMYK), compatibleGradients?: false (stepped gradients at level 3 too), selectedOnly?: false, useArtboards?: true (one file per chosen artboard, artboards?/range?, {stem}_{artboard}.eps, the bounding box the artboard; with two or more, also the central file {stem}.eps first: the whole document, the bounding box the visible art; none when no art shows) | false (one file, the bounding box the visible art, y up from the first artboard's bottom-left corner, even when artboards are named; the default when none are named), format?: \"eps\", artboard?: i | artboards?: [i…] | range?: \"1-3, 5\" (the artboards written; naming them without useArtboards works as useArtboards: true)} → {path, bytes, warnings, files?}; no path → {dataBase64, …}. Transparency is flattened with the preset (EPS has none); the native document rides along in comments, for reopening the file as it was. Same as document.export {format: eps}. A key EPS doesn't take, and an unknown key inside flattener, are refused", has_doc, export_eps )] diff --git a/crates/eps/src/scene.rs b/crates/eps/src/scene.rs index 5e5350b6c7..67827d6df9 100644 --- a/crates/eps/src/scene.rs +++ b/crates/eps/src/scene.rs @@ -511,14 +511,22 @@ impl<'a> Scene<'a> { } /// Whether a fill or stroke of `paint` marked to overprint (`overprint`) does: not when it is - /// white with Discard White Overprint in Output (Document Setup), as in PDF export. On a plate - /// the colors are already the plate's coverage, and the plate's document already left out or - /// kept each overprinting paint by that setting, so white is not checked there. + /// paper white with Discard White Overprint in Output (Document Setup); a spot white still + /// overprints ([`Self::spot_ink`]). On a plate the colors are already the plate's coverage, and + /// the plate's document already left out or kept each overprinting paint by that setting, so + /// white is not checked there. fn overprints(&self, overprint: bool, paint: &Paint) -> bool { - let discarded = !self.plate && self.doc.setup.discard_white_overprint && vectorcraft_doc::overprint::is_white(paint); + let discarded = !self.plate && self.doc.setup.discard_white_overprint && vectorcraft_doc::overprint::is_white(paint) && !self.spot_ink(paint); overprint && !discarded } + /// Whether `paint` is a tint above 0% of a spot swatch with a solid color, which the page writes + /// as a Separation ink of its own ([`Self::spot_space`]); a link is judged by the first swatch of + /// its name. + fn spot_ink(&self, paint: &Paint) -> bool { + matches!(paint, Paint::Solid { swatch: Some(name), tint, .. } if *tint > 0.0 && self.doc.swatch(name).is_some_and(|s| s.spot && s.paint.color().is_some())) + } + /// Turn overprinting on for one paint (when overprints are preserved); `false` when it stays off /// or is already on (a pattern's tiles inside an overprinting pattern fill). fn overprint_on(&mut self, overprint: bool) -> bool { diff --git a/crates/eps/src/tests.rs b/crates/eps/src/tests.rs index b550d15e0e..36aec465f0 100644 --- a/crates/eps/src/tests.rs +++ b/crates/eps/src/tests.rs @@ -519,6 +519,35 @@ fn white_type_fills_knock_out_with_discard_white_overprint() { } } +/// Discard White Overprint applies to paper white only: a white fill linked to a spot swatch +/// still overprints, at 100% and 50%; one linked to a global process swatch, at a 0% tint of a +/// spot swatch, or to a spot swatch without a color (written as process) knocks out. +#[test] +fn spot_white_fills_overprint_with_discard_white_overprint() { + let white = Paint::solid(Color::WHITE); + let cases = [ + (true, white.clone(), 1.0, true), + (true, white.clone(), 0.5, true), + (false, white.clone(), 1.0, false), + (true, white.clone(), 0.0, false), + (true, Paint::None, 1.0, false), + ]; + for (spot, swatch, tint, overprints) in cases { + let mut d = doc_with(|_| vec![]); + d.swatches.push(Swatch { name: "White Ink".into(), paint: swatch, global: true, spot }); + let mut n = red_rect(&mut d); + if let Some(AppearanceItem::Fill(f)) = n.appearance.items.first_mut() { + f.paint = Paint::Solid { color: Color::WHITE, swatch: Some("White Ink".into()), tint }; + f.overprint = true; + } + let layer = d.layers[0].id; + d.insert(Some(layer), 0, n).unwrap(); + assert!(d.setup.discard_white_overprint); + let fills = overprint_at_fills(&page_of(&d, &opts(&d))); + assert_eq!(fills, vec![overprints], "spot: {spot}, tint: {tint}, expected to overprint: {overprints}"); + } +} + const GOLD: Color = Color::Cmyk { c: 0.0, m: 0.2, y: 0.8, k: 0.1 }; const LEAF: Color = Color::Cmyk { c: 1.0, m: 0.0, y: 1.0, k: 0.0 }; diff --git a/docs/mcp.md b/docs/mcp.md index 3fb7a04ef7..8623e0aebe 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -10222,8 +10222,9 @@ without `useArtboards` (no central file when no art shows). `level: 3` (default) shadings and masks transparent image pixels out; `level: 2` writes gradients as bands of colour (as does `compatibleGradients`) and transparent pixels white. Type is always glyph outlines, so no fonts are needed (`embedFonts` is accepted); spot colours are Separation colour spaces, and overprinting fills and strokes overprint unless -`overprints: "discard"`. With `discardWhiteOverprint` (`document.setup`, on by default) white ones knock out instead, as -in PDF export. RGB documents are written in CMYK unless `cmykPostScript: false`. A freeform gradient is +`overprints: "discard"`. With `discardWhiteOverprint` (`document.setup`, on by default) paper white ones knock out +instead; a white linked to a spot swatch at a tint above 0% still overprints. RGB documents are written in CMYK unless +`cmykPostScript: false`. A freeform gradient is written as an image, in CMYK when every point is CMYK or when every point is Gray in a file written in CMYK. When the file would hold an image that can't be decoded, the image is left out, and `warnings` carries "an image couldn't be decoded and is missing from the picture" once for all such images. diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index d4b5f35ece..45ca7ce045 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -802,7 +802,7 @@ since 2026-10-01. - **EPS Save with Use Artboards:** Save As › EPS Options show Use Artboards with All or Range, for a separate file per artboard ([saving in EPS](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/save-artwork-in-eps-format.html)), unchecked by default (the scripting reference's EPS save options list `saveMultipleArtboards` with a default of false, [scripting reference](https://web.archive.org/web/20160803105056/https://wwwimages.adobe.com/content/dam/Adobe/en/devnet/illustrator/sdk/CC2015_3/Illustrator%20JavaScript%20Scripting%20Reference.pdf)). Unchecked, Save writes one file whose bounding box fits all the visible art, as Export does, without the artboards' background colors; when no art shows, the page is the first artboard in its color. An opened EPS saved back this way loses its page margins. Checked with two or more chosen artboards, the file at the path is the central file of the visible art and each artboard is also written to `_.eps` beside it. Checked with one chosen artboard, VectorCraft writes that artboard as the page of the file at the path alone (the behavior Save had since #4293). Evidence: `cmd::fileio::tests_artboard_fill::eps_save_draws_the_color_on_an_artboard_page`, `tests::save::eps_save_without_use_artboards_fits_the_box_to_art_past_the_artboard`, `tests::save::opened_eps_saves_to_its_own_file_around_its_art_or_on_its_page`, `tests::save::eps_save_with_use_artboards_writes_the_central_file_and_one_per_artboard`, `dialogs::save_options::tests::eps_save_as_shows_use_artboards_off_and_writes_the_art_or_the_artboard`. - **EPS Options custom flattener settings:** the help page describes flattening an EPS's transparency with a preset or with custom options, adjusted through Custom ([saving in EPS](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/save-artwork-in-eps-format.html)). EPS Options now has Custom… beside the flattener Preset. It opens Custom Transparency Flattener Options on the settings the export would use: the raster/vector balance, both resolutions, the text and stroke outline switches, Clip Complex Regions and Anti-alias Rasters. OK goes back to EPS Options with the preset shown as [Custom], the export flattens with those settings, and the next EPS Options start from them; choosing a preset drops them, and Cancel goes back to EPS Options unchanged. Preserve Alpha Transparency stays off, and overprints are kept only with Overprints set to Preserve. The [Custom] label, the remembering, the Cancel behavior, Anti-alias Rasters and the ranges (balance 0 to 100, resolutions 1 to 2400 ppi) are VectorCraft's own. Evidence: `dialogs::tests_eps::custom_flattener_options_start_from_the_preset_and_cancel_goes_back_unchanged`, `custom_flattener_options_are_exported_and_remembered_until_a_preset_is_chosen`, `bad_custom_flattener_options_keep_the_dialog_open`. -- **EPS export and Discard White Overprint:** the help page describes Discard White Overprint as taking the overprint attribute off white objects in output, without changing the artwork ([white overprint](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/white-overprint.html)). EPS export and composite PostScript printing now follow Discard White Overprint in Output (Document Setup), as PDF export does: a white fill or stroke marked to overprint knocks out while the setting is on and overprints while it is off. The tiles of an overprinting pattern fill overprint with it. Evidence: `cmd::fileio::tests_eps::overprints_are_kept_or_discarded`, `tests::tiles_overprint_with_their_overprinting_pattern`, `tests::white_type_fills_knock_out_with_discard_white_overprint`. +- **EPS export and Discard White Overprint:** the help page describes Discard White Overprint as taking the overprint attribute off white objects in output, without changing the artwork ([white overprint](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/white-overprint.html)). EPS export and composite PostScript printing now follow Discard White Overprint in Output (Document Setup), as PDF export does: a white fill or stroke marked to overprint knocks out while the setting is on and overprints while it is off. The same page says the setting covers process white and not spot white, so in EPS export a white fill linked to a spot swatch keeps overprinting. The tiles of an overprinting pattern fill overprint with it. Evidence: `cmd::fileio::tests_eps::overprints_are_kept_or_discarded`, `tests::tiles_overprint_with_their_overprinting_pattern`, `tests::white_type_fills_knock_out_with_discard_white_overprint`, `tests::spot_white_fills_overprint_with_discard_white_overprint`. - **Save PDF custom flattener settings:** the help page describes the Advanced section's flattener preset for PDF 1.3 saves of transparent art, with a Custom button for adjusting the flattener settings, and says neither is available at PDF 1.4 and later ([PDF options](https://helpx.adobe.com/illustrator/using/pdf-options.html)). Save PDF › Advanced now has Custom… beside Flattener preset, enabled for PDF 1.3, PDF/X-1a and PDF/X-3. It opens Custom Transparency Flattener Options on the settings the save would use: the raster/vector balance, both resolutions, the text and stroke outline switches and Anti-alias Rasters; Clip Complex Regions shows on, as the PDF 1.3 writer always clips, overprints are kept only with Overprint set to Preserve, and Preserve Alpha Transparency shows off, as PDF 1.3 rasters keep no alpha. OK goes back to Save PDF with the preset shown as [Custom] and the save flattens with those settings; settings equal to the preset's leave its name, choosing a preset drops them, and Cancel goes back unchanged. PDF presets keep the flattener preset but not these settings, and Save Preset… says so while they are set. `ui.savePdfDialog` keeps a `flattener` it is given. The [Custom] label, the Cancel behavior, Anti-alias Rasters, the editor's absence from the PDF preset editor and the ranges (balance 0 to 100, resolutions 1 to 2400 ppi) are VectorCraft's own. Evidence: `dialogs::save_pdf::tests::custom_is_enabled_where_the_save_flattens`, `custom_starts_from_the_preset_and_cancel_goes_back_unchanged`, `custom_options_are_written_until_a_preset_is_chosen`, `custom_options_equal_to_the_preset_leave_its_name`, `custom_shows_alpha_as_the_pdf_1_3_writer_drops_it`, `save_preset_says_it_leaves_the_custom_flattener_options_out`, `save_pdf_opens_with_the_flattener_options_given_and_refuses_bad_ones`. - **Raster export backgrounds (#6125):** a raster export draws its background under the finished art, and blend modes read only the art below them, as on the canvas. An Outer Glow in Screen mode on the bare page shows in a PNG on white and in a JPEG. Flatten Transparency puts its white under the finished art the same way. Evidence: `tests::file::a_screen_outer_glow_is_in_raster_exports`, `tests::objectfx::a_screen_outer_glow_on_the_bare_page_shows_on_a_background`, `tests::knockout::page_knockout_and_isolated_blending`, `tests::knockout::no_blend_mode_reads_the_background`, `tests::cmykflatten::every_blend_mode_flattens_to_the_canvas_pixels_in_cmyk`. From 225e810289b5e3c9fe6dd6f85aae66a20cb53da6 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 24 Nov 2026 20:49:02 -0800 Subject: [PATCH 14/32] Tests: the frame helpers give the runtime its input once per frame, as the apps do, and run the commands a pass fired without a second input, which made every command state of the next frame look changed and asked for a rerun --- crates/ui-egui/src/shortcut_editor.rs | 19 +++++++++++++++++++ crates/ui-egui/src/testing.rs | 16 ++++++++++++---- crates/ui-egui/src/tests/lifecycle.rs | 2 +- crates/ui-egui/src/tests/nativemenu.rs | 5 +---- crates/ui-egui/src/tests/plugins.rs | 11 ++++------- crates/ui-egui/src/tests/sysclip.rs | 6 +----- crates/ui-egui/tests/control_bar_corners.rs | 3 ++- crates/ui-egui/tests/pattern_only_nudge.rs | 2 +- .../ui-egui/tests/selection_tools_toggle.rs | 6 ++++-- 9 files changed, 45 insertions(+), 25 deletions(-) diff --git a/crates/ui-egui/src/shortcut_editor.rs b/crates/ui-egui/src/shortcut_editor.rs index 5ccce9988c..d8f7a3049c 100644 --- a/crates/ui-egui/src/shortcut_editor.rs +++ b/crates/ui-egui/src/shortcut_editor.rs @@ -1992,6 +1992,25 @@ mod tests { out.textures_delta.clear(); } + /// Frames of the app with the dialog open ask for no rerun once its first frame has sized it: the commands of its + /// set row publish the state they had the frame before. + #[test] + fn an_open_dialog_asks_for_no_rerun_after_its_first_frame() { + let mut app = crate::testing::windowed(VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default())); + let ctx = app.ui_ctx.clone().unwrap(); + let raw = + || egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1600.0, 1000.0))), ..Default::default() }; + for _ in 0..3 { + crate::testing::app_frame(&mut app, &ctx, raw()); + } + open(&mut app); + crate::testing::app_frame(&mut app, &ctx, raw()); + for frame in 0..4 { + let out = crate::testing::app_frame(&mut app, &ctx, raw()); + assert_eq!(out.platform_output.num_completed_passes, 1, "frame {frame} after the first is drawn again"); + } + } + /// An open dialog lists a live-effect plug-in installed while it is open, with the shortcut its /// set gives it, and drops the row while the plug-in is removed, keeping that shortcut in the /// set. diff --git a/crates/ui-egui/src/testing.rs b/crates/ui-egui/src/testing.rs index fcc438c353..ac732ae644 100644 --- a/crates/ui-egui/src/testing.rs +++ b/crates/ui-egui/src/testing.rs @@ -2,7 +2,7 @@ //! gives a real window, so a test lays text out and paints in the app's look; and the frame the //! hosts run. -use craft::ui::runtime::frame::{FrameInput, set_input}; +use craft::ui::runtime::frame::{FrameInput, set_input, take_output}; use craft::ui::shell::embed; /// Installs the runtime with a window system that has no OS services, the app's interface fonts @@ -36,8 +36,9 @@ pub(crate) fn ui_context() -> egui::Context { /// One frame of the whole app on `ctx` as the hosts run it (kb.C26): the app has the window's context, as the hosts /// hand it when they create the app, gives the input of the frame -/// (`embed::before_input`), the window draws with `raw`, and the app takes what the runtime gathered in it, running the -/// commands it fired, as the host's next frame begins. The frame's texture uploads are handled. +/// (`embed::before_input`, once, as the hosts call it), the window draws with `raw`, and the app takes what the runtime +/// gathered in it, running the commands it fired, as the host's next frame begins ([`run_fired`]). The frame's texture +/// uploads are handled. pub(crate) fn app_frame(app: &mut crate::VectorcraftApp, ctx: &egui::Context, raw: egui::RawInput) -> egui::FullOutput { part_frame(app, ctx, raw, |app, ui| { app.tick(ui.ctx()); @@ -56,11 +57,18 @@ pub(crate) fn part_frame( app.raw_input(ctx, &mut raw); embed::before_input(ctx, |out| app.frame_input(out)); let mut out = ctx.run_ui(raw, |ui| draw(app, ui)); - embed::before_input(ctx, |out| app.frame_input(out)); + run_fired(app, ctx); out.textures_delta.clear(); out } +/// The app takes what the runtime gathered on `ctx` since the last frame began and runs the commands it fired, as the +/// host's next `embed::before_input` does, without giving the runtime its input: the next frame gives it. A second +/// input in one frame makes every command state the next frame publishes look changed, and the frame asks for a rerun. +pub(crate) fn run_fired(app: &mut crate::VectorcraftApp, ctx: &egui::Context) { + let _ = app.frame_input(take_output(ctx)); +} + /// Held by a test that changes the custom dictionary, which the whole process shares, or that needs it to hold still: /// every change moves the dictionary's generation, and a Check Spelling walk that sees it move checks its scope again /// from the start. diff --git a/crates/ui-egui/src/tests/lifecycle.rs b/crates/ui-egui/src/tests/lifecycle.rs index a18e1c982b..1bd3331c5d 100644 --- a/crates/ui-egui/src/tests/lifecycle.rs +++ b/crates/ui-egui/src/tests/lifecycle.rs @@ -64,7 +64,7 @@ fn run_frame( } }); // The commands the frame fired run as the host's next frame begins (`testing::app_frame`). - craft::ui::shell::embed::before_input(ctx, |output| app.frame_input(output)); + crate::testing::run_fired(app, ctx); out.textures_delta.clear(); (passes, out.platform_output.ime) } diff --git a/crates/ui-egui/src/tests/nativemenu.rs b/crates/ui-egui/src/tests/nativemenu.rs index 40497b426c..7360d2350c 100644 --- a/crates/ui-egui/src/tests/nativemenu.rs +++ b/crates/ui-egui/src/tests/nativemenu.rs @@ -125,10 +125,7 @@ impl Mac { screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(1600.0, 850.0))), ..Default::default() }; - let app = &mut self.app; - craft::ui::shell::embed::before_input(&self.ctx, |out| app.frame_input(out)); - - crate::testing::app_frame(app, &self.ctx, raw) + crate::testing::app_frame(&mut self.app, &self.ctx, raw) } /// AppKit chose an item by its key equivalent `sc`. A paste the menu asks the host for diff --git a/crates/ui-egui/src/tests/plugins.rs b/crates/ui-egui/src/tests/plugins.rs index 24ec586447..7b51659271 100644 --- a/crates/ui-egui/src/tests/plugins.rs +++ b/crates/ui-egui/src/tests/plugins.rs @@ -48,14 +48,11 @@ pub(super) fn window(app: VectorcraftApp) -> Window { /// commands the pass fired run as the next frame begins. pub(super) fn app_step(h: &mut Window) { let ctx = h.ctx.clone(); - let input = |h: &mut Window| { - let app = h.state_mut(); - app.adopt_context(&ctx); - craft::ui::shell::embed::before_input(&ctx, |out| app.frame_input(out)); - }; - input(h); + let app = h.state_mut(); + app.adopt_context(&ctx); + craft::ui::shell::embed::before_input(&ctx, |out| app.frame_input(out)); h.step(); - input(h); + crate::testing::run_fired(h.state_mut(), &ctx); } /// Draws a frame of `h` at `time` seconds. diff --git a/crates/ui-egui/src/tests/sysclip.rs b/crates/ui-egui/src/tests/sysclip.rs index 878683cb4b..baa21396ed 100644 --- a/crates/ui-egui/src/tests/sysclip.rs +++ b/crates/ui-egui/src/tests/sysclip.rs @@ -315,11 +315,7 @@ pub(super) fn frame(app: &mut VectorcraftApp, events: Vec) -> egui: static CTX: egui::Context = crate::testing::ui_context(); } let ctx = CTX.with(Clone::clone); - craft::ui::shell::embed::before_input(&ctx, |output| app.frame_input(output)); - let mut out = crate::testing::app_frame(app, &ctx, egui::RawInput { events, ..Default::default() }); - craft::ui::shell::embed::before_input(&ctx, |output| app.frame_input(output)); - out.textures_delta.clear(); - out + crate::testing::app_frame(app, &ctx, egui::RawInput { events, ..Default::default() }) } /// The paste egui sends for a clipboard with a picture and no text. diff --git a/crates/ui-egui/tests/control_bar_corners.rs b/crates/ui-egui/tests/control_bar_corners.rs index 35c3b75deb..f11ca7b51e 100644 --- a/crates/ui-egui/tests/control_bar_corners.rs +++ b/crates/ui-egui/tests/control_bar_corners.rs @@ -4,6 +4,7 @@ use std::sync::{Mutex, MutexGuard}; +use craft::ui::runtime::frame::take_output; use craft::ui::shell::embed; use egui::{Event, Rect, vec2}; use serde_json::json; @@ -99,7 +100,7 @@ impl Frames { }, |ui| chrome::control_bar(app, ui), ); - embed::before_input(&self.ctx, |out| app.frame_input(out)); + let _ = app.frame_input(take_output(&self.ctx)); let nodes = output.platform_output.accesskit_update.take().map(|update| update.nodes.into_iter().map(|(_, node)| node).collect()).unwrap_or_default(); output.textures_delta.clear(); diff --git a/crates/ui-egui/tests/pattern_only_nudge.rs b/crates/ui-egui/tests/pattern_only_nudge.rs index cb7c58a7e2..9a17b2b498 100644 --- a/crates/ui-egui/tests/pattern_only_nudge.rs +++ b/crates/ui-egui/tests/pattern_only_nudge.rs @@ -74,7 +74,7 @@ impl Scene { // As the hosts run a frame: the app gives its input, and the commands the pass fired run as the next frame begins. craft::ui::shell::embed::before_input(&self.ctx, |out| self.app.frame_input(out)); let mut out = self.ctx.run_ui(raw, |ui| self.app.ui(ui)); - craft::ui::shell::embed::before_input(&self.ctx, |out| self.app.frame_input(out)); + let _ = self.app.frame_input(craft::ui::runtime::frame::take_output(&self.ctx)); out.textures_delta.clear(); } diff --git a/crates/ui-egui/tests/selection_tools_toggle.rs b/crates/ui-egui/tests/selection_tools_toggle.rs index fa8e35a3d7..5e7522ea77 100644 --- a/crates/ui-egui/tests/selection_tools_toggle.rs +++ b/crates/ui-egui/tests/selection_tools_toggle.rs @@ -4,6 +4,7 @@ use std::sync::{Mutex, MutexGuard}; +use craft::ui::runtime::frame::take_output; use craft::ui::shell::embed; use egui::{Event, Key, Modifiers}; use serde_json::json; @@ -65,6 +66,7 @@ impl Keyboard { fn frame(&mut self, app: &mut VectorcraftApp, events: Vec) { self.time += 0.05; + app.adopt_context(&self.ctx); embed::before_input(&self.ctx, |out| app.frame_input(out)); let mut out = self.ctx.run_ui( egui::RawInput { @@ -79,8 +81,8 @@ impl Keyboard { app.ui(ui); }, ); - // The commands the pass fired run as the host's next frame begins. - embed::before_input(&self.ctx, |out| app.frame_input(out)); + // The commands the pass fired run as the host's next frame begins; the next frame gives the input. + let _ = app.frame_input(take_output(&self.ctx)); out.textures_delta.clear(); } From 7b88933d73c64807b3e58855a0ef378fcdb6a437 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 24 Nov 2026 21:46:55 -0800 Subject: [PATCH 15/32] Tests: the hidden-characters memo test tries its edit and zoom again on a new document until the fonts, which other tests change, stay the same from the settled pass to the zoomed one --- crates/ui-egui/src/canvas/marks/tests.rs | 29 ++++++++++++++++-------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/crates/ui-egui/src/canvas/marks/tests.rs b/crates/ui-egui/src/canvas/marks/tests.rs index 33784cf250..b43b02b100 100644 --- a/crates/ui-egui/src/canvas/marks/tests.rs +++ b/crates/ui-egui/src/canvas/marks/tests.rs @@ -40,20 +40,29 @@ fn settled(app: &mut VectorcraftApp, view: &CanvasView, ids: &[NodeId]) -> Vec Date: Wed, 25 Nov 2026 14:58:16 +0800 Subject: [PATCH 16/32] docs(cli): clarify artboard fill for selected artwork --- crates/engine/src/cmd/layer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/layer.rs b/crates/engine/src/cmd/layer.rs index 5ccc441ddd..1782e60f9c 100644 --- a/crates/engine/src/cmd/layer.rs +++ b/crates/engine/src/cmd/layer.rs @@ -156,7 +156,7 @@ pub fn specs() -> Vec { "Artboard Options…", ["Window", "Artboards"], None, - "{index | artboards: [{index, name?, color?, guideLabel?, locked?, showCenterMark?, showCrossHairs?, showVideoSafeAreas?, videoRulerPixelAspectRatio?, x?, y?, width?, height?}…] (several artboards in one undo step, each with its own fields; the art inside each before any of them changes goes with it, and an object inside several goes with the first listed that moves or scales its art), name?, color?: color (\"#rrggbb\", {c,m,y,k}, … as the paint commands take, #rrggbbaa and #rgba refused: the background color the canvas draws the artboard's paper in, multiplied with the Simulate Colored Paper color while that is on. Supported artboard exports and printing include it by default. Set `includeArtboardFill: false` on the export or print command to omit it. Selection exports, exports of non-artboard regions, and unsupported formats omit the background) | null (no background color), guideLabel?: name | \"#rrggbb\" | null (the guide label: the canvas draws the artboard's own guides (guide.add with artboard) in this color instead of the guide color preference, selected ones still in the selection color; a layer color's name spelled exactly as Layer Options lists it (\"Light Blue\", \"Red\", …) or #rrggbb; null for none, which new artboards and older files have; screen-only, so exports and print leave it out; it can change on a locked artboard; an invalid value anywhere in the list changes nothing), locked?: bool (the Artboards panel's lock column: a locked artboard keeps its rectangle (a new x, y, width or height is an error unless locked is false), can't be moved, deleted or cut, and Rearrange and Fit to Artwork Bounds leave it as it is; the art on it (each object of a layer or sublayer whose bounds with strokes overlap it, a group as one object) acts as locked art until it is unlocked: clicks, marquees, select.set, select.all and the tools pass over it (art drawn or pasted onto it stays selected and editable until a selection leaves it out or it is moved off the locked artboards), it is deselected, and when another artboard moves or scales it stays unless lockedAndHidden), showCenterMark?: bool (Artboard Options' Show Center Mark: the canvas draws a mark at the artboard's center), showCrossHairs?: bool (Show Cross Hairs: the canvas draws a line from the middle of each side through the center), showVideoSafeAreas?: bool (Show Video Safe Areas: the canvas draws the action-safe area 3.5% and the title-safe area 5% in from each edge, as EBU R 95 sets them; the three are screen-only, as the artboard's edges are: exports and print leave them out), videoRulerPixelAspectRatio?: number 0.1–10 (Video Ruler Pixel Aspect Ratio: the width of one video pixel over its height, which View › Rulers › Show Video Rulers counts the artboard in; default 1, square pixels), x?, y?, width?, height?, moveArt?: bool (default false; a position-only change moves the contained art with its artboard), scaleArt?: bool (Scale Artwork with Artboard: resized, the artboard takes the art fully inside it (locked and hidden art only with lockedAndHidden?: bool, default prefs moveLockedWithArtboard) and its guides from its old rectangle onto the new one, each side by its own ratio; strokes/corners/patterns as object.scale), strokes?: bool, corners?: bool, patterns?: bool (the three as object.scale, for art that moves or scales with the artboard), lockedAndHidden?: bool (locked and hidden art moves along; default: the preference; recorded in the journal so a replay matches)} → null, or with scaleArt {scaled: the art scaled}; no undo step when nothing changes", + "{index | artboards: [{index, name?, color?, guideLabel?, locked?, showCenterMark?, showCrossHairs?, showVideoSafeAreas?, videoRulerPixelAspectRatio?, x?, y?, width?, height?}…] (several artboards in one undo step, each with its own fields; the art inside each before any of them changes goes with it, and an object inside several goes with the first listed that moves or scales its art), name?, color?: color (\"#rrggbb\", {c,m,y,k}, … as the paint commands take, #rrggbbaa and #rgba refused: the background color the canvas draws the artboard's paper in, multiplied with the Simulate Colored Paper color while that is on. Supported artboard exports and printing include it by default. This includes raster exports with `selectedOnly: true` when the output area is an artboard. Set `includeArtboardFill: false` on the export or print command to omit it. Exports cropped to selection bounds, artwork bounds, or an explicit raster region leave it out, as do formats that do not support artboard fills) | null (no background color), guideLabel?: name | \"#rrggbb\" | null (the guide label: the canvas draws the artboard's own guides (guide.add with artboard) in this color instead of the guide color preference, selected ones still in the selection color; a layer color's name spelled exactly as Layer Options lists it (\"Light Blue\", \"Red\", …) or #rrggbb; null for none, which new artboards and older files have; screen-only, so exports and print leave it out; it can change on a locked artboard; an invalid value anywhere in the list changes nothing), locked?: bool (the Artboards panel's lock column: a locked artboard keeps its rectangle (a new x, y, width or height is an error unless locked is false), can't be moved, deleted or cut, and Rearrange and Fit to Artwork Bounds leave it as it is; the art on it (each object of a layer or sublayer whose bounds with strokes overlap it, a group as one object) acts as locked art until it is unlocked: clicks, marquees, select.set, select.all and the tools pass over it (art drawn or pasted onto it stays selected and editable until a selection leaves it out or it is moved off the locked artboards), it is deselected, and when another artboard moves or scales it stays unless lockedAndHidden), showCenterMark?: bool (Artboard Options' Show Center Mark: the canvas draws a mark at the artboard's center), showCrossHairs?: bool (Show Cross Hairs: the canvas draws a line from the middle of each side through the center), showVideoSafeAreas?: bool (Show Video Safe Areas: the canvas draws the action-safe area 3.5% and the title-safe area 5% in from each edge, as EBU R 95 sets them; the three are screen-only, as the artboard's edges are: exports and print leave them out), videoRulerPixelAspectRatio?: number 0.1–10 (Video Ruler Pixel Aspect Ratio: the width of one video pixel over its height, which View › Rulers › Show Video Rulers counts the artboard in; default 1, square pixels), x?, y?, width?, height?, moveArt?: bool (default false; a position-only change moves the contained art with its artboard), scaleArt?: bool (Scale Artwork with Artboard: resized, the artboard takes the art fully inside it (locked and hidden art only with lockedAndHidden?: bool, default prefs moveLockedWithArtboard) and its guides from its old rectangle onto the new one, each side by its own ratio; strokes/corners/patterns as object.scale), strokes?: bool, corners?: bool, patterns?: bool (the three as object.scale, for art that moves or scales with the artboard), lockedAndHidden?: bool (locked and hidden art moves along; default: the preference; recorded in the journal so a replay matches)} → null, or with scaleArt {scaled: the art scaled}; no undo step when nothing changes", has_doc, artboard_set ), From baeef6db801dfe424ff55cf01016b043e72e7731 Mon Sep 17 00:00:00 2001 From: HassanKhan Date: Wed, 25 Nov 2026 12:05:11 +0500 Subject: [PATCH 17/32] GPU start: try the adapters that crashed an earlier start when no other is left A start ended before its first frame leaves its adapter recorded as crashed in graphics-start.json, and the next start leaves that adapter out. A start ended from outside (a --control session terminated early) looks the same as a crash in the driver, so on a machine with one GPU, such as an Apple Silicon Mac, the next start had no adapter left and failed with "no graphics adapter can show the window". The selector now tries the adapters that crashed an earlier start again, with a warning in the log, when leaving them out would leave none. Adapters a restart left out after they failed in this run of the app stay left out, and with another adapter to try, the one that crashed is still left out. Fixes #9183 --- apps/vectorcraft/src/gpu.rs | 31 +++++++++++++++++++++++++++++-- apps/vectorcraft/src/gpu/tests.rs | 14 ++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/apps/vectorcraft/src/gpu.rs b/apps/vectorcraft/src/gpu.rs index 0bf4732ed8..6728e5458d 100644 --- a/apps/vectorcraft/src/gpu.rs +++ b/apps/vectorcraft/src/gpu.rs @@ -398,6 +398,31 @@ pub fn adapter_order( order.into_iter().map(|(i, _)| i).collect() } +/// [`adapter_order`] without the adapters a restart left out after they failed (`skip`) and those +/// that crashed an earlier start (`crashed`), and `true` when that left none and the ones that +/// crashed are tried again. A crash record can't stop a start that has no other adapter to try: +/// the record may be from a start ended from outside before its first frame (#9183), which looks +/// the same as a crash in the driver. An adapter in `skip` failed in this run of the app and +/// stays left out. +pub fn order_leaving_out( + candidates: &[Candidate], + power: PowerPreference, + displays: &[DisplayGpu], + compositor: Option<(u32, u32)>, + named: Option<&str>, + skip: &[String], + crashed: &[String], +) -> (Vec, bool) { + let left_out: Vec = skip.iter().chain(crashed).cloned().collect(); + let order = adapter_order(candidates, power, displays, compositor, named, &left_out); + if !order.is_empty() || crashed.is_empty() { + return (order, false); + } + let again = adapter_order(candidates, power, displays, compositor, named, skip); + let retried = !again.is_empty(); + (again, retried) +} + /// wgpu's own ranking for a power preference: the preferred kind of GPU, the other kind, unknown, /// virtual, software. fn power_rank(t: DeviceType, power: PowerPreference) -> u8 { @@ -845,10 +870,9 @@ pub fn selector( ) -> NativeAdapterSelectorMethod { let named = std::env::var(NAME_ENV).ok(); let skip = skipped(); - let left_out: Vec = skip.iter().chain(&crashed).cloned().collect(); Arc::new(move |adapters, surface| { let candidates: Vec = adapters.iter().map(|a| Candidate::new(a, surface)).collect(); - let order = adapter_order(&candidates, power, &displays, compositor, named.as_deref(), &left_out); + let (order, retried) = order_leaving_out(&candidates, power, &displays, compositor, named.as_deref(), &skip, &crashed); let listed: Vec = candidates .iter() .map(|c| { @@ -872,6 +896,9 @@ pub fn selector( }) .collect(); log::info!("graphics adapters: {}", listed.join("; ")); + if retried { + log::warn!("every graphics adapter that can show the window crashed an earlier start: trying them again"); + } let first = order.first().and_then(|&i| adapters.get(i).zip(candidates.get(i))); let Some((adapter, chosen)) = first else { startup.none_left(); diff --git a/apps/vectorcraft/src/gpu/tests.rs b/apps/vectorcraft/src/gpu/tests.rs index f424280b30..fe4a4ddcc5 100644 --- a/apps/vectorcraft/src/gpu/tests.rs +++ b/apps/vectorcraft/src/gpu/tests.rs @@ -827,3 +827,17 @@ fn pci_ids_reject_a_sign_in_the_hex_digits() { assert_eq!(pci_ids("PCI\\VEN_+10DE&DEV_2204"), None); assert_eq!(pci_ids("PCI\\VEN_10DE&DEV_+2204"), None); } + +/// #9183: a Mac lists one adapter. A start ended from outside before its first frame left it +/// recorded as crashed, and the next start left it out and had nothing to draw on. It is tried +/// again when nothing else is left; an adapter a restart left out after it failed stays out, and +/// with another adapter to try, the one that crashed is still left out. +#[test] +fn an_adapter_that_crashed_an_earlier_start_is_tried_again_when_no_other_is_left() { + let mac = [gpu("Apple M6", Backend::Metal, DeviceType::IntegratedGpu)]; + let crashed = vec![mac[0].key.clone()]; + assert_eq!(order_leaving_out(&mac, PowerPreference::LowPower, &[], None, None, &[], &crashed), (vec![0], true)); + assert_eq!(order_leaving_out(&mac, PowerPreference::LowPower, &[], None, None, &crashed, &crashed), (vec![], false)); + let two = [gpu("Apple M6", Backend::Metal, DeviceType::IntegratedGpu), gpu("llvmpipe", Backend::Gl, DeviceType::Cpu)]; + assert_eq!(order_leaving_out(&two, PowerPreference::LowPower, &[], None, None, &[], &crashed), (vec![1], false)); +} From ca2af5d94b40f2b78a41e361da30473b4a2abbcc Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 24 Nov 2026 23:51:08 -0800 Subject: [PATCH 18/32] Tests: the hidden-characters memo test also tries again when the fonts or hyphenation exceptions change during the edit pass The attempt now records whether the memo inputs still match the settled pass right after the edit pass, and accepts it only when they match after both the edit pass and the zoom pass. Before, a change and restore of the hyphenation exceptions between the two passes cleared the memo, left the zoom check passing, and failed the assertion that the object not edited keeps its layout. --- crates/ui-egui/src/canvas/marks/tests.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/canvas/marks/tests.rs b/crates/ui-egui/src/canvas/marks/tests.rs index b43b02b100..81db600fa3 100644 --- a/crates/ui-egui/src/canvas/marks/tests.rs +++ b/crates/ui-egui/src/canvas/marks/tests.rs @@ -41,7 +41,8 @@ fn settled(app: &mut VectorcraftApp, view: &CanvasView, ids: &[NodeId]) -> Vec Date: Wed, 25 Nov 2026 16:12:32 +0500 Subject: [PATCH 19/32] docs: revision rows say #937's fix is still unconfirmed on the reporter's file (#8314) --- ROADMAP.md | 2 +- docs/target-app-parity.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 603f8dafbc..4d415cc0ba 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -251,7 +251,7 @@ The full earlier record of what landed is kept in [docs/roadmap.md](docs/roadmap | Date | Change | Summary | |---|---|---| -| 2026-11-22 | minor | Upcoming: the G11 item names what is left, the unit preference reverting to points (#864; SVG export units are fixed) and a Transform effect in a fill's or stroke's own effects (#885), instead of Shape Builder regions and Asset Export borders, which are fixed (#937, #983 / #1037); its estimate follows docs/roadmap.md and docs/gaps.md, 8–15 → 6–13 h, #8314. The Essentials readiness row's Shape Builder item names what its 4–8 h still covers (confirming #937's fix on the reporter's file). Headline numbers unchanged. | +| 2026-11-22 | minor | Upcoming: the G11 item names what is left, the unit preference reverting to points (#864; SVG export units are fixed) and a Transform effect in a fill's or stroke's own effects (#885), instead of Shape Builder regions and Asset Export borders, which are fixed (#937, #983 / #1037); its estimate follows docs/roadmap.md and docs/gaps.md, 8–15 → 6–13 h, #8314. The Essentials readiness row's Shape Builder item names what its 4–8 h still covers (checking #937's fix on the reporter's file, still unconfirmed). Headline numbers unchanged. | | 2026-11-15 | minor | Graphic Styles: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); G5 estimate unchanged (3–13 h). | | 2026-11-14 | minor | Tech Circuit adds three original procedural brushes (Circuit Trace, Bus Lines, Terminal Nodes); ten built-in brush libraries. G5 remaining estimate 3–13 h (estimated); parity scores and headline totals unchanged. | | 2026-11-14 | minor | Gujarati (#6613): contributor proofreading completed for all 387 additions, with 11 wording corrections; 4,673 reviewed catalog rows. Status/error messages remain partial; web selection requires a bundled Gujarati face. Scores and estimates unchanged. | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 3623b5e49c..d14fc7f77a 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -79,7 +79,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard | Date | Change | Summary | |---|---|---| -| 2026-11-22 | minor | Essentials readiness row: the Shape Builder item names what its 4–8 h still covers, confirming #937's fix on the reporter's file (the reproduced case is fixed), #8314. Scores and estimates unchanged. | +| 2026-11-22 | minor | Essentials readiness row: the Shape Builder item names what its 4–8 h still covers: checking #937's fix on the reporter's file, still unconfirmed (the reproduced case is fixed), #8314. Scores and estimates unchanged. | | 2026-11-20 | minor | G12: Asset Export tiles have item context menus for Export, Remove, Rename, Select Artwork on Canvas and collecting selected artwork; right-click selects an unselected tile and preserves an existing multi-selection. Headless regressions: panels::tests_asset_export. Scores and estimates unchanged. | | 2026-11-20 | minor | G12: Actions panel item context menus for action sets (New Action…, New Set…, Duplicate Set, Delete Set, Set Options…) and actions (Play, Record, Duplicate, Delete, Action Options…, Batch…) with selection handling; clicking Duplicate on an action duplicates that action; headless tests in `crates/ui-egui/src/panels/actions.rs`; scores and estimates unchanged. | | 2026-11-20 | minor | G12: Appearance panel row context menus (Duplicate Stroke/Fill, Delete Stroke/Fill, Hide/Show Stroke/Fill, Edit Effect…, Duplicate Effect, Delete Effect, Hide/Show Effect, Clear Appearance, Reduce to Basic Appearance); right-clicking an unselected row targets that row first. Headless regressions: `panels::tests_appearance`. Scores and estimates unchanged. | @@ -3211,7 +3211,7 @@ Edit › Copy and Cut put the selected ruler guides on the clipboard, with the s | Date | Change | Summary | |---|---|---| -| 2026-11-22 | minor | Essentials readiness row: the Shape Builder item names what its 4–8 h still covers, confirming #937's fix on the reporter's file (the reproduced case is fixed), #8314. Scores and estimates unchanged. | +| 2026-11-22 | minor | Essentials readiness row: the Shape Builder item names what its 4–8 h still covers: checking #937's fix on the reporter's file, still unconfirmed (the reproduced case is fixed), #8314. Scores and estimates unchanged. | | 2026-11-20 | minor | G12: Asset Export tiles have item context menus for Export, Remove, Rename, Select Artwork on Canvas and collecting selected artwork; right-click selects an unselected tile and preserves an existing multi-selection. Headless regressions: panels::tests_asset_export. Scores and estimates unchanged. | | 2026-11-19 | minor | Layers: a target circle whose item is targeted and has an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the four looks (not targeted, targeted, with an appearance, both) differ (#8711). Scores and estimates unchanged. | | 2026-11-19 | minor | Guides, grids, smart guides, snapping, rulers: View › Trim View hides the ruler guides, guide paths and the grid while it is on and greys out their Show/Hide items; a ruler drag or double-click makes no guide meanwhile (#8363). Scores and estimates unchanged. | From 1872e522033b3b12e308adf22b52ca7059a2be6d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 25 Nov 2026 03:24:49 -0800 Subject: [PATCH 20/32] Glyphs: a font's glyph names are read once, so the panel stops scanning the post table for every cell FontFace::glyph_name looked each name up in the font. In a version 2.0 post table the names are one run of strings, and read-fonts walks that run from its start for every lookup. The Glyphs panel builds the tooltip of every visible cell in every frame, and the tooltip of a glyph that no character maps carries its name, so each frame scanned the table once per such cell. glyph_name now reads every name of the face in one pass the first time it is asked, through skrifa's name iterator, and keeps them on the face. A new test checks the kept names against each glyph's own lookup for every bundled face. --- crates/text/src/fontdb/build.rs | 1 + crates/text/src/fontdb/face.rs | 2 ++ crates/text/src/fontdb/gsub.rs | 42 +++++++++++++++++++++++++++++---- 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/crates/text/src/fontdb/build.rs b/crates/text/src/fontdb/build.rs index 38f5aece65..b3f6fbbff8 100644 --- a/crates/text/src/fontdb/build.rs +++ b/crates/text/src/fontdb/build.rs @@ -83,6 +83,7 @@ pub(super) fn make_face(bytes: FontBytes, index: u32, spec: FaceStyle, path: Opt unencoded: std::sync::OnceLock::new(), char_list: std::sync::OnceLock::new(), named_chars: std::sync::OnceLock::new(), + glyph_names: std::sync::OnceLock::new(), }) } diff --git a/crates/text/src/fontdb/face.rs b/crates/text/src/fontdb/face.rs index c418d40308..85633460dc 100644 --- a/crates/text/src/fontdb/face.rs +++ b/crates/text/src/fontdb/face.rs @@ -210,6 +210,8 @@ pub struct FontFace { pub(super) char_list: std::sync::OnceLock>, /// [`Self::name_owner`]'s glyph names to characters, read once. pub(super) named_chars: std::sync::OnceLock>, + /// [`Self::glyph_name`]'s names by glyph id, read once. + pub(super) glyph_names: std::sync::OnceLock>>>, } impl vectorcraft_doc::FileFontFace for FontFace { diff --git a/crates/text/src/fontdb/gsub.rs b/crates/text/src/fontdb/gsub.rs index 7529a82929..2fef163351 100644 --- a/crates/text/src/fontdb/gsub.rs +++ b/crates/text/src/fontdb/gsub.rs @@ -589,11 +589,23 @@ impl FontFace { } /// The name of glyph `gid` from the font's `post` or `CFF` table: `None` for a glyph past the - /// face's glyphs, or when the font has no names (the ids are then `gid12`). + /// face's glyphs, or when the font has no names (the ids are then `gid12`). The names are read + /// once for the face, in one pass over the table. pub fn glyph_name(&self, gid: u32) -> Option { - let font = self.skrifa()?; - let name = font.glyph_names().get(skrifa::GlyphId::new(gid))?; - (!name.is_synthesized()).then(|| name.as_str().to_string()) + let names = self.glyph_names.get_or_init(|| { + let Some(font) = self.skrifa() else { return Vec::new() }; + let names = font.glyph_names(); + let mut out = vec![None; names.num_glyphs() as usize]; + for (id, name) in names.iter() { + if let Some(slot) = out.get_mut(id.to_u32() as usize) + && !name.is_synthesized() + { + *slot = Some(Box::from(name.as_str())); + } + } + out + }); + names.get(usize::try_from(gid).ok()?)?.as_deref().map(str::to_string) } /// The kinds of glyph the face's `GSUB` table gives ([`GlyphCategoryKind`]), in the order of @@ -651,6 +663,28 @@ mod tests { assert!(face.glyph_categories().is_empty()); } + /// The names read in one pass are the names the font gives each glyph id, for every bundled + /// face, and a glyph past the face's glyphs has none. + #[test] + fn glyph_names_read_once_match_each_glyphs_own_name() { + let db = super::super::FontDb::with_font_dirs(vec![]); + let mut checked = 0; + for family in db.families() { + for style in db.styles(&family) { + let Some(face) = db.face(&family, &style) else { continue }; + let Some(font) = face.skrifa() else { continue }; + let names = font.glyph_names(); + for gid in 0..face.glyph_count() { + let own = names.get(skrifa::GlyphId::new(gid)).filter(|n| !n.is_synthesized()).map(|n| n.as_str().to_string()); + assert_eq!(face.glyph_name(gid), own, "{family} {style}: glyph {gid}"); + checked += 1; + } + assert_eq!(face.glyph_name(face.glyph_count()), None, "{family} {style}"); + } + } + assert!(checked > 0, "the bundled faces have glyphs"); + } + #[test] fn kinds_round_trip_through_their_ids() { for kind in GlyphCategoryKind::all() { From 266e42b8f590d927bbf502c1dac29837a79083e9 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 25 Nov 2026 04:05:51 -0800 Subject: [PATCH 21/32] Fields: Character Style Options refuses 1,000% as it refuses 1,000 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The percent fields and Character Rotation read the decimal comma before the % or ° suffix came off, so 1,000% read as 1.000% and was accepted as 1, while 1,000 was refused. The suffix now comes off first; 12,5% and 12,5° still read as 12.5. --- crates/ui-egui/src/dialogs/char_style_options.rs | 7 ++++--- .../src/dialogs/char_style_options/tests.rs | 14 +++++++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/dialogs/char_style_options.rs b/crates/ui-egui/src/dialogs/char_style_options.rs index 0cd18ff6e7..f1d1b618af 100644 --- a/crates/ui-egui/src/dialogs/char_style_options.rs +++ b/crates/ui-egui/src/dialogs/char_style_options.rs @@ -437,16 +437,17 @@ fn case_from_attrs(attrs: &Map) -> Option<&'static str> { /// and a final `%` in the percent fields or `°` in Character Rotation. fn typed_number(key: &str, text: &str) -> Option { let text = text.trim().replace('\u{2212}', "-"); - let text = vectorcraft_doc::decimal_point(&text); let mark = match key { "size" | "leading" | "baseline_shift" | "tcyUpDown" | "tcyLeftRight" | "stroke_width" => { - return vectorcraft_doc::Unit::Points.parse(&text); + return vectorcraft_doc::Unit::Points.parse(&vectorcraft_doc::decimal_point(&text)); } "h_scale" | "v_scale" | "tsume" | "fill_tint" | "stroke_tint" => Some('%'), "rotation" => Some('°'), _ => None, }; - vectorcraft_doc::parse_number(mark.and_then(|m| text.strip_suffix(m)).unwrap_or(&text)) + // The suffix comes off before the comma is read, so `1,000%` is refused as `1,000` is. + let number = mark.and_then(|m| text.strip_suffix(m)).unwrap_or(&text); + vectorcraft_doc::parse_number(&vectorcraft_doc::decimal_point(number)) } fn optional_number(d: &Values, key: &str) -> Result, String> { diff --git a/crates/ui-egui/src/dialogs/char_style_options/tests.rs b/crates/ui-egui/src/dialogs/char_style_options/tests.rs index 44d443b361..048e16077d 100644 --- a/crates/ui-egui/src/dialogs/char_style_options/tests.rs +++ b/crates/ui-egui/src/dialogs/char_style_options/tests.rs @@ -529,13 +529,25 @@ fn number_fields_take_field_arithmetic() { ("leading", "1 in", 72.0), ("baseline_shift", "\u{2212}2", -2.0), ("kerning", "12,5", 12.5), + ("h_scale", "12,5%", 12.5), + ("rotation", "12,5°", 12.5), ]; for (key, text, want) in typed { let (mut d, _) = dialog_for(json!({})); put(&mut d, key, json!(text)); assert_eq!(optional_number(&Values::new(&d), key), Ok(Some(json!(want))), "{key} {text}"); } - for (key, text) in [("size", "12°"), ("leading", "50%"), ("tracking", "10%"), ("rotation", "45%"), ("h_scale", "1%2"), ("size", "1e3")] { + for (key, text) in [ + ("size", "12°"), + ("leading", "50%"), + ("tracking", "10%"), + ("rotation", "45%"), + ("h_scale", "1%2"), + ("size", "1e3"), + ("h_scale", "1,000"), + ("h_scale", "1,000%"), + ("rotation", "1,000°"), + ] { let (mut d, _) = dialog_for(json!({})); put(&mut d, key, json!(text)); assert!(optional_number(&Values::new(&d), key).is_err(), "{key} {text}"); From 2784f684a1804e42b26ab803abddf388e568b786 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 25 Nov 2026 04:12:07 -0800 Subject: [PATCH 22/32] EPS: white overprints knock out on PostScript plates with Discard White Overprint On a separated PostScript plate, a process white fill, stroke or character fill or stroke marked to overprint kept its overprint flag with Discard White Overprint on, so it was drawn as nothing and the ink below it stayed. The plate document now turns overprinting off for those whites, so they knock out as in composite output. White linked to a spot swatch that has a color, at a tint above 0%, still overprints. An overprinting colorized image in the tile of an overprinting pattern fill is now written in only the process inks it puts down, as it is outside a pattern, instead of as a full CMYK image that removed the inks below it. The params text and docs/mcp.md now say the spot exception needs a spot swatch with a color. --- crates/engine/src/cmd/fileio/eps.rs | 2 +- crates/eps/src/print/tests.rs | 50 +++++++++++++++++++++++++++-- crates/eps/src/scene.rs | 8 +++-- crates/eps/src/tests.rs | 21 ++++++++++++ crates/pdf/src/print/plates.rs | 10 ++++-- docs/mcp.md | 3 +- docs/target-app-parity.md | 2 +- 7 files changed, 86 insertions(+), 10 deletions(-) diff --git a/crates/engine/src/cmd/fileio/eps.rs b/crates/engine/src/cmd/fileio/eps.rs index 105f4deb8a..0ff99200c8 100644 --- a/crates/engine/src/cmd/fileio/eps.rs +++ b/crates/engine/src/cmd/fileio/eps.rs @@ -33,7 +33,7 @@ pub fn specs() -> Vec { "Export EPS", [], None, - "{path?, level?: 2|3 (default; PostScript language level: 3 writes smooth gradients and masks transparent image pixels out, 2 steps gradients and writes those pixels white), previewFormat?: none|tiffBw|tiffColor (default: a TIFF preview other apps show), transparentPreview?: true (else on white), overprints?: preserve (default; paper white fills and strokes knock out with document.setup discardWhiteOverprint; white linked to a spot swatch at a tint above 0% still overprints)|discard, flattenerPreset?: \"medium\" (default; high, low or a saved preset: flattener.presets.list), flattener?: {the options of object.flattenTransparency over the preset}, embedFonts?: true (type is always written as outlines, so no fonts are needed), includeLinkedFiles?: false (the embedded document keeps linked images whole, not just their previews), thumbnails?: true (a PNG thumbnail in the file), cmykPostScript?: true (RGB documents written in CMYK), compatibleGradients?: false (stepped gradients at level 3 too), selectedOnly?: false, useArtboards?: true (one file per chosen artboard, artboards?/range?, {stem}_{artboard}.eps, the bounding box the artboard; with two or more, also the central file {stem}.eps first: the whole document, the bounding box the visible art; none when no art shows) | false (one file, the bounding box the visible art, y up from the first artboard's bottom-left corner, even when artboards are named; the default when none are named), format?: \"eps\", artboard?: i | artboards?: [i…] | range?: \"1-3, 5\" (the artboards written; naming them without useArtboards works as useArtboards: true)} → {path, bytes, warnings, files?}; no path → {dataBase64, …}. Transparency is flattened with the preset (EPS has none); the native document rides along in comments, for reopening the file as it was. Same as document.export {format: eps}. A key EPS doesn't take, and an unknown key inside flattener, are refused", + "{path?, level?: 2|3 (default; PostScript language level: 3 writes smooth gradients and masks transparent image pixels out, 2 steps gradients and writes those pixels white), previewFormat?: none|tiffBw|tiffColor (default: a TIFF preview other apps show), transparentPreview?: true (else on white), overprints?: preserve (default; paper white fills and strokes knock out with document.setup discardWhiteOverprint; white linked to a spot swatch that has a color, at a tint above 0%, still overprints)|discard, flattenerPreset?: \"medium\" (default; high, low or a saved preset: flattener.presets.list), flattener?: {the options of object.flattenTransparency over the preset}, embedFonts?: true (type is always written as outlines, so no fonts are needed), includeLinkedFiles?: false (the embedded document keeps linked images whole, not just their previews), thumbnails?: true (a PNG thumbnail in the file), cmykPostScript?: true (RGB documents written in CMYK), compatibleGradients?: false (stepped gradients at level 3 too), selectedOnly?: false, useArtboards?: true (one file per chosen artboard, artboards?/range?, {stem}_{artboard}.eps, the bounding box the artboard; with two or more, also the central file {stem}.eps first: the whole document, the bounding box the visible art; none when no art shows) | false (one file, the bounding box the visible art, y up from the first artboard's bottom-left corner, even when artboards are named; the default when none are named), format?: \"eps\", artboard?: i | artboards?: [i…] | range?: \"1-3, 5\" (the artboards written; naming them without useArtboards works as useArtboards: true)} → {path, bytes, warnings, files?}; no path → {dataBase64, …}. Transparency is flattened with the preset (EPS has none); the native document rides along in comments, for reopening the file as it was. Same as document.export {format: eps}. A key EPS doesn't take, and an unknown key inside flattener, are refused", has_doc, export_eps )] diff --git a/crates/eps/src/print/tests.rs b/crates/eps/src/print/tests.rs index e560f7ab8d..f32bebaa4c 100644 --- a/crates/eps/src/print/tests.rs +++ b/crates/eps/src/print/tests.rs @@ -132,6 +132,15 @@ fn over(under: Option, art: &[Node]) -> Document { /// Ink `ink`'s plate of `d` as the print plan separates it for PostScript, and as a PostScript /// separation at `level` read back, both drawn at 1 px a point. fn plate_of(d: &Document, ink: &str, level: Level) -> (Image, Image) { + let area = Rect::new(0.0, 0.0, 200.0, 100.0); + let (plate, out) = separation(d, ink, level); + let back = crate::import(&out.bytes).unwrap().document; + (render_region(&plate, area, 1.0), render_region(&back, area, 1.0)) +} + +/// Ink `ink`'s plate of `d` as the print plan separates it for PostScript, and that plate written +/// as a PostScript separation at `level`. +fn separation(d: &Document, ink: &str, level: Level) -> (Document, EpsOutput) { let area = Rect::new(0.0, 0.0, 200.0, 100.0); let settings = serde_json::from_value(serde_json::json!({"output": {"mode": "separations"}})).unwrap(); let plan = vectorcraft_pdf::plan(d, &vectorcraft_pdf::PrintOptions { settings, postscript: true, ..Default::default() }).unwrap(); @@ -151,8 +160,7 @@ fn plate_of(d: &Document, ink: &str, level: Level) -> (Image, Image) { }; let out = print(&[page], &[0], &PrintJob { level, ..PrintJob::default() }).unwrap(); assert!(level == Level::Three || !text(&out).contains("shfill"), "Level 2 has no smooth shadings"); - let back = crate::import(&out.bytes).unwrap().document; - (render_region(plate, area, 1.0), render_region(&back, area, 1.0)) + (plate.clone(), out) } /// Ink `ink`'s PostScript plate of `art` over a page of 100% `ink` (`under`), checked against the @@ -234,6 +242,44 @@ fn an_overprinting_gradient_keeps_the_ink_below_where_it_puts_none_on_a_postscri assert_keeps_the_ink_below(&cases); } +/// With Discard White Overprint, a process white fill or stroke marked to overprint knocks out the +/// cyan below it on the Cyan plate and is written without overprinting, as in composite output. +/// Without the setting, and for a white linked to a spot swatch with a color at a tint above 0%, +/// the cyan below it prints. +#[test] +fn white_overprints_knock_out_on_postscript_plates_with_discard_white_overprint() { + let cyan = Paint::solid(Color::cmyk(1.0, 0.0, 0.0, 0.0)); + let white = Paint::solid(Color::cmyk(0.0, 0.0, 0.0, 0.0)); + let spot_white = Paint::Solid { color: Color::cmyk(0.0, 0.0, 0.0, 0.0), swatch: Some("White Ink".into()), tint: 1.0 }; + // The fill is sampled in the rectangle's middle, the stroke on its top edge. + let (fill_at, stroke_at) = ((100, 50), (100, 10)); + let cases = [ + ("process white fill", overprinting(white.clone(), Paint::None), fill_at, true, true), + ("process white stroke", overprinting(Paint::None, white.clone()), stroke_at, true, true), + ("process white fill without the setting", overprinting(white.clone(), Paint::None), fill_at, false, false), + ("process white stroke without the setting", overprinting(Paint::None, white), stroke_at, false, false), + ("spot white fill", overprinting(spot_white.clone(), Paint::None), fill_at, true, false), + ("spot white stroke", overprinting(Paint::None, spot_white), stroke_at, true, false), + ]; + let mut failed = vec![]; + for (name, art, (x, y), discard, knocks_out) in cases { + let mut d = over(Some(cyan.clone()), &[art]); + d.swatches.push(Swatch { name: "White Ink".into(), paint: Paint::solid(Color::cmyk(0.0, 0.0, 0.0, 0.0)), global: true, spot: true }); + d.setup.discard_white_overprint = discard; + for level in [Level::Three, Level::Two] { + let (_, printed) = plate_of(&d, "Cyan", level); + let paper = printed.over_white(x, y)[0] >= 254; + if paper != knocks_out { + failed.push(format!("{name} at level {level:?}: knocked out {paper}, expected {knocks_out}")); + } + if text(&separation(&d, "Cyan", level).1).contains("true op") { + failed.push(format!("{name} at level {level:?}: overprints on the plate")); + } + } + } + assert!(failed.is_empty(), "{failed:#?}"); +} + #[test] fn an_overprinting_gradient_with_a_hard_stop_at_an_end_keeps_the_ink_below_on_a_postscript_plate() { // Two stops at an end, one with cyan and one without: Level 2's bands pad with the end stop, diff --git a/crates/eps/src/scene.rs b/crates/eps/src/scene.rs index b862e5e0dd..8452decdf6 100644 --- a/crates/eps/src/scene.rs +++ b/crates/eps/src/scene.rs @@ -541,8 +541,8 @@ impl<'a> Scene<'a> { /// Whether a fill or stroke of `paint` marked to overprint (`overprint`) does: not when it is /// paper white with Discard White Overprint in Output (Document Setup); a spot white still /// overprints ([`Self::spot_ink`]). On a plate the colors are already the plate's coverage, and - /// the plate's document already left out or kept each overprinting paint by that setting, so - /// white is not checked there. + /// the plate's document has already turned overprinting off for each white the setting knocks + /// out, so white is not checked there. fn overprints(&self, overprint: bool, paint: &Paint) -> bool { let discarded = !self.plate && self.doc.setup.discard_white_overprint && vectorcraft_doc::overprint::is_white(paint) && !self.spot_ink(paint); overprint && !discarded @@ -634,7 +634,9 @@ impl<'a> Scene<'a> { && vectorcraft_doc::overprint::is_white(p) && vectorcraft_doc::overprint::DiscardWhite::of(self.doc).discards(p); let on = self.overprint_on(n.colorize_overprints() && !discarded); - self.colorized_image(im, blob, p, on); + // Inside an overprinting pattern fill the image overprints with its tiles. + let overprinting = self.overprinting; + self.colorized_image(im, blob, p, overprinting); self.overprint_off(on); } _ => self.image(&im.key, blob, im.width, im.height, im.xf), diff --git a/crates/eps/src/tests.rs b/crates/eps/src/tests.rs index 44994d11d4..3b45578deb 100644 --- a/crates/eps/src/tests.rs +++ b/crates/eps/src/tests.rs @@ -1353,6 +1353,27 @@ fn an_overprinting_colorized_image_writes_only_its_process_inks() { assert!(ps.contains("VCdn0 setcolorspace") && ps.contains("/DeviceCMYK setcolorspace"), "{ps}"); } +/// An overprinting colorized image in the tile of an overprinting pattern fill is written in only +/// the process inks it puts down, as it is outside a pattern, so the inks below it stay. +#[test] +fn an_overprinting_colorized_image_in_an_overprinting_pattern_writes_only_its_process_inks() { + let mut d = overprinting_colorized_doc(vec![0, 128, 255], Color::cmyk(1.0, 0.0, 0.0, 0.0), true); + let id = d.layers[0].children().unwrap()[0].id; + let image = d.remove(id).unwrap(); + d.patterns.push(vectorcraft_doc::PatternDef::new("tile", vec![image])); + let mut n = red_rect(&mut d); + if let Some(AppearanceItem::Fill(f)) = n.appearance.items.first_mut() { + f.paint = Paint::Pattern { pattern: "tile".into(), xf: Affine::IDENTITY }; + f.overprint = true; + } + let layer = d.layers[0].id; + d.insert(Some(layer), 0, n).unwrap(); + for level in Level::ALL { + let ps = page_of(&d, &EpsOptions { level, ..opts(&d) }); + assert!(ps.contains("true op") && ps.contains("VCdn0 setcolorspace") && !ps.contains("/DeviceCMYK setcolorspace"), "{level:?}: {ps}"); + } +} + /// On a separation plate, an overprinting colorized image whose color puts none of the plate's ink /// down is drawn as nothing, so the ink below stays; one that knocks out, or whose overprint is /// discarded, is drawn as paper. (The plate's colors come from the separator, which has already diff --git a/crates/pdf/src/print/plates.rs b/crates/pdf/src/print/plates.rs index 38e46654cf..f93b7a4d8a 100644 --- a/crates/pdf/src/print/plates.rs +++ b/crates/pdf/src/print/plates.rs @@ -238,8 +238,9 @@ impl<'a> Separator<'a> { /// Overprinting fills and strokes of `a`'s subtree with a Normal blending mode, and /// overprinting character fills and strokes, that put none of ink `plate` down leave its plate - /// as it is: they are drawn as nothing on it (paper white ones that `discard_white` knocks out - /// aside, [`DiscardWhite::discards`]). A writer without blending modes (PostScript) then keeps the ink below them, + /// as it is: they are drawn as nothing on it. Paper white ones that `discard_white` knocks out + /// ([`DiscardWhite::discards`]) stop overprinting instead, and knock out the ink below them on + /// the plate as in composite output. A writer without blending modes (PostScript) then keeps the ink below them, /// where it would draw their Darken as a knockout. One that puts any ink down is drawn, and on /// a PostScript plate its ink replaces the ink below, as a nonzero component of an overprinting /// color replaces the backdrop's with overprint mode 1 (ISO 32000-1, 11.7.4.2). On a @@ -259,6 +260,9 @@ impl<'a> Separator<'a> { } let image = whole && n.extras().colorize.as_deref().is_some_and(|p| self.no_ink(plate, p)); for it in &mut n.appearance.items { + if it.overprint() && discard_white.discards(it.paint()) { + *it.overprint_mut() = false; + } let normal = match it { AppearanceItem::Fill(l) => l.blend == BlendMode::Normal, AppearanceItem::Stroke(l) => l.blend == BlendMode::Normal, @@ -274,6 +278,8 @@ impl<'a> Separator<'a> { } if let NodeKind::Text(t) = &mut n.kind { for r in &mut t.runs { + r.style.overprint_fill &= !discard_white.discards(&r.style.fill); + r.style.overprint_stroke &= !discard_white.discards(&r.style.stroke); if inkless(r.style.overprint_fill, &r.style.fill) { r.style.fill = Paint::None; } else if r.style.overprint_fill { diff --git a/docs/mcp.md b/docs/mcp.md index da6743e1f2..ca9f0e63e6 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -10461,7 +10461,8 @@ shadings and masks transparent image pixels out; `level: 2` writes gradients as `compatibleGradients`) and transparent pixels white. Type is always glyph outlines, so no fonts are needed (`embedFonts` is accepted); spot colours are Separation colour spaces, and overprinting fills and strokes overprint unless `overprints: "discard"`. With `discardWhiteOverprint` (`document.setup`, on by default) paper white ones knock out -instead; a white linked to a spot swatch at a tint above 0% still overprints. RGB documents are written in CMYK unless +instead; a white linked to a spot swatch that has a color, at a tint above 0%, still overprints. RGB documents are +written in CMYK unless `cmykPostScript: false`. A freeform gradient is written as an image, in CMYK when every point is CMYK or when every point is Gray in a file written in CMYK. When the file would hold an image that can't be decoded, the image is left out, and `warnings` carries "an image couldn't be decoded and is missing diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 377d2d0fdf..95fedb08bf 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -809,7 +809,7 @@ since 2026-10-01. - **EPS Save with Use Artboards:** Save As › EPS Options show Use Artboards with All or Range, for a separate file per artboard ([saving in EPS](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/save-artwork-in-eps-format.html)), unchecked by default (the scripting reference's EPS save options list `saveMultipleArtboards` with a default of false, [scripting reference](https://web.archive.org/web/20160803105056/https://wwwimages.adobe.com/content/dam/Adobe/en/devnet/illustrator/sdk/CC2015_3/Illustrator%20JavaScript%20Scripting%20Reference.pdf)). Unchecked, Save writes one file whose bounding box fits all the visible art, as Export does, without the artboards' background colors; when no art shows, the page is the first artboard in its color. An opened EPS saved back this way loses its page margins. Checked with two or more chosen artboards, the file at the path is the central file of the visible art and each artboard is also written to `_.eps` beside it. Checked with one chosen artboard, VectorCraft writes that artboard as the page of the file at the path alone (the behavior Save had since #4293). Evidence: `cmd::fileio::tests_artboard_fill::eps_save_draws_the_color_on_an_artboard_page`, `tests::save::eps_save_without_use_artboards_fits_the_box_to_art_past_the_artboard`, `tests::save::opened_eps_saves_to_its_own_file_around_its_art_or_on_its_page`, `tests::save::eps_save_with_use_artboards_writes_the_central_file_and_one_per_artboard`, `dialogs::save_options::tests::eps_save_as_shows_use_artboards_off_and_writes_the_art_or_the_artboard`. - **EPS Options custom flattener settings:** the help page describes flattening an EPS's transparency with a preset or with custom options, adjusted through Custom ([saving in EPS](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/save-artwork-in-eps-format.html)). EPS Options now has Custom… beside the flattener Preset. It opens Custom Transparency Flattener Options on the settings the export would use: the raster/vector balance, both resolutions, the text and stroke outline switches, Clip Complex Regions and Anti-alias Rasters. OK goes back to EPS Options with the preset shown as [Custom], the export flattens with those settings, and the next EPS Options start from them; choosing a preset drops them, and Cancel goes back to EPS Options unchanged. Preserve Alpha Transparency stays off, and overprints are kept only with Overprints set to Preserve. The [Custom] label, the remembering, the Cancel behavior, Anti-alias Rasters and the ranges (balance 0 to 100, resolutions 1 to 2400 ppi) are VectorCraft's own. Evidence: `dialogs::tests_eps::custom_flattener_options_start_from_the_preset_and_cancel_goes_back_unchanged`, `custom_flattener_options_are_exported_and_remembered_until_a_preset_is_chosen`, `bad_custom_flattener_options_keep_the_dialog_open`. -- **EPS export and Discard White Overprint:** the help page describes Discard White Overprint as taking the overprint attribute off white objects in output, without changing the artwork ([white overprint](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/white-overprint.html)). EPS export and composite PostScript printing now follow Discard White Overprint in Output (Document Setup), as PDF export does: a white fill or stroke marked to overprint knocks out while the setting is on and overprints while it is off. The same page says the setting covers process white and not spot white, so in EPS export a white fill linked to a spot swatch keeps overprinting. The tiles of an overprinting pattern fill overprint with it. Evidence: `cmd::fileio::tests_eps::overprints_are_kept_or_discarded`, `tests::tiles_overprint_with_their_overprinting_pattern`, `tests::white_type_fills_knock_out_with_discard_white_overprint`, `tests::spot_white_fills_overprint_with_discard_white_overprint`. +- **EPS export and Discard White Overprint:** the help page describes Discard White Overprint as taking the overprint attribute off white objects in output, without changing the artwork ([white overprint](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/white-overprint.html)). EPS export and PostScript printing, composite and separated, now follow Discard White Overprint in Output (Document Setup), as PDF export does: a white fill or stroke marked to overprint knocks out while the setting is on and overprints while it is off. The same page says the setting covers process white and not spot white, so a white fill linked to a spot swatch that has a color keeps overprinting. The tiles of an overprinting pattern fill overprint with it. Evidence: `cmd::fileio::tests_eps::overprints_are_kept_or_discarded`, `tests::tiles_overprint_with_their_overprinting_pattern`, `tests::white_type_fills_knock_out_with_discard_white_overprint`, `tests::spot_white_fills_overprint_with_discard_white_overprint`, `print::tests::white_overprints_knock_out_on_postscript_plates_with_discard_white_overprint`. - **Save PDF custom flattener settings:** the help page describes the Advanced section's flattener preset for PDF 1.3 saves of transparent art, with a Custom button for adjusting the flattener settings, and says neither is available at PDF 1.4 and later ([PDF options](https://helpx.adobe.com/illustrator/using/pdf-options.html)). Save PDF › Advanced now has Custom… beside Flattener preset, enabled for PDF 1.3, PDF/X-1a and PDF/X-3. It opens Custom Transparency Flattener Options on the settings the save would use: the raster/vector balance, both resolutions, the text and stroke outline switches and Anti-alias Rasters; Clip Complex Regions shows on, as the PDF 1.3 writer always clips, overprints are kept only with Overprint set to Preserve, and Preserve Alpha Transparency shows off, as PDF 1.3 rasters keep no alpha. OK goes back to Save PDF with the preset shown as [Custom] and the save flattens with those settings; settings equal to the preset's leave its name, choosing a preset drops them, and Cancel goes back unchanged. PDF presets keep the flattener preset but not these settings, and Save Preset… says so while they are set. `ui.savePdfDialog` keeps a `flattener` it is given. The [Custom] label, the Cancel behavior, Anti-alias Rasters, the editor's absence from the PDF preset editor and the ranges (balance 0 to 100, resolutions 1 to 2400 ppi) are VectorCraft's own. Evidence: `dialogs::save_pdf::tests::custom_is_enabled_where_the_save_flattens`, `custom_starts_from_the_preset_and_cancel_goes_back_unchanged`, `custom_options_are_written_until_a_preset_is_chosen`, `custom_options_equal_to_the_preset_leave_its_name`, `custom_shows_alpha_as_the_pdf_1_3_writer_drops_it`, `save_preset_says_it_leaves_the_custom_flattener_options_out`, `save_pdf_opens_with_the_flattener_options_given_and_refuses_bad_ones`. - **Raster export backgrounds (#6125):** a raster export draws its background under the finished art, and blend modes read only the art below them, as on the canvas. An Outer Glow in Screen mode on the bare page shows in a PNG on white and in a JPEG. Flatten Transparency puts its white under the finished art the same way. Evidence: `tests::file::a_screen_outer_glow_is_in_raster_exports`, `tests::objectfx::a_screen_outer_glow_on_the_bare_page_shows_on_a_background`, `tests::knockout::page_knockout_and_isolated_blending`, `tests::knockout::no_blend_mode_reads_the_background`, `tests::cmykflatten::every_blend_mode_flattens_to_the_canvas_pixels_in_cmyk`. From 8b05d98951b2cb3432c9ad9dd9216af5638be29f Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 25 Nov 2026 04:23:32 -0800 Subject: [PATCH 23/32] Scripts: every script reads E4X and has the XML objects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script host ran its realm with E4X off, so XML literals were syntax errors and XML, XMLList, Namespace, QName, isXMLName and setDefaultXMLNamespace were missing from every script, although vectorcraft-js has them. script.run and File › Scripts now turn E4X on for .js and .jsx files, script text, #include files, $.evalFile, eval and Function, and for a #targetengine engine. script.check lists the e4x and xml features under the language need instead of hostOnly, since VectorCraft runs them. --- crates/engine/src/script/include.rs | 2 +- crates/engine/src/script/mod.rs | 2 +- crates/engine/src/tests/script_run.rs | 34 +++++++++++++++++++ .../tests/it/script_host_vs_scriptcheck.rs | 10 +++--- crates/scriptcheck/src/catalog.rs | 4 +-- crates/scriptcheck/src/lib.rs | 5 +-- crates/scriptcheck/src/tests.rs | 7 ++++ docs/mcp.md | 17 ++++++---- docs/target-app-parity.md | 1 + 9 files changed, 65 insertions(+), 17 deletions(-) diff --git a/crates/engine/src/script/include.rs b/crates/engine/src/script/include.rs index a024949a35..ae6b41b1a1 100644 --- a/crates/engine/src/script/include.rs +++ b/crates/engine/src/script/include.rs @@ -326,7 +326,7 @@ impl Files { /// The options a file of this run is parsed with, preprocessor lines aside. pub(crate) fn options(&self) -> Options { - Options { max_source_units: MAX_TOTAL_BYTES, es2015: self.es2015, ..Options::default() } + Options { max_source_units: MAX_TOTAL_BYTES, es2015: self.es2015, e4x: true, ..Options::default() } } /// The `JSINCLUDE` folders of this process: absolute folders separated by `;`. diff --git a/crates/engine/src/script/mod.rs b/crates/engine/src/script/mod.rs index 00d0a3a371..fdec594f69 100644 --- a/crates/engine/src/script/mod.rs +++ b/crates/engine/src/script/mod.rs @@ -2009,7 +2009,7 @@ impl Session { // A `.js` script reads ECMAScript 2015; `eval`, `Function`, includes and `$.evalFile` read // code the way the script does. let es2015 = include::es2015_script(request.file.as_deref()); - let options = Options { max_source_units: include::MAX_TOTAL_BYTES.saturating_mul(2), es2015, ..Options::default() }; + let options = Options { max_source_units: include::MAX_TOTAL_BYTES.saturating_mul(2), es2015, e4x: true, ..Options::default() }; let strict = options.strict; // A kept engine reads each run's code the way that run's script does. let mut realm = match realm { diff --git a/crates/engine/src/tests/script_run.rs b/crates/engine/src/tests/script_run.rs index 3cb7dc96af..7c415160be 100644 --- a/crates/engine/src/tests/script_run.rs +++ b/crates/engine/src/tests/script_run.rs @@ -354,6 +354,40 @@ fn a_js_script_reads_optional_chains_and_coalescing_and_a_jsx_script_does_not() let _ = std::fs::remove_dir_all(&dir); } +#[test] +fn every_script_reads_e4x_and_has_the_xml_objects() { + let dir = fresh_folder("e4x"); + let write = |name: &str, text: &str| { + let p = dir.join(name); + std::fs::write(&p, text).unwrap(); + p.to_string_lossy().into_owned() + }; + let mut s = two_docs(); + let path = |p: &str| json!({"path": p}); + // Script text: literals, selectors, for each and the four constructors. + let text = "var x = 12;\n\ + vc.log(x.item.length() + ' ' + x.item.(@id == 'b').toString() + ' ' + x..item[0].@id);\n\ + var sum = 0; for each (var i in x.item) sum += Number(i); vc.log(sum);\n\ + vc.log(new XML('').b.length() + new XMLList('').length());\n\ + vc.log(new Namespace('p', 'urn:p').prefix + ' ' + new QName('urn:q', 'n').localName + ' ' + isXMLName('ok'));\n\ + vc.log(typeof setDefaultXMLNamespace + ' ' + (1 < 2));\n"; + let r = run(&mut s, text).unwrap(); + assert_eq!(r["log"], json!(["2 2 a", 3, 3, "p n true", "function true"]), "{r}"); + // A .js file, a file it includes, eval, Function and $.evalFile read XML as well. + write("lib.jsxinc", "var fromLib = .@n.toString();\n"); + write("more.jsx", "{fromLib}.toString();\n"); + let modern = "#include \"lib.jsxinc\"\nlet tag = {fromLib};\nvc.log(tag.toString());\n\ + vc.log(eval('5').toString());\nvc.log(new Function('return 6.toString()')());\n\ + vc.log($.evalFile(File($.fileName).parent + '/more.jsx'));\n"; + let r = s.execute("script.run", &path(&write("modern.js", modern))).unwrap(); + assert_eq!(r["log"], json!(["7", "5", "6", "7"]), "{r}"); + // A named engine first made by a .js run gives a later .jsx run the XML objects too. + s.execute("script.run", &path(&write("first.js", "#targetengine xmlkept\nlet k = 1;"))).unwrap(); + let later = s.execute("script.run", &path(&write("second.jsx", "#targetengine xmlkept\nvc.log(XML('2').toString());"))).unwrap(); + assert_eq!(later["log"], json!(["2"]), "{later}"); + let _ = std::fs::remove_dir_all(&dir); +} + /// A new empty folder for test `name`. fn fresh_folder(name: &str) -> std::path::PathBuf { let dir = std::env::temp_dir().join(format!("vc-script-run-{name}-{}", std::process::id())); diff --git a/crates/engine/tests/it/script_host_vs_scriptcheck.rs b/crates/engine/tests/it/script_host_vs_scriptcheck.rs index 60239864d7..2ec927bd48 100644 --- a/crates/engine/tests/it/script_host_vs_scriptcheck.rs +++ b/crates/engine/tests/it/script_host_vs_scriptcheck.rs @@ -2,8 +2,8 @@ //! the tables below, and each name that reaches outside the document has the `outside` id //! `script.check` (`vectorcraft-scriptcheck`) gives it. The names are read from a run: the own //! properties of the global object, of each object or function it holds and of each function's -//! `prototype`, with a setter listed again as `name=`. The names a plain `vectorcraft_js::Realm` also -//! has are the language's, which reach files and other apps only through the host; `eval` and +//! `prototype`, with a setter listed again as `name=`. The names a plain `vectorcraft_js::Realm` with +//! E4X also has are the language's, which reach files and other apps only through the host; `eval` and //! `Function` still have rows, since they run code the checker can't read. A name the host adds //! without a row fails the test. @@ -11,7 +11,7 @@ use std::collections::BTreeSet; use serde_json::json; use vectorcraft_engine::Session; -use vectorcraft_js::{DirectiveName, JsValue, Realm}; +use vectorcraft_js::{DirectiveName, JsValue, Options, Realm}; use vectorcraft_scriptcheck::{Limits, check}; /// The names that reach outside the document: each with a script that uses it and the `outside` id @@ -110,9 +110,9 @@ fn host_names() -> BTreeSet { text.lines().map(str::to_string).collect() } -/// The names a plain JavaScript engine has. +/// The names a plain JavaScript engine with E4X has. fn language_names() -> BTreeSet { - match Realm::new().run(LIST) { + match Realm::with_options(Options { e4x: true, ..Options::default() }, vectorcraft_js::Limits::default()).run(LIST) { Ok(JsValue::String(text)) => text.lines().map(str::to_string).collect(), other => panic!("no list: {other:?}"), } diff --git a/crates/scriptcheck/src/catalog.rs b/crates/scriptcheck/src/catalog.rs index 82fd61084b..dc4249b6a6 100644 --- a/crates/scriptcheck/src/catalog.rs +++ b/crates/scriptcheck/src/catalog.rs @@ -164,7 +164,7 @@ features! { DollarEnv "dollar.env" Files, DollarEvalFile "dollar.evalFile" Files, DynamicCode "dynamicCode" Language, - E4x "e4x" HostOnly, + E4x "e4x" Language, ExternalObject "externalObject" HostOnly, FileDialog "file.dialog" Files, FileExecute "file.execute" Files, @@ -186,6 +186,6 @@ features! { SelectTool "selectTool" HostOnly, Socket "socket" HostOnly, UnitValue "unitValue" Language, - Xml "xml" HostOnly, + Xml "xml" Language, Xmp "xmp" HostOnly, } diff --git a/crates/scriptcheck/src/lib.rs b/crates/scriptcheck/src/lib.rs index 2bd8c60fba..e74d299aaa 100644 --- a/crates/scriptcheck/src/lib.rs +++ b/crates/scriptcheck/src/lib.rs @@ -109,7 +109,8 @@ impl Kind { /// A kind of help a script needs from the app that runs it. #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum Need { - /// The script language's own objects and directives (`$`, `alert`, `UnitValue`, `#target`). + /// The script language's own objects, syntax and directives (`$`, `alert`, `UnitValue`, E4X + /// with the `XML` object, `#target`). Language, /// The reference app's document model (`app.activeDocument…`). Dom, @@ -120,7 +121,7 @@ pub enum Need { /// Dialogs and windows of its own. Dialogs, /// Features only the reference app has (palettes, messages to other apps, network - /// connections, native code, E4X, actions). + /// connections, native code, actions). HostOnly, } diff --git a/crates/scriptcheck/src/tests.rs b/crates/scriptcheck/src/tests.rs index fec22ed62d..45f5d02d02 100644 --- a/crates/scriptcheck/src/tests.rs +++ b/crates/scriptcheck/src/tests.rs @@ -1550,6 +1550,13 @@ fn application_methods_are_features_not_members() { assert_eq!(r.needs, [Need::MenuCommands, Need::HostOnly]); } +#[test] +fn e4x_and_the_xml_object_need_only_the_language() { + let r = report("var x = ;\nvar y = new XML(s);\nfor each (var v in x.b) {}\n"); + assert!(feature(&r, "e4x").is_some() && feature(&r, "xml").is_some()); + assert_eq!(r.needs, [Need::Language]); +} + #[test] fn type_names_compared_or_created_are_listed() { let r = report(concat!( diff --git a/docs/mcp.md b/docs/mcp.md index 68355c78f6..c6b49db93d 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2561,11 +2561,11 @@ script, and it does not change the document or the preferences. The reply's `kin top-level `import` or `export`, such as a React `.jsx` file), `notText` (a NUL byte, or more than one byte in ten a control character, in the first 8 KiB) or `tooLarge` (over 8 MiB). For a script, the reply holds these lists: -- `needs` lists what the script needs from the app that runs it: `language` (the script language's own objects - and directives, such as `$`, `alert`, `UnitValue`, `#target` and `#targetengine`), `dom` (the reference app's - document model), `files`, `menuCommands`, `dialogs`, and `hostOnly` (features only the reference app has: - palettes, BridgeTalk, sockets, native code, XMP, the XML object and E4X, operator overloading, reflection, actions - and `selectTool`). +- `needs` lists what the script needs from the app that runs it: `language` (the script language's own objects, + syntax and directives, such as `$`, `alert`, `UnitValue`, the XML object and E4X, `#target` and `#targetengine`), + `dom` (the reference app's document model), `files`, `menuCommands`, `dialogs`, and `hostOnly` (features only the + reference app has: palettes, BridgeTalk, sockets, native code, XMP, operator overloading, reflection, actions and + `selectTool`). - `directives` lists the `#include`, `#includepath`, `#script`, `#strict`, `#target` and `#targetengine` lines, and `targets` splits each `#target` line's application specifier into `app`, `instance`, `version` and `locale`. A directive is read where it starts a line, written `#name` or `//@name`. @@ -2656,7 +2656,12 @@ also reads two ECMAScript 2020 forms (https://262.ecma-international.org/11.0/): `f?.(args)`), which give `undefined` and skip the rest of the chain when the value before `?.` is `undefined` or `null`, and `??`, which evaluates its right side only when its left side is `undefined` or `null`. Mixing `??` with `&&` or `||` without parentheses, and assigning to an optional chain, are syntax errors. In a `.jsx` file and a `source` -string, `?.` and `??` are syntax errors. Which files read these forms is VectorCraft's own rule. The script reaches the +string, `?.` and `??` are syntax errors. Which files read these forms is VectorCraft's own rule. Every script, `.js`, +`.jsx` or `source`, also reads ECMAScript for XML (E4X, ECMA-357, 2nd edition, +https://ecma-international.org/publications-and-standards/standards/ecma-357/): XML and XMLList literals, the `..`, +`.@`, `.*`, `.()` and `::` selectors, `for each`, `default xml namespace`, and the global `XML`, `XMLList`, +`Namespace`, `QName`, `isXMLName` and `setDefaultXMLNamespace`, as the XML object pages describe them +(https://extendscript.docsforadobe.dev/integrating-xml/the-xml-object/). The script reaches the app through the global object `vc`, and writes to the Script Console and runs other files through `$`: - `vc.run(id, params)` runs a command and returns its result. A command that fails throws an error the script can diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index d40a4216cd..7913b5bf43 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1098,6 +1098,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - `vectorcraft-js` runs ECMAScript for XML (ECMA-357, 2nd edition, https://ecma-international.org/publications-and-standards/standards/ecma-357/) when `Options::e4x` is set, which it is not by default: XML and XMLList literals with embedded `{}` expressions, the `..`, `.@`, `.*`, `.()` and `::` selectors, assignment and `delete` on selected nodes, `for each`, `default xml namespace`, and the `XML`, `XMLList`, `Namespace` and `QName` objects with their methods and settings. `xml.xpath(expression[, variables])` evaluates an XPath 1.0 expression (https://www.w3.org/TR/1999/REC-xpath-19991116/) with all 13 axes and the 27 core functions, and returns the selected nodes as an XMLList in document order without repeats. Each property of `variables` binds the variable of its name, an XMLList runs the expression on each of its elements in turn, and a prefix in a name test resolves through the context element's in-scope namespaces. An expression that breaks the grammar gives a `SyntaxError`; an unknown function, a wrong argument count, an unbound prefix or variable, and a result that is not a node-set or that holds the root or a namespace node give a `TypeError`. `id()` selects nothing, and evaluation uses no native stack, takes fuel and counts against the heap limit. `` in an XML string gives a `SyntaxError`. An XML declaration at the start of an XML string, after optional white space, is checked against XML 1.0's grammar (https://www.w3.org/TR/xml/#NT-XMLDecl): a version of `1.` and digits, then an optional encoding name and an optional standalone `yes` or `no`, in that order; any other declaration, or one with a character XML does not allow, gives a `SyntaxError`. The parser takes fuel for the length of every name, white space run and declaration it scans, and for the text it searched when a quote, CDATA section, comment or processing instruction is not closed. Parsing, serializing, comparing and copying trees use no native stack, and each takes fuel and counts against the heap limit. Inserting a node into itself or its descendants throws a `TypeError` before the tree changes, a literal or XML string nested past `Options::max_depth` gives a `SyntaxError`, and a tree built past that depth stops at the heap limit. Tests: `crates/js/src/xml_tests.rs`. - Scripts: `inScopeNamespaces()`, `namespace()`, `namespaceDeclarations()`, the XPath `namespace` axis, prefixes in an XPath expression and the qualified names `name()` gives count the namespaces they collect from a node and its ancestors against the heap limit, so a node with many namespaces in scope stops the script at the heap limit instead of growing past it. `addNamespace()`, `setNamespace()`, `setName()` and `removeNamespace()` read an element's attributes in place instead of copying them, and `removeNamespace()` counts its walk of the tree; `child()` by index, `comments()`, `text()`, `elements()`, `processingInstructions()` and `normalize()` on an XMLList count their copy of its items; `replace()` counts its copy of the children it matched; and `name()` counts the prefixed name it builds. The `XML`, `XMLList`, `Namespace` and `QName` constructors, `isXMLName()`, `attribute()`, `namespace()`, `propertyIsEnumerable()`, `setName()`, `setLocalName()`, `addNamespace()`, `removeNamespace()` and `setNamespace()` count the copy they make when they flatten a long string argument, and `QName.prototype.toString()` counts its result before it builds it. Tests: `crates/js/src/xml_tests.rs`. - Scripts: assigning to a named child of an XML element (`x.b = v`) counts its list of the matching children against the heap limit, and assigning through an empty XMLList counts the chain of targets it climbs, so an assignment that would not fit stops before the tree changes. `copy()`, `toXMLString()`, `normalize()`, the `..` selector and inserting a node count the stack they keep for each open level of the tree, `copy()` and `toXMLString()` read an element's attributes in place instead of copying the list, `toXMLString()` also reads its namespace declarations in place, and `copy()` counts the declarations it copies before it copies them. `toXMLString()` counts the flat copy it makes of text or an attribute value built by joining strings. Deleting children or attributes by name, and assigning an attribute, remove the nodes in place instead of building a second list. `toXMLString()` counts the set of prefixes it passes looking up a namespace, and picks a new `ns` prefix in one pass over the declarations in scope. Inserting an XMLList, and assigning one to an item of an XMLList, count their copy of the list's items. Parsing counts the open elements, the text it gathers, each tag's attributes and the sets that check them, and the namespace declarations it makes. Comparing XML values, converting them to strings, and reading a name, a namespace or embedded text from a string built by joining strings count the flat copy they make; an attribute name read from a string counts its copy. Tests: `crates/js/src/xml_tests.rs`. + - Scripts: `script.run` and File › Scripts run every script with E4X on, `.js` and `.jsx` files, `#include` files, `$.evalFile`, `eval` and `Function` alike, so XML literals and the global `XML`, `XMLList`, `Namespace`, `QName`, `isXMLName` and `setDefaultXMLNamespace` work as the XML object pages describe them (https://extendscript.docsforadobe.dev/integrating-xml/the-xml-object/). `script.check` lists the `e4x` and `xml` features under the `language` need instead of `hostOnly`. Tests: `crates/engine/src/tests/script_run.rs`, `crates/scriptcheck/src/tests.rs`. - **UI:** Illustrator 2026 layout restyled to measured values: - Medium Dark theme, categorized and Advanced toolbars (a tool group's flyout opens on a right press, a long press or a press on its corner triangle), 35 pt document tabs, 33 pt panel tabs. - Hint bar, contextual task bar, 19 dock panels with ≡ menus. From 382e40dce142b4d52019e5ec73e9f37eee228da1 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 25 Nov 2026 04:30:56 -0800 Subject: [PATCH 24/32] JavaScript: spread tests follow the iterator protocol Since #9138, spread steps the array's iterator, so spreading a long array ends at the fuel limit instead of an early RangeError. Three tests in es2015_tests.rs still expected the by-index RangeError and failed: - an_index_setter_without_a_getter_does_not_delay_the_spread_s_check - a_prototype_getter_behind_an_own_element_does_not_delay_the_spread_s_check - looking_for_index_getters_takes_fuel_for_each_property The setter and prototype-getter tests now check the fuel limit and that the setter or getter did not run. The test of the index-getter scan, which #9138 removed, is deleted. docs/target-app-parity.md had two ES2015 entries after #9138. The by-index entry is removed; the entry that describes iterator spread stays. --- crates/js/src/es2015_tests.rs | 38 ++++++++++++++--------------------- docs/target-app-parity.md | 1 - 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/crates/js/src/es2015_tests.rs b/crates/js/src/es2015_tests.rs index 77d28df820..c6b237aaca 100644 --- a/crates/js/src/es2015_tests.rs +++ b/crates/js/src/es2015_tests.rs @@ -613,26 +613,32 @@ fn an_array_s_spread_is_checked_against_the_elements_it_reads() { } #[test] -fn an_index_setter_without_a_getter_does_not_delay_the_spread_s_check() { - // A setter does not run when the elements are read, so the array is still checked when - // spread begins, on its own and on its prototype. +fn an_index_setter_without_a_getter_does_not_run_when_the_array_is_spread() { + // The iterator reads the element and the new array defines its own, so a setter on the array + // or on its prototype does not run, and the long array ends at the fuel limit. for setter in ["a", "Array.prototype"] { let mut realm = Realm::with_options(es_options(), Limits { fuel: 10_000, ..Limits::default() }); - let src = format!("var a = []; a.length = 4294967295; Object.defineProperty({setter}, 0, {{ set: function () {{}} }}); [...a]"); + let src = format!( + "var ran = false; var a = []; a.length = 4294967295; Object.defineProperty({setter}, 0, {{ set: function () {{ ran = true; }} }}); [...a]" + ); let long = realm.run(&src); - assert!(is_thrown(&long, "RangeError"), "{setter}: {long:?}"); + assert!(matches!(&long, Err(e) if e.kind == RunErrorKind::Limit(LimitKind::Fuel)), "{setter}: {long:?}"); + realm.set_limits(Limits::default()); + assert_eq!(realm.run("ran"), Ok(JsValue::Bool(false)), "{setter}"); } } #[test] -fn a_prototype_getter_behind_an_own_element_does_not_delay_the_spread_s_check() { - // The array's own element 0 is read instead of the getter on its prototype, so no getter can - // shrink it, and it is checked when spread begins. +fn a_prototype_getter_behind_an_own_element_is_not_read_by_the_spread() { + // The array's own element 0 is read instead of the getter on its prototype, so the getter does + // not shrink it, and the long array ends at the fuel limit. let mut realm = Realm::with_options(es_options(), Limits { fuel: 10_000, ..Limits::default() }); let src = "var a = [7]; Object.defineProperty(Array.prototype, 0, { get: function () { a.length = 1; return 0; } }); \ a.length = 4294967295; [...a]"; let long = realm.run(src); - assert!(is_thrown(&long, "RangeError"), "{long:?}"); + assert!(matches!(&long, Err(e) if e.kind == RunErrorKind::Limit(LimitKind::Fuel)), "{long:?}"); + realm.set_limits(Limits::default()); + assert_eq!(realm.run("a.length"), Ok(JsValue::Number(4294967295.0))); // A getter on the prototype with no own element in front of it is read, and shrinks the array. let shrink = "var a = []; a.length = 4294967295; \ Object.defineProperty(Array.prototype, 0, { get: function () { a.length = 1; return 7; } }); \ @@ -640,20 +646,6 @@ fn a_prototype_getter_behind_an_own_element_does_not_delay_the_spread_s_check() truth(shrink); } -#[test] -fn looking_for_index_getters_takes_fuel_for_each_property() { - // Each attempt to spread the long array looks at every one of its 10,000 elements, so each - // takes at least that much fuel. - let fuel = 10_000_000; - let mut realm = Realm::with_options(es_options(), Limits { fuel, ..Limits::default() }); - let setup = "var a = []; for (var i = 0; i < 10000; i++) a[i] = i; a.length = 4294967295; 0"; - assert_eq!(realm.run(setup), Ok(JsValue::Number(0.0))); - let attempt = "var ok = false; try { [...a]; } catch (e) { ok = e instanceof RangeError; } ok"; - assert_eq!(realm.run(attempt), Ok(JsValue::Bool(true))); - let used = fuel - realm.interp().fuel; - assert!(used >= 10_000, "{used}"); -} - #[test] fn spread_counts_each_index_name_against_the_heap() { // The elements' properties, with their index names and a string's characters, fit in the diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 941e67ace9..70115604d1 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1088,7 +1088,6 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - `vectorcraft-js` parses JavaScript as ECMAScript 5.1 defines it, with the legacy octal forms, block functions and lenient regular expressions of Annex B, into a syntax tree with source spans. A comma may follow the last argument of a call or `new` expression and the last parameter of a function other than a setter, as ECMAScript 2017 allows (https://tc39.es/ecma262/2017/#sec-left-hand-side-expressions, https://tc39.es/ecma262/2017/#sec-function-definitions); `f(,)` and `f(1,,)` give a `SyntaxError`. It reads the `#target`, `#include` and other preprocessor lines as directives without running them, and a script that breaks the grammar or an early-error rule gives a `SyntaxError` with its line and column. Nesting past the parser's depth limit (`Options::max_depth`, 200 by default) gives a `SyntaxError` instead of exhausting the stack. `cargo xtask test262` fetches the conformance suite at a pinned commit and parses its ES5 tests: 5,411 of 5,418 runs pass (the 7 others use `let` and `const`). This entry covers parsing; the next entry covers running scripts. Tests: `crates/js/src/tests.rs`, `crates/engine/tests/it/js_lexer_vs_scriptcheck.rs`. - `vectorcraft-js` identifiers, written out or as `\uXXXX` and `\u{...}` escapes, take the characters Unicode's `ID_Start` and `ID_Continue` properties allow (https://www.unicode.org/reports/tr31/), plus `$` and, at the start, `_`, as later ECMAScript editions define them (https://tc39.es/ecma262/#sec-names-and-keywords). `Other_ID_Start` characters such as U+2118 and `Other_ID_Continue` characters such as U+00B7 and the zero width non-joiner and joiner are accepted, and no `Pattern_Syntax` or `Pattern_White_Space` character is. Letter categories come from Unicode 17.0, so U+088F starts an identifier and U+1ACF may follow its first character; characters assigned after Unicode 17.0 are not yet identifier characters. Tests: `crates/js/src/tests.rs` (`identifier_characters_are_unicode_17_id_start_and_id_continue`, which checks every code point, `identifiers_take_the_characters_unicode_17_assigned`, `identifiers_take_the_other_id_start_and_continue_characters`, `identifiers_refuse_pattern_syntax_surrogates_and_bad_escapes`, `no_pattern_syntax_or_white_space_character_is_an_identifier_character`). - `vectorcraft-js`'s `Realm` runs ECMAScript 5.1 scripts: the parsed script compiles to verified bytecode that a non-recursive interpreter runs, with closures, `this`, `arguments`, `with`, direct and indirect `eval`, `new Function`, `try`/`catch`/`finally`, labeled `break` and `continue`, and `for`-`in` in insertion order, over a mark-and-sweep heap, with the built-ins the next two entries list. Every run is bounded by fuel, heap bytes, frames, nested host calls and an interrupt flag (smaller defaults in the wasm build), and a run that reaches a limit stops with a limit error that `try` cannot catch. `cargo xtask test262` also runs the suite's ES5 language tests that need only the built-ins present: 4,280 of 4,286 runs pass (4 of the others expect the completion values of later editions, and 2 expect a configurable function `length`). The app does not call it yet. Tests: `crates/js/src/interp_tests.rs`, `crates/js/tests/test262.rs`. - - With `Options::es2015`, `vectorcraft-js` also reads and runs these ECMAScript 2015 forms (https://262.ecma-international.org/6.0/): `let` and `const` with block scope and their temporal dead zone (a read or write before the declaration runs throws a `ReferenceError`, and a write to a `const` throws a `TypeError` in any code), a new `let` binding for each iteration of a `for` or `for`-`in` loop, function declarations scoped to their block, arrow functions with the `this` and `arguments` of the code around them and no `prototype`, template literals and tagged templates with one frozen strings object for each site, default and rest parameters with an `arguments` object that does not follow the parameters, and spread in array literals, calls and `new`. Spread reads arrays by index, reading the length again before each element, strings and `String` objects by code point, and objects with a `length` property by index, and throws a `TypeError` for any other value; that rule is VectorCraft's own until iterators are added. Spread and template objects take fuel for each element and count against the heap limit, and nested arrows and templates count against `Options::max_depth`. `script.run` sets the option for a `.js` file, and `eval`, `Function`, `#include` files and `$.evalFile` read code the way the script does; a `.jsx` file and a `source` string stay ES5.1. Destructuring, `for`-`of`, classes, generators and modules are still syntax errors. `cargo xtask test262` reads the suite's tests of these forms without and with the option: 390 of 390 negative parse runs and 533 of 708 other runs pass with it (373 and 27 without it). Of the 175 failing runs, 151 do not parse because the tests also use forms this list leaves out (classes, method definitions, destructuring, `for`-`of`, trailing commas in parameter lists, and a later edition's rule for escapes in tagged templates), and 24 expect function `name` properties, a configurable function `length` and the `caller` and `arguments` restrictions, ECMAScript 2015 rules that `vectorcraft-js` does not implement. Tests: `crates/js/src/es2015_tests.rs`, `crates/js/tests/test262.rs`, `crates/engine/src/tests/script_run.rs`. - With `Options::es2015`, `vectorcraft-js` also reads and runs these ECMAScript 2015 forms (https://262.ecma-international.org/6.0/): `let` and `const` with block scope and their temporal dead zone (a read or write before the declaration runs throws a `ReferenceError`, and a write to a `const` throws a `TypeError` in any code), a new `let` binding for each iteration of a `for` or `for`-`in` loop, function declarations scoped to their block, arrow functions with the `this` and `arguments` of the code around them and no `prototype`, template literals and tagged templates with one frozen strings object for each site, default and rest parameters with an `arguments` object that does not follow the parameters, and spread in array literals, calls and `new`. Spread uses the iterator protocol (see the `for`-`of` line below). Spread and template objects take fuel for each element and count against the heap limit, and nested arrows and templates count against `Options::max_depth`. `script.run` sets the option for a `.js` file, and `eval`, `Function`, `#include` files and `$.evalFile` read code the way the script does; a `.jsx` file and a `source` string stay ES5.1. Classes, generators and modules are still syntax errors. `cargo xtask test262` reads the suite's tests of these forms without and with the option: when these forms were added, 390 of 390 negative parse runs and 565 of 589 other runs passed with it (373 and 27 without it), and the 24 failing runs expected function `name` properties, a configurable function `length` and the `caller` and `arguments` restrictions. The object-literal line below adds function names and configurable lengths; the `caller` and `arguments` restrictions are still not implemented. Tests: `crates/js/src/es2015_tests.rs`, `crates/js/tests/test262.rs`, `crates/engine/src/tests/script_run.rs`. - `Options::es2015` also reads and runs two ECMAScript 2020 forms (https://262.ecma-international.org/11.0/): optional chains (`a?.b`, `a?.[key]`, `f?.(args)` and the accesses and calls after them), which evaluate their base once and give `undefined` without evaluating the rest of the chain when a value before `?.` is `undefined` or `null`, keep the object as `this` for `a?.b()` and `a.b?.()`, make `eval?.(code)` an indirect eval and make `delete a?.b` true when `a` is `undefined` or `null`; and `??`, which keeps any left side other than `undefined` and `null`. `?.` before a digit reads as `?` and a number (`a?.5:1`). Mixing `??` with `&&` or `||` without parentheses, assigning to or updating an optional chain, a tagged template after one and `new a?.b()` are syntax errors. A skipped part of a chain takes no fuel, and a chain of any length compiles without recursion. Using the ECMAScript 2015 option for them, so `.js` files read them and `.jsx` files and `source` strings do not, is VectorCraft's own rule. With the suite's `expressions/optional-chaining` and `expressions/coalesce` tests that need only the forms above, `cargo xtask test262` reads 426 of 426 negative parse runs and 591 of 782 other runs as passing with the option (409 and 27 without it). Of the 191 failing runs, 175 are those the entry above names, and 16 do not parse because the tests also use method definitions, classes, `for`-`of` or `new.target`. Tests: `crates/js/src/es2020_tests.rs`, `crates/js/tests/test262.rs`. - `vectorcraft-js` provides the ECMAScript 5.1 built-ins `Object` with its property-descriptor functions, `create`, `keys`, `seal` and `freeze` (section 15.2), `Function.prototype.bind` (15.3.4.5), `Array` with every ES5 method (15.4), the error types (15.11), `Math` (15.8), `JSON` with revivers, replacers and indentation (15.12), and the global functions with Annex B's `escape` and `unescape` (15.1, B.2). The array methods work on array-like objects. A method visits only the indices that exist when its range is longer than 4,096 indices and more than 8 times the properties on the object and its prototypes, so `new Array(4294967295).join("")` ends at once; a shorter range is visited index by index, holes included, and each index takes fuel. `join` writes a cycle back to an array as an empty string, `JSON.stringify` throws a `TypeError` on a cycle, and deep `JSON` nesting uses no native stack. Every loop takes fuel and every result is checked against the heap limit. `cargo xtask test262` runs the suite's ES5 built-in tests that need only these built-ins: 6,798 of 6,866 runs pass (the 34 failing tests expect rules of later editions). It also fetches the `json2.js` polyfill at a pinned commit and checks that its `stringify` and `parse` agree with the built-in `JSON`. Tests: `crates/js/src/builtins_tests.rs`, `crates/js/tests/test262.rs`, `crates/js/tests/json2.rs`. From 2ffccc3e90d93f18aa4e0ad8aac6a80e0f5b7aff Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 25 Nov 2026 06:07:34 -0800 Subject: [PATCH 25/32] SVG export: feet, yards, meters, Q and Ha documents keep their printed size Since #8610, a document in millimeters, centimeters, inches or picas is exported with that unit on the root width and height. A document in feet, feet and inches, yards, meters, Q or Ha still got unitless point values, which SVG readers take as CSS pixels at 96 per inch, so the art opened at 75% of its size. These units have no SVG unit identifier, so the export now writes feet and yards in inches, meters in centimeters, and Q and Ha in millimeters. The viewBox stays in points, and VectorCraft reads the file back at the same size. --- crates/doc/src/units.rs | 12 ++++++++++++ crates/svg/src/export.rs | 6 +++--- crates/svg/tests/it/import_units.rs | 25 +++++++++++++++++++++++++ docs/gaps.md | 2 +- 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/crates/doc/src/units.rs b/crates/doc/src/units.rs index 728c8aa816..f65fa1fd10 100644 --- a/crates/doc/src/units.rs +++ b/crates/doc/src/units.rs @@ -96,6 +96,18 @@ impl Unit { _ => None, } } + /// The SVG length unit an export writes this unit's sizes in: the unit itself when SVG has it, + /// else an SVG unit of the same kind (inches for feet and yards, centimeters for meters, + /// millimeters for Q and Ha). `None` for points and pixels. + pub fn svg_unit(self) -> Option { + match self { + Unit::Millimeters | Unit::Centimeters | Unit::Inches | Unit::Picas => Some(self), + Unit::FeetInches | Unit::Feet | Unit::Yards => Some(Unit::Inches), + Unit::Meters => Some(Unit::Centimeters), + Unit::Q | Unit::Ha => Some(Unit::Millimeters), + Unit::Points | Unit::Pixels => None, + } + } pub const fn label(self) -> &'static str { match self { Unit::Points => "Points", diff --git a/crates/svg/src/export.rs b/crates/svg/src/export.rs index 84b2efa32b..e0f5540b7d 100644 --- a/crates/svg/src/export.rs +++ b/crates/svg/src/export.rs @@ -195,9 +195,9 @@ fn write(doc: &Document, opts: &ExportOptions, native: Option<&[u8]>, id_prefix: root = root.attr("version", "1.2").attr("baseProfile", "tiny"); } if !opts.responsive { - if let Some(suffix) = doc.units.svg_suffix() { - let w_val = physical_num(doc.units.from_pt(rect.width())); - let h_val = physical_num(doc.units.from_pt(rect.height())); + if let Some((unit, suffix)) = doc.units.svg_unit().and_then(|u| Some((u, u.svg_suffix()?))) { + let w_val = physical_num(unit.from_pt(rect.width())); + let h_val = physical_num(unit.from_pt(rect.height())); root = root.attr("width", format_args!("{w_val}{suffix}")).attr("height", format_args!("{h_val}{suffix}")); } else { root = root.attr("width", &ww).attr("height", &hh); diff --git a/crates/svg/tests/it/import_units.rs b/crates/svg/tests/it/import_units.rs index 0140741aeb..91138d8a93 100644 --- a/crates/svg/tests/it/import_units.rs +++ b/crates/svg/tests/it/import_units.rs @@ -192,3 +192,28 @@ fn export_physical_units_writes_unit_suffixes() { let back = import(&s).unwrap(); assert_eq!(back.units, Unit::Millimeters); } + +/// The `width` of `svg`'s root as a length in points, read by the SVG and CSS absolute units +/// (96 px per inch). `None` when it has no unit an SVG reader takes as physical. +fn root_width_in_points(svg: &str) -> Option { + let start = svg.find("().ok().map(|v| v * points_per_unit) +} + +#[test] +fn every_physical_document_unit_exports_its_printed_size() { + // 100 inches by 50: feet, yards, meters, Q and Ha have no SVG unit of their own. + for unit in [Unit::Feet, Unit::FeetInches, Unit::Yards, Unit::Meters, Unit::Q, Unit::Ha, Unit::Inches, Unit::Millimeters] { + let mut d = Document::new(7200.0, 3600.0); + d.units = unit; + let s = export(&d, &ExportOptions::default()); + let width = root_width_in_points(&s).unwrap_or_else(|| panic!("{unit:?}: no physical width in {s}")); + assert!((width - 7200.0).abs() < 0.01, "{unit:?}: {width} pt in {s}"); + let back = import(&s).unwrap(); + assert!(close_rect(back.artboards[0].rect, d.artboards[0].rect), "{unit:?}: {:?}", back.artboards[0].rect); + } +} diff --git a/docs/gaps.md b/docs/gaps.md index b502f9e146..0dcd5ac37b 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -442,7 +442,7 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi such stubs into one vertex (within 4× the sweep's tolerance up and down its frame and 1/16 of the 0.01 pt precision along it, bounded by each cluster's extent so a run of tiny level segments keeps its length); regression tests in `crates/pathops/src/planar.rs`. Estimate unchanged. -- **Done (#864):** SVG export writes physical unit suffixes on the root `` for documents with physical units (`mm`, `cm`, `in`, `pc`), so external vector tools (Inkscape, LightBurn) and browsers render drawings at their intended physical scale rather than scaling to 75% under point-based user-unit assumptions; unitless user coordinates in `viewBox` and path geometry remain in 1:1 internal points per SVG 1.1 coords §7.10, preserving document units on round trips (`export_physical_units_writes_unit_suffixes`, `svg_round_trip_preserves_document_units`). General document unit preferences across restarts remain tracked under #864. +- **Done (#864):** SVG export writes physical unit suffixes on the root `` for documents with physical units (`mm`, `cm`, `in`, `pc`; documents in feet and yards are written in `in`, in meters in `cm`, and in Q or Ha in `mm`, since SVG has no unit for them: `every_physical_document_unit_exports_its_printed_size`), so external vector tools (Inkscape, LightBurn) and browsers render drawings at their intended physical scale rather than scaling to 75% under point-based user-unit assumptions; unitless user coordinates in `viewBox` and path geometry remain in 1:1 internal points per SVG 1.1 coords §7.10, preserving document units on round trips (`export_physical_units_writes_unit_suffixes`, `svg_round_trip_preserves_document_units`). General document unit preferences across restarts remain tracked under #864. - **Missing:** general document unit preference on restart (#864; SVG export physical units done). Shape Builder regions (#937, closed), PDF text placement (#722, above), the bezier drag preview (#834, #3065, #3729) and deleting an interior anchor of an open path (above) are done. From 2b075e5a9ac7ee45cfd0464b9b1f3894f2cc118f Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 25 Nov 2026 07:49:18 -0800 Subject: [PATCH 26/32] Panels: rows wrap in a panel at its narrowest width At the narrowest panel width (220 pt), rows of side-by-side controls ran past the panel's edge in Stroke (the Profile list and the two flip buttons), Attributes (Fill Rule, Image Map with Browser, and the URL field after them), Variables (the footer's buttons), Properties (the Align buttons and More Align options), Magic Wand (Tolerance, in French) and Document Info (a label and its value, in German). These rows now wrap onto a new line when the panel is too narrow for them, as the Arrowheads row already does. A wider panel keeps each row on one line. The tests float each panel at the narrowest width in the whole window and check that the named controls stay inside it, and that the Stroke panel's Profile row stays on one line at 360 pt. --- crates/ui-egui/src/panels/align.rs | 2 +- crates/ui-egui/src/panels/attributes.rs | 4 +- crates/ui-egui/src/panels/doc_info.rs | 2 +- crates/ui-egui/src/panels/magic_wand.rs | 2 +- crates/ui-egui/src/panels/properties.rs | 2 +- crates/ui-egui/src/panels/stroke.rs | 2 +- crates/ui-egui/src/panels/tests_panel_rows.rs | 96 +++++++++++++++++++ crates/ui-egui/src/panels/variables.rs | 2 +- 8 files changed, 104 insertions(+), 8 deletions(-) diff --git a/crates/ui-egui/src/panels/align.rs b/crates/ui-egui/src/panels/align.rs index 9b8d94a31b..300cd6a13d 100644 --- a/crates/ui-egui/src/panels/align.rs +++ b/crates/ui-egui/src/panels/align.rs @@ -306,7 +306,7 @@ fn bar_items(buttons: impl Iterator) -> BarItems { /// Align panel's Align To says (the key object while there is one), as its own buttons do (#789), /// and the selected artboards with the Artboard tool chosen. pub(crate) fn align_buttons(_app: &mut VectorcraftApp, ui: &mut Ui) { - Row::new().show(ui, |ui, _| { + Row::new().wrap(true).show(ui, |ui, _| { for (icon, b) in align_icons() { command_button(ui, bar_glyph(b).unwrap_or(icon), b); } diff --git a/crates/ui-egui/src/panels/attributes.rs b/crates/ui-egui/src/panels/attributes.rs index 11fe0a02bf..516194a51b 100644 --- a/crates/ui-egui/src/panels/attributes.rs +++ b/crates/ui-egui/src/panels/attributes.rs @@ -154,7 +154,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { }); if !part_hidden(app, OPTIONS_KEY) { Divider::horizontal().show(ui); - Row::new().show(ui, |ui, _| { + Row::new().wrap(true).show(ui, |ui, _| { let center = [("dc-center-hide", tl!("Don't Show Center"), false), ("dc-center-show", tl!("Show Center"), true)]; acts.extend(pair(ui, tl!("Show Center"), has, info.show_center, center).map(|v| ("attributes.set", json!({ "showCenter": v })))); let dir = [("dc-dir-off", tl!("Reverse Path Direction Off"), false), ("dc-dir-on", tl!("Reverse Path Direction On"), true)]; @@ -170,7 +170,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { let maps = ImageMap::ALL.map(|m| Entry::new(m, m.label())); let name = side_name(tl!("Image Map:")); Field::new(name.clone()).show(ui, |ui, _| { - Row::new().show(ui, |ui, _| { + Row::new().wrap(true).show(ui, |ui, _| { let pick = Select::new(name.clone(), Bind::given(or_mixed(info.image_map)), &maps).enabled(has).show(ui); acts.extend(pick.events.committed().map(|m| ("attributes.set", json!({ "imageMap": m })))); let browser = Button::new(tl!("Browser")).enabled(url.is_some()).tooltip(tl!("Open the URL in the web browser")).show(ui); diff --git a/crates/ui-egui/src/panels/doc_info.rs b/crates/ui-egui/src/panels/doc_info.rs index e323f23620..88ee1d6f6f 100644 --- a/crates/ui-egui/src/panels/doc_info.rs +++ b/crates/ui-egui/src/panels/doc_info.rs @@ -33,7 +33,7 @@ pub struct DocInfoView { /// A `label: value` row. `label` is shown as given: translate an interface label first, a name /// stays as it is. pub(crate) fn row(ui: &mut Ui, label: &str, value: String) { - Row::new().fill_width().align(RowAlign::SpaceBetween).show(ui, |ui, _| { + Row::new().fill_width().align(RowAlign::SpaceBetween).wrap(true).show(ui, |ui, _| { Text::new(label.to_string()).shade(Shade::Muted).show(ui); // The value can be selected and copied (#8432). SelectableText::new(label.to_string(), &value).show(ui); diff --git a/crates/ui-egui/src/panels/magic_wand.rs b/crates/ui-egui/src/panels/magic_wand.rs index 3661a3480e..7a44811ed0 100644 --- a/crates/ui-egui/src/panels/magic_wand.rs +++ b/crates/ui-egui/src/panels/magic_wand.rs @@ -39,7 +39,7 @@ fn tolerance(o: &Value, key: &str) -> NumberField<'static> { /// checkbox is on. fn row(app: &mut VectorcraftApp, ui: &mut Ui, o: &Value, label: &'static str, flag: &str, tol: Option<(&str, &dyn Fn() -> NumberField<'static>)>) { let on = o[flag].as_bool().unwrap_or(false); - Row::new().fill_width().align(RowAlign::SpaceBetween).show(ui, |ui, _| { + Row::new().fill_width().align(RowAlign::SpaceBetween).wrap(true).show(ui, |ui, _| { if let Some(now) = Checkbox::new(Bind::given(on)).label(label).id_salt(flag).show(ui).value().copied() { app.run("magicWand.set", json!({ flag: now })).ok(); } diff --git a/crates/ui-egui/src/panels/properties.rs b/crates/ui-egui/src/panels/properties.rs index eaf171be66..3081b1a0c3 100644 --- a/crates/ui-egui/src/panels/properties.rs +++ b/crates/ui-egui/src/panels/properties.rs @@ -116,7 +116,7 @@ fn body(app: &mut VectorcraftApp, ui: &mut Ui, first: Option<&Node>, n_sel: usiz } appearance_section::appearance_section(app, ui); section(tl!("Align")).show(ui, |ui, _| { - Row::new().show(ui, |ui, _| { + Row::new().wrap(true).show(ui, |ui, _| { super::align::align_buttons(app, ui); // The rest (Distribute Objects, Distribute Spacing, Align To) is the Align panel's. more_options(ui, "align", tl!("More Align options")); diff --git a/crates/ui-egui/src/panels/stroke.rs b/crates/ui-egui/src/panels/stroke.rs index 6c752691f2..d7e9ebcc94 100644 --- a/crates/ui-egui/src/panels/stroke.rs +++ b/crates/ui-egui/src/panels/stroke.rs @@ -391,7 +391,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { arrow_rows(app, ui, st.as_ref()); ui.separator(); Field::new(tl!("Profile")).show(ui, |ui, _| { - Row::new().show(ui, |ui, _| { + Row::new().wrap(true).show(ui, |ui, _| { profile_select(app, ui); flip_buttons(app, ui, st.as_ref()); }); diff --git a/crates/ui-egui/src/panels/tests_panel_rows.rs b/crates/ui-egui/src/panels/tests_panel_rows.rs index 51a22a4d2b..e536facd0d 100644 --- a/crates/ui-egui/src/panels/tests_panel_rows.rs +++ b/crates/ui-egui/src/panels/tests_panel_rows.rs @@ -1,7 +1,10 @@ //! Headless frames of panel rows that the framework lays out: controls side by side stay inside the panel's width. +use serde_json::json; + use super::tests_appearance::app_with_rect; use super::*; +use crate::i18n::Lang; use crate::panel_docking::PANEL_MIN_WIDTH; use crate::tests::panel_harness::{Panel, ROOM}; @@ -27,6 +30,99 @@ fn the_color_themes_hex_row_stays_inside_a_narrow_panel() { } } +/// Panel `panel` floated `width` wide in the whole app window, drawn in `lang`: the rect of its body, and the rects of +/// the controls named each of `names` (catalog strings, shown in `lang`). +fn floated(panel: &str, lang: &str, width: f32, names: &[&str]) -> (egui::Rect, Vec<(String, Vec)>) { + use egui::accesskit::Role; + const AT: f32 = 520.0; + let mut app = app_with_rect(); + app.session.prefs.interface_language = lang.into(); + app.run("window.panel", json!({ "panel": panel })).unwrap(); + app.run("window.panel.float", json!({ "panel": panel, "x": AT, "y": 120, "width": width, "height": 700 })).unwrap(); + let ctx = crate::testing::ui_context(); + ctx.enable_accesskit(); + let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1440.0, 900.0)); + let mut nodes = Vec::new(); + for at in 1..=8 { + let input = egui::RawInput { time: Some(f64::from(at) * 0.1), screen_rect: Some(screen), ..Default::default() }; + let out = crate::testing::app_frame(&mut app, &ctx, input); + nodes = out.platform_output.accesskit_update.map_or_else(Vec::new, |update| update.nodes); + } + // The frames set the language from the preference; the names are looked up in it before English is put back. + let shown: Vec<&str> = names.iter().map(|name| crate::i18n::t(name)).collect(); + crate::i18n::set_current(Lang::EN); + let rect = |node: &egui::accesskit::Node| { + node.bounds().map(|b| egui::Rect::from_min_max(egui::pos2(b.x0 as f32, b.y0 as f32), egui::pos2(b.x1 as f32, b.y1 as f32))) + }; + // The floating panel's body: the tab panel at the left edge the float asked for. + let body = nodes + .iter() + .filter(|(_, n)| n.role() == Role::TabPanel) + .find_map(|(_, n)| rect(n).filter(|r| (r.left() - AT).abs() < 1.0)) + .unwrap_or_else(|| panic!("{panel} does not float at x {AT}")); + let controls = shown + .into_iter() + .map(|name| { + let found: Vec = nodes.iter().filter(|(_, n)| n.label().is_some_and(|l| l == name)).filter_map(|(_, n)| rect(n)).collect(); + assert!(!found.is_empty(), "{panel} shows no {name:?}"); + (name.to_owned(), found) + }) + .collect(); + (body, controls) +} + +/// The controls named `names` (catalog strings, shown in `lang`) that reach past either side of panel `panel`, +/// floated at the narrowest panel width in the whole app window, each with its rect. +fn past_a_narrow_panel(panel: &str, lang: &str, names: &[&str]) -> Vec { + let (body, controls) = floated(panel, lang, PANEL_MIN_WIDTH, names); + let outside = |r: &egui::Rect| r.left() < body.left() - 0.5 || r.right() > body.right() + 0.5; + controls.iter().flat_map(|(name, found)| found.iter().filter(|r| outside(r)).map(move |r| format!("{name} at {r:?}"))).collect() +} + +#[test] +fn the_profile_row_stays_on_one_line_in_a_wide_stroke_panel() { + let (_, controls) = floated("stroke", "en", 360.0, &["Profile", "Flip Along", "Flip Across"]); + // The field, its caption, the list and the two buttons share one line, so their middles are level. + let middles: Vec = controls.iter().flat_map(|(_, found)| found.iter().map(|r| r.center().y)).collect(); + assert!(middles.windows(2).all(|m| (m[0] - m[1]).abs() < 1.0), "{controls:?}"); +} + +#[test] +fn the_profile_row_wraps_in_a_narrow_stroke_panel() { + let past = past_a_narrow_panel("stroke", "en", &["Profile", "Flip Along", "Flip Across"]); + assert!(past.is_empty(), "past the panel: {past:?}"); +} + +#[test] +fn the_attributes_rows_wrap_in_a_narrow_panel() { + let past = past_a_narrow_panel("attributes", "en", &["Fill Rule", "Image Map", "Browser", "URL"]); + assert!(past.is_empty(), "past the panel: {past:?}"); +} + +#[test] +fn the_variables_footer_wraps_in_a_narrow_panel() { + let past = past_a_narrow_panel("variables", "en", &["Delete Variable", "Lock Variables"]); + assert!(past.is_empty(), "past the panel: {past:?}"); +} + +#[test] +fn the_align_row_wraps_in_a_narrow_properties_panel() { + let past = past_a_narrow_panel("properties", "en", &["Vertical Align Bottom", "More Align options"]); + assert!(past.is_empty(), "past the panel: {past:?}"); +} + +#[test] +fn the_document_info_rows_wrap_in_a_narrow_panel_in_german() { + let past = past_a_narrow_panel("docInfo", "de", &["Flattener Preset"]); + assert!(past.is_empty(), "past the panel: {past:?}"); +} + +#[test] +fn the_magic_wand_rows_wrap_in_a_narrow_panel_in_french() { + let past = past_a_narrow_panel("magicWand", "fr", &["Tolerance:"]); + assert!(past.is_empty(), "past the panel: {past:?}"); +} + #[test] fn the_color_wheel_box_and_its_strip_stay_inside_the_panel() { let mut app = app_with_rect(); diff --git a/crates/ui-egui/src/panels/variables.rs b/crates/ui-egui/src/panels/variables.rs index 56eb5988cf..3ff0fd0191 100644 --- a/crates/ui-egui/src/panels/variables.rs +++ b/crates/ui-egui/src/panels/variables.rs @@ -558,7 +558,7 @@ fn footer(ui: &mut Ui, states: &RowStates) -> Option<&'static str> { FooterBar::body().show(ui, |ui, _| { Stack::new().show(ui, |ui, _| { for row in FOOTER { - Row::new().show(ui, |ui, _| { + Row::new().wrap(true).show(ui, |ui, _| { for &(icon, id) in row { let name = title(id, states.locked); let button = IconButton::new(IconId::new(icon)).label(name).tooltip(name).enabled(states.enabled(id)); From 849bf0888c242756bb70f044c871419d0b0daac4 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 25 Nov 2026 08:06:56 -0800 Subject: [PATCH 27/32] Canvas: the anchor overlay groups selected anchors by path with one lookup per path canvas::selection::anchors added every selected path but the first to the overlay's PathSelection with PathSelection::also, which searches the list it is building for the same path. With n selected paths that is about n^2/2 key comparisons per rebuild of the marks. The anchors are now grouped by path with a hash map (by_key) and the result is assigned to `others` once. A path listed twice keeps its anchors together where it first appears, as `also` did. With 5,000 selected rectangles and Properties open (release test build, Linux x86_64), an idle frame went from 64.1 ms to 61.0 ms (mean of two runs). Test grouping_selected_anchors_by_path_compares_each_path_a_bounded_number_of_times counts the key comparisons for 2,001 entries; a per-entry search makes 1,999,197. --- crates/ui-egui/src/canvas/selection.rs | 28 +++++++++++++++--- crates/ui-egui/src/canvas/selection/tests.rs | 31 ++++++++++++++++++++ 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/canvas/selection.rs b/crates/ui-egui/src/canvas/selection.rs index 2018e50323..96be3fcc89 100644 --- a/crates/ui-egui/src/canvas/selection.rs +++ b/crates/ui-egui/src/canvas/selection.rs @@ -2,7 +2,8 @@ //! centre point, point type's origin, the key anchor). Each rule is a function of the app that returns what to draw; //! `show` hands the results to the framework's controls, which keep what they stroke between passes. -use std::collections::hash_map::DefaultHasher; +use std::collections::HashMap; +use std::collections::hash_map::{DefaultHasher, Entry}; use std::hash::{Hash, Hasher}; use craft::behavior::Input; @@ -316,13 +317,32 @@ pub(super) fn anchors(app: &VectorcraftApp, st: &DocState, tool: &str, tool_poin primary.and_then(|key| chosen.iter().find(|(k, _)| *k == key)).map(|(_, knots)| knots.clone()).unwrap_or_default(), segment.map(|(_, at)| at), ); - for (key, knots) in chosen.into_iter().filter(|(key, _)| Some(*key) != primary) { - selection = selection.also(key, knots); - } + selection.others = by_key(chosen.into_iter().filter(|(key, _)| Some(*key) != primary)); out.selection = selection; out } +/// `listed` with the lists of a repeated key joined, each key where it first appears: what +/// [`PathSelection::also`] makes of the entries added one at a time, found with one lookup per entry. +fn by_key(listed: impl IntoIterator)>) -> Vec<(K, Vec)> { + let mut at: HashMap = HashMap::new(); + let mut out: Vec<(K, Vec)> = Vec::new(); + for (key, items) in listed { + match at.entry(key) { + Entry::Occupied(seen) => { + if let Some((_, held)) = out.get_mut(*seen.get()) { + held.extend(items); + } + } + Entry::Vacant(new) => { + new.insert(out.len()); + out.push((key, items)); + } + } + } + out +} + /// The outline of the object under the pointer at document point `at`, at view `zoom`, for Smart Guides › Object /// Highlighting: the object a click of the selection tools would pick, unless the click keeps the selection (the /// object, or with the Selection tool selected art inside it, is selected) or the object has too many points. diff --git a/crates/ui-egui/src/canvas/selection/tests.rs b/crates/ui-egui/src/canvas/selection/tests.rs index fdca4b2a9e..4f5e469a63 100644 --- a/crates/ui-egui/src/canvas/selection/tests.rs +++ b/crates/ui-egui/src/canvas/selection/tests.rs @@ -558,3 +558,34 @@ fn an_empty_selection_has_no_marks() { let st = app.session.active().unwrap(); assert_eq!(dots(&app, st).centers.len() + dots(&app, st).origins.len(), 0); } + +/// A path key that counts the comparisons made with it. +#[derive(Clone, Copy, Debug)] +struct Counted<'a>(u64, &'a std::cell::Cell); + +impl PartialEq for Counted<'_> { + fn eq(&self, other: &Self) -> bool { + self.1.set(self.1.get() + 1); + self.0 == other.0 + } +} + +impl Eq for Counted<'_> {} + +impl Hash for Counted<'_> { + fn hash(&self, state: &mut H) { + self.0.hash(state); + } +} + +// Grouping the selected anchors of 2,000 paths compares each key a bounded number of times, not once per path listed +// before it, and joins a repeated path's anchors where the path first appears, as `PathSelection::also` does. +#[test] +fn grouping_selected_anchors_by_path_compares_each_path_a_bounded_number_of_times() { + let compared = std::cell::Cell::new(0); + let listed = (0..2000u64).map(|key| (Counted(key, &compared), vec![key])).chain([(Counted(5, &compared), vec![9])]); + let grouped = by_key(listed); + assert_eq!(grouped.iter().map(|(key, _)| key.0).collect::>(), (0..2000).collect::>()); + assert_eq!(grouped[5].1, vec![5, 9]); + assert!(compared.get() < 2 * 2001, "{} comparisons for 2,001 entries", compared.get()); +} From e4347f0d6f36eb09a2d830ea65149d3c8292d67f Mon Sep 17 00:00:00 2001 From: BFlat Date: Wed, 25 Nov 2026 23:23:47 +0700 Subject: [PATCH 28/32] Look: production's breathing room across VectorCraft (type size, menus, dialogs, Home, panels) and main's lib test fixes (#9292) * Theme: type at the size production draws it. Production set Inter at 92% of its nominal size, so its 13-point body, 12.5-point labels and 11.5-point captions read at 12, 11.5 and 10.5 points; SIZES took the nominal sizes, which drew every text about 8% larger than production on the same rows. Body and strong body 12, labels 11.5, captions 10.5, line heights kept. Dialog buttons at least 72 points wide, as production's. * Theme: menus and dialogs as production spaces them. 29-point menu rows (production's 24-point rows 5 points apart), dialogs 22 points inside their edge (production's dialog margin) and 28-point dialog buttons. Needs a craft-libs rev with size.row.menu, size.dialog.button_height and space.pad.dialog (fix/vc-look9-metrics): on an older rev SIZES does not parse. Land it after that rev move. * Home: production's rhythm through the framework's page sizes: 9 from title to subtitle, 27 to New and Open, which stand 28 high with 16 points beside their labels and 14 apart, 33 between sections, 15 under a heading, the community links in 24-point rows 5 apart and in the link colour alone (LinkLook::Plain on Home only); Learn's skills a heading gap apart, each title muted over its tutorials, which stand as tall as New and Open, as production's secondary buttons did * Swatches: thumbnails at production's sizes and the footer split as production The thumbnail views give the browser zooms of 1/4, 1/3 and 2/3 on the large thumbnail: 12, 16 and 32 point tiles, production's 11, 15.5 and 30. The library panels' saved view follows the new zooms. Swatch Libraries, Show Swatch Kinds and the edit action stand at the footer's start edge; New Color Group, New Swatch and Delete at its end edge. * Color Guide: the footer split as production Limit to Library stands at the start edge; Edit or Apply Colors, Save selected colors and Save color group at the end edge, in that order. * Graphic Styles: 40-point tiles in Thumbnail View Thumbnail View sets its own zoom, as the list views do, so its tiles are production's 40 points and no longer keep a list view's zoom. * Align panel: the reference app's groups and rules: the align and distribute buttons in groups a section gap apart, a rule between Align Objects and Distribute Objects, and Distribute Spacing and Align To on one line with a rule between them * Transform panel: a rule over the shape properties and over the options, as the reference app had * Info panel: the two columns of numbers are equal halves of the panel, as the reference app had them * Layers panel: the footer's layer count is a text unit of the footer row in the text ink, as the reference app showed it * Libraries panel: the no-library notice shows the library icon over its title, as the reference app did * craft-libs: next 5442cfb97, with the page rhythm tokens, LinkLook, the menu row height and the dialog padding and button height the look commits set * Docking test: the report names the panel that has the keys after a click in its search field. A press on a dock tab now leaves the keys where they were (craft-libs TabStrip::keeps_focus), so the tab click alone no longer focuses the panel; the search lookup is a harness helper both tests use * craft-libs: next 6fcf61c81, a document window raised as Presentation Mode ends comes to the front * Canvas drops: a canvas takes no drop where a floating panel's OS window lies over it The canvas's drop catcher accepted art carried off its own canvas wherever the pointer was over the canvas, including where a floating panel's OS window lies over it. The main window's pass runs first, so the canvas took the drop and resumed the move, and the panel under the pointer got nothing. Every target of the catcher now refuses a point that panel_docking::os_window_at reports covered, the same rule the Selection tools' carry uses. It used to work by accident: the carry's covered test flickered every other frame, the move dispatched a drag in those frames, and the changed revision made the canvas refuse the carried art until the release. * Safe Mode: the choice about a stopped plug-in opens on the host at once The choice was put on the host's startup queue, which the host drains only at the start of its next pass. On main the first frame happened to run a second pass (layout memory asked for a rerun), so the choice was open by the end of the launch frame; the framework now settles that frame in one pass, and the choice stayed queued until the frame after, where an agent's ui.dialog.* found no hosted dialog open. The choice is only asked for on an empty host, so opening it directly is what the queue would do one pass later. * Image Trace sampler test: a step runs until the press lifecycle reported its events run_ui stopped stepping once egui had seen every pointer event of the step. The press lifecycle reports one phase a pass, so a pass that brings a release and the next press (two clicks in one frame) reports the press's Down one pass later and holds its release for the pass after that, asking for a repaint. The step ended before that pass, and the second click of review_597048_two_ordinary_clicks_in_one_frame_survive_ sampler_correction never reached the tool, so the group did not isolate. It passed before by accident: with craft-libs a4b6d3b6ca every other frame ran a second pass, and the held release landed in it. With 6fcf61c81 each of these frames runs one pass. The step now also counts the phases owed and runs empty frames until the passes have caught up. * Shapes add-on: the helper that maps a shape tool to its icon is icon_for_shape, so the icon test no longer reads its tool ids ("polygon", "no-such-tool") as icon ids * Native panel window test: drop the art on the first graphic style's tile The test dropped the art 60 x 120 points into the Graphic Styles window. Since Thumbnail View's tiles are 40 points (df940cff4e) the tile row ends at 116 points, so that point lies in the empty room below the tiles, which takes no drop, and the panel made no style. The test now finds the first style's tile by its name in the window's access tree and drops the art there. The test host keeps each window's named access nodes for that. --- Cargo.lock | 160 +++++++++--------- Cargo.toml | 68 ++++---- apps/vectorcraft-web/Cargo.toml | 2 +- crates/ui-egui/src/addons/shapes.rs | 14 +- crates/ui-egui/src/canvas/drops.rs | 31 ++-- crates/ui-egui/src/canvas/home.rs | 58 ++++--- crates/ui-egui/src/dialogs/safe_mode.rs | 7 +- .../ui-egui/src/panel_docking/native_tests.rs | 21 ++- crates/ui-egui/src/panel_docking/tests.rs | 20 ++- crates/ui-egui/src/panels/align.rs | 78 +++++---- crates/ui-egui/src/panels/color_guide.rs | 13 +- crates/ui-egui/src/panels/graphic_styles.rs | 15 +- crates/ui-egui/src/panels/info.rs | 9 +- crates/ui-egui/src/panels/layers/controls.rs | 6 +- crates/ui-egui/src/panels/libraries.rs | 3 +- crates/ui-egui/src/panels/library_panel.rs | 4 +- .../ui-egui/src/panels/library_panel/tests.rs | 10 ++ crates/ui-egui/src/panels/swatches.rs | 44 +++-- crates/ui-egui/src/panels/tests_panel_rows.rs | 9 + crates/ui-egui/src/panels/transform.rs | 13 +- crates/ui-egui/src/theme.rs | 37 ++-- .../tests/image_trace_ignore_sampler.rs | 14 +- xtask/src/pdf_deps.rs | 2 +- 23 files changed, 379 insertions(+), 259 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1b57f15652..5c9393ef10 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1134,7 +1134,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-automation", "craft-behavior", @@ -1175,7 +1175,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "crc32fast", "flate2", @@ -1186,7 +1186,7 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "block2 0.6.2", "objc2-app-kit 0.3.2", @@ -1196,7 +1196,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "rustix 1.1.6", ] @@ -1204,7 +1204,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1229,7 +1229,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1247,7 +1247,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-behavior", "craft-docpath", @@ -1265,7 +1265,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "crc32fast", "flate2", @@ -1274,7 +1274,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "egui", ] @@ -1282,7 +1282,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "md-5", "rayon", @@ -1291,12 +1291,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-behavior", "craft-cms", @@ -1316,7 +1316,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "getrandom 0.3.4", "serde", @@ -1326,7 +1326,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "rayon", ] @@ -1334,7 +1334,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "block2 0.6.2", "craft-atomic", @@ -1359,7 +1359,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "serde", ] @@ -1367,7 +1367,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1386,7 +1386,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-codepage", "encoding_rs", @@ -1398,12 +1398,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1418,7 +1418,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1437,7 +1437,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "cap-primitives", "craft-atomic", @@ -1459,12 +1459,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "gif", ] @@ -1472,7 +1472,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "flate2", ] @@ -1480,7 +1480,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1493,7 +1493,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "chrono", "fixed_decimal", @@ -1521,7 +1521,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-dds", "craft-jpeg", @@ -1548,7 +1548,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1566,7 +1566,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "thiserror 2.0.21", ] @@ -1574,7 +1574,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1585,7 +1585,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-host", "craft-i18n", @@ -1600,7 +1600,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-behavior", "craft-i18n", @@ -1614,7 +1614,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-behavior", "craft-host", @@ -1632,7 +1632,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1644,7 +1644,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "encoding_rs", "image", @@ -1655,7 +1655,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "chrono", "craft-codepage", @@ -1665,7 +1665,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-behavior", "craft-keymap", @@ -1681,7 +1681,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1693,7 +1693,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "async-channel", "async-io", @@ -1724,7 +1724,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1733,7 +1733,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-behavior", "craft-host", @@ -1757,7 +1757,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1768,7 +1768,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-eps", "flate2", @@ -1782,7 +1782,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "encoding_rs", "flate2", @@ -1793,7 +1793,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "dispatch2", "egui", @@ -1806,7 +1806,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1825,7 +1825,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-atomic", "craft-host", @@ -1842,7 +1842,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "fax", "hayro-ccitt", @@ -1853,7 +1853,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-image-codecs", "craft-xml", @@ -1874,7 +1874,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-behavior", "craft-keymap", @@ -1886,7 +1886,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-behavior", "craft-font-manager", @@ -1911,7 +1911,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -1926,7 +1926,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-atomic", "craft-behavior", @@ -1941,7 +1941,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "serde", "thiserror 2.0.21", @@ -1951,7 +1951,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "serde", "thiserror 2.0.21", @@ -1960,7 +1960,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-behavior", "craft-keymap", @@ -1975,12 +1975,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -1994,7 +1994,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-behavior", "craft-i18n", @@ -2010,7 +2010,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "accesskit", "craft-behavior", @@ -2048,7 +2048,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2059,7 +2059,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-behavior", "craft-host", @@ -2077,7 +2077,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-behavior", "craft-host", @@ -2098,7 +2098,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-behavior", "craft-host", @@ -2119,7 +2119,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-behavior", "craft-host", @@ -2138,7 +2138,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "chrono", "craft-host", @@ -2167,7 +2167,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "flate2", "serde", @@ -2178,7 +2178,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2188,7 +2188,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "js-sys", "serde_json", @@ -2199,7 +2199,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "winsafe", ] @@ -2207,7 +2207,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "craft-appkit", "craft-atomic", @@ -2239,7 +2239,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3507,7 +3507,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "brotli", "hayro-postscript", @@ -3516,7 +3516,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3534,7 +3534,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3552,12 +3552,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "flate2", "hayro-ccitt", @@ -4488,7 +4488,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4645,7 +4645,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043" +source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" dependencies = [ "arrayvec", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index 15f14067e6..e7eb351554 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,44 +11,44 @@ rust-version = "1.95" repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } # 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 = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } # 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 = "4bed21baaa41d2b47bef90879c04df521f6f6043" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } # 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 = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -191,13 +191,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } emath = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } epaint = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index ce5110f8ac..8cca976717 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -27,7 +27,7 @@ log = { 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 = "4bed21baaa41d2b47bef90879c04df521f6f6043", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/crates/ui-egui/src/addons/shapes.rs b/crates/ui-egui/src/addons/shapes.rs index e02e323061..a134adeab4 100644 --- a/crates/ui-egui/src/addons/shapes.rs +++ b/crates/ui-egui/src/addons/shapes.rs @@ -52,7 +52,7 @@ pub fn control_bar(app: &mut VectorcraftApp, ui: &mut Ui) -> bool { if tool == "box3d" { let shapes: [Choice; 6] = [("box3d", "3D Box"), ("rectangle", "Rectangle"), ("ellipse", "Ellipse"), ("polygon", "Polygon"), ("star", "Star"), ("spiral", "Spiral")] - .map(|(id, label)| (id, label, shape_icon(id))); + .map(|(id, label)| (id, label, icon_for_shape(id))); if let Some(shape) = choice(ui, "Shape", &active_shape, &shapes) { app.run("tool.setOption", json!({ "key": "shape", "value": shape })).ok(); } @@ -309,7 +309,7 @@ fn draw_polygon_controls(app: &mut VectorcraftApp, ui: &mut Ui, opts: &Value, ac end_deg = a1; mode = mode_str(arc_mode); } - let kinds: [Choice; 2] = [("polygon", "Polygon", shape_icon("polygon")), ("star", "Star", shape_icon("star"))]; + let kinds: [Choice; 2] = [("polygon", "Polygon", icon_for_shape("polygon")), ("star", "Star", icon_for_shape("star"))]; match choice(ui, "Shape", if is_star { "star" } else { "polygon" }, &kinds) { Some("star") => apply_shape(app, &[("polyIsStar", json!(true))], json!({ "isStar": true, "spokeRatio": spoke })), Some(_) => apply_shape(app, &[("polyIsStar", json!(false))], json!({ "isStar": false })), @@ -410,7 +410,7 @@ fn draw_box3d_controls(app: &mut VectorcraftApp, ui: &mut Ui, opts: &Value, sele } /// The toolbar icon of the shape tool `id`, so the Control bar's shape buttons show the same icon. -fn shape_icon(id: &str) -> &'static str { +fn icon_for_shape(id: &str) -> &'static str { vectorcraft_tools::tool_info(id).map_or("square-dashed", |t| crate::icons::tool_icon(t.icon)) } @@ -428,7 +428,7 @@ mod tests { use craft::behavior::IconId; use craft::ui::primitives::{has_icon, register_app_icons}; - use super::shape_icon; + use super::icon_for_shape; /// The Control bar's shape buttons look their icons up by tool id; an id that names no tool /// would show the placeholder instead of the toolbar's icon. @@ -437,9 +437,9 @@ mod tests { register_app_icons(&crate::icons::APP_ICONS); for id in ["box3d", "rectangle", "ellipse", "polygon", "star", "spiral"] { let tool = vectorcraft_tools::tool_info(id).unwrap_or_else(|| panic!("{id} is a tool")); - assert_eq!(shape_icon(id), crate::icons::tool_icon(tool.icon), "{id}"); - assert!(has_icon(&IconId::new(shape_icon(id))), "{id}'s icon {} isn't an icon", shape_icon(id)); + assert_eq!(icon_for_shape(id), crate::icons::tool_icon(tool.icon), "{id}"); + assert!(has_icon(&IconId::new(icon_for_shape(id))), "{id}'s icon {} isn't an icon", icon_for_shape(id)); } - assert_eq!(shape_icon("no-such-tool"), "square-dashed"); + assert_eq!(icon_for_shape("no-such-tool"), "square-dashed"); } } diff --git a/crates/ui-egui/src/canvas/drops.rs b/crates/ui-egui/src/canvas/drops.rs index 7a8b606305..274b1fde7f 100644 --- a/crates/ui-egui/src/canvas/drops.rs +++ b/crates/ui-egui/src/canvas/drops.rs @@ -76,17 +76,19 @@ pub struct CanvasDropsStyle { } /// A drop target for one payload type `P`: `make` turns the payload into the canvas's own, or refuses it. `seen` is -/// the operation of the last payload it accepted at the pointer. +/// the operation of the last payload it accepted at the pointer. Where `covered` (another window lies over the canvas), +/// it takes nothing: that window's targets take the drop. struct Target<'a, F> { rect: Rect, view: &'a CanvasView, + covered: &'a dyn Fn(Pos2) -> bool, make: F, seen: Cell>, } impl<'a, F> Target<'a, F> { - fn new(rect: Rect, view: &'a CanvasView, make: F) -> Self { - Target { rect, view, make, seen: Cell::new(None) } + fn new(rect: Rect, view: &'a CanvasView, covered: &'a dyn Fn(Pos2) -> bool, make: F) -> Self { + Target { rect, view, covered, make, seen: Cell::new(None) } } } @@ -94,6 +96,9 @@ impl Option> DropTarget

for Target<'_, F> { type Drop = Dropped; fn accept(&self, payload: &P, at: Pos2, op: DropOperation) -> Option { + if (self.covered)(at) { + return None; + } let payload = (self.make)(payload)?; self.seen.set(Some(op)); Some(Dropped { payload, at: self.view.to_doc(at), zoom: self.view.zoom, op }) @@ -121,6 +126,8 @@ pub(crate) struct CanvasDrops<'a> { /// has the content the move started from ([`CarriedArt::before`]), and the document a tab rest showed is still the /// current one. given_up: bool, + /// Whether another window lies over the canvas at a point of it: a floating panel's OS window. + covered: &'a dyn Fn(Pos2) -> bool, out: &'a RefCell>, /// The files from the OS the canvas places, and where their drop goes. files: (CanvasFiles<'a>, &'a RefCell>), @@ -150,9 +157,9 @@ impl Component for CanvasDrops<'_> { fn update(&mut self, cx: &mut Cx<'_, Self>) { let rect = cx.rect; - let (sources, given_up, view) = (&self.sources, self.given_up, &self.view); + let (sources, given_up, view, covered) = (&self.sources, self.given_up, &self.view, self.covered); let unchanged = |a: &CarriedArt| given_up || sources.contains(&(a.document, a.revision)); - let art = Target::new(rect, view, |a: &CarriedArt| unchanged(a).then(|| Payload::Art(a.clone()))); + let art = Target::new(rect, view, covered, |a: &CarriedArt| unchanged(a).then(|| Payload::Art(a.clone()))); let mut dropped = cx.drop_target::(&art); if self.kind == BodyKind::Pane && let (Some(op), Some((carried, _))) = (art.seen.get(), cx.dragging::()) @@ -163,11 +170,11 @@ impl Component for CanvasDrops<'_> { } if self.kind == BodyKind::Live { // The art of this canvas's own document is not accepted as a panel payload: its move resumes. - let panel = Target::new(rect, view, |p: &PanelDrag| (!matches!(p, PanelDrag::Art { .. })).then(|| Payload::Panel(p.clone()))); - let style = Target::new(rect, view, |d: &ListDrag| Some(Payload::Style(d.grabbed.clone()))); - let symbol = Target::new(rect, view, |d: &ListDrag| Some(Payload::Symbol(d.grabbed.clone()))); - let brush = Target::new(rect, view, |d: &ListDrag| Some(Payload::Brush(d.grabbed.clone()))); - let library = Target::new(rect, view, |d: &ListDrag| Some(Payload::Library(d.grabbed.clone()))); + let panel = Target::new(rect, view, covered, |p: &PanelDrag| (!matches!(p, PanelDrag::Art { .. })).then(|| Payload::Panel(p.clone()))); + let style = Target::new(rect, view, covered, |d: &ListDrag| Some(Payload::Style(d.grabbed.clone()))); + let symbol = Target::new(rect, view, covered, |d: &ListDrag| Some(Payload::Symbol(d.grabbed.clone()))); + let brush = Target::new(rect, view, covered, |d: &ListDrag| Some(Payload::Brush(d.grabbed.clone()))); + let library = Target::new(rect, view, covered, |d: &ListDrag| Some(Payload::Library(d.grabbed.clone()))); let panel = cx.drop_target::(&panel); let style = cx.drop_target::, _>(&style); let symbol = cx.drop_target::, _>(&symbol); @@ -215,8 +222,10 @@ pub(crate) fn show(app: &mut VectorcraftApp, ui: &mut Ui, win: Win, kind: BodyKi && app.session.documents().iter().any(|d| d.uid == a.document && d.same_content(&a.before)) }); let (out, files_out) = (RefCell::new(None), RefCell::new(None)); + let ctx = ui.ctx().clone(); + let covered = |at: Pos2| crate::panel_docking::os_window_at(app, &ctx, at); let files = (CanvasFiles::new(app, rect, &view), &files_out); - let drops = CanvasDrops { common: Common::new(), view, kind, document, sources, given_up, out: &out, files }; + let drops = CanvasDrops { common: Common::new(), view, kind, document, sources, given_up, covered: &covered, out: &out, files }; drops.id_salt(("canvas-drops", win)).show_at(ui, rect); if let Some(files) = files_out.take() { crate::place::canvas_drop(app, ui.ctx(), files); diff --git a/crates/ui-egui/src/canvas/home.rs b/crates/ui-egui/src/canvas/home.rs index e2dfa19c73..556574d1ba 100644 --- a/crates/ui-egui/src/canvas/home.rs +++ b/crates/ui-egui/src/canvas/home.rs @@ -1,9 +1,11 @@ use craft::behavior::IconId; -use craft::ui::buttons::Button; -use craft::ui::contract::{Bind, Props as _, Show as _, ShowContainer as _}; -use craft::ui::display::Text; -use craft::ui::layout_components::Row; +use craft::ui::buttons::{Button, ControlPlace, LinkLook}; +use craft::ui::contract::{Bind, Gap, Props as _, Show as _, ShowContainer as _}; +use craft::ui::display::{Shade, Text}; +use craft::ui::layout_components::{Row, Stack}; +use craft::ui::runtime::env::{Overrides, with_env}; use craft::ui::shell::{RecentFile, StartAction, StartLayout, StartLink, StartScreen, Template}; +use craft::ui::style::TypeRole; use super::{Ui, VectorcraftApp, json}; @@ -40,7 +42,11 @@ pub(super) fn home(app: &mut VectorcraftApp, ui: &mut Ui, rect: egui::Rect) { let mut pressed = None; let mut learn = |ui: &mut Ui| learn(app, ui, &mut pressed); let mut child = ui.new_child(egui::UiBuilder::new().max_rect(rect).layout(egui::Layout::top_down(egui::Align::Min))); - let out = StartScreen::new(Bind::bound(&mut view), Bind::bound(&mut sort), &recent) + // Production's community links read in the accent alone, with no underline. + let plain_links = |overrides: &mut Overrides| { + overrides.values.set(LinkLook::Plain); + }; + let start = StartScreen::new(Bind::bound(&mut view), Bind::bound(&mut sort), &recent) .layout(StartLayout::Column) .title(tl!("Welcome to VectorCraft")) .subtitle(tl!("Vector illustration — fast, open, scriptable.")) @@ -51,8 +57,8 @@ pub(super) fn home(app: &mut VectorcraftApp, ui: &mut Ui, rect: egui::Rect) { .templates_title(tl!("Quickly start a new file")) .links(&links) .links_title(tl!("Community")) - .app_section(tl!("Learn"), &mut learn) - .show(&mut child); + .app_section(tl!("Learn"), &mut learn); + let out = with_env(&mut child, plain_links, |ui| start.show(ui)); app.ui.home_view = view; app.ui.home_sort = sort; for action in out.actions { @@ -87,20 +93,30 @@ fn run_action(app: &mut VectorcraftApp, action: StartAction) { } /// The Home screen's Learn section: the Quick skill guide card, which shows the Learn panel's list -/// of skills, and the Learn panel's tutorials under their skills, each a button that shows the -/// panel at its steps (`learn.show`). The start screen may run this twice in a pass, so it only -/// draws and records the tutorial pressed in `pressed`. +/// of skills, and the Learn panel's tutorials under their skills (each title dim over its tutorials), each a button +/// that shows the panel at its steps (`learn.show`), as tall as New and Open and a page heading's gap apart, as +/// production spaced them. The start screen may run this twice in a pass, so it only draws and records the tutorial +/// pressed in `pressed`. fn learn(app: &mut VectorcraftApp, ui: &mut Ui, pressed: &mut Option<&'static str>) { use crate::panels::learn::{catalog, guide_card}; - guide_card(app, ui); // PLAN: assumed `guide_card(app, ui)` as document-panels-w18 leaves it, on `Button::detail`. - for skill in catalog::SKILLS { - let _ = Text::new(skill.title).show(ui); - let _ = Row::new().show(ui, |ui, _| { - for tutorial in skill.tutorials { - if Button::new(tutorial.title).id_salt(tutorial.id).show(ui).clicked() { - *pressed = Some(tutorial.id); - } - } - }); - } + let _ = Stack::new().gap(Gap::PageHeading).fill_width().show(ui, |ui, _| { + guide_card(app, ui); // PLAN: assumed `guide_card(app, ui)` as document-panels-w18 leaves it, on `Button::detail`. + for skill in catalog::SKILLS { + let _ = Stack::new().gap(Gap::Stack).fill_width().show(ui, |ui, _| { + let _ = Text::new(skill.title).role(TypeRole::Label).shade(Shade::Muted).show(ui); + let place = |overrides: &mut Overrides| { + overrides.values.set(ControlPlace::PageAction); + }; + let _ = with_env(ui, place, |ui| { + Row::new().show(ui, |ui, _| { + for tutorial in skill.tutorials { + if Button::new(tutorial.title).id_salt(tutorial.id).show(ui).clicked() { + *pressed = Some(tutorial.id); + } + } + }) + }); + }); + } + }); } diff --git a/crates/ui-egui/src/dialogs/safe_mode.rs b/crates/ui-egui/src/dialogs/safe_mode.rs index 375c9aca14..32ac3dd51a 100644 --- a/crates/ui-egui/src/dialogs/safe_mode.rs +++ b/crates/ui-egui/src/dialogs/safe_mode.rs @@ -5,7 +5,7 @@ //! dialogs live on the dialog host; [`pump`] reads their answers. use craft::ui::contract::Bind; -use craft::ui::dialog::{DialogResult, PromptChoice, StandardPrompt, StartupStage, dialog_id}; +use craft::ui::dialog::{DialogResult, PromptChoice, StandardPrompt, dialog_id}; use craft::ui::patterns::form_dialogs::{DialogFields, FieldValue, HostedParamDialog, Param, ParamDialog, ParamKind}; use serde_json::{Value, json}; use vectorcraft_plugins::safe_mode::{self, Item}; @@ -239,9 +239,10 @@ fn pump_stopped(app: &mut VectorcraftApp, ctx: &egui::Context) { let Some(dialogs) = app.dialogs() else { return }; let answered = dialogs.with(|h| { let answered = h.take::(); - // An empty host has neither an open dialog nor a queued one: otherwise the choice waits. + // An empty host has neither an open dialog nor a queued one: otherwise the choice waits. It opens now rather + // than through the startup queue, which the host drains only in its next pass: a frame may have no other. if answered.is_none() && h.is_empty() { - h.enqueue(StartupStage::Warning, stopped_prompt(&fields)); + h.open(stopped_prompt(&fields)); ctx.request_repaint(); } answered diff --git a/crates/ui-egui/src/panel_docking/native_tests.rs b/crates/ui-egui/src/panel_docking/native_tests.rs index 4c33e45b1e..996afc5964 100644 --- a/crates/ui-egui/src/panel_docking/native_tests.rs +++ b/crates/ui-egui/src/panel_docking/native_tests.rs @@ -27,6 +27,8 @@ struct Window { frames: usize, /// The texts its last frame drew, with their rects in the window. texts: Vec<(String, Rect)>, + /// The named nodes of its last frame's access tree, with their rects in the window. + nodes: Vec<(String, Rect)>, } struct Host { @@ -77,6 +79,7 @@ impl Host { dropped: Vec::new(), frames: 0, texts: Vec::new(), + nodes: Vec::new(), }); let viewports = host.infos(); let (time, focused) = (host.time, host.focus == id); @@ -105,9 +108,16 @@ impl Host { } let mut shown = Vec::new(); full.shapes.iter().for_each(|c| texts(&c.shape, &mut shown)); + let nodes = full.platform_output.accesskit_update.as_ref().map_or_else(Vec::new, |update| { + let rect = |b: egui::accesskit::Rect| Rect::from_min_max(pos2(b.x0 as f32, b.y0 as f32), pos2(b.x1 as f32, b.y1 as f32)); + update.nodes.iter().filter_map(|(_, node)| Some((node.label()?.to_string(), rect(node.bounds()?)))).collect() + }); let mut host = host.borrow_mut(); if let Some(window) = host.windows.get_mut(&id) { window.texts = shown; + if !nodes.is_empty() { + window.nodes = nodes; + } } host.apply(&full); } @@ -317,6 +327,7 @@ fn button(pos: Pos2, pressed: bool) -> Event { #[test] fn art_dragged_from_the_canvas_onto_a_native_panel_window_drops_there() { let mut h = Harness::new(); + h.ctx.enable_accesskit(); let id = h.app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 50, "height": 40})).unwrap()["id"].as_u64().unwrap(); let id = vectorcraft_doc::NodeId(id); let viewport = h.float("graphicStyles"); @@ -327,8 +338,14 @@ fn art_dragged_from_the_canvas_onto_a_native_panel_window_drops_there() { let before = art(&h); let view = h.app.canvas_view().expect("the canvas was drawn"); let from = view.to_screen(vectorcraft_geom::Point::new(35.0, 30.0)); - let window = h.host.borrow().windows.get(&viewport).map(|w| w.rect).unwrap(); - let to = window.min + vec2(60.0, 120.0) - ORIGIN.to_vec2(); + // The first style's tile, found by its name: the panel takes art dropped onto a style or between styles. + let first = h.app.session.active().unwrap().doc.graphic_styles[0].name.clone(); + let to = { + let host = h.host.borrow(); + let window = &host.windows[&viewport]; + let tile = window.nodes.iter().find(|(name, _)| *name == first).map(|(_, r)| *r).expect("the first style's tile"); + window.rect.min + tile.center().to_vec2() - ORIGIN.to_vec2() + }; assert!(view.rect.contains(to), "the window lies over the canvas"); h.frame(vec![Event::PointerMoved(from), button(from, true)]); for k in 1..=8 { diff --git a/crates/ui-egui/src/panel_docking/tests.rs b/crates/ui-egui/src/panel_docking/tests.rs index 0aad943515..b3eb083b42 100644 --- a/crates/ui-egui/src/panel_docking/tests.rs +++ b/crates/ui-egui/src/panel_docking/tests.rs @@ -62,6 +62,15 @@ impl Harness { .map(|b| Rect::from_min_max(pos2(b.x0 as f32, b.y0 as f32), pos2(b.x1 as f32, b.y1 as f32))) } + /// The centre of the text field named `label` in the last frame. + fn text_field(&self, label: &str) -> Option { + self.nodes + .iter() + .filter(|(_, n)| n.role() == egui::accesskit::Role::TextInput && n.label() == Some(label)) + .find_map(|(_, n)| n.bounds()) + .map(|b| pos2(((b.x0 + b.x1) / 2.0) as f32, ((b.y0 + b.y1) / 2.0) as f32)) + } + fn tab(&self, panel: &str) -> Option { self.named(panel, egui::accesskit::Role::Tab) } @@ -679,6 +688,9 @@ fn ui_docking_reports_the_layout_and_the_dock_state() { h.frame(vec![]); let tab = h.tab("layers").unwrap(); h.click(tab.center()); + // A press on a tab leaves the keys where they were (the dock's TabStrip::keeps_focus); a click in the panel's + // search field gives the panel the keys. + h.click(h.text_field("Search layers").expect("the Layers panel's search field")); let report = inspect(&h.app, &h.ctx); assert_eq!(report["layout"], serde_json::to_value(h.layout()).unwrap()); assert_eq!(report["focused"], json!("layers")); @@ -838,13 +850,7 @@ fn other_function_keys_and_keyboard_guards_keep_their_routes() { // The Layers panel's search field, clicked once the dialog has gone: it has the keys until a click on the canvas // takes them. h.frames(2); - let field = h - .nodes - .iter() - .filter(|(_, n)| n.role() == egui::accesskit::Role::TextInput && n.label() == Some("Search layers")) - .find_map(|(_, n)| n.bounds()) - .map(|b| pos2(((b.x0 + b.x1) / 2.0) as f32, ((b.y0 + b.y1) / 2.0) as f32)) - .expect("the Layers panel's search field"); + let field = h.text_field("Search layers").expect("the Layers panel's search field"); h.click(field); h.f7(); assert!(showing(&h.app.ui, "layers"), "F7 does nothing while a text field has focus"); diff --git a/crates/ui-egui/src/panels/align.rs b/crates/ui-egui/src/panels/align.rs index 9b8d94a31b..53c5273d55 100644 --- a/crates/ui-egui/src/panels/align.rs +++ b/crates/ui-egui/src/panels/align.rs @@ -7,7 +7,7 @@ use craft::behavior::IconId; use craft::keymap::CommandRef; use craft::ui::bars::{BarItem, BarItems}; use craft::ui::buttons::{IconButton, PopupMark, ToggleButton}; -use craft::ui::contract::{Bind, PopupKind, Props as _, Show as _, ShowContainer as _, Trigger}; +use craft::ui::contract::{Bind, Gap, PopupKind, Props as _, Show as _, ShowContainer as _, Trigger}; use craft::ui::display::Divider; use craft::ui::layout_components::Row; use craft::ui::menu::{Menu, MenuItem, PanelRow}; @@ -498,20 +498,13 @@ pub(crate) fn run_align_to(app: &mut VectorcraftApp, v: AlignTo) -> Result = align_icons().collect(); + crate::panels::subheading(tl!("Align Objects:")).show(ui, |ui, _| button_groups(ui, &[&align[..3], &align[3..4], &align[4..]])); + Divider::horizontal().show(ui); + let distribute: Vec<_> = distribute_icons().collect(); + crate::panels::subheading(tl!("Distribute Objects:")).show(ui, |ui, _| button_groups(ui, &[&distribute[..3], &distribute[3..]])); if part_hidden(app, HIDE_OPTIONS) { return; } @@ -524,30 +517,47 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { let lengths = crate::canvas::general_lengths(app); let min_spacing = spacing_min(app); let mut edited = None; - crate::panels::subheading(tl!("Distribute Spacing:")).show(ui, |ui, _| { - Row::new().show(ui, |ui, _| { - command_button(ui, "dc-dist-vspace", Button::Spacing("vertical")); - command_button(ui, "dc-dist-hspace", Button::Spacing("horizontal")); - // The value is UI state, not a document edit: a landed value is assigned. - let field = NumberField::length(tl!("Distribute Spacing"), Bind::given(Some(spacing)), lengths) - .step(1.0) - .range(min_spacing..=f64::INFINITY) - .enabled(sent); - edited = field.show(ui).edit.events.landed().cloned().flatten(); + // With one object selected the buttons align it to the artboard, and Align To shows Artboard. + let anchor = key_is_anchor(app); + // Distribute Spacing and Align To share a line, a rule between them, as the reference app had them. + Row::new().gap(Gap::Section).show(ui, |ui, _| { + crate::panels::subheading(tl!("Distribute Spacing:")).show(ui, |ui, _| { + Row::new().show(ui, |ui, _| { + command_button(ui, "dc-dist-vspace", Button::Spacing("vertical")); + command_button(ui, "dc-dist-hspace", Button::Spacing("horizontal")); + // The value is UI state, not a document edit: a landed value is assigned. + let field = NumberField::length(tl!("Distribute Spacing"), Bind::given(Some(spacing)), lengths) + .step(1.0) + .range(min_spacing..=f64::INFINITY) + .enabled(sent); + edited = field.show(ui).edit.events.landed().cloned().flatten(); + }); + }); + Divider::vertical().show(ui); + crate::panels::subheading(tl!("Align To:")).show(ui, |ui, _| { + Row::new().show(ui, |ui, _| { + for (id, v) in ALIGN_TO_COMMANDS { + let (icon, _) = align_to_icon_name(v, anchor); + ToggleButton::command(CommandRef::new(id)).icon(IconId::new(icon)).icon_only().show(ui); + } + }); }); }); if let Some(v) = edited { app.ui.align_spacing = v; } - crate::panels::subheading(tl!("Align To:")).show(ui, |ui, _| { - // With one object selected the buttons align it to the artboard, and Align To shows Artboard. - let anchor = key_is_anchor(app); - Row::new().show(ui, |ui, _| { - for (id, v) in ALIGN_TO_COMMANDS { - let (icon, _) = align_to_icon_name(v, anchor); - ToggleButton::command(CommandRef::new(id)).icon(IconId::new(icon)).icon_only().show(ui); - } - }); +} + +/// The command buttons of `groups` on one line, a section gap between the groups. +fn button_groups(ui: &mut Ui, groups: &[&[(&'static str, Button)]]) { + Row::new().gap(Gap::Section).show(ui, |ui, _| { + for group in groups { + Row::new().show(ui, |ui, _| { + for (icon, b) in *group { + command_button(ui, icon, *b); + } + }); + } }); } diff --git a/crates/ui-egui/src/panels/color_guide.rs b/crates/ui-egui/src/panels/color_guide.rs index 89bfc7f328..07569242ce 100644 --- a/crates/ui-egui/src/panels/color_guide.rs +++ b/crates/ui-egui/src/panels/color_guide.rs @@ -664,11 +664,12 @@ fn set_base(app: &mut VectorcraftApp) { } } -// The footer's actions, in order. +// The footer's actions, in order: the limit at the start edge, the rest from the end edge, so they read Edit or +// Apply, Save Selected, Save Group from left to right. const LIMIT: usize = 0; -const EDIT: usize = 1; +const SAVE_GROUP: usize = 1; const SAVE_SELECTED: usize = 2; -const SAVE_GROUP: usize = 3; +const EDIT: usize = 3; /// The Limit to Library popup's rows: None, Document Swatches, then the colour libraries. → the /// key of the row that ran. @@ -722,11 +723,11 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { .footer(|ui, _| { let actions = [ FooterAction::new(icon("library"), tip.clone()).pressed(limited).popup(PopupKind::Menu), - FooterAction::new(icon("palette"), tl!("Edit or Apply Colors").to_string()).enabled(doc), - FooterAction::new(icon("dc-new-item"), tl!("Save selected colors as swatches").to_string()).enabled(has_cells), FooterAction::new(icon("dc-folder"), tl!("Save color group to Swatch panel").to_string()), + FooterAction::new(icon("dc-new-item"), tl!("Save selected colors as swatches").to_string()).enabled(has_cells), + FooterAction::new(icon("palette"), tl!("Edit or Apply Colors").to_string()).enabled(doc), ]; - let out = FooterBar::actions(actions).show_footer(ui); + let out = FooterBar::actions(actions).at_start(LIMIT + 1).show_footer(ui); footer_picked = out.picked; limit_picked = None; if let Some(button) = out.responses.get(LIMIT) { diff --git a/crates/ui-egui/src/panels/graphic_styles.rs b/crates/ui-egui/src/panels/graphic_styles.rs index c59d8734e1..634289e1ed 100644 --- a/crates/ui-egui/src/panels/graphic_styles.rs +++ b/crates/ui-egui/src/panels/graphic_styles.rs @@ -78,12 +78,13 @@ impl View { } } - /// The thumbnail zoom that makes the browser's list rows small or large; `None` keeps the grid's own. - fn list_zoom(self) -> Option { + /// The thumbnail zoom of this view: the grid's tiles about 40 points, as production's, and the list rows small or + /// large. + fn zoom(self) -> f64 { match self { - View::Thumbnail => None, - View::SmallList => Some(0.5), - View::LargeList => Some(2.0), + View::Thumbnail => 5.0 / 6.0, + View::SmallList => 0.5, + View::LargeList => 2.0, } } } @@ -468,9 +469,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { let mut panel = std::mem::take(&mut app.ui.graphic_styles_panel); let looks = look_hashes(&mut panel, app); let view = app.ui.graphic_styles_view; - if let Some(zoom) = view.list_zoom() { - panel.state.zoom = zoom; - } + panel.state.zoom = view.zoom(); let before = panel.selection.clone(); let (alt, linked) = (alt_held(ui), app.session.selection_graphic_style().is_some()); let thumbs = style_thumbs(app, &doc, &looks, panel.preview); diff --git a/crates/ui-egui/src/panels/info.rs b/crates/ui-egui/src/panels/info.rs index 3e8e46b46d..e9310e692a 100644 --- a/crates/ui-egui/src/panels/info.rs +++ b/crates/ui-egui/src/panels/info.rs @@ -3,10 +3,11 @@ //! drag, the Zoom tool's magnification, the Paintbrush's brush) and the selection's fill and //! stroke colour values. +use craft::behavior::ColumnWidth; use craft::keymap::CommandRef; use craft::ui::contract::{Show as _, ShowContainer as _}; use craft::ui::display::{Divider, Picture, Shade, Text}; -use craft::ui::layout_components::{Row, Stack}; +use craft::ui::layout_components::{Grid, Row, Stack}; use craft::ui::list::ThumbAspect; use craft::ui::menu::PanelRow; use craft::ui::runtime::commands::{CommandState, CommandStates}; @@ -231,9 +232,13 @@ pub(crate) fn lines(app: &mut VectorcraftApp, ctx: &egui::Context) -> InfoLines } } +/// The panel's two columns of numbers: two equal halves of its width. +const HALVES: &[ColumnWidth] = &[ColumnWidth::fill(1.0); 2]; + pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { let l = lines(app, ui.ctx()); - Row::new().show(ui, |ui, _| { + // Two equal halves of the panel, as the reference app's columns were. + let _ = Grid::new(HALVES).show(ui, |ui, _| { for column in [&l.left, &l.right] { Stack::new().show(ui, |ui, _| { for s in column { diff --git a/crates/ui-egui/src/panels/layers/controls.rs b/crates/ui-egui/src/panels/layers/controls.rs index 30cbc520aa..3ac7f25522 100644 --- a/crates/ui-egui/src/panels/layers/controls.rs +++ b/crates/ui-egui/src/panels/layers/controls.rs @@ -2,7 +2,8 @@ use craft::behavior::IconId; use craft::keymap::Mods; use craft::layers::ui::panel::MenuTarget; // PLAN: assumed path of craft-layers' panel types use craft::layers::ui::tree::LayerRowKey; -use craft::ui::contract::{Entry, ListDrag}; +use craft::ui::contract::{Entry, ListDrag, Show as _}; +use craft::ui::display::{Elide, Text}; use craft::ui::menu::{MenuRow, PanelRow}; use craft::ui::primitives::IconSpec; use craft::ui::runtime::commands::{CommandRef, CommandState, CommandStates}; @@ -450,8 +451,9 @@ pub(crate) fn footer(tree: &DocLayers, ui: &mut Ui, out: &mut Vec<(String, Value .enabled(locate_ok), ]; let count = crate::i18n::tn(tree.doc().layers.len() as u64, "{n} Layer", "{n} Layers").to_string(); + // The count is a unit of the footer's row, centred on its buttons' line in the text ink. let (output, _) = FooterBar::actions(actions).at_start(0).show_footer_leading(ui, |ui, _| { - ui.weak(&count); + Text::new(count.clone()).elide(Elide::End).show(ui); }); // The footer runs twice per pass: the sizing pass measures it and must report nothing. if ui.is_sizing_pass() { diff --git a/crates/ui-egui/src/panels/libraries.rs b/crates/ui-egui/src/panels/libraries.rs index 87b0818bd4..655be80fb3 100644 --- a/crates/ui-egui/src/panels/libraries.rs +++ b/crates/ui-egui/src/panels/libraries.rs @@ -27,7 +27,7 @@ use craft::ui::display::{Divider, Shade, Text}; use craft::ui::layout_components::{Row, Stack}; use craft::ui::list::{List, ListRow, ThumbAspect, ThumbSize}; use craft::ui::menu::{Menu, MenuItem, PanelRow}; -use craft::ui::notices::{Notice, NoticeAction, NoticeLayout}; +use craft::ui::notices::{Notice, NoticeAction, NoticeIcon, NoticeLayout}; use craft::ui::patterns::form_dialogs::{DialogFields, HostedParamDialog, Param, ParamDialog, ParamKind}; use craft::ui::pickers::Select; use craft::ui::primitives::textures::{Priority, Revision, ThumbPaint, ThumbRender, ThumbRequest, ThumbSource, ThumbnailOptions, Thumbnails}; @@ -791,6 +791,7 @@ fn no_library(ui: &mut Ui) -> bool { ), ) .title(tl!("Local Libraries")) + .icon(NoticeIcon::Custom(IconSpec::svg(IconId::new("library")))) .layout(NoticeLayout::Centred) .action(NoticeAction::new(tl!("Create New Library"))) .show(ui) diff --git a/crates/ui-egui/src/panels/library_panel.rs b/crates/ui-egui/src/panels/library_panel.rs index e447006140..f0eb4a72e2 100644 --- a/crates/ui-egui/src/panels/library_panel.rs +++ b/crates/ui-egui/src/panels/library_panel.rs @@ -588,8 +588,8 @@ pub(crate) fn show_window(app: &mut VectorcraftApp, ctx: &egui::Context) { // PLAN: the zoom slider can set a zoom the five views do not name; it saves as the nearest of them. fn saved_view(view: PresetView, zoom: f64) -> View { match (view == PresetView::List, zoom) { - (false, z) if z < 0.625 => View::SmallThumb, - (false, z) if z < 0.875 => View::MediumThumb, + (false, z) if z < 7.0 / 24.0 => View::SmallThumb, + (false, z) if z < 0.5 => View::MediumThumb, (false, _) => View::LargeThumb, (true, z) if z < 0.75 => View::SmallList, (true, _) => View::LargeList, diff --git a/crates/ui-egui/src/panels/library_panel/tests.rs b/crates/ui-egui/src/panels/library_panel/tests.rs index 77183d3f6d..1844bb5f5f 100644 --- a/crates/ui-egui/src/panels/library_panel/tests.rs +++ b/crates/ui-egui/src/panels/library_panel/tests.rs @@ -76,6 +76,16 @@ pub(crate) fn menu_library_ids(app: &VectorcraftApp) -> Vec usize { app.session.doc().unwrap().history.undo.len() } diff --git a/crates/ui-egui/src/panels/swatches.rs b/crates/ui-egui/src/panels/swatches.rs index 851717edf8..9995752ec1 100644 --- a/crates/ui-egui/src/panels/swatches.rs +++ b/crates/ui-egui/src/panels/swatches.rs @@ -65,12 +65,13 @@ impl View { (View::SmallList, "Small List View"), (View::LargeList, "Large List View"), ]; - /// The browser's view and thumbnail zoom this mode stands for. + /// The browser's view and thumbnail zoom this mode stands for: thumbnails of about 12, 16 and 32 points on the + /// 48-point large thumbnail, the 11, 15.5 and 30 point tiles of production. pub(crate) fn preset(self) -> (PresetView, f64) { match self { - View::SmallThumb => (PresetView::Grid, 0.5), - View::MediumThumb => (PresetView::Grid, 0.75), - View::LargeThumb => (PresetView::Grid, 1.0), + View::SmallThumb => (PresetView::Grid, 0.25), + View::MediumThumb => (PresetView::Grid, 1.0 / 3.0), + View::LargeThumb => (PresetView::Grid, 2.0 / 3.0), View::SmallList => (PresetView::List, 0.5), View::LargeList => (PresetView::List, 1.0), } @@ -751,6 +752,14 @@ fn popup(ui: &mut Ui, label: &'static str, opener: Option<&Response>, mut body: } } +// The footer's actions, in order. +const LIBRARIES: usize = 0; +const KINDS: usize = 1; +const EDIT: usize = 2; +const DELETE: usize = 3; +const NEW: usize = 4; +const NEW_GROUP: usize = 5; + /// The panel's footer: Swatch Libraries, Show Swatch Kinds, Edit Color Group or Swatch Options, New Color Group, New /// Swatch and Delete. Alt-click on Delete deletes without asking; Cmd/Ctrl-click on New Swatch makes a spot color, and /// Cmd/Ctrl+Shift-click a global process color. Swatches dragged from the list and dropped on New Swatch are @@ -763,31 +772,32 @@ fn footer(app: &mut VectorcraftApp, ui: &mut Ui) { let group = actions::selected_group(app, &sel).filter(|_| opts.is_none()); let icon = |id: &'static str| IconSpec::svg(IconId::new(id)); let rows_drag = |d: &PanelDrag| matches!(d, PanelDrag::Paint { rows: Some(_), .. }); - // The first action sits at the end edge. let edit = if group.is_some() { FooterAction::new(icon("palette"), tl!("Edit or Apply Color Group")) } else { FooterAction::new(icon("dc-options"), tl!("Swatch Options")).enabled(opts.is_some()) }; + // Libraries, Show Swatch Kinds and the edit action sit at the start edge; Delete at the end edge, then New Swatch + // and New Color Group before it. let actions = [ + FooterAction::new(icon("library"), SwatchLibraries::MENU).pressed(library_panel::any_open::(&app.ui)), + FooterAction::new(icon("dc-swatch-kinds"), tl!("Show Swatch Kinds")).pressed(kind != Kind::All), + edit, FooterAction::new(icon("trash-2"), tl!("Delete Swatch")) .enabled(!del.is_empty()) .takes_drops_disabled(del.is_empty()) .accepts_drops::(rows_drag), FooterAction::new(icon("dc-new-item"), tl!("New Swatch")).accepts_drops::(rows_drag), FooterAction::new(icon("dc-folder"), tl!("New Color Group")), - edit, - FooterAction::new(icon("dc-swatch-kinds"), tl!("Show Swatch Kinds")).pressed(kind != Kind::All), - FooterAction::new(icon("library"), SwatchLibraries::MENU).pressed(library_panel::any_open::(&app.ui)), ]; - let out = FooterBar::actions(actions).show_footer(ui); + let out = FooterBar::actions(actions).at_start(EDIT + 1).show_footer(ui); match out.picked { - Some(0) if !del.is_empty() => actions::delete(app, del, out.mods.alt), - Some(1) => actions::new_swatch(app, &sel, out.mods), - Some(2) => { + Some(DELETE) if !del.is_empty() => actions::delete(app, del, out.mods.alt), + Some(NEW) => actions::new_swatch(app, &sel, out.mods), + Some(NEW_GROUP) => { app.run("ui.newColorGroup", json!({"swatches": del})).ok(); } - Some(3) => match (group, opts) { + Some(EDIT) => match (group, opts) { (Some(g), _) => actions::edit_group(app, &g), (None, Some(n)) => { app.run("ui.swatchOptions", json!({"name": n})).ok(); @@ -800,19 +810,19 @@ fn footer(app: &mut VectorcraftApp, ui: &mut Ui) { && let Some(drag) = drop.payload::() { match drop.index { - 0 => dnd::on_footer_drop(app, dnd::FooterTarget::Delete, drag), - 1 => dnd::on_footer_drop(app, dnd::FooterTarget::New, drag), + DELETE => dnd::on_footer_drop(app, dnd::FooterTarget::Delete, drag), + NEW => dnd::on_footer_drop(app, dnd::FooterTarget::New, drag), _ => {} } } - popup(ui, tl!("Show Swatch Kinds"), out.responses.get(4), |ui| { + popup(ui, tl!("Show Swatch Kinds"), out.responses.get(KINDS), |ui| { for (k, label) in Kind::ALL { if item(ui, label, true, Some(k == kind)) { app.ui.swatches_panel.kind = k; } } }); - popup(ui, tl!("Swatch Libraries"), out.responses.get(5), |ui| { + popup(ui, tl!("Swatch Libraries"), out.responses.get(LIBRARIES), |ui| { ui.set_min_width(200.0); library_panel::library_menu::(app, ui); }); diff --git a/crates/ui-egui/src/panels/tests_panel_rows.rs b/crates/ui-egui/src/panels/tests_panel_rows.rs index 51a22a4d2b..03752e9bdc 100644 --- a/crates/ui-egui/src/panels/tests_panel_rows.rs +++ b/crates/ui-egui/src/panels/tests_panel_rows.rs @@ -36,3 +36,12 @@ fn the_color_wheel_box_and_its_strip_stay_inside_the_panel() { assert!(strip.height() <= field.height(), "the strip {strip:?} is taller than the box {field:?}"); assert!(field.right() <= ROOM.x && strip.right() <= ROOM.x, "the box {field:?} or its strip {strip:?} runs past the panel"); } + +#[test] +fn align_to_shares_the_distribute_spacing_line_inside_the_align_panel() { + let panel = Panel::new(app_with_rect(), align::show); + let (field, to) = (panel.rect("Distribute Spacing"), panel.rect("Align to Artboard")); + assert!(to.left() > field.right(), "Align To at {to:?} is not beside the spacing field {field:?}"); + assert!((field.top()..=field.bottom()).contains(&to.center().y), "Align To at {to:?} is off the spacing field's line {field:?}"); + assert!(to.right() <= ROOM.x, "Align To at {to:?} runs past the panel"); +} diff --git a/crates/ui-egui/src/panels/transform.rs b/crates/ui-egui/src/panels/transform.rs index 4e16fcc963..1b2f34334a 100644 --- a/crates/ui-egui/src/panels/transform.rs +++ b/crates/ui-egui/src/panels/transform.rs @@ -16,7 +16,7 @@ use craft::keymap::CommandRef; use craft::ui::buttons::IconButton; use craft::ui::choice::Checkbox; use craft::ui::contract::{Bind, Entry, GlyphLabel, LabelKind, LabelPress, Props, Show, ShowContainer, SideLabel, Sizing}; -use craft::ui::display::{Shade, Text}; +use craft::ui::display::{Divider, Shade, Text}; use craft::ui::form::Field; use craft::ui::layout_components::Row; use craft::ui::menu::PanelRow; @@ -576,18 +576,21 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { IconButton::command(IconId::new("flip-vertical-2"), FLIP_HORIZONTAL).show(ui); IconButton::command(IconId::new("flip-horizontal-2"), FLIP_VERTICAL).show(ui); }); - // Live shape properties (a path with live corners is no shape). + // Live shape properties (a path with live corners is no shape), ruled off from the fields as the options are. if let Some(n) = first_selected(app) && let NodeKind::Path { live: Some(live), .. } = &n.kind && !matches!(**live, LiveShape::Path { .. }) - && !live_shape_rows(app, ui, &n, live, true) { - Text::new(tl!("Shape Properties:")).show(ui); - Text::new(tl!(n.kind_label())).shade(Shade::Muted).show(ui); + Divider::horizontal().show(ui); + if !live_shape_rows(app, ui, &n, live, true) { + Text::new(tl!("Shape Properties:")).show(ui); + Text::new(tl!(n.kind_label())).shade(Shade::Muted).show(ui); + } } if part_hidden(app, HIDE_OPTIONS_KEY) { return; } + Divider::horizontal().show(ui); let (sc, ss) = (app.session.prefs.scale_corners, app.session.prefs.scale_strokes); option_check(app, ui, tl!("Scale Corners"), "scaleCorners", sc); option_check(app, ui, tl!("Scale Strokes & Effects"), "scaleStrokes", ss); diff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rs index d7f66aaafb..016e665e88 100644 --- a/crates/ui-egui/src/theme.rs +++ b/crates/ui-egui/src/theme.rs @@ -147,18 +147,31 @@ pub fn root_theme(prefs: &Prefs) -> (ThemeId, ModeChoice, Option) { /// The app's sizes over the framework's size sets (`sizes.json`): push buttons have the app's 4-point corners /// where the sets give pills, the Home title is 26-point under 60 points of page margin with a 36-point call to -/// action, and the compact set takes the reference app's metrics: -/// 26-point fields and spinners, 24-point push buttons, 10 points inside panels, 5 between rows, 13-point body type -/// with 12.5-point labels and 11-point captions, 16-point glyphs in icon buttons, 5-point control corners, 8-point -/// menus and 10-point windows, 33-point panel tabs, 310-point dock columns with 14-point column bars and 38-point -/// icon columns. +/// action, Home keeps production's rhythm (its item spacing of 5 plus the room it added: 9 from title to subtitle, 27 +/// to New and Open, 28-point New and Open with 16 points beside their labels and 14 between them, 33 between sections, +/// 15 under a heading, 24-point link rows 5 apart), and the compact set takes the reference app's metrics: +/// 26-point fields and spinners, 24-point push buttons, 10 points inside panels, 5 between rows, 16-point glyphs in +/// icon buttons, 5-point control corners, 8-point menus and 10-point windows, 33-point panel tabs, 310-point dock +/// columns with 14-point column bars and 38-point icon columns, 29-point menu rows, and dialogs 22 points inside their +/// edge with 28-point buttons at least 72 points wide. +/// Its type is the size the reference app draws: it set Inter at 92% of its nominal 13-point body, 12.5-point labels +/// and 11.5-point captions, so they read at 12, 11.5 and 10.5 points, on the rows those nominal sizes gave. const SIZES: &[u8] = br#"{ "all": { "radius.button": 4, "typography.display.size": 26, "typography.display.line_height": 32, "size.page.margin": 60, - "size.page.action": 36 + "size.page.action": 36, + "size.page.button": 28, + "size.page.button_side": 16, + "size.page.gap.title": 9, + "size.page.gap.lead": 27, + "size.page.gap.actions": 14, + "size.page.gap.section": 33, + "size.page.gap.heading": 15, + "size.page.gap.link": 5, + "size.page.link": 24 }, "compact": { "size.control.md": 26, @@ -175,13 +188,17 @@ const SIZES: &[u8] = br#"{ "radius.control": 5, "radius.surface": 8, "radius.window": 10, - "typography.body.size": 13, + "size.dialog.button": 72, + "size.dialog.button_height": 28, + "size.row.menu": 29, + "space.pad.dialog": 22, + "typography.body.size": 12, "typography.body.line_height": 17, - "typography.body_strong.size": 13, + "typography.body_strong.size": 12, "typography.body_strong.line_height": 17, - "typography.label.size": 12.5, + "typography.label.size": 11.5, "typography.label.line_height": 17, - "typography.caption.size": 11, + "typography.caption.size": 10.5, "typography.caption.line_height": 15 } }"#; diff --git a/crates/ui-egui/tests/image_trace_ignore_sampler.rs b/crates/ui-egui/tests/image_trace_ignore_sampler.rs index 9d8aefd246..4ecc34891e 100644 --- a/crates/ui-egui/tests/image_trace_ignore_sampler.rs +++ b/crates/ui-egui/tests/image_trace_ignore_sampler.rs @@ -31,13 +31,15 @@ fn pointer_events(events: &[Event]) -> usize { events.iter().filter(|event| matches!(event, Event::PointerMoved(_) | Event::PointerButton { .. })).count() } -/// One step of the app: the frame of `raw`, then empty frames at its time until all its pointer events arrived. A frame -/// can take more than one pass, and egui gives the frame's events to its first; the framework gives a pass one press, -/// as its last pointer event, and holds the events after it for the next frame ("Input pacing", one press per pass). +/// One step of the app: the frame of `raw`, then empty frames at its time until all its pointer events arrived and the +/// press lifecycle reported them. A frame can take more than one pass, and egui gives the frame's events to its first; +/// the framework gives a pass one press, as its last pointer event, and holds the events after it for the next frame +/// ("Input pacing", one press per pass). The lifecycle reports one phase a pass: a pass that brings a release and the +/// next press reports the press's Down in the next pass, and the release that follows it one pass later still. fn run_ui(app: &mut VectorcraftApp, ctx: &egui::Context, mut raw: RawInput) -> egui::FullOutput { let (sent, time, screen_rect) = (pointer_events(&raw.events), raw.time, raw.screen_rect); let mut frames = Vec::new(); - let mut arrived = 0; + let (mut arrived, mut owed) = (0, 0); loop { let mut first = None; let out = ctx.run_ui(raw, |ui| { @@ -49,8 +51,10 @@ fn run_ui(app: &mut VectorcraftApp, ctx: &egui::Context, mut raw: RawInput) -> e }); let first = first.expect("a frame runs a pass"); arrived += pointer_events(&first.events); + let buttons = first.events.iter().filter(|event| matches!(event, Event::PointerButton { .. })).count(); + owed = (owed + buttons).saturating_sub(out.platform_output.num_completed_passes); frames.push(first); - if arrived >= sent { + if arrived >= sent && owed == 0 { FRAME_INPUT.with(|input| *input.borrow_mut() = Some((frames, ctx.cumulative_pass_nr()))); return out; } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index bc98064b41..18a9a70160 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 = "4bed21baaa41d2b47bef90879c04df521f6f6043"; +const REV: &str = "6fcf61c816c399508a60c7029a59e2c7b6139e0b"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV), From f49734f5ec92d66f932f2e084f989314d650b8b2 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 25 Nov 2026 08:57:54 -0800 Subject: [PATCH 29/32] Docs: SVG round trips keep mm, cm, in and pc; other units keep their printed size --- docs/gaps.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/gaps.md b/docs/gaps.md index 0dcd5ac37b..0c9937458b 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -442,7 +442,7 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi such stubs into one vertex (within 4× the sweep's tolerance up and down its frame and 1/16 of the 0.01 pt precision along it, bounded by each cluster's extent so a run of tiny level segments keeps its length); regression tests in `crates/pathops/src/planar.rs`. Estimate unchanged. -- **Done (#864):** SVG export writes physical unit suffixes on the root `` for documents with physical units (`mm`, `cm`, `in`, `pc`; documents in feet and yards are written in `in`, in meters in `cm`, and in Q or Ha in `mm`, since SVG has no unit for them: `every_physical_document_unit_exports_its_printed_size`), so external vector tools (Inkscape, LightBurn) and browsers render drawings at their intended physical scale rather than scaling to 75% under point-based user-unit assumptions; unitless user coordinates in `viewBox` and path geometry remain in 1:1 internal points per SVG 1.1 coords §7.10, preserving document units on round trips (`export_physical_units_writes_unit_suffixes`, `svg_round_trip_preserves_document_units`). General document unit preferences across restarts remain tracked under #864. +- **Done (#864):** SVG export writes physical unit suffixes on the root `` for documents with physical units (`mm`, `cm`, `in`, `pc`; documents in feet and yards are written in `in`, in meters in `cm`, and in Q or Ha in `mm`, since SVG has no unit for them: `every_physical_document_unit_exports_its_printed_size`), so external vector tools (Inkscape, LightBurn) and browsers render drawings at their intended physical scale rather than scaling to 75% under point-based user-unit assumptions; unitless user coordinates in `viewBox` and path geometry remain in 1:1 internal points per SVG 1.1 coords §7.10. A round trip keeps `mm`, `cm`, `in` and `pc` documents in their unit (`export_physical_units_writes_unit_suffixes`, `svg_round_trip_preserves_document_units`); documents in feet, yards, meters, Q or Ha keep their printed size and open again in the SVG unit they were written in. General document unit preferences across restarts remain tracked under #864. - **Missing:** general document unit preference on restart (#864; SVG export physical units done). Shape Builder regions (#937, closed), PDF text placement (#722, above), the bezier drag preview (#834, #3065, #3729) and deleting an interior anchor of an open path (above) are done. From edc0a6da504d0816cd7f5598eca3c9541fbd3959 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 25 Nov 2026 09:35:53 -0800 Subject: [PATCH 30/32] Tests: floated panel bodies stay within the requested width The narrow-panel row tests compared each control with the floating panel's body but never checked the body itself, so a body wider than the requested width would let controls past the panel edge pass. floated() now asserts the body is no wider than the width the float asked for. --- crates/ui-egui/src/panels/tests_panel_rows.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/ui-egui/src/panels/tests_panel_rows.rs b/crates/ui-egui/src/panels/tests_panel_rows.rs index e536facd0d..6f6e099900 100644 --- a/crates/ui-egui/src/panels/tests_panel_rows.rs +++ b/crates/ui-egui/src/panels/tests_panel_rows.rs @@ -60,6 +60,7 @@ fn floated(panel: &str, lang: &str, width: f32, names: &[&str]) -> (egui::Rect, .filter(|(_, n)| n.role() == Role::TabPanel) .find_map(|(_, n)| rect(n).filter(|r| (r.left() - AT).abs() < 1.0)) .unwrap_or_else(|| panic!("{panel} does not float at x {AT}")); + assert!(body.width() <= width + 1.0, "{panel}'s body {body:?} is wider than the {width} the float asked for"); let controls = shown .into_iter() .map(|name| { From 694f66a7bdbc6a23d652b39f81bb40993699aa54 Mon Sep 17 00:00:00 2001 From: BFlat Date: Thu, 26 Nov 2026 02:04:33 +0700 Subject: [PATCH 31/32] Look: Home's Learn below the presets, and the title bar's menus, cursor and tab close as production's (#9322) * Home: Learn after the presets, as one row of skill cards The presets stand right under New and Open again, as in 0.24.1, and Learn follows them before Community. Learn is a Column page section whose heading row ends in the Quick skill guide link (learn.skills), over a raised card per skill: its title over its tutorials as plain links (learn.show), a page link gap apart. The four cards stand in one row in a full-width column and two by two in a narrower one. The section is about half as tall as before (161 points at 1600x1000, was 333). * Chrome: menu titles, title bar cursor and tab close button as production's The menu bar's titles stand as production's egui buttons (MenuTitleLook::Button): 24 high, 4-point corners, 2 points beside the text, 6 apart, in place of square 26-high rows padded 6. The title bar and the panel headers keep the arrow, over the menu titles too (MoveBandCursor::Arrow), where the move band showed its open hand. A document tab's x is a 12-point glyph that brightens under the pointer with no fill (TabCloseLook::Glyph), in place of a fill as tall as the tab. Needs craft-libs fix/vc-look10-chrome (MenuTitleLook, MoveBandCursor, TabCloseLook); the pin moves when it lands on next. * craft-libs: next b0d422cf0, with the menu title, move band cursor and tab close looks VectorCraft sets --- Cargo.lock | 160 ++++++++++++++--------------- Cargo.toml | 68 ++++++------ apps/vectorcraft-web/Cargo.toml | 2 +- crates/ui-egui/src/app.rs | 14 ++- crates/ui-egui/src/canvas/home.rs | 87 ++++++++-------- crates/ui-egui/src/panels/learn.rs | 8 +- crates/ui-egui/src/tests/home.rs | 6 +- docs/mcp.md | 6 +- docs/target-app-parity.md | 2 +- xtask/src/pdf_deps.rs | 2 +- 10 files changed, 184 insertions(+), 171 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5c9393ef10..14d5119325 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1134,7 +1134,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-automation", "craft-behavior", @@ -1175,7 +1175,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "crc32fast", "flate2", @@ -1186,7 +1186,7 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "block2 0.6.2", "objc2-app-kit 0.3.2", @@ -1196,7 +1196,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "rustix 1.1.6", ] @@ -1204,7 +1204,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1229,7 +1229,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1247,7 +1247,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-docpath", @@ -1265,7 +1265,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "crc32fast", "flate2", @@ -1274,7 +1274,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "egui", ] @@ -1282,7 +1282,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "md-5", "rayon", @@ -1291,12 +1291,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-cms", @@ -1316,7 +1316,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "getrandom 0.3.4", "serde", @@ -1326,7 +1326,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "rayon", ] @@ -1334,7 +1334,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "block2 0.6.2", "craft-atomic", @@ -1359,7 +1359,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "serde", ] @@ -1367,7 +1367,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1386,7 +1386,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-codepage", "encoding_rs", @@ -1398,12 +1398,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1418,7 +1418,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1437,7 +1437,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "cap-primitives", "craft-atomic", @@ -1459,12 +1459,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "gif", ] @@ -1472,7 +1472,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "flate2", ] @@ -1480,7 +1480,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1493,7 +1493,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "chrono", "fixed_decimal", @@ -1521,7 +1521,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-dds", "craft-jpeg", @@ -1548,7 +1548,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1566,7 +1566,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "thiserror 2.0.21", ] @@ -1574,7 +1574,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1585,7 +1585,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-host", "craft-i18n", @@ -1600,7 +1600,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-i18n", @@ -1614,7 +1614,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-host", @@ -1632,7 +1632,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1644,7 +1644,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "encoding_rs", "image", @@ -1655,7 +1655,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "chrono", "craft-codepage", @@ -1665,7 +1665,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-keymap", @@ -1681,7 +1681,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1693,7 +1693,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "async-channel", "async-io", @@ -1724,7 +1724,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1733,7 +1733,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-host", @@ -1757,7 +1757,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1768,7 +1768,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-eps", "flate2", @@ -1782,7 +1782,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "encoding_rs", "flate2", @@ -1793,7 +1793,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "dispatch2", "egui", @@ -1806,7 +1806,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1825,7 +1825,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-atomic", "craft-host", @@ -1842,7 +1842,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "fax", "hayro-ccitt", @@ -1853,7 +1853,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-image-codecs", "craft-xml", @@ -1874,7 +1874,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-keymap", @@ -1886,7 +1886,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-font-manager", @@ -1911,7 +1911,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -1926,7 +1926,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-atomic", "craft-behavior", @@ -1941,7 +1941,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "serde", "thiserror 2.0.21", @@ -1951,7 +1951,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "serde", "thiserror 2.0.21", @@ -1960,7 +1960,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-keymap", @@ -1975,12 +1975,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -1994,7 +1994,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-i18n", @@ -2010,7 +2010,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "accesskit", "craft-behavior", @@ -2048,7 +2048,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2059,7 +2059,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-host", @@ -2077,7 +2077,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-host", @@ -2098,7 +2098,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-host", @@ -2119,7 +2119,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-host", @@ -2138,7 +2138,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "chrono", "craft-host", @@ -2167,7 +2167,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "flate2", "serde", @@ -2178,7 +2178,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2188,7 +2188,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "js-sys", "serde_json", @@ -2199,7 +2199,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "winsafe", ] @@ -2207,7 +2207,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-appkit", "craft-atomic", @@ -2239,7 +2239,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3507,7 +3507,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "brotli", "hayro-postscript", @@ -3516,7 +3516,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3534,7 +3534,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3552,12 +3552,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "flate2", "hayro-ccitt", @@ -4488,7 +4488,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4645,7 +4645,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "arrayvec", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index e7eb351554..51693818bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,44 +11,44 @@ rust-version = "1.95" repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # 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 = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # 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 = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # 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 = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -191,13 +191,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } emath = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } epaint = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index 8cca976717..6a5d1de9b7 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -27,7 +27,7 @@ log = { 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 = "6fcf61c816c399508a60c7029a59e2c7b6139e0b", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 299f4c22d5..2f25c3ea4d 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -6,10 +6,10 @@ use craft::platform::clock::monotonic_ms; use craft::theme::variant::Tone; use craft::ui::buttons::{ActiveLook, PushButtonLook}; use craft::ui::choice::ChoiceLook; -use craft::ui::contract::{Bind, CaptionInk, GlyphColon, LinkLabelInk, LinkLabelUnderline, QuietHeader, SectionRhythm}; +use craft::ui::contract::{Bind, CaptionInk, GlyphColon, LinkLabelInk, LinkLabelUnderline, MoveBandCursor, QuietHeader, SectionRhythm}; use craft::ui::docking::IconGroupSeparator; use craft::ui::list::{CommandHighlight, ThumbRows}; -use craft::ui::menu::MenuTitlePad; +use craft::ui::menu::MenuTitleLook; use craft::ui::patterns::form_dialogs::PresetCardLook; use craft::ui::runtime::env::{RootEnv, Scale, ScrubDrags, WindowKey}; use craft::ui::runtime::frame::{FrameInput, FrameOutput}; @@ -19,7 +19,7 @@ use craft::ui::sections::{DialogButtonLook, QuietTitleRow}; use craft::ui::shell::embed::CloseDecision; use craft::ui::shell::{AppShell, CanvasPanel, Slot}; use craft::ui::style::TrackFill; -use craft::ui::tabs::DocumentTabLook; +use craft::ui::tabs::{DocumentTabLook, TabCloseLook}; use craft::ui::text::{NumberLook, NumberPrecision}; use vectorcraft_engine::cmd::clipboard::PASTE_ORDER; use vectorcraft_engine::cmd::toast::Level; @@ -741,10 +741,14 @@ pub(crate) fn root_env(prefs: &vectorcraft_engine::Prefs, native_ppp: f32) -> Ro root.values.set(ThumbRows::Tight); // The Layers Objects search field fills the filter bar up to its Filter button, as production's did. root.values.set(ObjectsSearch::Fill); - // The menu bar's titles stand as close as production's, which share the line with the bar's other controls. - root.values.set(MenuTitlePad::Control); + // The menu bar's titles are production's egui buttons: a push button high, 2 points beside the text, rounded. + root.values.set(MenuTitleLook::Button); + // The title bar and the panel headers keep the arrow, over the menu titles too, as production's did. + root.values.set(MoveBandCursor::Arrow); // Document tabs show their title and its `*` in the label's semibold face, as production drew them. root.values.set(DocumentTabLook::Semibold); + // A document tab's × is a small glyph that brightens under the pointer, with no fill, as production drew it. + root.values.set(TabCloseLook::Glyph); // A collapsed panel column's icon groups stand apart by a hairline, as production drew them. root.values.set(IconGroupSeparator::Rule); // New Document's preset cards show blank paper on a flat card, as production drew them. diff --git a/crates/ui-egui/src/canvas/home.rs b/crates/ui-egui/src/canvas/home.rs index 556574d1ba..d95cdc02e1 100644 --- a/crates/ui-egui/src/canvas/home.rs +++ b/crates/ui-egui/src/canvas/home.rs @@ -1,11 +1,13 @@ -use craft::behavior::IconId; -use craft::ui::buttons::{Button, ControlPlace, LinkLook}; -use craft::ui::contract::{Bind, Gap, Props as _, Show as _, ShowContainer as _}; -use craft::ui::display::{Shade, Text}; -use craft::ui::layout_components::{Row, Stack}; -use craft::ui::runtime::env::{Overrides, with_env}; -use craft::ui::shell::{RecentFile, StartAction, StartLayout, StartLink, StartScreen, Template}; -use craft::ui::style::TypeRole; +use craft::behavior::{ColumnWidth, IconId}; +use craft::ui::buttons::{Link, LinkLook}; +use craft::ui::contract::{Bind, Gap, Pad, Props as _, Show as _, ShowContainer as _, clicked}; +use craft::ui::display::Text; +use craft::ui::layout::CellAlign; +use craft::ui::layout_components::{Grid, Stack}; +use craft::ui::runtime::env::{Env, Overrides, with_env}; +use craft::ui::sections::Section; +use craft::ui::shell::{RecentFile, StartAction, StartLayout, StartLink, StartPlace, StartScreen, Template}; +use craft::ui::style::{SurfaceKind, TypeRole}; use super::{Ui, VectorcraftApp, json}; @@ -15,6 +17,10 @@ const TEMPLATES: [&str; 6] = ["Letter", "A4", "Web 1920×1080", "Phone 390×844" /// The icons of the three `community::link_urls` links, in their order. const LINK_ICONS: [&str; 3] = ["globe", "external-link", "git-branch"]; +/// The Learn cards across a full-width column, and across a narrower one. +const FOUR: &[ColumnWidth] = &[ColumnWidth::fill(1.0); 4]; +const TWO: &[ColumnWidth] = &[ColumnWidth::fill(1.0); 2]; + /// The Home screen (`app.home`; with no document open, unless its preference is off). pub(super) fn home(app: &mut VectorcraftApp, ui: &mut Ui, rect: egui::Rect) { let recent: Vec = crate::io::recent_files(app) @@ -37,16 +43,14 @@ pub(super) fn home(app: &mut VectorcraftApp, ui: &mut Ui, rect: egui::Rect) { for ((label, url), icon) in crate::community::link_urls(app).into_iter().zip(LINK_ICONS) { links.push(StartLink::url(tl!(label), Some(IconId::new(icon)), url)); } - // The column shows no view switch or sort; the bindings hold copies so the Learn section can borrow the app. - let (mut view, mut sort) = (app.ui.home_view, app.ui.home_sort); let mut pressed = None; - let mut learn = |ui: &mut Ui| learn(app, ui, &mut pressed); let mut child = ui.new_child(egui::UiBuilder::new().max_rect(rect).layout(egui::Layout::top_down(egui::Align::Min))); // Production's community links read in the accent alone, with no underline. let plain_links = |overrides: &mut Overrides| { overrides.values.set(LinkLook::Plain); }; - let start = StartScreen::new(Bind::bound(&mut view), Bind::bound(&mut sort), &recent) + // Learn follows the presets, which stand right under New and Open as in production 0.24.1. + let start = StartScreen::new(Bind::bound(&mut app.ui.home_view), Bind::bound(&mut app.ui.home_sort), &recent) .layout(StartLayout::Column) .title(tl!("Welcome to VectorCraft")) .subtitle(tl!("Vector illustration — fast, open, scriptable.")) @@ -57,15 +61,13 @@ pub(super) fn home(app: &mut VectorcraftApp, ui: &mut Ui, rect: egui::Rect) { .templates_title(tl!("Quickly start a new file")) .links(&links) .links_title(tl!("Community")) - .app_section(tl!("Learn"), &mut learn); + .section(StartPlace::AfterSections, |ui, _| learn(ui, &mut pressed)); let out = with_env(&mut child, plain_links, |ui| start.show(ui)); - app.ui.home_view = view; - app.ui.home_sort = sort; for action in out.actions { run_action(app, action); } - if let Some(id) = pressed - && let Err(e) = app.run("learn.show", json!({ "tutorial": id })) + if let Some((command, args)) = pressed + && let Err(e) = app.run(command, args) { app.status(e); } @@ -92,31 +94,36 @@ fn run_action(app: &mut VectorcraftApp, action: StartAction) { } } -/// The Home screen's Learn section: the Quick skill guide card, which shows the Learn panel's list -/// of skills, and the Learn panel's tutorials under their skills (each title dim over its tutorials), each a button -/// that shows the panel at its steps (`learn.show`), as tall as New and Open and a page heading's gap apart, as -/// production spaced them. The start screen may run this twice in a pass, so it only draws and records the tutorial -/// pressed in `pressed`. -fn learn(app: &mut VectorcraftApp, ui: &mut Ui, pressed: &mut Option<&'static str>) { - use crate::panels::learn::{catalog, guide_card}; - let _ = Stack::new().gap(Gap::PageHeading).fill_width().show(ui, |ui, _| { - guide_card(app, ui); // PLAN: assumed `guide_card(app, ui)` as document-panels-w18 leaves it, on `Button::detail`. - for skill in catalog::SKILLS { - let _ = Stack::new().gap(Gap::Stack).fill_width().show(ui, |ui, _| { - let _ = Text::new(skill.title).role(TypeRole::Label).shade(Shade::Muted).show(ui); - let place = |overrides: &mut Overrides| { - overrides.values.set(ControlPlace::PageAction); - }; - let _ = with_env(ui, place, |ui| { - Row::new().show(ui, |ui, _| { - for tutorial in skill.tutorials { - if Button::new(tutorial.title).id_salt(tutorial.id).show(ui).clicked() { - *pressed = Some(tutorial.id); +/// The Home screen's Learn section, after the new-file presets: a Column page section whose heading row ends in the +/// Quick skill guide link, which shows the Learn panel's list of skills (`learn.skills`), over a card per skill: its +/// title over its tutorials as links, each showing the panel at its steps (`learn.show`). The four cards stand in one +/// row in a column at its full `size.page.column` width, and two by two in a narrower one. The start screen may run +/// this twice in a pass, so it only draws and records the command chosen in `pressed`. +fn learn(ui: &mut Ui, pressed: &mut Option<(&'static str, serde_json::Value)>) { + use crate::panels::learn::catalog::SKILLS; + let (mut guide, mut tutorial) = (false, None); + let across = if ui.available_width() + 0.5 >= Env::of(ui).tokens.size.page.column { FOUR } else { TWO }; + let section = Section::fixed(tl!("Learn")).quiet_header().header_gap(Gap::PageHeading); + let _ = section.controls(|ui, _| guide |= clicked(&Link::new(tl!("Quick skill guide")).show(ui))).show(ui, |ui, _| { + let _ = Grid::new(across).gap(Gap::Section).cells(CellAlign::Top).fill_width().show(ui, |ui, _| { + for skill in SKILLS { + let card = Stack::new().surface(SurfaceKind::Raised).pad(Pad::Regular).gap(Gap::Stack).fill_width(); + let _ = card.show(ui, |ui, _| { + let _ = Text::new(skill.title).role(TypeRole::BodyStrong).show(ui); + let _ = Stack::new().gap(Gap::PageLink).show(ui, |ui, _| { + for t in skill.tutorials { + if clicked(&Link::new(t.title).id_salt(t.id).show(ui)) { + tutorial = Some(t.id); } } - }) + }); }); - }); - } + } + }); }); + if guide { + *pressed = Some(("learn.skills", json!({}))); + } else if let Some(id) = tutorial { + *pressed = Some(("learn.show", json!({ "tutorial": id }))); + } } diff --git a/crates/ui-egui/src/panels/learn.rs b/crates/ui-egui/src/panels/learn.rs index 7b67ecc804..d765fe48c3 100644 --- a/crates/ui-egui/src/panels/learn.rs +++ b/crates/ui-egui/src/panels/learn.rs @@ -13,8 +13,7 @@ //! one tutorial, `learn.back` goes up one level, `learn.locateTool` shows where a tool is, //! `learn.openSample`, `learn.markStep`, `learn.finish` and `learn.next` run the practice controls, //! `learn.resetProgress` clears the progress, and `window.learn` shows or hides the panel. The Home -//! screen's Learn section shows the same card ([`guide_card`]) and the tutorials, which open the -//! panel. +//! screen's Learn section links to the list of skills and to each tutorial, which open the panel. pub mod catalog; pub mod locate; @@ -109,9 +108,8 @@ fn for_you(app: &mut VectorcraftApp, ui: &mut Ui) { } /// The Quick skill guide card, as one button: a click, or Enter or Space while it has the keyboard -/// focus, shows the panel's list of skills (`learn.skills`). The For you tab and the Home screen's -/// Learn section show it. -pub(crate) fn guide_card(app: &mut VectorcraftApp, ui: &mut Ui) { +/// focus, shows the panel's list of skills (`learn.skills`). The For you tab shows it. +fn guide_card(app: &mut VectorcraftApp, ui: &mut Ui) { // PLAN: assumed `Button::detail(impl Into