diff --git a/apps/vectorcraft-cli/src/main.rs b/apps/vectorcraft-cli/src/main.rs index 5dfe7386f6..533074b9b5 100644 --- a/apps/vectorcraft-cli/src/main.rs +++ b/apps/vectorcraft-cli/src/main.rs @@ -253,6 +253,7 @@ fn with_stores(mut h: Headless) -> Headless { prefs_dir::attach_pdf_preset_store(&mut h.session); prefs_dir::attach_custom_dictionary(&mut h.session); prefs_dir::attach_arrowheads(&mut h.session); + prefs_dir::attach_bevels(&mut h.session); h } diff --git a/apps/vectorcraft/src/main.rs b/apps/vectorcraft/src/main.rs index aa62211500..29cb56bdfa 100644 --- a/apps/vectorcraft/src/main.rs +++ b/apps/vectorcraft/src/main.rs @@ -567,6 +567,8 @@ fn main() -> std::process::ExitCode { prefs_dir::attach_custom_dictionary(&mut app.session); // The custom arrowheads, kept in their own file next to the preferences. prefs_dir::attach_arrowheads(&mut app.session); + // The custom bevels, kept in their own file next to the preferences. + prefs_dir::attach_bevels(&mut app.session); // Fit the window to its monitor, or put it back where it was (still hidden). let winit_window = cc.winit_window().cloned(); if let Some(w) = &winit_window { diff --git a/apps/vectorcraft/src/prefs_dir.rs b/apps/vectorcraft/src/prefs_dir.rs index f863a6eba3..492e2ea7bf 100644 --- a/apps/vectorcraft/src/prefs_dir.rs +++ b/apps/vectorcraft/src/prefs_dir.rs @@ -122,6 +122,14 @@ pub fn attach_arrowheads(session: &mut vectorcraft_engine::Session) { } } +/// Keep the custom bevels (`threeD.bevels.edit`) in the `Bevels.vectorcraft` file next to the +/// settings, and list the bevels it holds. +pub fn attach_bevels(session: &mut vectorcraft_engine::Session) { + if let Some(path) = store_dir(vectorcraft_engine::cmd::bevels::FILE_NAME) { + session.attach_bevels_file(path.to_string_lossy().to_string()); + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/crates/effects/src/catalog.rs b/crates/effects/src/catalog.rs index 3f7c979e8b..060afd92a8 100644 --- a/crates/effects/src/catalog.rs +++ b/crates/effects/src/catalog.rs @@ -191,7 +191,7 @@ pub fn effect_catalog() -> Vec { EXTRUDE, "Extrude & Bevel…", &["Effect", "3D and Materials"], - "{depth: pt (0..2000, 50), twist: degrees (0..360, 0; the back turned against the front), taper: % (1..100, 100; the back's size), cap: bool (true: solid; false: hollow), bevel: none|classic|rounded|cove|step|ogee (none), bevelWidth: pt (0..1000, 4), bevelHeight: pt (0..1000, 4), bevelRepeat: integer (1..32, 1), bevelSpace: % (0..90, 0; flat between repeats), bevelInside: bool (false: added around the shape; true: carved into it), bevelBothSides: bool (false), rotationX: degrees (-180..180, -21.88), rotationY: degrees (-180..180, -23.4), rotationZ: degrees (-180..180, 9.06; the defaults are the Off-Axis Front position), perspectiveAngle: degrees (0..160, 0; 0 is none, wider brings the eye nearer), perspective: % (0..100; the earlier form, read as the perspectiveAngle that shows the same view), shade: bool (true), lightColor: #rrggbb (white, #ffffff; legacy directional light color), lights: null or array of 1..10 objects (color: #rrggbb, intensity: % 0..100, rotation: degrees -180..180, height: degrees 0..90, softness: % 0..100, behind: bool; overrides the single-light fields; ambient is shared), lightRotation: degrees (-180..180, 125.26; round the object on the page, 0 on its right, counterclockwise), lightHeight: degrees (0..90, 30; 0 beside the object, 90 straight in front), lightBehind: bool (false; true lights it from behind), lightIntensity: % (0..100, 80), lightSoftness: % (0..100, 0; how far round the object the light reaches, and how much it blurs the shadow), ambient: % (0..200, 25; Ambient Light), lightAzimuth: degrees (the earlier form: with lightElevation, read as the lightRotation, lightHeight and lightBehind of the same light), lightElevation: degrees (the earlier form, with lightAzimuth), shadow: bool (false; the first light casts a shadow, black at 50% times the art's opacity, hard-edged at the first light's softness 0 and blurred above it), shadowPosition: behind|below (behind; behind: on a plane square to the view, below: on the floor under the object, turned with it), shadowDistance: % (0..100, 0; how far the plane is from the object, as a share of its largest size), shadowBounds: % (10..400, 100; how far the plane reaches: at 100 it is four times the object's largest size across), graphics: array of 0..64 objects ([]; the 3D and Materials panel's Graphics on the caps and the side, see threeD.mapGraphic: symbol: name of a document symbol, face: front|back|side (front; the back reads left to right as seen from behind; side is the walls and bevels), x: pt (0; the offset of the graphic's center from the center of the object's bounds, in the face's own plane; on the side from the middle of the side unrolled flat, along the outline, clockwise from its top), y: pt (0; on the side from the front toward the back), scale: % (1..10000, 100; of the symbol's own size), rotation: degrees (-360..360, 0; counterclockwise); drawn turned, foreshortened and shaded with the face and clipped to it: on a cap of a solid object only, and on the side of a solid or hollow object wrapped around it and drawn only where its outside faces the viewer), render: object ({mode: shaded}; mode: shaded|wireframe, as Revolve's)}. The front face is the art, extruded backwards about the centre of its bounds; painted with the top fill (else the top stroke).", + "{depth: pt (0..2000, 50), twist: degrees (0..360, 0; the back turned against the front), taper: % (1..100, 100; the back's size), cap: bool (true: solid; false: hollow), bevel: none|classic|rounded|cove|step|ogee (none; or custom, a bevel of the user's own drawn by bevelProfile), bevelWidth: pt (0..1000, 4), bevelHeight: pt (0..1000, 4), bevelRepeat: integer (1..32, 1), bevelSpace: % (0..90, 0; flat between repeats), bevelInside: bool (false: added around the shape; true: carved into it), bevelBothSides: bool (false), bevelName: string (a custom bevel's name), bevelProfile: [[x, y], …] (a custom bevel's 2 to 64 points, shares 0..1 of the width and height from [0, 0] at the cap's edge to [1, 1] at the side wall, joined by straight lines; effect.apply and effect.setParams also take bevel {custom: name}, a bevel of the bevels file (threeD.bevels.list), and store it as bevel custom with its bevelName and bevelProfile), rotationX: degrees (-180..180, -21.88), rotationY: degrees (-180..180, -23.4), rotationZ: degrees (-180..180, 9.06; the defaults are the Off-Axis Front position), perspectiveAngle: degrees (0..160, 0; 0 is none, wider brings the eye nearer), perspective: % (0..100; the earlier form, read as the perspectiveAngle that shows the same view), shade: bool (true), lightColor: #rrggbb (white, #ffffff; legacy directional light color), lights: null or array of 1..10 objects (color: #rrggbb, intensity: % 0..100, rotation: degrees -180..180, height: degrees 0..90, softness: % 0..100, behind: bool; overrides the single-light fields; ambient is shared), lightRotation: degrees (-180..180, 125.26; round the object on the page, 0 on its right, counterclockwise), lightHeight: degrees (0..90, 30; 0 beside the object, 90 straight in front), lightBehind: bool (false; true lights it from behind), lightIntensity: % (0..100, 80), lightSoftness: % (0..100, 0; how far round the object the light reaches, and how much it blurs the shadow), ambient: % (0..200, 25; Ambient Light), lightAzimuth: degrees (the earlier form: with lightElevation, read as the lightRotation, lightHeight and lightBehind of the same light), lightElevation: degrees (the earlier form, with lightAzimuth), shadow: bool (false; the first light casts a shadow, black at 50% times the art's opacity, hard-edged at the first light's softness 0 and blurred above it), shadowPosition: behind|below (behind; behind: on a plane square to the view, below: on the floor under the object, turned with it), shadowDistance: % (0..100, 0; how far the plane is from the object, as a share of its largest size), shadowBounds: % (10..400, 100; how far the plane reaches: at 100 it is four times the object's largest size across), graphics: array of 0..64 objects ([]; the 3D and Materials panel's Graphics on the caps and the side, see threeD.mapGraphic: symbol: name of a document symbol, face: front|back|side (front; the back reads left to right as seen from behind; side is the walls and bevels), x: pt (0; the offset of the graphic's center from the center of the object's bounds, in the face's own plane; on the side from the middle of the side unrolled flat, along the outline, clockwise from its top), y: pt (0; on the side from the front toward the back), scale: % (1..10000, 100; of the symbol's own size), rotation: degrees (-360..360, 0; counterclockwise); drawn turned, foreshortened and shaded with the face and clipped to it: on a cap of a solid object only, and on the side of a solid or hollow object wrapped around it and drawn only where its outside faces the viewer), render: object ({mode: shaded}; mode: shaded|wireframe, as Revolve's)}. The front face is the art, extruded backwards about the centre of its bounds; painted with the top fill (else the top stroke).", json!({"depth":50.0,"twist":0.0,"taper":100.0,"cap":true,"bevel":"none","bevelWidth":4.0,"bevelHeight":4.0,"bevelRepeat":1,"bevelSpace":0.0,"bevelInside":false,"bevelBothSides":false,"rotationX":-21.88,"rotationY":-23.4,"rotationZ":9.06,"perspectiveAngle":0.0,"shade":true,"lightColor":"#ffffff","lights":null,"lightRotation":125.26438968275465,"lightHeight":30.0,"lightBehind":false,"lightIntensity":80.0,"lightSoftness":0.0,"ambient":25.0,"shadow":false,"shadowPosition":"behind","shadowDistance":0.0,"shadowBounds":100.0,"graphics":[],"render":{"mode":"shaded"}}), ), g( @@ -212,7 +212,7 @@ pub fn effect_catalog() -> Vec { CLASSIC_EXTRUDE, "Extrude & Bevel (Classic)…", &["Effect", "3D and Materials", "3D (Classic)"], - "{depth: pt (0..2000, 50), cap: bool (true: solid; false: hollow), bevel: none|classic|rounded|cove|step|ogee (none), bevelHeight: pt (1..100, 4; the bevel is as wide as it is tall), bevelInside: bool (false: added around the shape; true: carved into it), rotationX: degrees (-180..180, -21.88), rotationY: degrees (-180..180, -23.4), rotationZ: degrees (-180..180, 9.06; the defaults are the Off-Axis Front position), perspectiveAngle: degrees (0..160, 0; 0 is none, wider brings the eye nearer), surface: wireframe|none|diffuse|plastic (plastic; wireframe draws the edges of every face, hidden ones included, and fills none; none keeps the paint unlit; diffuse lights the faces softly; plastic adds a glossy highlight), lights: null or array of 1..10 objects (intensity: % 0..100, rotation: degrees -180..180, height: degrees 0..90, behind: bool; overrides the single-light fields; the lights add up; color and softness are not used), lightRotation: degrees (-180..180, 125.26; round the object on the page, 0 on its right, counterclockwise), lightHeight: degrees (0..90, 30; 0 beside the object, 90 straight in front), lightBehind: bool (false; true lights it from behind), lightIntensity: % (0..100, 100), ambient: % (0..100, 50; Ambient Light, every face whichever way it faces), highlightIntensity: % (0..100, 60; plastic only), highlightSize: % (0..100, 90; 100 broad, 0 a small spot; plastic only), blendSteps: integer (1..256, 25; how many levels the shading and the highlight are rounded to), shadingColor: black|custom|none|blackOverprint (black; the color the faces darken toward; none keeps the paint and adds only the highlight; blackOverprint keeps the paint and draws the shading over it as overprinting black, on the black plate, with no highlight), shadingCustom: #rrggbb (#000000; the color shadingColor custom darkens toward), preserveSpotColors: bool (false; a color linked to a spot or global swatch stays a tint of that swatch, lighter where the highlight is, with black multiplied and overprinting where the faces darken, so a spot color keeps its plate; it does nothing while shadingColor is custom, and with blackOverprint every face keeps its paint and swatch link whether it is on or off), drawHiddenFaces: bool (false; also draws the faces turned away, behind the others), mapArt: array of 0..64 objects ([]; Map Art, see threeD.mapArt: surface: integer (1..100000; the numbered surface, one map for a surface), symbol: name of a document symbol, x: pt (-1000000..1000000, 0; the offset of the art's center from the center of the surface laid out flat), y: pt (-1000000..1000000, 0), scaleX: % (1..10000, 100; of the symbol's own width), scaleY: % (1..10000, 100), rotation: degrees (-360..360, 0; counterclockwise); the surfaces are numbered through the object's solids in the order they are built: each solid's front cap and back cap (none on a hollow solid, cap false), then each side wall from corner to corner of the outline, then the bevel above each wall; a map past the object's surfaces draws nothing; wireframe draws no mapped art), mapShade: bool (false; Shade Artwork: the mapped art takes the tone and highlight of its face), mapInvisible: bool (false; Invisible Geometry: with at least one map, only the mapped art is drawn)}. The front face is the art, extruded backwards about the center of its bounds; a solid is built for the top fill and for each stroke, each in its own paint. The defaults, the surface numbering and the limits are VectorCraft's own.", + "{depth: pt (0..2000, 50), cap: bool (true: solid; false: hollow), bevel: none|classic|rounded|cove|step|ogee (none; or custom, a bevel of the user's own drawn by bevelProfile), bevelHeight: pt (1..100, 4; the bevel is as wide as it is tall), bevelInside: bool (false: added around the shape; true: carved into it), bevelName: string (a custom bevel's name), bevelProfile: [[x, y], …] (a custom bevel's points, as for threeD.extrude; bevel {custom: name} takes a bevel of the bevels file), rotationX: degrees (-180..180, -21.88), rotationY: degrees (-180..180, -23.4), rotationZ: degrees (-180..180, 9.06; the defaults are the Off-Axis Front position), perspectiveAngle: degrees (0..160, 0; 0 is none, wider brings the eye nearer), surface: wireframe|none|diffuse|plastic (plastic; wireframe draws the edges of every face, hidden ones included, and fills none; none keeps the paint unlit; diffuse lights the faces softly; plastic adds a glossy highlight), lights: null or array of 1..10 objects (intensity: % 0..100, rotation: degrees -180..180, height: degrees 0..90, behind: bool; overrides the single-light fields; the lights add up; color and softness are not used), lightRotation: degrees (-180..180, 125.26; round the object on the page, 0 on its right, counterclockwise), lightHeight: degrees (0..90, 30; 0 beside the object, 90 straight in front), lightBehind: bool (false; true lights it from behind), lightIntensity: % (0..100, 100), ambient: % (0..100, 50; Ambient Light, every face whichever way it faces), highlightIntensity: % (0..100, 60; plastic only), highlightSize: % (0..100, 90; 100 broad, 0 a small spot; plastic only), blendSteps: integer (1..256, 25; how many levels the shading and the highlight are rounded to), shadingColor: black|custom|none|blackOverprint (black; the color the faces darken toward; none keeps the paint and adds only the highlight; blackOverprint keeps the paint and draws the shading over it as overprinting black, on the black plate, with no highlight), shadingCustom: #rrggbb (#000000; the color shadingColor custom darkens toward), preserveSpotColors: bool (false; a color linked to a spot or global swatch stays a tint of that swatch, lighter where the highlight is, with black multiplied and overprinting where the faces darken, so a spot color keeps its plate; it does nothing while shadingColor is custom, and with blackOverprint every face keeps its paint and swatch link whether it is on or off), drawHiddenFaces: bool (false; also draws the faces turned away, behind the others), mapArt: array of 0..64 objects ([]; Map Art, see threeD.mapArt: surface: integer (1..100000; the numbered surface, one map for a surface), symbol: name of a document symbol, x: pt (-1000000..1000000, 0; the offset of the art's center from the center of the surface laid out flat), y: pt (-1000000..1000000, 0), scaleX: % (1..10000, 100; of the symbol's own width), scaleY: % (1..10000, 100), rotation: degrees (-360..360, 0; counterclockwise); the surfaces are numbered through the object's solids in the order they are built: each solid's front cap and back cap (none on a hollow solid, cap false), then each side wall from corner to corner of the outline, then the bevel above each wall; a map past the object's surfaces draws nothing; wireframe draws no mapped art), mapShade: bool (false; Shade Artwork: the mapped art takes the tone and highlight of its face), mapInvisible: bool (false; Invisible Geometry: with at least one map, only the mapped art is drawn)}. The front face is the art, extruded backwards about the center of its bounds; a solid is built for the top fill and for each stroke, each in its own paint. The defaults, the surface numbering and the limits are VectorCraft's own.", json!({"depth":50.0,"cap":true,"bevel":"none","bevelHeight":4.0,"bevelInside":false,"rotationX":-21.88,"rotationY":-23.4,"rotationZ":9.06,"perspectiveAngle":0.0,"surface":"plastic","lights":null,"lightRotation":125.26438968275465,"lightHeight":30.0,"lightBehind":false,"lightIntensity":100.0,"ambient":50.0,"highlightIntensity":60.0,"highlightSize":90.0,"blendSteps":25,"shadingColor":"black","shadingCustom":"#000000","preserveSpotColors":false,"drawHiddenFaces":false,"mapArt":[],"mapShade":false,"mapInvisible":false}), ), g( diff --git a/crates/effects/src/lib.rs b/crates/effects/src/lib.rs index 574097624a..c46ab0c76e 100644 --- a/crates/effects/src/lib.rs +++ b/crates/effects/src/lib.rs @@ -97,11 +97,11 @@ pub use revolve::{ CLASSIC_REVOLVE, REVOLVE, has_revolve, is_revolve, revolve_art, revolve_art_in, revolve_options, validate_revolve, validate_revolve_in, }; pub use solids::{ - CLASSIC_EXTRUDE, CLASSIC_ROTATE, EXTRUDE, GRAPHICS, GraphicFrame, INFLATE, MAX_GRAPHICS, MappedGraphic, MeshGraphics, RENDER, RENDER_MODES, - ROTATE, ROTATE_SURFACES, ROTATION_PRESETS, SHADING_COLORS, SOLIDS, SolidMesh, THREE_D_TYPES, classic_extrude_options, classic_shading, - extrude_options, graphic_bounds, graphic_frame, graphic_symbols, has_solid, inflate_options, is_classic_three_d, is_three_d, mapped_graphics, - mesh_graphics_art, missing_symbol, names_graphic_symbol, rename_graphic_symbol, rename_graphic_symbol_in, renders_wireframe, solid_art, - solid_art_in, takes_graphics, three_d_meshes, three_d_meshes_in, three_d_meshes_of, three_d_meshes_of_in, three_d_params_as, + BEVEL_NAME, BEVEL_PROFILE, CLASSIC_EXTRUDE, CLASSIC_ROTATE, EXTRUDE, GRAPHICS, GraphicFrame, INFLATE, MAX_GRAPHICS, MappedGraphic, MeshGraphics, + RENDER, RENDER_MODES, ROTATE, ROTATE_SURFACES, ROTATION_PRESETS, SHADING_COLORS, SOLIDS, SolidMesh, THREE_D_TYPES, classic_extrude_options, + classic_shading, extrude_options, graphic_bounds, graphic_frame, graphic_symbols, has_solid, inflate_options, is_classic_three_d, is_three_d, + mapped_graphics, mesh_graphics_art, missing_symbol, names_graphic_symbol, rename_graphic_symbol, rename_graphic_symbol_in, renders_wireframe, + solid_art, solid_art_in, takes_graphics, three_d_meshes, three_d_meshes_in, three_d_meshes_of, three_d_meshes_of_in, three_d_params_as, three_d_wireframe_in, validate_solid, validate_solid_in, validate_three_d, validate_three_d_at, validate_three_d_at_in, validate_three_d_in, validate_three_d_params, view_options, with_graphic, }; @@ -116,8 +116,8 @@ pub use solids::{ pub use stylize::{ScribbleSetting, scribble_setting_id, scribble_settings}; pub use svg_filter::SVG_FILTER; pub use trap::TRAP; -pub use vectorcraft_three_d::Mesh; pub use vectorcraft_three_d::PlanarFace; +pub use vectorcraft_three_d::{BevelProfile, Mesh}; pub use warp::{WARP_NET, WarpNet, WarpStyle, map_version, warp_point, warp_version}; mod catalog; diff --git a/crates/effects/src/solids.rs b/crates/effects/src/solids.rs index 0ac1bbe416..df091cc719 100644 --- a/crates/effects/src/solids.rs +++ b/crates/effects/src/solids.rs @@ -8,7 +8,7 @@ use vectorcraft_doc::{Appearance, AppearanceItem, Document, Effect, Node, NodeId use vectorcraft_geom::{BezPath, FillRule, PathData, Point, Rect, Vec2}; use vectorcraft_pathops::BoolOp; use vectorcraft_three_d::{ - Bevel, BevelShape, DepthPlane, Extrude, Facet, Inflate, MAX_OBJECT_FACES, Mesh, MeshedSolid, PlanarFace, SolidFaces, View, + Bevel, BevelProfile, BevelShape, DepthPlane, Extrude, Facet, Inflate, MAX_OBJECT_FACES, Mesh, MeshedSolid, PlanarFace, SolidFaces, View, }; #[cfg(test)] @@ -72,7 +72,9 @@ pub const THREE_D_TYPES: [(&str, &str); 4] = [("plane", ROTATE), ("extrude", EXT /// The parameters of 3D effect `to` for an effect `from` with `params`, as switching the object /// type keeps them: every setting `to` takes keeps its value from `params` (the defaults of `from` /// under them), each rotation angle wrapped into -180° to 180° when `to` is not Revolve, and the -/// settings only `to` takes start at their defaults. Settings `to` does not take are dropped. +/// settings only `to` takes start at their defaults. Settings `to` does not take are dropped; a +/// custom bevel's name and points ([`BEVEL_NAME`], [`BEVEL_PROFILE`]) go with `bevel` when `to` +/// takes one. pub fn three_d_params_as(from: &str, params: &Value, to: &str) -> Value { let current = crate::merged_params(from, params); let mut out = crate::default_params(to).and_then(|v| v.as_object().cloned()).unwrap_or_default(); @@ -81,6 +83,13 @@ pub fn three_d_params_as(from: &str, params: &Value, to: &str) -> Value { value.clone_from(v); } } + if out.contains_key("bevel") { + for key in [BEVEL_NAME, BEVEL_PROFILE] { + if let Some(v) = current.get(key).filter(|v| !v.is_null()) { + out.insert(key.into(), v.clone()); + } + } + } if to != crate::REVOLVE { for key in ["rotationX", "rotationY", "rotationZ"] { if let Some(a) = out.get(key).and_then(Value::as_f64).filter(|a| !(-180.0..=180.0).contains(a)) { @@ -168,14 +177,66 @@ pub fn view_options(p: &Value) -> View { } } -/// Extrude & Bevel's parameters. `bevel` is `"none"` or a [`BevelShape`] id. +/// The custom bevel's name parameter: the name the bevels file gave it, kept for the menus. +pub const BEVEL_NAME: &str = "bevelName"; +/// The custom bevel's points parameter: `[[across, down], …]`, shares of the bevel's width and +/// height from the cap's edge `[0, 0]` to the side wall `[1, 1]` (a copy of the bevel's path, so +/// the document draws it without the bevels file). +pub const BEVEL_PROFILE: &str = "bevelProfile"; + +/// The points of `v`, a [`BEVEL_PROFILE`] value; `None` unless it is an array of `[x, y]` number +/// pairs that make a [`BevelProfile`]. +fn bevel_profile(v: &Value) -> Option { + let list = v.as_array().filter(|a| a.len() <= BevelProfile::MAX_POINTS)?; + let pts: Option> = list + .iter() + .map(|pt| match pt.as_array().map(Vec::as_slice) { + Some([x, y]) => Some((x.as_f64()?, y.as_f64()?)), + _ => None, + }) + .collect(); + BevelProfile::new(&pts?) +} + +/// The bevel shape of parameters `p`: `bevel` `"none"` (none), a built-in [`BevelShape`] id, or +/// `"custom"` with its points in [`BEVEL_PROFILE`] (none when they do not make a profile). +pub(crate) fn bevel_shape(p: &Value) -> Option { + match text(p, "bevel", "none") { + "custom" => p.get(BEVEL_PROFILE).and_then(bevel_profile).map(BevelShape::Custom), + id => BevelShape::parse(id), + } +} + +/// Check the custom bevel parameters of `p`: `bevel` `"custom"` needs [`BEVEL_PROFILE`], whose +/// points, when given, must make a profile, and [`BEVEL_NAME`] is a string. +fn validate_bevel(p: &Value) -> Result<(), String> { + let most = BevelProfile::MAX_POINTS; + if let Some(v) = p.get(BEVEL_PROFILE) + && !v.is_null() + && bevel_profile(v).is_none() + { + return Err(format!( + "{BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall)" + )); + } + if text(p, "bevel", "none") == "custom" && p.get(BEVEL_PROFILE).is_none_or(Value::is_null) { + return Err(format!("bevel custom needs {BEVEL_PROFILE}, the bevel's points")); + } + if p.get(BEVEL_NAME).is_some_and(|v| !v.is_string() && !v.is_null()) { + return Err(format!("{BEVEL_NAME} must be a string")); + } + Ok(()) +} + +/// Extrude & Bevel's parameters. `bevel` is `"none"`, a [`BevelShape`] id, or `"custom"` with +/// its points in [`BEVEL_PROFILE`]. pub fn extrude_options(p: &Value) -> Extrude { Extrude { depth: num(p, "depth", 50.0), twist: num(p, "twist", 0.0), taper: num(p, "taper", 100.0) / 100.0, cap: flag(p, "cap", true), - bevel: BevelShape::parse(text(p, "bevel", "none")).map(|shape| Bevel { + bevel: bevel_shape(p).map(|shape| Bevel { shape, width: num(p, "bevelWidth", 4.0), height: num(p, "bevelHeight", 4.0), @@ -351,12 +412,12 @@ fn validate_solid_params(id: &str, p: &Value) -> Result<(), String> { graphics::validate(id, p)?; wireframe::validate_render(id, p)?; if let Some(v) = p.get("bevel") - && !v.as_str().is_some_and(|s| s == "none" || BevelShape::parse(s).is_some()) + && !v.as_str().is_some_and(|s| s == "none" || s == "custom" || BevelShape::parse(s).is_some()) { let names: Vec<_> = BevelShape::ALL.iter().map(|b| b.id()).collect(); - return Err(format!("bevel must be none or one of {}", names.join(", "))); + return Err(format!("bevel must be none or one of {}, or custom with {BEVEL_PROFILE}", names.join(", "))); } - Ok(()) + validate_bevel(p) } /// The name an error gives 3D effect `id`. diff --git a/crates/effects/src/solids/classic.rs b/crates/effects/src/solids/classic.rs index 609743fe03..88764122d4 100644 --- a/crates/effects/src/solids/classic.rs +++ b/crates/effects/src/solids/classic.rs @@ -7,7 +7,7 @@ use serde_json::Value; use vectorcraft_doc::color::{BlendMode, Color, Paint}; use vectorcraft_doc::{Appearance, AppearanceItem, FillLayer, Node}; use vectorcraft_geom::Rect; -use vectorcraft_three_d::{Bevel, BevelShape, ClassicShading, ClassicSurface, Extrude, Facet, Light}; +use vectorcraft_three_d::{Bevel, ClassicShading, ClassicSurface, Extrude, Facet, Light}; use super::graphics::map_art::{self, MapArt, MapBudget, SolidLayout}; use crate::util::{flag, num, text}; @@ -44,13 +44,7 @@ pub fn classic_extrude_options(p: &Value) -> Extrude { Extrude { depth: num(p, "depth", 50.0), cap: flag(p, "cap", true), - bevel: BevelShape::parse(text(p, "bevel", "none")).map(|shape| Bevel { - shape, - width: height, - height, - inside: flag(p, "bevelInside", false), - ..Bevel::default() - }), + bevel: super::bevel_shape(p).map(|shape| Bevel { shape, width: height, height, inside: flag(p, "bevelInside", false), ..Bevel::default() }), hidden: flag(p, "drawHiddenFaces", false) || classic_shading(p).surface == ClassicSurface::Wireframe, // The numbered surfaces are laid out only for an effect that maps art onto them. map_surfaces: !map_art::surface_maps(p).is_empty(), @@ -119,9 +113,15 @@ const FLAGS: [&str; 7] = ["cap", "bevelInside", "lightBehind", "drawHiddenFaces" /// Check Extrude & Bevel (Classic)'s parameters `p` (its defaults filled in): every key is one of /// its parameters, numbers are in range, flags are true or false, `surface`, `shadingColor` and /// `shadingCustom` name a surface, a shading color and a #rrggbb color, and `mapArt` holds valid -/// maps. +/// maps. A custom bevel's name and points ([`super::BEVEL_NAME`], [`super::BEVEL_PROFILE`]) are +/// parameters too, checked with Extrude & Bevel's. pub fn validate(p: &Value) -> Result<(), String> { - validate_classic(CLASSIC_EXTRUDE, p, &RANGES, &FLAGS)?; + let mut rest = p.clone(); + if let Some(m) = rest.as_object_mut() { + m.remove(super::BEVEL_NAME); + m.remove(super::BEVEL_PROFILE); + } + validate_classic(CLASSIC_EXTRUDE, &rest, &RANGES, &FLAGS)?; map_art::validate(CLASSIC_EXTRUDE, p) } diff --git a/crates/effects/src/solids/tests.rs b/crates/effects/src/solids/tests.rs index 74636721b8..e2a7b551a3 100644 --- a/crates/effects/src/solids/tests.rs +++ b/crates/effects/src/solids/tests.rs @@ -1594,6 +1594,58 @@ fn parameters_are_validated_and_lengths_scale_with_the_object() { assert!(extrude_options(&json!({})).bevel.is_none()); } +/// `bevel` custom draws the points of `bevelProfile` in both Extrude & Bevels, with the other bevel +/// settings; bad points, a custom bevel without points and a name that is not a string are refused. +#[test] +fn custom_bevels_draw_their_points_and_bad_points_are_refused() { + let n = square_node(); + let notch = json!([[0, 0], [0.2, 0.6], [0.7, 0.4], [1, 1]]); + let custom = json!({"bevel": "custom", "bevelName": "Notch", "bevelProfile": notch, "bevelWidth": 10, "bevelRepeat": 2, "bevelBothSides": true}); + let b = extrude_options(&custom).bevel.unwrap(); + assert!(matches!(b.shape, BevelShape::Custom(_))); + assert_eq!((b.width, b.repeat, b.both_sides), (10.0, 2, true)); + let points: Vec<(f64, f64)> = match b.shape { + BevelShape::Custom(p) => p.points().collect(), + _ => vec![], + }; + assert_eq!(points.len(), 4); + assert!((points[2].0 - 0.7).abs() < 1e-4 && (points[2].1 - 0.4).abs() < 1e-4, "{points:?}"); + assert!(matches!(classic_extrude_options(&custom).bevel.map(|b| b.shape), Some(BevelShape::Custom(_)))); + for id in [EXTRUDE, CLASSIC_EXTRUDE] { + let classic_params = json!({"bevel": "classic", "bevelHeight": 10}); + let custom_params = json!({"bevel": "custom", "bevelProfile": notch, "bevelHeight": 10, "bevelName": "Notch"}); + assert!(validate_solid(&n, id, &custom_params).is_ok(), "{id}"); + let art = |p: &Value| { + let mut n = square_node(); + n.appearance.effects.push(fx(id, p.clone())); + solid_art(&n).unwrap() + }; + assert_ne!(art(&classic_params), art(&custom_params), "{id}"); + for (bad, err) in [ + (json!({"bevel": "custom"}), "bevel custom needs bevelProfile"), + (json!({"bevel": "custom", "bevelProfile": [[0, 0]]}), "bevelProfile must be 2 to 64"), + (json!({"bevel": "custom", "bevelProfile": [[0.1, 0], [1, 1]]}), "bevelProfile must be 2 to 64"), + (json!({"bevel": "custom", "bevelProfile": [[0, 0], [2, 0.5], [1, 1]]}), "bevelProfile must be 2 to 64"), + (json!({"bevel": "custom", "bevelProfile": [[0, 0], ["a", 0.5], [1, 1]]}), "bevelProfile must be 2 to 64"), + (json!({"bevel": "custom", "bevelProfile": "0,0 1,1"}), "bevelProfile must be 2 to 64"), + (json!({"bevel": "custom", "bevelProfile": notch, "bevelName": 3}), "bevelName must be a string"), + ] { + let e = validate_solid(&n, id, &bad).unwrap_err(); + assert!(e.contains(err), "{id} {bad}: {e}"); + } + } + // A loaded file whose points do not make a profile draws no bevel. + assert!(extrude_options(&json!({"bevel": "custom", "bevelProfile": [[0, 0]]})).bevel.is_none()); + // Changing the type keeps the custom bevel where the new effect takes a bevel, and drops it + // where it does not. + let classic = three_d_params_as(EXTRUDE, &custom, CLASSIC_EXTRUDE); + assert_eq!((&classic["bevel"], &classic[BEVEL_NAME], &classic[BEVEL_PROFILE]), (&json!("custom"), &json!("Notch"), ¬ch)); + assert!(validate_solid(&n, CLASSIC_EXTRUDE, &classic).is_ok()); + assert_eq!(three_d_params_as(CLASSIC_EXTRUDE, &classic, EXTRUDE)[BEVEL_PROFILE], notch); + let inflate = three_d_params_as(EXTRUDE, &custom, INFLATE); + assert!(inflate.get(BEVEL_PROFILE).is_none() && inflate.get(BEVEL_NAME).is_none()); +} + #[test] fn inflate_reads_twist_taper_and_cap() { let o = inflate_options(&json!({"twist": 90, "taper": 40, "cap": false})); diff --git a/crates/engine/src/cmd.rs b/crates/engine/src/cmd.rs index c012e1cc3f..5afdf15cc3 100644 --- a/crates/engine/src/cmd.rs +++ b/crates/engine/src/cmd.rs @@ -8,6 +8,7 @@ pub mod arrowheads; mod artboardalign; mod assets; mod attributes; +pub mod bevels; pub mod brushlib; mod brushsym; mod buildcmds; @@ -321,6 +322,7 @@ pub fn command_specs() -> &'static [CommandSpec] { v.extend(draw2::specs()); v.extend(xform::specs()); v.extend(effectcmd::specs()); + v.extend(bevels::specs()); v.extend(wireframe::specs()); v.extend(pathops::specs()); v.extend(compoundshape::specs()); diff --git a/crates/engine/src/cmd/arrowheads.rs b/crates/engine/src/cmd/arrowheads.rs index 340cf98459..cef54db187 100644 --- a/crates/engine/src/cmd/arrowheads.rs +++ b/crates/engine/src/cmd/arrowheads.rs @@ -378,13 +378,14 @@ impl Session { } } -fn same_file(a: &str, b: &str) -> bool { +pub(super) fn same_file(a: &str, b: &str) -> bool { let canon = |p: &str| std::fs::canonicalize(p).unwrap_or_else(|_| std::path::PathBuf::from(p)); std::path::Path::new(a) == std::path::Path::new(b) || canon(a) == canon(b) } -/// The document in the arrowheads file at `path`; `None` when there is no file. -fn read(path: &str) -> std::result::Result, String> { +/// The document in the arrowheads file at `path` (or another such file of the user's, as the +/// bevels file); `None` when there is no file. +pub(super) fn read(path: &str) -> std::result::Result, String> { let size = match std::fs::metadata(path) { Err(e) if e.kind() == std::io::ErrorKind::NotFound => return Ok(None), Err(e) => return Err(format!("{path}: {e}")), @@ -412,13 +413,13 @@ fn skipped(s: &Session) -> Vec { /// The arrowheads file at `path` checked for reading against the automation roots in force: an agent /// confined to read roots reaches the file only inside them. The error names the file by its file /// name outside them. -fn may_reach(path: &str) -> Result<()> { +pub(super) fn may_reach(path: &str) -> Result<()> { crate::file_access::check_read(path).map_err(|e| super::fileio::naming_in_error(EngineError::Other(e), path)) } /// `msg`, an error about the arrowheads file at `path`, as the request being served may see it: the /// file named whole inside the read roots, else by its file name. -fn shown_error(msg: &str, path: Option<&str>) -> String { +pub(super) fn shown_error(msg: &str, path: Option<&str>) -> String { let Some(path) = path else { return msg.to_string() }; match super::fileio::naming_in_error(EngineError::Other(msg.to_string()), path) { EngineError::Other(m) => m, diff --git a/crates/engine/src/cmd/bevels.rs b/crates/engine/src/cmd/bevels.rs new file mode 100644 index 0000000000..3fcaa1094c --- /dev/null +++ b/crates/engine/src/cmd/bevels.rs @@ -0,0 +1,378 @@ +//! Custom bevels for Extrude & Bevel and Extrude & Bevel (Classic). The bevels file is a native +//! document kept next to the preferences ([`Session::attach_bevels_file`]). Each of its symbols +//! whose art is one open path is one bevel, listed by the symbol's name after the built-in shapes +//! in the Bevel Shape menus. The path runs from its first anchor, at the cap's edge, to its last, +//! at the side wall: across the page is across the bevel's width and down the page is along its +//! height, whichever way the path is drawn, and points past its ends are held to them. Curves are +//! cut into straight lines, at most [`BevelProfile::MAX_POINTS`] points in all. Saving the file +//! reloads the bevels. An effect that uses a custom bevel carries a copy of its points +//! (`bevelProfile`), so its document draws it anywhere. + +use std::sync::Arc; + +use serde_json::{Value, json}; +use vectorcraft_color::{Color, Paint}; +use vectorcraft_doc::{Appearance, Document, Node, NodeId, NodeKind, Symbol}; +use vectorcraft_geom::{Affine, PathData, PathEl, Point, SubPath}; +use vectorcraft_render::effects::{BEVEL_NAME, BEVEL_PROFILE, BevelProfile}; + +use super::arrowheads::{may_reach, read, same_file, shown_error}; +use super::{CommandSpec, Result, Session, always, bad, cmd}; + +/// The bevels file's name, in the folder of the preferences. +pub const FILE_NAME: &str = "Bevels.vectorcraft"; +/// The most bevels read from the file; symbols past it are skipped. +pub const MAX_BEVELS: usize = 256; +/// The most anchors a bevel's path may have; a symbol past it is skipped. +pub const MAX_ANCHORS: usize = 4096; +/// The most points a bevel's path is cut into before it is simplified; a symbol past it is skipped. +pub const MAX_LINE_POINTS: usize = 8192; +/// The most point-to-line distances simplifying the bevels of one file may measure; a symbol that +/// needs more than is left is skipped as too detailed. +pub const MAX_SIMPLIFY_WORK: u64 = 40_000_000; + +pub fn specs() -> Vec { + vec![ + cmd!( + query "threeD.bevels.list", + "Bevels", + [], + None, + "{} → {bevels: [{name (effect.apply and effect.setParams take Extrude & Bevel's and Extrude & Bevel (Classic)'s `bevel` as {custom: name}), points: [[x, y]…] (shares of the bevel's width and height from the cap's edge [0, 0] to the side wall [1, 1])}], file: the bevels file's path or null (no file here, as on the web), skipped: [{name, reason}] symbols of the file that are not bevels, error: why the file could not be read, or null} the custom bevels, listed after the built-in shapes in the Bevel Shape menus", + always, + list + ), + cmd!( + "threeD.bevels.edit", + "Edit Bevels", + [], + None, + "{} open the bevels file (a native document next to the preferences; created first with one example bevel when it is missing). Each symbol in it whose art is one open path is one custom bevel named after the symbol: the path runs from its first anchor at the cap's edge to its last at the side wall, across the page across the bevel's width and down the page along its height. Saving the file reloads the bevels → {path, created: whether the file was made now}", + has_file, + edit + ), + cmd!( + "threeD.bevels.reload", + "Reload Bevels", + [], + None, + "{} read the bevels file again (a save of it from VectorCraft does this already) → {count, skipped: [{name, reason}]}", + has_file, + reload + ), + ] +} + +/// A custom bevel: its name and its points, (share of the width, share of the height). +#[derive(Clone, Debug, PartialEq)] +pub struct CustomBevel { + pub name: String, + pub points: Vec<(f64, f64)>, +} + +impl CustomBevel { + /// The points as `bevelProfile` holds them. + pub fn profile_json(&self) -> Value { + json!(self.points.iter().map(|&(x, y)| [x, y]).collect::>()) + } +} + +/// The custom bevels read from the bevels file. +#[derive(Default)] +pub struct Bevels { + path: Option, + bevels: Vec>, + skipped: Vec<(String, String)>, + error: Option, +} + +impl Bevels { + /// The bevels file's path; `None` without one (the web, runs without preferences). + pub fn path(&self) -> Option<&str> { + self.path.as_deref() + } + /// The bevels, in the order of the file's symbols. + pub fn bevels(&self) -> &[Arc] { + &self.bevels + } + /// Bevel `name`. + pub fn get(&self, name: &str) -> Option> { + self.bevels.iter().find(|b| b.name == name).cloned() + } + fn set(&mut self, read: Read) { + (self.bevels, self.skipped) = (read.bevels.into_iter().map(Arc::new).collect(), read.skipped); + self.error = None; + } +} + +/// The bevels a document holds, and the symbols that are not bevels with the reason. +#[derive(Debug, Default)] +pub struct Read { + pub bevels: Vec, + pub skipped: Vec<(String, String)>, +} + +/// The bevels of document `doc`: one per symbol, up to [`MAX_BEVELS`] (see the module docs). +pub fn bevels_of(doc: &Document) -> Read { + bevels_within(doc, MAX_SIMPLIFY_WORK) +} + +/// [`bevels_of`] with `work` point-to-line distances to simplify the paths with. +pub fn bevels_within(doc: &Document, mut work: u64) -> Read { + let mut out = Read::default(); + for (i, sym) in doc.symbols.iter().enumerate() { + if i >= MAX_BEVELS { + out.skipped.push((sym.name.clone(), format!("only the first {MAX_BEVELS} symbols are read"))); + continue; + } + if out.bevels.iter().any(|b| b.name == sym.name) { + out.skipped.push((sym.name.clone(), "another symbol has this name".into())); + continue; + } + match points_of(&sym.art, &mut work) { + Ok(points) => out.bevels.push(CustomBevel { name: sym.name.clone(), points }), + Err(why) => out.skipped.push((sym.name.clone(), why.into())), + } + } + out +} + +/// The one open path of art `n`: `n` itself, or the one member of groups that hold one member each. +fn open_path(n: &Node) -> Option<&PathData> { + match &n.kind { + NodeKind::Path { path, guide: false, .. } if path.subpaths.len() == 1 && !path.subpaths[0].closed => Some(path), + NodeKind::Group { children, clip: false } if children.len() == 1 => open_path(&children[0]), + _ => None, + } +} + +/// The profile points of a bevel symbol's art `n` (see the module docs), simplified within `work` +/// point-to-line distances, which it uses up. +fn points_of(n: &Node, work: &mut u64) -> std::result::Result, &'static str> { + let path = open_path(n).ok_or("its art is not one open path")?; + if path.anchor_count() > MAX_ANCHORS { + return Err("its path has too many anchors for a bevel"); + } + let mut line: Vec = vec![]; + let tolerance = path.bounds().map_or(1.0, |b| b.width().hypot(b.height()) / 2000.0).max(1e-9); + // One segment at a time, so a path past the limit stops being cut at the segment that passes it. + let mut at: Option = None; + for &el in path.to_bezpath().elements() { + if line.len() > MAX_LINE_POINTS { + return Err("its path is too detailed for a bevel"); + } + match (el, at) { + (PathEl::MoveTo(p), _) => line.push(p), + (_, Some(start)) => vectorcraft_geom::flatten([PathEl::MoveTo(start), el], tolerance, |e| { + if let PathEl::LineTo(p) = e { + line.push(p); + } + }), + (_, None) => {} + } + at = el.end_point().or(at); + } + if line.len() > MAX_LINE_POINTS { + return Err("its path is too detailed for a bevel"); + } + let (Some(&first), Some(&last)) = (line.first(), line.last()) else { return Err("its path has no length") }; + let (dx, dy) = (last.x - first.x, last.y - first.y); + let size = path.bounds().map_or(0.0, |b| b.width().hypot(b.height())); + if !(dx.abs() > size * 1e-6 && dy.abs() > size * 1e-6 && size.is_finite()) { + return Err("its ends are not apart both across and down"); + } + let mut pts: Vec<(f64, f64)> = line.iter().map(|p| (((p.x - first.x) / dx).clamp(0.0, 1.0), ((p.y - first.y) / dy).clamp(0.0, 1.0))).collect(); + pts.dedup_by(|a, b| (a.0 - b.0).abs() < 1e-9 && (a.1 - b.1).abs() < 1e-9); + if pts.len() < 2 { + return Err("its ends are not apart both across and down"); + } + // The ends map to the corners exactly. + let last = pts.len() - 1; + (pts[0], pts[last]) = ((0.0, 0.0), (1.0, 1.0)); + let pts = simplified(&pts, work).ok_or("its path is too detailed for a bevel")?; + BevelProfile::new(&pts).ok_or("its path is too detailed for a bevel")?; + Ok(pts) +} + +/// `pts` with the fewest points the Ramer-Douglas-Peucker rule keeps at a tolerance (from a +/// thousandth of the bevel, doubled until they fit) that leaves at most +/// [`BevelProfile::MAX_POINTS`]. The first and last points are always kept. `None` when that +/// measures more point-to-line distances than `work` has left. +fn simplified(pts: &[(f64, f64)], work: &mut u64) -> Option> { + let mut eps = 1e-3; + loop { + let out = rdp(pts, eps, work)?; + if out.len() <= BevelProfile::MAX_POINTS || eps > 2.0 { + return Some(out); + } + eps *= 2.0; + } +} + +/// The points of `pts` Ramer-Douglas-Peucker keeps at tolerance `eps`; `None` when that measures +/// more point-to-line distances than `work` has left. +fn rdp(pts: &[(f64, f64)], eps: f64, work: &mut u64) -> Option> { + if pts.len() < 3 { + return Some(pts.to_vec()); + } + let mut keep = vec![false; pts.len()]; + keep[0] = true; + keep[pts.len() - 1] = true; + let mut stack = vec![(0, pts.len() - 1)]; + while let Some((a, b)) = stack.pop() { + *work = work.checked_sub((b - a).saturating_sub(1) as u64)?; + let (p, q) = (pts[a], pts[b]); + let (vx, vy) = (q.0 - p.0, q.1 - p.1); + let len = vx.hypot(vy); + let far = (a + 1..b) + .map(|i| { + let (wx, wy) = (pts[i].0 - p.0, pts[i].1 - p.1); + let d = if len > 0.0 { (vx * wy - vy * wx).abs() / len } else { wx.hypot(wy) }; + (i, d) + }) + .fold(None, |best: Option<(usize, f64)>, (i, d)| if best.is_none_or(|(_, bd)| d > bd) { Some((i, d)) } else { best }); + if let Some((i, d)) = far + && d > eps + { + keep[i] = true; + stack.push((a, i)); + stack.push((i, b)); + } + } + Some(pts.iter().zip(keep).filter_map(|(p, k)| k.then_some(*p)).collect()) +} + +/// The document a missing bevels file starts as: one example bevel, a chamfer with a notch. +pub fn starter() -> Document { + let mut doc = Document::new(612.0, 792.0); + doc.title = "Bevels".into(); + let name = "Example Bevel"; + let pts = [Point::new(0.0, 0.0), Point::new(10.0, 40.0), Point::new(55.0, 30.0), Point::new(100.0, 100.0)]; + let art = + Node::path(NodeId(0), PathData::single(SubPath::polyline(&pts, false)), Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 1.0)); + let art = doc.reid(&art); + doc.symbols.push(Symbol { name: name.into(), art: Arc::new(art), dynamic: false }); + let id = doc.alloc_id(); + let instance = Node::new(id, NodeKind::SymbolInstance { symbol: name.into(), xf: Affine::translate((256.0, 346.0)) }); + let layer = doc.layers.first().map(|l| l.id); + let _ = doc.insert(layer, 0, instance); + doc +} + +impl Session { + /// Keep the custom bevels in the file at `path` and read the bevels it holds (none while it is + /// missing; an unreadable file is reported by `threeD.bevels.list`). + pub fn attach_bevels_file(&mut self, path: String) { + self.bevels.path = Some(path); + self.reload_bevels(); + } + + /// Read the bevels file again. + fn reload_bevels(&mut self) { + let Some(path) = self.bevels.path.clone() else { return }; + match read(&path) { + Ok(Some(doc)) => self.bevels.set(bevels_of(&doc)), + Ok(None) => self.bevels.set(Read::default()), + Err(e) => { + self.bevels.set(Read::default()); + self.bevels.error = Some(e); + } + } + } + + /// A document was saved to `path`: when that is the bevels file, its bevels are read back from + /// what was written. + pub(crate) fn bevels_saved(&mut self, path: &str) { + if self.bevels.path.as_deref().is_some_and(|b| same_file(b, path)) { + self.reload_bevels(); + } + } +} + +/// The command parameter that holds the points a custom bevel given by name had when the command +/// ran. The journal records it, so a replay draws the same bevel after the bevels file changes or +/// loses that name. +pub const SAVED_BEVEL: &str = "savedBevel"; + +/// `params` of an effect with `bevel` given as `{custom: name}`: the bevel of the bevels file named +/// so, stored as `bevel` `"custom"` with its `bevelName` and `bevelProfile`. The command's +/// [`SAVED_BEVEL`] points (`p`), when given, are used in place of the file's, and the points used +/// join the journal entry as [`SAVED_BEVEL`]. Other values are left for the effect to check. +pub(crate) fn resolve_custom(s: &mut Session, p: &Value, params: &mut Value, cmd: &str) -> Result<()> { + let Some(Value::Object(o)) = params.get("bevel") else { return Ok(()) }; + let name = match (o.len(), o.get("custom")) { + (1, Some(Value::String(name))) => name.clone(), + _ => return Err(bad(cmd, "bevel: give a shape id, or {custom: name} for a bevel of the bevels file (threeD.bevels.list)")), + }; + let points = match p.get(SAVED_BEVEL).filter(|v| !v.is_null()) { + Some(saved) => saved.clone(), + None => s.bevels.get(&name).ok_or_else(|| bad(cmd, format!("no custom bevel {name} (see threeD.bevels.list)")))?.profile_json(), + }; + s.note_journal(SAVED_BEVEL, points.clone()); + params["bevel"] = json!("custom"); + params[BEVEL_NAME] = json!(name); + params[BEVEL_PROFILE] = points; + Ok(()) +} + +fn has_file(s: &Session) -> std::result::Result<(), String> { + if s.bevels.path.is_some() { Ok(()) } else { Err("no bevels file here".into()) } +} + +fn skipped(s: &Session) -> Vec { + s.bevels.skipped.iter().map(|(name, reason)| json!({"name": name, "reason": reason})).collect() +} + +fn list(s: &mut Session, _: &Value) -> Result { + let bevels: Vec = s.bevels.bevels.iter().map(|b| json!({"name": b.name, "points": b.profile_json()})).collect(); + // Under automation read roots, a file outside them is not shown and its error names it by its file name. + let path = s.bevels.path.as_deref(); + let file = path.filter(|p| crate::file_access::check_read(p).is_ok()); + let error = s.bevels.error.as_deref().map(|e| shown_error(e, path)); + Ok(json!({"bevels": bevels, "file": file, "skipped": skipped(s), "error": error})) +} + +fn reload(s: &mut Session, _: &Value) -> Result { + const C: &str = "threeD.bevels.reload"; + if let Some(path) = &s.bevels.path { + may_reach(path)?; + } + s.reload_bevels(); + if let Some(e) = &s.bevels.error { + return Err(bad(C, e.clone())); + } + Ok(json!({"count": s.bevels.bevels.len(), "skipped": skipped(s)})) +} + +fn edit(s: &mut Session, _: &Value) -> Result { + const C: &str = "threeD.bevels.edit"; + let path = s.bevels.path.clone().ok_or_else(|| bad(C, "no bevels file here"))?; + // Checked before anything is made, brought to the front or opened. + may_reach(&path)?; + if let Some(dir) = std::path::Path::new(&path).parent() { + let dir = dir.to_string_lossy(); + std::fs::create_dir_all(&*dir).map_err(|e| super::fileio::naming_in_error(bad(C, format!("{dir}: {e}")), &dir))?; + } + // Made only when no file is there, also when another run makes one at the same moment. + let bytes = vectorcraft_format::save_file(&starter()); + let created = match crate::file_access::unconfined(|| super::fileio::write_new_file(&path, &bytes)) { + Ok(()) => true, + Err(_) if std::path::Path::new(&path).exists() => false, + Err(e) => return Err(bad(C, e.to_string())), + }; + if created { + s.reload_bevels(); + } + // Already open: that document comes to the front. + let open = s.documents().iter().position(|st| st.path.as_deref().is_some_and(|p| same_file(p, &path))); + match open { + Some(i) => { + s.set_active(i); + } + None => { + // Opened in the request's own scope, so the document keeps the roots it was opened under. + s.execute("document.open", &json!({ "path": path }))?; + } + } + Ok(json!({"path": path, "created": created})) +} diff --git a/crates/engine/src/cmd/effectcmd.rs b/crates/engine/src/cmd/effectcmd.rs index 831c56063a..edb5561796 100644 --- a/crates/engine/src/cmd/effectcmd.rs +++ b/crates/engine/src/cmd/effectcmd.rs @@ -52,7 +52,7 @@ fn effect_specs() -> Vec { "Apply Effect", [], None, - "{effect: id (see effect.list, e.g. \"stylize.dropShadow\", \"distort.roughen\", \"warp.arc\", or \"plugin.\" for an installed effect plug-in), params?: {…} (missing keys take the dialog defaults), item?: appearance item index|null (apply to that fill/stroke only; omitted: the Appearance panel's active item, else the whole object), ids?|id?: [..] (layers too), target?: \"object\"|\"contents\" (contents: the objects inside groups and layers), aligned?: bool (item is a row of the first target's stack: each other target gets the effect on its equal one, as the Appearance panel does for a mixed selection; with the art of a graph design in a series given first, a row of the art's stack: docs/mcp.md)} append a live effect to each selected object's appearance (a group's or layer's apply to its members as one piece: one combined shadow; a Pathfinder effect, which combines a group's contents, groups several loose selected objects first, in the same undo step); the art of a graph design in a graph series is left out, and objects that are all such art are an error (docs/mcp.md) → {ids, index, item, grouped?}", + "{effect: id (see effect.list, e.g. \"stylize.dropShadow\", \"distort.roughen\", \"warp.arc\", or \"plugin.\" for an installed effect plug-in), params?: {…} (missing keys take the dialog defaults), item?: appearance item index|null (apply to that fill/stroke only; omitted: the Appearance panel's active item, else the whole object), ids?|id?: [..] (layers too), target?: \"object\"|\"contents\" (contents: the objects inside groups and layers), aligned?: bool (item is a row of the first target's stack: each other target gets the effect on its equal one, as the Appearance panel does for a mixed selection; with the art of a graph design in a series given first, a row of the art's stack: docs/mcp.md), savedBevel?: [[x, y]…] (with params bevel {custom: name}: the custom bevel's points, used in place of the bevels file's; the journal records them so a replay draws the same bevel after the file changes)} append a live effect to each selected object's appearance (a group's or layer's apply to its members as one piece: one combined shadow; a Pathfinder effect, which combines a group's contents, groups several loose selected objects first, in the same undo step); the art of a graph design in a graph series is left out, and objects that are all such art are an error (docs/mcp.md) → {ids, index, item, grouped?}", has_doc, apply ), @@ -79,7 +79,7 @@ fn effect_specs() -> Vec { "Effect Options", [], None, - "{index: int, params?: {…} (merged into the current parameters), warpStyle?: string (an existing Warp style suffix, e.g. arc or flag; changes only an applied Warp in place; params are checked against the new style), threeDType?: plane|extrude|revolve|inflate (the 3D and Materials panel's object type: changes only an applied 3D effect in place into Rotate, Extrude & Bevel, Revolve or Inflate; the settings the new effect also takes keep their values, rotation angles wrapped into -180..180 outside Revolve, and the others start at its defaults; params then merge into the new effect's; the type the effect already has, with nothing else given, changes nothing and records no undo step), visible?: bool (any other value but null is refused, when a step plays too), item?: appearance item index|null (as effect.remove), ids?|id?: [..], target?: \"object\"|\"contents\", aligned?: bool (index and item are rows of the first target's stack: each other target edits its equal one, as the Appearance panel does for a mixed selection; with the art of a graph design in a series given first, rows of the art's stack: docs/mcp.md)} → {ids}", + "{index: int, params?: {…} (merged into the current parameters), warpStyle?: string (an existing Warp style suffix, e.g. arc or flag; changes only an applied Warp in place; params are checked against the new style), threeDType?: plane|extrude|revolve|inflate (the 3D and Materials panel's object type: changes only an applied 3D effect in place into Rotate, Extrude & Bevel, Revolve or Inflate; the settings the new effect also takes keep their values, rotation angles wrapped into -180..180 outside Revolve, and the others start at its defaults; params then merge into the new effect's; the type the effect already has, with nothing else given, changes nothing and records no undo step), visible?: bool (any other value but null is refused, when a step plays too), item?: appearance item index|null (as effect.remove), ids?|id?: [..], target?: \"object\"|\"contents\", aligned?: bool (index and item are rows of the first target's stack: each other target edits its equal one, as the Appearance panel does for a mixed selection; with the art of a graph design in a series given first, rows of the art's stack: docs/mcp.md), savedBevel?: [[x, y]…] (as effect.apply)} → {ids}", has_doc, set_params ), @@ -496,6 +496,10 @@ pub(crate) fn apply(s: &mut Session, p: &Value) -> Result { if texture_load_effect(id) { load_texture(&mut params, C)?; } + // A custom bevel by name takes a copy of its points from the bevels file. + if bevel_effect(id) { + super::bevels::resolve_custom(s, p, &mut params, C)?; + } // An SVG filter needs its element, and is named by its id. if id == effects::SVG_FILTER { let xml = params.get("xml").and_then(Value::as_str).ok_or_else(|| bad(C, "give `xml`, one SVG element"))?; @@ -818,6 +822,9 @@ pub(crate) fn set_params(s: &mut Session, p: &Value) -> Result { if edited.iter().any(|e| texture_load_effect(e)) { load_texture(&mut params, C)?; } + if edited.iter().any(|e| bevel_effect(e)) || kind == Some(effects::EXTRUDE) { + super::bevels::resolve_custom(s, p, &mut params, C)?; + } let targets = effect_targets(s, p, item, index, C)?; // The type each 3D effect already has, with nothing else to change, is no edit (and is not // checked again). @@ -910,6 +917,12 @@ pub(crate) fn set_params(s: &mut Session, p: &Value) -> Result { Ok(json!({ "ids": ids_json(&ids) })) } +/// Does effect `id` take a `bevel` (Extrude & Bevel, Extrude & Bevel (Classic)), which may be a +/// custom bevel given by name? +fn bevel_effect(id: &str) -> bool { + id == effects::EXTRUDE || id == effects::CLASSIC_EXTRUDE +} + /// Does merging `params` into Pathfinder effect `e` leave it drawing as it does: the same Pathfinder /// Options ([`effects::PathfinderEffectOptions`], so an effect saved without them and given their /// defaults is unchanged), each option given equal to the one it stores (a precision that Scale diff --git a/crates/engine/src/cmd/fileio/save.rs b/crates/engine/src/cmd/fileio/save.rs index 7150d68dbb..f03dc6fe0d 100644 --- a/crates/engine/src/cmd/fileio/save.rs +++ b/crates/engine/src/cmd/fileio/save.rs @@ -1193,7 +1193,8 @@ impl SaveJob { } // The other open documents that place this one show the new version. let written = self.plan.path.clone().filter(|_| matches!(self.plan.format.id, "vectorcraft" | "template")); - // A save of the arrowheads file lists its heads in the arrowhead menus. + // A save of the arrowheads file lists its heads in the arrowhead menus, and one of the + // bevels file its bevels in the Bevel Shape menus. let native = self.plan.format.id == "vectorcraft"; if let Some(st) = s.document_mut(uid) { self.finish(st); @@ -1204,6 +1205,7 @@ impl SaveJob { if let Some(path) = written { if native { s.arrowheads_saved(&path); + s.bevels_saved(&path); } crate::cmd::links::refresh_placed(s, uid, &path); } diff --git a/crates/engine/src/cmd/object/commands.rs b/crates/engine/src/cmd/object/commands.rs index e5ff38efa6..0bc08c748e 100644 --- a/crates/engine/src/cmd/object/commands.rs +++ b/crates/engine/src/cmd/object/commands.rs @@ -305,7 +305,7 @@ pub fn specs() -> Vec { "Live Shape Properties", [], None, - "{id?, ids?, radius?: pt (or % of each corner's maximum when `relativeRadii` is true), kind?: \"round\"|\"invertedRound\"|\"chamfer\", relativeRadii?: bool (Relative rounding, as in the reference app: store radii as fractions of each corner's maximum so they scale with the shape), corners?: [i…], items?: [{id, corners?: [i…]}] (several objects, each with its own corners, in place of ids and corners: the canvas's corner widgets across a selection), sides?: n, polygonAngle?: degrees (counter-clockwise from its first vertex straight up), polygonRadius?: pt (centre to vertex), sideLength?: pt (sets the radius), makeSidesEqual?: true (a polygon scaled unevenly: drops the uneven scale and shear, keeping its centre, angle and mean radius), pieStart?, pieEnd?: degrees (an ellipse's pie, counter-clockwise from 3 o'clock; 0 to 360 is the whole ellipse), invertPie?: true (swaps them: the other part of the ellipse), constrainPie?: bool (Constrain Pie Angle: with one of pieStart and pieEnd, not both and not with invertPie, the other angle moves by as much, so each ellipse keeps its span), lineLength?: pt (a live line's length, above 0; its first end stays), lineAngle?: degrees (a live line's angle, counter-clockwise from 3 o'clock, from its first end to its second; it turns about its midpoint), rectangleAngle?: degrees (a live rectangle's, counterclockwise from level), ellipseAngle?: degrees (a live ellipse's, counterclockwise from level; its pie turns with it)} (rectangleAngle, ellipseAngle and polygonAngle turn each shape of that kind about its own center and leave other objects as they are; a pixel-aligned shape then goes back on the pixel grid, as after other edits, which can move its center or change its size; an angle that is not a number is an error, and `null` counts as an omitted key; a shape that a turn would take past the coordinate limit (±4,000,000 pt) is an error that changes nothing; Live Corners on any path: radius and kind set its corners (anchors that aren't smooth, where two sides, straight or curved (#1144), meet at an angle): `corners` (anchor indices of the path with its corners uncut, counting every subpath's anchors in order: a rectangle's 0 top-left, 1 top-right, 2 bottom-right, 3 bottom-left; a polygon's from the first vertex clockwise), else the corners with a Direct-Selected anchor, else every corner; each radius is drawn no larger than half the corner's shorter side allows; a path that isn't a live shape keeps its uncut outline so its corners stay editable, and is plain again once none is cut; sides: a polygon's, which keep the radius they shared; the polygon params apply in that order: sides, makeSidesEqual, polygonAngle, then sideLength or else polygonRadius; a line's lineLength applies before its lineAngle)", + "{id?, ids?, radius?: pt (or % of each corner's maximum when `relativeRadii` is true), kind?: \"round\"|\"invertedRound\"|\"chamfer\", relativeRadii?: bool (Relative rounding, as in the reference app: store radii as fractions of each corner's maximum so they scale with the shape), corners?: [i…], rectanglesOnly?: bool (only the live rectangles among the targets; the other objects stay as they are), items?: [{id, corners?: [i…]}] (several objects, each with its own corners, in place of ids and corners: the canvas's corner widgets across a selection), sides?: n, polygonAngle?: degrees (counter-clockwise from its first vertex straight up), polygonRadius?: pt (centre to vertex), sideLength?: pt (sets the radius), makeSidesEqual?: true (a polygon scaled unevenly: drops the uneven scale and shear, keeping its centre, angle and mean radius), pieStart?, pieEnd?: degrees (an ellipse's pie, counter-clockwise from 3 o'clock; 0 to 360 is the whole ellipse), invertPie?: true (swaps them: the other part of the ellipse), constrainPie?: bool (Constrain Pie Angle: with one of pieStart and pieEnd, not both and not with invertPie, the other angle moves by as much, so each ellipse keeps its span), lineLength?: pt (a live line's length, above 0; its first end stays), lineAngle?: degrees (a live line's angle, counter-clockwise from 3 o'clock, from its first end to its second; it turns about its midpoint), rectangleAngle?: degrees (a live rectangle's, counterclockwise from level), ellipseAngle?: degrees (a live ellipse's, counterclockwise from level; its pie turns with it)} (rectangleAngle, ellipseAngle and polygonAngle turn each shape of that kind about its own center and leave other objects as they are; a pixel-aligned shape then goes back on the pixel grid, as after other edits, which can move its center or change its size; an angle that is not a number is an error, and `null` counts as an omitted key; a shape that a turn would take past the coordinate limit (±4,000,000 pt) is an error that changes nothing; Live Corners on any path: radius and kind set its corners (anchors that aren't smooth, where two sides, straight or curved (#1144), meet at an angle): `corners` (anchor indices of the path with its corners uncut, counting every subpath's anchors in order: a rectangle's 0 top-left, 1 top-right, 2 bottom-right, 3 bottom-left; a polygon's from the first vertex clockwise), else the corners with a Direct-Selected anchor, else every corner; each radius is drawn no larger than half the corner's shorter side allows; a path that isn't a live shape keeps its uncut outline so its corners stay editable, and is plain again once none is cut; sides: a polygon's, which keep the radius they shared; the polygon params apply in that order: sides, makeSidesEqual, polygonAngle, then sideLength or else polygonRadius; a line's lineLength applies before its lineAngle)", has_selection, set_live_shape ), diff --git a/crates/engine/src/cmd/object/shape.rs b/crates/engine/src/cmd/object/shape.rs index b2e69cc279..a4cec6253c 100644 --- a/crates/engine/src/cmd/object/shape.rs +++ b/crates/engine/src/cmd/object/shape.rs @@ -124,7 +124,7 @@ fn line_edit(l: &LiveShape, len: Option, angle: Option) -> Option Result { - check_switches(p, &["constrainPie", "invertPie", "makeSidesEqual", "relativeRadii"], "object.setLiveShape")?; + check_switches(p, &["constrainPie", "invertPie", "makeSidesEqual", "rectanglesOnly", "relativeRadii"], "object.setLiveShape")?; check_numbers(p, &["radius", "sides"], "object.setLiveShape")?; // `items`: objects each with its own `corners`; else `ids` (or the selection) sharing them. let items = match p.get("items").filter(|v| !v.is_null()) { @@ -235,6 +235,13 @@ pub(super) fn set_live_shape(s: &mut Session, p: &Value) -> Result { // When every value given is the current one, the document and its undo history stay as they // are. let st = s.doc()?; + // `rectanglesOnly`: the live rectangles among the targets; the other objects stay as they are. + let ids: Vec = if p.get("rectanglesOnly").and_then(Value::as_bool) == Some(true) { + let rectangle = |id: &NodeId| matches!(st.doc.node(*id).map(|n| &n.kind), Some(NodeKind::Path { live: Some(l), .. }) if matches!(**l, LiveShape::Rectangle { .. })); + ids.into_iter().filter(rectangle).collect() + } else { + ids + }; // The lines that Line Length or Line Angle changes, as they become. A line that would reach // past the document's coordinate limit is an error before anything changes. let mut lines = std::collections::BTreeMap::new(); @@ -278,16 +285,23 @@ pub(super) fn set_live_shape(s: &mut Session, p: &Value) -> Result { } let Some(c) = LiveCorners::new(path, live.as_deref()) else { return true }; let picked = corners_of(*id).unwrap_or_else(|| c.picked(st.selection.anchors.get(id))); - // Setting corners folds a scale left in a rectangle's transform into its size, which - // changes it. - live.as_deref().is_none_or(|l| l.folded() == *l) + // Setting a radius folds a scale left in a rectangle's transform into its size, which + // changes it. A kind the corners already have leaves the rectangle as it is. + (radius.is_none() || live.as_deref().is_none_or(|l| l.folded() == *l)) && picked.iter().all(|k| { *k < c.base.anchor_count() - && radius.is_none_or(|r| (c.drawn_radius(*k) - r.max(0.0)).abs() < 1e-9) + // A radius stored in document units can be larger than it draws; a relative + // one is a fraction, so it is compared as drawn. + && radius.is_none_or(|r| { + let now = if c.radii_relative() { c.drawn_radius(*k) } else { c.radius(*k) }; + (now - r.max(0.0)).abs() < 1e-9 + }) && kind.is_none_or(|kd| c.kind(*k) == kd) }) }; - if ids.iter().all(has_values) { + // The objects every value given already matches stay as they are, beside others that change. + let ids: Vec = ids.into_iter().filter(|id| !has_values(id)).collect(); + if ids.is_empty() { return ok(); } s.edit("Live Shape", |d, sel| { diff --git a/crates/engine/src/cmd/params.rs b/crates/engine/src/cmd/params.rs index ff66759b5a..64ce29e337 100644 --- a/crates/engine/src/cmd/params.rs +++ b/crates/engine/src/cmd/params.rs @@ -582,8 +582,9 @@ fn check_effect_types(id: &str, effect: &str, params: &Value) -> Result<()> { /// `lightElevation`) and Scribble `variation` are numbers, an Outline Stroke's `width` is a number /// and a Gaussian Blur's `linear` is true or false. A Pathfinder effect's `precision` is a number and /// its `removeRedundantPoints` and `removeUnpainted` are true or false. A Glass, Texturizer or Rough -/// Pastels `textureImage`, an SVG filter's `name` and `xml`, a Warp's `version` and the `style` of -/// Crop Marks have checks of their own; they aren't listed. +/// Pastels `textureImage`, an SVG filter's `name` and `xml`, a Warp's `version`, the `style` of Crop +/// Marks and an Extrude & Bevel's custom `bevelName` and `bevelProfile` have checks of their own; +/// they aren't listed. pub(crate) fn undefaulted_type(effect: &str, key: &str) -> Option { use vectorcraft_render::effects; let number = || Some(Value::from(0.0)); diff --git a/crates/engine/src/cmd/plugin_call/reviewed.rs b/crates/engine/src/cmd/plugin_call/reviewed.rs index fa41a609c8..45df90f0f1 100644 --- a/crates/engine/src/cmd/plugin_call/reviewed.rs +++ b/crates/engine/src/cmd/plugin_call/reviewed.rs @@ -746,5 +746,7 @@ pub(super) const DENIED: &[&str] = &[ "stroke.arrowheads.edit", "stroke.arrowheads.list", "text.similarFonts", + "threeD.bevels.edit", + "threeD.bevels.list", "type.compositeFonts.set", ]; diff --git a/crates/engine/src/cmd/retype.rs b/crates/engine/src/cmd/retype.rs index cb548bd46e..8f4bcb4b35 100644 --- a/crates/engine/src/cmd/retype.rs +++ b/crates/engine/src/cmd/retype.rs @@ -10,7 +10,8 @@ //! path, inside groups too) is compared with the glyphs of the candidate fonts //! ([`vectorcraft_text::retype`]), the same up to uniform scale, rotation and translation. Matched //! glyphs map back to characters through the font's cmap and are rebuilt as point text, one object -//! per line of glyphs, with the first glyph's fill and stroke. Shapes that match no font stay as +//! per line of glyphs, with the first glyph's fill and stroke. A line whose glyphs are evenly spaced +//! apart takes that spacing as its tracking ([`Line::tracked`]). Shapes that match no font stay as //! they are and are reported. Near matches (another version of the font, simplified outlines, //! merged glyphs) and images are phase 2. @@ -39,7 +40,7 @@ pub fn specs() -> Vec { "Retype", ["Type"], None, - "{fonts?: [family…]} turn the selected outlined text (glyph paths and compound paths, inside groups too) back into live point text: each shape is matched against the glyphs of the fonts the app has loaded, the document's fonts and the families in fonts, the same up to uniform scale, rotation and translation (exact matches only); matched glyphs become point text in that font and size at the same baseline, one object per line, with the first glyph's fill, stroke, opacity and blend mode, in one undo step; a line splits where its type would not draw the outlines' glyphs in their places (tracking, manual spacing, font substitutions); shapes that match no font, glyphs type cannot draw as they are, and shapes with their own opacity mask stay as they are → {ids (the new type), texts, fonts: [{family, style, size}], unmatched: [id…], truncated (shapes past the limits of 2048 shapes or 16 nested groups were left out)}; an error when no shape matches", + "{fonts?: [family…]} turn the selected outlined text (glyph paths and compound paths, inside groups too) back into live point text: each shape is matched against the glyphs of the fonts the app has loaded, the document's fonts and the families in fonts, the same up to uniform scale, rotation and translation (exact matches only); matched glyphs become point text in that font and size at the same baseline, one object per line, with the first glyph's fill, stroke, opacity and blend mode, in one undo step; a line of three or more glyphs takes the spacing most of its gaps share as its tracking (pair kerning left out) when tracked type draws all of it in place, or more of it than untracked type (when untracked type also draws it, untracked type is kept if the tracking is under one unit or the tracked type would drop a gap one space wide (a b c keeps its spaces), and the tracked type otherwise), and negative tracking only when the line is opaque, Normal, with a solid fill or none and no stroke (its glyphs may overlap); a line splits where its type would not draw the outlines' glyphs in their places (uneven spacing, manual kerning, font substitutions); shapes that match no font, glyphs type cannot draw as they are, and shapes with their own opacity mask stay as they are → {ids (the new type), texts, fonts: [{family, style, size, tracking (1/1000 em)}], unmatched: [id…], truncated (shapes past the limits of 2048 shapes or 16 nested groups were left out)}; an error when no shape matches", has_selected_path, retype )] @@ -163,8 +164,11 @@ fn candidate_faces(db: &FontDb, d: &Document, fonts: &[String]) -> Vec, + /// Tracking in 1/1000 em, added after each character, spaces included. + tracking: f64, /// What each piece matched, as `pieces`. matches: Vec, /// Every glyph the first piece fits, while the line holds only it: the next glyph may tell @@ -204,16 +208,53 @@ impl Line { // Wrapped: type turned 180° has angles near +π and −π. && ((m.angle - self.angle + PI).rem_euclid(TAU) - PI).abs() < 1e-5 && across < size * 0.05 - && (m.origin - self.end).dot(dir) > -size * 0.25 + // After the line's end, or, for type tracked tighter than that, still ahead of the + // last glyph's start (by more than rounding); the layout check decides whether it fits. + && ((m.origin - self.end).dot(dir) > -size * 0.25 + || self.matches.last().is_some_and(|last| (m.origin - last.origin).dot(dir) > size * 1e-3)) + } + + fn size(&self) -> f64 { + self.scale * self.face.units_per_em() + } + + /// The shapes of the one-contour glyphs that stand alone on this line: neither the glyph before + /// nor the one after continues it by starting after the end of the glyph before it. A glyph + /// that joined the line only through the tight-tracking test counts as alone. A line of three + /// glyphs or more is type (its tracking can be read), so none of its glyphs is alone. + fn lone_one_contour(&self) -> Vec { + if self.matches.len() >= 3 { + return vec![]; + } + let dir = self.dir(); + let size = self.size(); + // Does glyph `k` start after the end of the glyph before it, less a quarter em? + let after_previous = |k: usize| match (k.checked_sub(1).and_then(|j| self.matches.get(j)), self.matches.get(k)) { + (Some(a), Some(b)) => (b.origin - (a.origin + dir * (a.face.advance(a.gid) * a.scale))).dot(dir) > -size * 0.25, + _ => false, + }; + let n = self.matches.len(); + (0..n) + .filter(|&k| !after_previous(k) && !after_previous(k + 1)) + .filter_map(|k| self.matches.get(k).filter(|m| m.contours == 1).and_then(|_| self.pieces.get(k).copied())) + .collect() + } + + /// The line's tracking in points. + fn tracking_pt(&self) -> f64 { + self.tracking * self.size() / 1000.0 } fn push(&mut self, id: NodeId, m: &GlyphMatch) { - // A gap wider than half a space before the glyph is spaces the outlines left no shape for. + // A gap, past the tracking, wider than half a space before the glyph is spaces the + // outlines left no shape for. Each space takes the tracking too. let dir = self.dir(); - let gap = (m.origin - self.end).dot(dir); - let space = space_advance(&self.face) * self.scale; - if space > 0.0 && gap > space * 0.5 { - let n = ((gap / space).round() as usize).clamp(1, 64); + let gap = (m.origin - self.end).dot(dir) - self.tracking_pt(); + // Tracking tighter than a space's width gives each space a negative advance. + let space = space_advance(&self.face) * self.scale + self.tracking_pt(); + let spaces = if space.abs() > 1e-9 { gap / space } else { 0.0 }; + if spaces.is_finite() && spaces > 0.5 { + let n = (spaces.round() as usize).clamp(1, 64); self.text.extend(std::iter::repeat_n(' ', n)); } self.text.push(m.ch); @@ -222,13 +263,49 @@ impl Line { self.end = m.origin + dir * (m.face.advance(m.gid) * m.scale); } - /// The line of this one's glyphs `from..to`, with its group, paint and transparency. + /// The line of this one's glyphs `from..to`, with its group, paint, transparency, tracking and + /// the spaces between those glyphs. fn part(&self, from: usize, to: usize) -> Option { + let mut text = String::new(); + let mut glyph = 0usize; + for c in self.text.chars() { + // The text after glyph `to - 1` is not read. + if glyph >= to { + break; + } + if c == ' ' { + // Spaces before glyph `glyph`, after glyph `glyph - 1`. + if glyph > from { + text.push(c); + } + continue; + } + if glyph >= from { + text.push(c); + } + glyph += 1; + } + if glyph != to || to > self.matches.len() { + return self.respaced(from, to, self.tracking); + } + let mut l = self.respaced(from, to.min(from.saturating_add(1)), self.tracking)?; + l.pieces = self.pieces.get(from..to)?.to_vec(); + l.matches = self.matches.get(from..to)?.to_vec(); + let last = l.matches.last()?; + l.end = last.origin + l.dir() * (last.face.advance(last.gid) * last.scale); + l.text = text; + Some(l) + } + + /// The line of this one's glyphs `from..to` at `tracking`, with its group, paint and + /// transparency, its spaces read again from the gaps at that tracking. + fn respaced(&self, from: usize, to: usize, tracking: f64) -> Option { let (ids, ms) = (self.pieces.get(from..to)?, self.matches.get(from..to)?); let (first, m) = (ids.first()?, ms.first()?); let dir = Vec2::new(m.angle.cos(), m.angle.sin()); let mut l = Line { pieces: vec![*first], + tracking, matches: vec![m.clone()], first_cands: vec![], text: m.ch.to_string(), @@ -248,8 +325,8 @@ impl Line { Some(l) } - /// The point type that sets this line. - fn text_object(&self, system_layout: bool) -> TextObject { + /// The point type that sets this line, not yet laid out (for a layout check). + fn probe(&self, system_layout: bool) -> TextObject { let style = CharStyle { font_family: self.face.family.clone(), font_style: self.face.style.clone(), @@ -258,6 +335,7 @@ impl Line { // Each outlined glyph was drawn on its own; a ligature would draw another shape. features: vec!["-liga".into()], size: self.scale * self.face.units_per_em(), + tracking: self.tracking, fill: self.appearance.fill_paint(), stroke: self.appearance.stroke_paint(), stroke_width: self.appearance.stroke_width(), @@ -277,6 +355,12 @@ impl Line { } t.para = super::create::new_type_para(); t.system_layout = system_layout; + t + } + + /// The point type that sets this line, laid out and measured. + fn text_object(&self, system_layout: bool) -> TextObject { + let mut t = self.probe(system_layout); super::typecmd::refresh_bounds(&mut t); t } @@ -298,6 +382,217 @@ impl Line { // Ink the outlines did not have: the last glyph is where it went wrong. drawn.next().map(|_| self.matches.len().saturating_sub(1)) } + + /// This line with the tracking its glyphs are spaced by, when it has at least three glyphs. + /// The glyphs are laid out untracked and without spaces, so each gap's extra is how much + /// further apart the outlines are than the font's advances and pair kerning set them; a gap + /// read as word spaces is measured from the glyph's own advance instead, as no pair kerning + /// crosses a space. The extra most gaps share (the lower median, so that the word spaces of a + /// few gaps do not count) places the word spaces; the tracking is then the lower median, over + /// the gaps, of each gap's extra less its spaces, per character. The upper median of the + /// extras is tried next, for a line whose word spaces are its tighter gaps, and last the lower + /// median less one space, halved, for a line most of whose gaps hold a word space. A tracking within + /// 0.05 of a whole number is tried rounded to it first, then as measured. A tracked line is + /// kept when its type draws the whole line in place, or more of it from its start than + /// untracked type does. When untracked type with the spaces also draws the whole line, the line stays + /// untracked if the tracking is under one unit or the tracked reading drops a gap untracked + /// type reads as one space. The line also stays as it is when its tracking is 0 or outside + /// -1000..10000, and when its tracking is negative and the line does not paint the same as one + /// object ([`paints_as_one`]: its glyphs may overlap). Each of the nine layouts at most takes + /// its characters, spaces included, from `budget` before it runs; without enough left, the + /// line stays as it is, or becomes the best tracked reading laid out before the budget ran out. + fn tracked(self, system_layout: bool, budget: &mut usize) -> Line { + let size = self.size(); + let n = self.pieces.len(); + if n < 3 || size <= 0.0 { + return self; + } + // Each layout takes its characters, spaces included, from `budget` before it runs. + let mut take = |text: &str| match budget.checked_sub(text.chars().count()) { + Some(left) => { + *budget = left; + true + } + None => false, + }; + if !take(&self.text) { + return self; + } + let plain_miss = self.first_mismatch(&self.probe(system_layout)); + let dir = self.dir(); + // Where untracked type draws the glyphs of `text` (each layout dropped once read). + let mut bare = self.clone(); + bare.tracking = 0.0; + let mut origins = |text: String| -> Vec { + bare.text = text; + let t = bare.probe(system_layout); + let lay = vectorcraft_text::layout(FontDb::global(), &t); + lay.glyphs.iter().filter(|g| !g.outline.elements().is_empty()).map(|g| t.xf * (g.xf * Point::ORIGIN)).collect() + }; + // With no spaces. + let joined: String = self.matches.iter().map(|m| m.ch).collect(); + if !take(&joined) { + return self; + } + let drawn = origins(joined); + if drawn.len() != n { + return self; + } + // And with one space between each two glyphs (kerning against the space included). + let spaced = self.matches.iter().map(|m| m.ch.to_string()).collect::>().join(" "); + if !take(&spaced) { + return self; + } + let drawn_spaced = origins(spaced); + // A font whose space has ink draws more glyphs: then the glyph's own advance stands in. + let spaced_ok = drawn_spaced.len() == n; + let space = space_advance(&self.face) * self.scale; + // Each gap's extra over the joined pair, and over the pair with one space between them + // plus a space (so the extra counts the spaces as the joined pair's extra counts none). + let gaps: Vec<(f64, f64)> = self + .matches + .windows(2) + .enumerate() + .zip(drawn.windows(2)) + .filter_map(|((i, m), p)| match (m, p) { + ([a, b], [pa, pb]) => { + let d = (b.origin - a.origin).dot(dir); + let apart = match (spaced_ok, drawn_spaced.get(i), drawn_spaced.get(i + 1)) { + (true, Some(qa), Some(qb)) => d - (*qb - *qa).dot(dir) + space, + _ => d - a.face.advance(a.gid) * a.scale, + }; + Some((d - (*pb - *pa).dot(dir), apart)) + } + _ => None, + }) + .collect(); + let extra: Vec = gaps.iter().map(|g| g.0).collect(); + // The spaces in each gap at a tracking of `tr` points: each space takes the tracking too, + // and tracking tighter than a space's width gives it a negative advance. A gap reads as + // spaces when they fit it better than the joined pair does. + let spaces = |tr: f64| -> Vec { + gaps.iter() + .map(|(joined, apart)| { + let step = space + tr; + // Spaces with no advance: one space, which still breaks the pair's kerning. + let s = if step.abs() > 1e-9 { (apart - tr) / step } else { 1.0 }; + if !s.is_finite() { + return 0; + } + // At least one space: the space's own kerning can make it fit a narrower gap. + let k = (s.round().max(1.0) as usize).clamp(1, 64); + // Spaces only where they fit better by more than rounding (1/100,000 em). + if (apart - tr - k as f64 * step).abs() + size * 1e-5 < (joined - tr).abs() { k } else { 0 } + }) + .collect() + }; + // The tracking the gaps give when the word spaces are placed by `seed`. + let measure = |seed: f64| -> Option { + let per: Vec = gaps + .iter() + .zip(spaces(seed)) + .map(|((joined, apart), s)| if s == 0 { *joined } else { (apart - s as f64 * space) / (s + 1) as f64 }) + .collect(); + median(per, false).map(|g| g / size * 1000.0) + }; + // The lower median of the extras places the word spaces first; the upper one second, for a + // line whose word spaces are its tighter gaps (tracking tighter than a space). + let lower = median(extra.clone(), false); + // A line whose word gaps are most of its gaps has a space and two trackings in each extra + // (tracking is added after the glyph and after the space): the seed then places the spaces + // from the extra less one space, shared by the two. It goes last, so a reading that fits + // without it is kept (an untracked "a b c" has no such tracking). + // Where untracked type already draws the whole line, a space and a tracking of half its + // advance less draw it too: that reading is not tried. + let spaced_seed = lower.filter(|_| plain_miss.is_some()).map(|e| (e - space) / 2.0); + let mut tries = vec![]; + for seed in [lower, median(extra, true), spaced_seed].into_iter().flatten() { + let Some(measured) = measure(seed) else { continue }; + for t in [round_tracking(measured), measured] { + if !tries.contains(&t) { + tries.push(t); + } + } + } + // The spaces in each gap of the line as it is (the reading `plain_miss` checked). + let mut plain_gaps = vec![]; + let mut run = 0usize; + for (i, c) in self.text.chars().enumerate() { + if c == ' ' { + run += 1; + } else { + if i > 0 { + plain_gaps.push(run); + } + run = 0; + } + } + let mut best: Option<(usize, Line)> = None; + for t in tries { + if t == 0.0 || !TRACKING.contains(&t) { + continue; + } + if t < 0.0 && !paints_as_one(&self) { + return self; + } + let mut tracked = self.clone(); + tracked.tracking = t; + tracked.text = String::new(); + let gaps = spaces(t * size / 1000.0); + for (k, (m, s)) in self.matches.iter().zip(std::iter::once(0).chain(gaps.iter().copied())).enumerate() { + if k > 0 { + tracked.text.extend(std::iter::repeat_n(' ', s)); + } + tracked.text.push(m.ch); + } + // A reading the budget cannot lay out is skipped; the next may be shorter. + if !take(&tracked.text) { + continue; + } + // When both draw the whole line (gaps as wide as whole spaces), the tracked reading is + // kept unless it drops a gap that untracked type reads as one space: such a gap is a + // word space ("a b c"), and the line keeps its spaces. + let drops_a_word_space = plain_gaps.iter().zip(&gaps).any(|(plain, tracked)| *plain == 1 && *tracked == 0); + match (tracked.first_mismatch(&tracked.probe(system_layout)), plain_miss) { + // Under a unit of tracking, or a word space the tracked reading drops, where + // untracked type draws the line: no tracking. + (None, None) if t.abs() < 1.0 || drops_a_word_space => return self, + (None, _) => return tracked, + (Some(k), Some(p)) if k > p && best.as_ref().is_none_or(|(b, _)| k > *b) => best = Some((k, tracked)), + _ => {} + } + } + best.map_or(self, |(_, l)| l) + } +} + +/// Does line `l` paint the same as one object as glyph by glyph where its glyphs overlap: opaque, +/// Normal blend, a solid fill or none, and no stroke? One object composites its transparency and +/// blend once, spans a gradient over all of it, and strokes after filling every glyph. +fn paints_as_one(l: &Line) -> bool { + l.opacity == 1.0 + && l.blend == vectorcraft_color::BlendMode::Normal + && matches!(l.appearance.fill_paint(), vectorcraft_color::Paint::None | vectorcraft_color::Paint::Solid { .. }) + && matches!(l.appearance.stroke_paint(), vectorcraft_color::Paint::None) +} + +/// The tracking Retype sets, in 1/1000 em. +const TRACKING: std::ops::RangeInclusive = -1000.0..=10000.0; + +/// The lower median of the finite values of `v`, or the upper one when `upper`; None for fewer +/// than two. +fn median(mut v: Vec, upper: bool) -> Option { + v.retain(|x| x.is_finite()); + if v.len() < 2 { + return None; + } + v.sort_by(f64::total_cmp); + v.get(if upper { v.len() / 2 } else { (v.len() - 1) / 2 }).copied() +} + +/// Tracking `t` rounded to a whole number when it is within 0.05 of one. +fn round_tracking(t: f64) -> f64 { + if (t - t.round()).abs() < 0.05 { t.round() } else { t } } /// `lines` checked against their own layout: a line splits where its type stops drawing the @@ -306,6 +601,15 @@ impl Line { fn verified(lines: Vec, system_layout: bool, unmatched: &mut Vec) -> Vec { // Glyphs laid out in all, at most: past it, the glyphs left unchecked stay outlines. let mut budget = lines.iter().map(|l| l.pieces.len()).sum::().saturating_mul(16).saturating_add(256); + // Measuring the tracking of the glyphs after a split has a budget of its own, so it cannot + // leave glyphs unchecked; past it they keep no tracking. Each measure takes the glyphs to + // rebuild the rest and the characters it lays out (see [`Line::tracked`]); the budget covers + // one measure of each whole line, as `retype` gives the first, and the glyph checks' budget. + // The glyphs measured again after splits are limited apart from it, at six times each rest's + // glyphs from half as much again as the glyph checks' budget. + let mut remeasured = budget.saturating_add(budget / 2); + let mut track_budget = + lines.iter().map(|l| l.text.chars().count().saturating_add(l.pieces.len().saturating_mul(394))).fold(budget, usize::saturating_add); let mut todo: std::collections::VecDeque = lines.into(); let mut out = vec![]; while let Some(l) = todo.pop_front() { @@ -323,28 +627,58 @@ fn verified(lines: Vec, system_layout: bool, unmatched: &mut Vec) break; }; budget = left; - match part.first_mismatch(&part.text_object(system_layout)) { + match part.first_mismatch(&part.probe(system_layout)) { // The whole line is drawn as it was: one object. None if e == n => { out.push(part); break; } None => w = w.saturating_mul(2), - // The first glyph on its own may still be drawn as it was (a contextual form - // changed it in the line); else it stays an outline. Checked again either way. - Some(0) if n > 1 => { - todo.extend_front_parts(&l, [(0, 1), (1, n)]); + // Tracking that type does not set as the outlines are spaced: the line is + // checked again without it. + Some(k) if l.tracking != 0.0 && k < 2 => { + match l.respaced(0, n, 0.0) { + Some(p) => todo.push_front(p), + None => unmatched.extend(l.pieces.iter().copied()), + } break; } - Some(0) => { + // A single glyph its type cannot draw as it was stays an outline. + Some(0) if n == 1 => { unmatched.extend(l.pieces.first().copied()); break; } // The glyphs before the mismatch, then the rest, each checked as a line of its // own: the type before the mismatch may draw otherwise without what follows it (a - // font can place a glyph by the glyph after it). + // font can place a glyph by the glyph after it), and the first glyph on its own + // may still be drawn as it was (a contextual form changed it in the line). The + // rest takes the tracking its own glyphs are spaced by, while the budget for + // measuring it lasts and when type draws its first glyph as it was, followed by the + // next two (else that glyph splits off first, and the tracking is measured from the + // next one); past it, an untracked line's rest keeps its text as it is. Some(k) => { - todo.extend_front_parts(&l, [(0, k), (k, n)]); + let k = k.max(1); + // A measure takes at least six times the rest's glyphs from each budget. + let measurable = n - k >= 3 && remeasured >= (n - k).saturating_mul(6) && track_budget >= (n - k).saturating_mul(6); + let first_drawn = measurable && { + budget = budget.saturating_sub(3); + l.respaced(k, k + 3, l.tracking).is_some_and(|p| p.first_mismatch(&p.probe(system_layout)) != Some(0)) + }; + let rest = if first_drawn { + // Rebuilding the rest for the measure takes its glyphs from the budget. + remeasured = remeasured.saturating_sub((n - k).saturating_mul(6)); + track_budget = track_budget.saturating_sub(n - k); + l.respaced(k, n, 0.0).map(|r| r.tracked(system_layout, &mut track_budget)) + } else if l.tracking == 0.0 { + l.part(k, n) + } else { + l.respaced(k, n, 0.0) + }; + match rest { + Some(r) => todo.push_front(r), + None => unmatched.extend(l.pieces.get(k..).unwrap_or_default().iter().copied()), + } + todo.extend_front_parts(&l, [(0, k)]); break; } } @@ -407,6 +741,7 @@ fn reposed(l: &Line, id: NodeId, m: &GlyphMatch) -> Line { let dir = Vec2::new(m.angle.cos(), m.angle.sin()); Line { pieces: vec![id], + tracking: 0.0, matches: vec![m.clone()], first_cands: l.first_cands.clone(), text: m.ch.to_string(), @@ -428,6 +763,7 @@ fn new_line(pc: &Piece, cands: &[GlyphMatch]) -> Option { let dir = Vec2::new(m.angle.cos(), m.angle.sin()); Some(Line { pieces: vec![pc.id], + tracking: 0.0, matches: vec![m.clone()], first_cands: cands.to_vec(), text: m.ch.to_string(), @@ -531,8 +867,14 @@ fn retype(s: &mut Session, p: &Value) -> Result { // art (a dot, a bar): beside other shapes it stays an outline. Selected on its own, it is // what was asked for. Lone means alone on its baseline as the outlines lie, before the // layout check splits lines (tracking and manual kerning split them glyph by glyph). - let lone_pieces: std::collections::HashSet = - lines.iter().filter(|l| matches!(l.matches.as_slice(), [m] if m.contours == 1)).flat_map(|l| l.pieces.iter().copied()).collect(); + let lone_pieces: std::collections::HashSet = lines.iter().flat_map(Line::lone_one_contour).collect(); + // Each line's tracking is measured with nine layouts at most: the line as read (its + // characters), its glyphs without and with one space between them (three times its + // glyphs) and six tracked readings of at most 64 spaces in each gap (390 times its + // glyphs), so every line has what its measure can take. + let mut budget = + lines.iter().map(|l| l.text.chars().count().saturating_add(l.pieces.len().saturating_mul(393))).fold(256usize, usize::saturating_add); + let lines = lines.into_iter().map(|l| l.tracked(system_layout, &mut budget)).collect(); let mut lines = verified(lines, system_layout, &mut unmatched); if pieces.len() > 1 { lines.retain(|l| { @@ -611,7 +953,10 @@ fn retype(s: &mut Session, p: &Value) -> Result { Ok(json!({ "ids": made.iter().map(|i| i.0).collect::>(), "texts": lines.iter().map(|l| l.text.clone()).collect::>(), - "fonts": lines.iter().map(|l| json!({"family": l.face.family, "style": l.face.style, "size": l.scale * l.face.units_per_em()})).collect::>(), + "fonts": lines + .iter() + .map(|l| json!({"family": l.face.family, "style": l.face.style, "size": l.size(), "tracking": l.tracking})) + .collect::>(), "unmatched": unmatched.iter().map(|i| i.0).collect::>(), "truncated": truncated, })) diff --git a/crates/engine/src/cmd/retype_tests.rs b/crates/engine/src/cmd/retype_tests.rs index d691ab34fa..3d9dc5e3fe 100644 --- a/crates/engine/src/cmd/retype_tests.rs +++ b/crates/engine/src/cmd/retype_tests.rs @@ -477,10 +477,10 @@ fn tracked_one_contour_letters_still_become_type() { let g = s.execute("type.createOutlines", &json!({})).unwrap()["ids"][0].as_u64().unwrap(); s.execute("select.set", &json!({"ids": [g]})).unwrap(); let r = s.execute("type.retype", &json!({})).unwrap(); - let texts: Vec = r["texts"].as_array().unwrap().iter().map(|t| t.as_str().unwrap().to_owned()).collect(); - assert_eq!(texts.concat(), text, "split by the tracking, every letter still becomes type: {r}"); - assert!(texts.len() > 1, "the tracking splits the line: {r}"); + assert_eq!(r["texts"], json!([text]), "evenly tracked, the line is one object: {r}"); + assert_eq!(r["fonts"][0]["tracking"], json!(50.0), "{r}"); assert_eq!(r["unmatched"], json!([]), "{r}"); + assert_eq!(text_of(&s, r["ids"][0].as_u64().unwrap()).first_style().tracking, 50.0); } } @@ -521,8 +521,8 @@ fn timing_with_hundreds_of_cjk_outlines() { #[test] fn a_long_tracked_line_is_checked_in_time() { - // Tracking splits the line at every glyph: the layout check must not lay out the rest of the - // line again after each split. + // Even tracking is kept on the line; the layout check of a long line must not lay out the rest + // of the line again after each window. let text = "abe".repeat(150); let mut s = session(); let id = s.execute("text.create", &json!({"x": 10, "y": 100, "text": text, "size": 4})).unwrap()["id"].as_u64().unwrap(); @@ -533,7 +533,379 @@ fn a_long_tracked_line_is_checked_in_time() { let t0 = std::time::Instant::now(); let r = s.execute("type.retype", &json!({})).unwrap(); let texts: Vec = r["texts"].as_array().unwrap().iter().map(|t| t.as_str().unwrap().to_owned()).collect(); - assert_eq!(texts.concat(), text); + assert_eq!(texts, vec![text], "the whole line is one object: {r}"); + assert_eq!(r["fonts"][0]["tracking"], json!(50.0), "{r}"); assert_eq!(r["unmatched"], json!([])); eprintln!("450 tracked glyphs: {:?}, {} objects", t0.elapsed(), texts.len()); } + +#[test] +fn two_overlapping_lone_glyphs_beside_art_stay_outlines() { + // Two M outlines start 0.3 em apart, closer than the first one's advance: a tight-tracking + // line of two, which the layout check splits again. Each is still a lone one-contour glyph. + let mut s = session(); + let a = outlined(&mut s, json!({"x": 40, "y": 100, "text": "M", "size": 30})); + let b = outlined(&mut s, json!({"x": 49, "y": 100, "text": "M", "size": 30})); + let dot = s.execute("shape.ellipse", &json!({"x": 300, "y": 60, "width": 8, "height": 8})).unwrap()["id"].as_u64().unwrap(); + s.execute("select.set", &json!({"ids": [a, b, dot]})).unwrap(); + // Nothing is left to retype: both stay outlines, as the lone bar beside art does. + let e = s.execute("type.retype", &json!({})).unwrap_err(); + assert!(format!("{e:?}").contains("no selected shape matches"), "{e:?}"); +} + +/// Where type `t` draws each glyph that has ink, in document space. +fn glyph_places(t: &TextObject) -> Vec { + let lay = vectorcraft_text::layout(vectorcraft_text::FontDb::global(), t); + lay.glyphs.iter().filter(|g| !g.outline.elements().is_empty()).map(|g| t.xf * (g.xf * kurbo::Point::ORIGIN)).collect() +} + +/// Type made with `p` (and `setup` run on its id), outlined and retyped: the original type, and +/// Retype's result. +fn retyped(s: &mut Session, p: serde_json::Value, setup: &[serde_json::Value]) -> (TextObject, serde_json::Value) { + let id = s.execute("text.create", &p).unwrap()["id"].as_u64().unwrap(); + for q in setup { + let mut q = q.clone(); + q["id"] = json!(id); + s.execute("text.setRangeStyle", &q).unwrap(); + } + let before = text_of(s, id); + s.execute("select.set", &json!({"ids": [id]})).unwrap(); + let g = s.execute("type.createOutlines", &json!({})).unwrap()["ids"][0].as_u64().unwrap(); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + (before, s.execute("type.retype", &json!({})).unwrap()) +} + +fn assert_same_places(a: &TextObject, b: &TextObject) { + let (pa, pb) = (glyph_places(a), glyph_places(b)); + assert_eq!(pa.len(), pb.len()); + for (x, y) in pa.iter().zip(&pb) { + assert!(x.distance(*y) < 0.05, "{x:?} vs {y:?}"); + } +} + +#[test] +fn unevenly_tracked_type_still_becomes_type() { + let mut s = session(); + // Less than half a space more after e: no gap can be read as a word space. + let text = "abcdefgh"; + let (before, r) = retyped( + &mut s, + json!({"x": 40, "y": 100, "text": text, "size": 30}), + &[json!({"start": 0, "end": 4, "tracking": 50}), json!({"start": 4, "end": 8, "tracking": 120})], + ); + let texts: Vec = r["texts"].as_array().unwrap().iter().map(|t| t.as_str().unwrap().to_owned()).collect(); + assert_eq!(texts.concat(), text, "{r}"); + assert!(texts.len() > 1, "{r}"); + assert_eq!(r["unmatched"], json!([]), "{r}"); + // Each object's glyphs are where the outlines were. + let places: Vec = r["ids"].as_array().unwrap().iter().flat_map(|id| glyph_places(&text_of(&s, id.as_u64().unwrap()))).collect(); + let want = glyph_places(&before); + assert_eq!(places.len(), want.len()); + for (x, y) in places.iter().zip(&want) { + assert!(x.distance(*y) < 0.05, "{x:?} vs {y:?}"); + } + // The second half keeps its own tracking. + assert_eq!(r["fonts"].as_array().unwrap().last().unwrap()["tracking"], json!(120.0), "{r}"); +} + +#[test] +fn a_tracked_line_keeps_its_tracking_and_spaces() { + let mut s = session(); + let text = "SPACED OUT"; + let (before, r) = retyped(&mut s, json!({"x": 40, "y": 100, "text": text, "size": 24}), &[json!({"tracking": 400})]); + assert_eq!(r["texts"], json!([text]), "{r}"); + assert_eq!(r["fonts"][0]["tracking"], json!(400.0), "{r}"); + assert_same_places(&before, &text_of(&s, r["ids"][0].as_u64().unwrap())); +} + +#[test] +fn a_long_line_tracked_two_spaces_wide_keeps_its_tracking() { + // Read as it is, the line holds two spaces in each gap, which the tracking measure lays out too. + let mut s = session(); + let text = "M".repeat(400); + let (_, r) = retyped(&mut s, json!({"x": 10, "y": 100, "text": text, "size": 10}), &[json!({"tracking": 400})]); + assert_eq!(r["texts"], json!([text]), "{}", r["fonts"]); + assert_eq!(r["fonts"][0]["tracking"], json!(400.0), "{}", r["fonts"]); +} + +#[test] +fn a_long_tightly_tracked_line_keeps_its_word_spaces() { + // Read as it is, the line holds no spaces; the tracked reading holds eight in each word gap. + let mut s = session(); + let text = vec!["MMM"; 100].join(" "); + let (_, r) = retyped(&mut s, json!({"x": 10, "y": 100, "text": text, "size": 10}), &[json!({"tracking": -180})]); + assert_eq!(r["texts"], json!([text]), "{}", r["fonts"]); + assert_eq!(r["fonts"][0]["tracking"], json!(-180.0), "{}", r["fonts"]); +} + +#[test] +fn spaced_letters_keep_their_spaces_when_type_draws_them() { + // Most gaps are word spaces: untracked type with the spaces draws every glyph in place. + // Every gap one word space: tracking a space wide would draw them too, without the spaces. + // L T J: without its spaces the pairs kern, which a measure of the gaps would read as more space. + for text in ["a a a aa", "1 2 3", "a b c d", "x = y + 1", "L T J"] { + let mut s = session(); + let (before, r) = retyped(&mut s, json!({"x": 40, "y": 100, "text": text, "size": 30}), &[]); + assert_eq!(r["texts"], json!([text]), "{r}"); + assert_eq!(r["fonts"][0]["tracking"], json!(0.0), "{r}"); + assert_same_places(&before, &text_of(&s, r["ids"][0].as_u64().unwrap())); + } +} + +#[test] +fn slight_tracking_without_spaces_is_kept() { + // Tracking 3 moves the last glyph less than the layout check notices: both readings draw it. + // A word space both readings keep does not cost the tracking either. + for text in ["MMM", "M MM"] { + let mut s = session(); + let (before, r) = retyped(&mut s, json!({"x": 40, "y": 100, "text": text, "size": 30}), &[json!({"tracking": 3})]); + assert_eq!(r["texts"], json!([text]), "{r}"); + assert_eq!(r["fonts"][0]["tracking"], json!(3.0), "{r}"); + assert_same_places(&before, &text_of(&s, r["ids"][0].as_u64().unwrap())); + } +} + +/// The lines Retype reads from the outlines in group `g` (all in the face of its first glyph's +/// first match), before their tracking is measured and their layout checked. +fn lines_in(s: &Session, g: u64) -> Vec { + let d = &s.doc().unwrap().doc; + let (mut barrier, mut truncated, mut pieces) = (true, false, vec![]); + super::collect(d.node(NodeId(g)).unwrap(), d.parent_of(NodeId(g)), 0, &mut barrier, &mut truncated, &mut pieces); + let db = vectorcraft_text::FontDb::global(); + let wanted = pieces.iter().filter_map(|pc| vectorcraft_text::retype::shape_key(&pc.path)).collect(); + let index = super::RetypeIndex::build(db, super::candidate_faces(db, d, &[]), &wanted); + let face = index.matches(&pieces[0].path)[0].face.id(); + let mut lines: Vec = vec![]; + for pc in &pieces { + let cands: Vec<_> = index.matches(&pc.path).into_iter().filter(|m| m.face.id() == face).collect(); + if !lines.last_mut().is_some_and(|l| super::join(l, pc, &cands)) { + lines.extend(super::new_line(pc, &cands)); + } + } + lines +} + +#[test] +fn the_glyphs_after_one_type_cannot_draw_keep_their_tracking() { + // Glyph `bad` of a tracked line read as another glyph of its font, as when the line's type + // would draw another form there: the glyphs after it are still one tracked object. + for bad in [0usize, 1] { + let mut s = session(); + let id = s.execute("text.create", &json!({"x": 40, "y": 100, "text": "MMMMMM", "size": 30})).unwrap()["id"].as_u64().unwrap(); + s.execute("text.setRangeStyle", &json!({"id": id, "tracking": 300})).unwrap(); + s.execute("select.set", &json!({"ids": [id]})).unwrap(); + let g = s.execute("type.createOutlines", &json!({})).unwrap()["ids"][0].as_u64().unwrap(); + let lines = lines_in(&s, g); + assert_eq!(lines.len(), 1); + let mut budget = 1000; + let mut l = lines.into_iter().next().unwrap().tracked(false, &mut budget); + assert_eq!(l.tracking, 300.0); + let other = l.matches[bad].gid + 1; + l.matches[bad].gid = other; + let bad_id = l.pieces[bad]; + let mut unmatched = vec![]; + let out = super::verified(vec![l], false, &mut unmatched); + assert_eq!(unmatched, vec![bad_id], "{bad}"); + let last = out.last().unwrap(); + assert_eq!(last.pieces.len(), 5 - bad, "{bad}: {:?}", out.iter().map(|l| (l.pieces.len(), l.tracking)).collect::>()); + assert_eq!(last.tracking, 300.0, "{bad}"); + } +} + +#[test] +fn the_tracking_measure_counts_the_spaces_it_lays_out() { + // Three glyphs ten spaces apart: a budget of six times the glyphs, short of the first + // layout's 23 characters, lays nothing out. + let mut s = session(); + let g = outlined(&mut s, json!({"x": 40, "y": 100, "text": "a b c", "size": 30})); + let lines = lines_in(&s, g); + assert_eq!(lines.len(), 1); + assert!(lines[0].text.chars().filter(|c| *c == ' ').count() >= 20, "{}", lines[0].text); + let mut budget = 3 * 6; + let l = lines.into_iter().next().unwrap().tracked(false, &mut budget); + assert_eq!((budget, l.tracking), (3 * 6, 0.0)); +} + +#[test] +fn the_tracking_measure_needs_only_the_layouts_it_runs() { + // The line as read, without spaces, with one space per gap, then the tracked reading: a + // budget of exactly those characters recovers the tracking. + let mut s = session(); + let id = s.execute("text.create", &json!({"x": 40, "y": 100, "text": "MMMMMM", "size": 30})).unwrap()["id"].as_u64().unwrap(); + s.execute("text.setRangeStyle", &json!({"id": id, "tracking": 300})).unwrap(); + s.execute("select.set", &json!({"ids": [id]})).unwrap(); + let g = s.execute("type.createOutlines", &json!({})).unwrap()["ids"][0].as_u64().unwrap(); + let lines = lines_in(&s, g); + assert_eq!(lines.len(), 1); + let mut budget = lines[0].text.chars().count() + 6 + 11 + 6; + let l = lines.into_iter().next().unwrap().tracked(false, &mut budget); + assert_eq!((budget, l.tracking), (0, 300.0)); +} + +#[test] +fn the_rest_of_a_widely_tracked_line_keeps_its_tracking_after_a_split() { + // Tracking 40 spaces wide: read untracked, the rest after the split holds 40 spaces per gap, + // and its measure still has the budget to lay them out. + let mut s = session(); + let id = s.execute("text.create", &json!({"x": 10, "y": 100, "text": "M".repeat(100), "size": 2})).unwrap()["id"].as_u64().unwrap(); + s.execute("text.setRangeStyle", &json!({"id": id, "tracking": 8000})).unwrap(); + s.execute("select.set", &json!({"ids": [id]})).unwrap(); + let g = s.execute("type.createOutlines", &json!({})).unwrap()["ids"][0].as_u64().unwrap(); + let mut budget = 100_000; + let mut l = lines_in(&s, g).into_iter().next().unwrap().tracked(false, &mut budget); + assert_eq!(l.tracking, 8000.0); + l.matches[0].gid += 1; + let mut unmatched = vec![]; + let out = super::verified(vec![l], false, &mut unmatched); + assert_eq!(unmatched.len(), 1); + let last = out.last().unwrap(); + assert_eq!((last.pieces.len(), last.tracking), (99, 8000.0), "{:?}", out.iter().map(|l| (l.pieces.len(), l.tracking)).collect::>()); +} + +#[test] +fn glyphs_type_cannot_draw_do_not_use_up_the_tracking_measure() { + // A long tracked line whose first five glyphs are read as other glyphs: the rest is still one + // tracked object. + let mut s = session(); + let id = s.execute("text.create", &json!({"x": 10, "y": 100, "text": "i".repeat(100), "size": 10})).unwrap()["id"].as_u64().unwrap(); + s.execute("text.setRangeStyle", &json!({"id": id, "tracking": 300})).unwrap(); + s.execute("select.set", &json!({"ids": [id]})).unwrap(); + let g = s.execute("type.createOutlines", &json!({})).unwrap()["ids"][0].as_u64().unwrap(); + let mut budget = 1000; + let mut l = lines_in(&s, g).into_iter().next().unwrap().tracked(false, &mut budget); + assert_eq!(l.tracking, 300.0); + for m in l.matches.iter_mut().take(5) { + m.gid += 1; + } + let mut unmatched = vec![]; + let out = super::verified(vec![l], false, &mut unmatched); + assert_eq!(unmatched.len(), 5); + let last = out.last().unwrap(); + assert_eq!((last.pieces.len(), last.tracking), (95, 300.0), "{:?}", out.iter().map(|l| (l.pieces.len(), l.tracking)).collect::>()); +} + +#[test] +fn tightly_tracked_type_keeps_its_tracking() { + // Tracking tighter than a space: the space moves the next glyph back. + // M MM: of its two gaps, the word space is the tighter, and the lower median. + // M M MM: most gaps hold a word space, so the tightest extras alone seed a tracking that + // splits the last glyph. + for text in ["MMMM", "MMMM MM", "M MM", "MM M", "M M MM"] { + let mut s = session(); + let (before, r) = retyped(&mut s, json!({"x": 40, "y": 100, "text": text, "size": 30}), &[json!({"tracking": -300})]); + assert_eq!(r["texts"], json!([text]), "{r}"); + assert_eq!(r["fonts"][0]["tracking"], json!(-300.0), "{r}"); + assert_same_places(&before, &text_of(&s, r["ids"][0].as_u64().unwrap())); + } +} + +#[test] +fn kerned_pairs_in_tight_tracking_are_not_read_as_spaces() { + // Tracking -250 gives a space a negative advance; the pair kerning of T and a is no space. + let mut s = session(); + let text = "MMMTaMMM"; + let (before, r) = retyped(&mut s, json!({"x": 40, "y": 100, "text": text, "size": 30}), &[json!({"tracking": -250})]); + assert_eq!(r["texts"], json!([text]), "{r}"); + assert_eq!(r["fonts"][0]["tracking"], json!(-250.0), "{r}"); + assert_same_places(&before, &text_of(&s, r["ids"][0].as_u64().unwrap())); +} + +#[test] +fn a_word_space_between_kerned_letters_is_read_as_a_space() { + // T and a kern when they touch; with a space between them they do not. + let mut s = session(); + let text = "MMMT aMMM"; + let (before, r) = retyped(&mut s, json!({"x": 40, "y": 100, "text": text, "size": 30}), &[json!({"tracking": -250})]); + assert_eq!(r["texts"], json!([text]), "{r}"); + assert_eq!(r["fonts"][0]["tracking"], json!(-250.0), "{r}"); + assert_same_places(&before, &text_of(&s, r["ids"][0].as_u64().unwrap())); + // Tracking that cancels the space's advance: the space still stops the pair kerning. + let mut s = session(); + let text = "MMMT aMMM"; + let (before, r) = retyped(&mut s, json!({"x": 40, "y": 100, "text": text, "size": 30}), &[json!({"tracking": -200})]); + assert_eq!(r["texts"], json!([text]), "{r}"); + assert_eq!(r["fonts"][0]["tracking"], json!(-200.0), "{r}"); + assert_same_places(&before, &text_of(&s, r["ids"][0].as_u64().unwrap())); + // Tracking that nearly cancels it: the space still moves the glyphs after it a little. + let mut s = session(); + let text = "MMMM MM"; + let (before, r) = retyped(&mut s, json!({"x": 40, "y": 100, "text": text, "size": 30}), &[json!({"tracking": -199.5})]); + assert_eq!(r["texts"], json!([text]), "{r}"); + assert!(near(r["fonts"][0]["tracking"].as_f64().unwrap(), -199.5, 1e-3), "{r}"); + assert_same_places(&before, &text_of(&s, r["ids"][0].as_u64().unwrap())); + // A word space a little narrower than its tracking makes it (the word after it moved left by + // less than the layout check notices): one space still fits better than the kerned pair. + for (tracking, dx) in [(-190, -0.18), (-193, -0.24)] { + let mut s = session(); + let id = s.execute("text.create", &json!({"x": 40, "y": 100, "text": "MMMc aMMM", "size": 30})).unwrap()["id"].as_u64().unwrap(); + s.execute("text.setRangeStyle", &json!({"id": id, "tracking": tracking})).unwrap(); + s.execute("select.set", &json!({"ids": [id]})).unwrap(); + let g = s.execute("type.createOutlines", &json!({})).unwrap()["ids"][0].as_u64().unwrap(); + let kids = children_of(&s, g); + assert_eq!(kids.len(), 8); + s.execute("select.set", &json!({"ids": kids[4..]})).unwrap(); + s.execute("object.move", &json!({"dx": dx, "dy": 0})).unwrap(); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + assert_eq!(r["texts"], json!(["MMMc aMMM"]), "{tracking}: {r}"); + } + // A space that kerns with the letter after it. + let mut s = session(); + let text = "MMMd TMMM"; + let p = json!({"x": 40, "y": 100, "text": text, "size": 30, "font": "Source Serif 4", "style": "Regular"}); + let (before, r) = retyped(&mut s, p, &[json!({"tracking": -217})]); + assert_eq!(r["texts"], json!([text]), "{r}"); + assert_eq!(r["fonts"][0]["tracking"], json!(-217.0), "{r}"); + assert_same_places(&before, &text_of(&s, r["ids"][0].as_u64().unwrap())); +} + +#[test] +fn an_untracked_word_is_not_read_as_spaced_letters_in_tight_tracking() { + // Letters, each followed by a space, at tracking of minus half a space, sit where the word's + // letters do. + let mut s = session(); + let (_, r) = retyped(&mut s, json!({"x": 40, "y": 100, "text": "Third", "size": 24}), &[]); + assert_eq!(r["texts"], json!(["Third"]), "{r}"); + assert_eq!(r["fonts"][0]["tracking"], json!(0.0), "{r}"); +} + +#[test] +fn glyphs_barely_ahead_of_each_other_stay_one_line() { + let mut s = session(); + let (before, r) = retyped(&mut s, json!({"x": 40, "y": 100, "text": "MMMM", "size": 30}), &[json!({"tracking": -700})]); + assert_eq!(r["texts"], json!(["MMMM"]), "{r}"); + assert_eq!(r["fonts"][0]["tracking"], json!(-700.0), "{r}"); + assert_same_places(&before, &text_of(&s, r["ids"][0].as_u64().unwrap())); +} + +#[test] +fn tracking_near_a_whole_number_is_kept_as_measured_when_rounding_moves_glyphs() { + let mut s = session(); + let text = "i".repeat(400); + let (before, r) = retyped(&mut s, json!({"x": 10, "y": 100, "text": text, "size": 10}), &[json!({"tracking": 50.04})]); + assert_eq!(r["texts"], json!([text]), "{r}"); + assert!(near(r["fonts"][0]["tracking"].as_f64().unwrap(), 50.04, 1e-3), "{}", r["fonts"]); + assert_same_places(&before, &text_of(&s, r["ids"][0].as_u64().unwrap())); +} + +#[test] +fn overlapping_translucent_glyphs_are_not_tracked_into_one_object() { + let mut s = session(); + let id = s.execute("text.create", &json!({"x": 40, "y": 100, "text": "MMMM", "size": 30})).unwrap()["id"].as_u64().unwrap(); + s.execute("text.setRangeStyle", &json!({"id": id, "tracking": -300})).unwrap(); + s.execute("select.set", &json!({"ids": [id]})).unwrap(); + let g = s.execute("type.createOutlines", &json!({})).unwrap()["ids"][0].as_u64().unwrap(); + let kids = children_of(&s, g); + s.edit("test", |d, _| { + for k in &kids { + d.node_mut(NodeId(*k)).unwrap().opacity = 0.5; + } + Ok(()) + }) + .unwrap(); + s.execute("select.set", &json!({"ids": [g]})).unwrap(); + let r = s.execute("type.retype", &json!({})).unwrap(); + // Each glyph composites on its own over the one it overlaps, as the outlines did. + assert_eq!(r["texts"], json!(["M", "M", "M", "M"]), "{r}"); + assert!(r["fonts"].as_array().unwrap().iter().all(|f| f["tracking"] == json!(0.0)), "{r}"); +} diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 180493757f..12851cc7bb 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -164,6 +164,8 @@ pub struct Session { pub brush_libraries: cmd::brushlib::Libraries, /// The custom arrowheads of the arrowheads file (`stroke.arrowheads.*`); none without one. pub arrowheads: cmd::arrowheads::Arrowheads, + /// The custom bevels of the bevels file (`threeD.bevels.*`); none without one. + pub bevels: cmd::bevels::Bevels, /// The id each loaded library outside a request's read roots has been shown under, by its own id /// ([`cmd::swatchlib::concealed_library_ids`]), kept for the session. shown_library_ids: std::sync::Mutex>, diff --git a/crates/engine/src/session/documents.rs b/crates/engine/src/session/documents.rs index 13d178c2b2..7c80262dbb 100644 --- a/crates/engine/src/session/documents.rs +++ b/crates/engine/src/session/documents.rs @@ -90,6 +90,7 @@ impl Session { symbol_libraries: Default::default(), brush_libraries: Default::default(), arrowheads: Default::default(), + bevels: Default::default(), shown_library_ids: Default::default(), libraries: Default::default(), pdf_preset_dir: None, diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index b74d501308..cbebd7d489 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -15,6 +15,7 @@ mod assets; mod assets_3d; mod attributes; mod bboxrotate; +mod bevels; mod blendfidelity; mod blendopts; mod blendspine; diff --git a/crates/engine/src/tests/bevels.rs b/crates/engine/src/tests/bevels.rs new file mode 100644 index 0000000000..301ed61905 --- /dev/null +++ b/crates/engine/src/tests/bevels.rs @@ -0,0 +1,394 @@ +//! Custom bevels (`cmd/bevels.rs`): bevels read from the bevels file's symbols, listed, set on +//! Extrude & Bevel and Extrude & Bevel (Classic) by name, reloaded when the file is saved, and kept +//! with the documents that use them. + +use std::sync::Arc; + +use serde_json::{Value, json}; +use vectorcraft_color::{Color, Paint}; +use vectorcraft_doc::{Appearance, Document, Node, Symbol}; +use vectorcraft_geom::{Anchor, PathData, Point, SubPath}; +use vectorcraft_render::effects; + +use crate::cmd::bevels::{self, bevels_of}; +use crate::*; + +fn line(pts: &[(f64, f64)], closed: bool) -> Node { + let pts: Vec = pts.iter().map(|&(x, y)| Point::new(x, y)).collect(); + Node::path(NodeId(0), PathData::single(SubPath::polyline(&pts, closed)), Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 1.0)) +} + +fn add_symbol(d: &mut Document, name: &str, art: Node) { + let art = d.reid(&art); + d.symbols.push(Symbol { name: name.into(), art: Arc::new(art), dynamic: false }); +} + +/// A folder of its own for test `name`, emptied. +fn folder(name: &str) -> std::path::PathBuf { + let dir = std::env::temp_dir().join(format!("vectorcraft-bevels-{name}-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(&dir).unwrap(); + dir +} + +fn close(a: (f64, f64), b: (f64, f64)) -> bool { + (a.0 - b.0).abs() < 1e-9 && (a.1 - b.1).abs() < 1e-9 +} + +#[test] +fn each_open_path_symbol_is_a_bevel_from_its_first_anchor_to_its_last() { + let mut d = Document::new(100.0, 100.0); + add_symbol(&mut d, "Notch", line(&[(0.0, 0.0), (20.0, 60.0), (70.0, 40.0), (100.0, 100.0)], false)); + // The same path mirrored across the page and drawn from the other side gives the same points. + add_symbol(&mut d, "Mirrored", line(&[(300.0, 50.0), (280.0, 110.0), (230.0, 90.0), (200.0, 150.0)], false)); + // In a group of one, at another size. + let small = line(&[(0.0, 0.0), (2.0, 6.0), (7.0, 4.0), (10.0, 10.0)], false); + add_symbol(&mut d, "Grouped", Node::group(NodeId(0), vec![Arc::new(small)])); + // Points past the ends are held to them. + add_symbol(&mut d, "Overshoot", line(&[(0.0, 0.0), (-20.0, 50.0), (100.0, 120.0), (100.0, 100.0)], false)); + add_symbol(&mut d, "Closed", line(&[(0.0, 0.0), (10.0, 0.0), (10.0, 10.0)], true)); + let two = Node::group(NodeId(0), vec![Arc::new(line(&[(0.0, 0.0), (1.0, 1.0)], false)), Arc::new(line(&[(0.0, 0.0), (1.0, 1.0)], false))]); + add_symbol(&mut d, "Two paths", two); + add_symbol(&mut d, "Upright", line(&[(0.0, 0.0), (5.0, 50.0), (0.0, 100.0)], false)); + let dense: Vec<(f64, f64)> = (0..=bevels::MAX_ANCHORS).map(|i| (i as f64, i as f64)).collect(); + add_symbol(&mut d, "Dense", line(&dense, false)); + add_symbol(&mut d, "Notch", line(&[(0.0, 0.0), (1.0, 1.0)], false)); + let read = bevels_of(&d); + let names: Vec<&str> = read.bevels.iter().map(|b| b.name.as_str()).collect(); + assert_eq!(names, ["Notch", "Mirrored", "Grouped", "Overshoot"]); + let notch = [(0.0, 0.0), (0.2, 0.6), (0.7, 0.4), (1.0, 1.0)]; + for b in &read.bevels[..3] { + assert_eq!(b.points.len(), 4, "{}", b.name); + assert!(b.points.iter().zip(notch).all(|(&a, b)| close(a, b)), "{}: {:?}", b.name, b.points); + } + assert!(close(read.bevels[3].points[1], (0.0, 0.5)) && close(read.bevels[3].points[2], (1.0, 1.0)), "{:?}", read.bevels[3].points); + let skipped: Vec<(&str, &str)> = read.skipped.iter().map(|(n, r)| (n.as_str(), r.as_str())).collect(); + assert_eq!( + skipped, + [ + ("Closed", "its art is not one open path"), + ("Two paths", "its art is not one open path"), + ("Upright", "its ends are not apart both across and down"), + ("Dense", "its path has too many anchors for a bevel"), + ("Notch", "another symbol has this name"), + ] + ); +} + +/// A curve is cut into straight lines, and a path of many points keeps the ones that matter, at +/// most 64 in all, ends included. +#[test] +fn curves_and_long_paths_fit_in_the_points_a_bevel_holds() { + let mut d = Document::new(100.0, 100.0); + // A quarter circle from (0, 0) to (100, 100), bulging up and right. + let k = 0.5523 * 100.0; + let mut a = Anchor::corner(Point::new(0.0, 0.0)); + a.h_out = Point::new(k, 0.0); + let mut b = Anchor::corner(Point::new(100.0, 100.0)); + b.h_in = Point::new(100.0, 100.0 - k); + let arc = Node::path(NodeId(0), PathData::single(SubPath::new(vec![a, b], false)), Appearance::default()); + add_symbol(&mut d, "Arc", arc); + let wavy: Vec<(f64, f64)> = (0..=3000).map(|i| (i as f64 / 30.0, i as f64 / 30.0 + 5.0 * (i as f64 / 50.0).sin())).collect(); + add_symbol(&mut d, "Wavy", line(&wavy, false)); + let read = bevels_of(&d); + assert!(read.skipped.is_empty(), "{:?}", read.skipped); + for b in &read.bevels { + assert!((3..=effects::BevelProfile::MAX_POINTS).contains(&b.points.len()), "{}: {}", b.name, b.points.len()); + assert!(close(b.points[0], (0.0, 0.0)) && close(*b.points.last().unwrap(), (1.0, 1.0)), "{}", b.name); + assert!(effects::BevelProfile::new(&b.points).is_some(), "{}", b.name); + } + // The arc's points lie on the circle: across first, then down. + let arc = &read.bevels[0]; + assert!(arc.points.iter().all(|&(x, y)| (((x - 0.0).powi(2) + (y - 1.0).powi(2)).sqrt() - 1.0).abs() < 0.01), "{:?}", arc.points); +} + +/// A path of many tall curves, cut into more straight lines than a bevel's path may take, is +/// skipped as too detailed. +#[test] +fn a_path_cut_into_too_many_lines_is_skipped() { + let mut d = Document::new(100.0, 100.0); + let anchors: Vec = (0..4000) + .map(|i| { + let p = Point::new(f64::from(i), f64::from(i) / 4.0); + let swing = if i % 2 == 0 { 1000.0 } else { -1000.0 }; + let mut a = Anchor::corner(p); + a.h_in = Point::new(p.x - 0.5, p.y - swing); + a.h_out = Point::new(p.x + 0.5, p.y + swing); + a + }) + .collect(); + let wild = Node::path(NodeId(0), PathData::single(SubPath::new(anchors, false)), Appearance::default()); + add_symbol(&mut d, "Wild", wild); + let read = bevels_of(&d); + assert!(read.bevels.is_empty()); + assert_eq!(read.skipped, [("Wild".to_string(), "its path is too detailed for a bevel".to_string())]); +} + +/// Simplifying the paths of one file measures at most a fixed number of point-to-line distances: +/// a path that needs more than are left is skipped as too detailed, and a short one still reads. +#[test] +fn simplifying_the_bevels_of_a_file_has_a_work_limit() { + let mut d = Document::new(100.0, 100.0); + let wavy: Vec<(f64, f64)> = (0..=3000).map(|i| (i as f64 / 30.0, i as f64 / 30.0 + 5.0 * (i as f64 / 50.0).sin())).collect(); + add_symbol(&mut d, "Wavy", line(&wavy, false)); + add_symbol(&mut d, "Notch", line(&[(0.0, 0.0), (20.0, 60.0), (70.0, 40.0), (100.0, 100.0)], false)); + let read = bevels::bevels_within(&d, 5_000); + let names: Vec<&str> = read.bevels.iter().map(|b| b.name.as_str()).collect(); + assert_eq!(names, ["Notch"]); + assert_eq!(read.skipped, [("Wavy".to_string(), "its path is too detailed for a bevel".to_string())]); + assert_eq!(bevels_of(&d).bevels.len(), 2); +} + +fn rect(s: &mut Session, x: u32) -> NodeId { + NodeId(s.execute("shape.rectangle", &json!({"x": x, "y": 100, "width": 60, "height": 60})).unwrap()["id"].as_u64().unwrap()) +} + +fn params(s: &Session, id: NodeId) -> Value { + s.doc().unwrap().doc.node(id).unwrap().appearance.effects[0].params.clone() +} + +#[test] +fn the_bevels_file_is_made_opened_and_reloaded_when_saved() { + let dir = folder("edit"); + let file = dir.join(bevels::FILE_NAME).to_string_lossy().to_string(); + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 400, "height": 400})).unwrap(); + let id = rect(&mut s, 20); + s.attach_bevels_file(file.clone()); + let list = s.execute("threeD.bevels.list", &json!({})).unwrap(); + assert_eq!((list["bevels"].as_array().unwrap().len(), list["file"].as_str()), (0, Some(file.as_str()))); + let apply = json!({"effect": effects::EXTRUDE, "ids": [id.0], "item": null, "params": {"bevel": {"custom": "Example Bevel"}}}); + assert!(s.execute("effect.apply", &apply).unwrap_err().to_string().contains("no custom bevel Example Bevel")); + let r = s.execute("threeD.bevels.edit", &json!({})).unwrap(); + assert_eq!(r["created"], true); + assert_eq!(s.doc().unwrap().path.as_deref(), Some(file.as_str()), "the file is the active document"); + let list = s.execute("threeD.bevels.list", &json!({})).unwrap(); + assert_eq!(list["bevels"][0]["name"], "Example Bevel"); + assert_eq!(list["bevels"][0]["points"].as_array().unwrap().len(), 4); + // A second bevel drawn in the file is listed once the file is saved. + let st = s.doc_mut().unwrap(); + add_symbol(Arc::make_mut(&mut st.doc), "Steps", line(&[(0.0, 0.0), (0.0, 50.0), (50.0, 50.0), (50.0, 100.0), (100.0, 100.0)], false)); + assert_eq!(s.execute("threeD.bevels.list", &json!({})).unwrap()["bevels"].as_array().unwrap().len(), 1); + s.execute("document.save", &json!({})).unwrap(); + let list = s.execute("threeD.bevels.list", &json!({})).unwrap(); + let names: Vec<&str> = list["bevels"].as_array().unwrap().iter().filter_map(|b| b["name"].as_str()).collect(); + assert_eq!(names, ["Example Bevel", "Steps"]); + assert_eq!(s.execute("threeD.bevels.reload", &json!({})).unwrap()["count"], 2); + // Editing again brings the open file to the front, without making it anew. + s.execute("document.activate", &json!({"index": 0})).unwrap(); + assert_eq!(s.execute("threeD.bevels.edit", &json!({})).unwrap()["created"], false); + assert_eq!(s.documents().len(), 2); + // The rectangle takes the bevel with a copy of its points, in both Extrude & Bevels. + s.execute("document.activate", &json!({"index": 0})).unwrap(); + s.execute("effect.apply", &json!({"effect": effects::EXTRUDE, "ids": [id.0], "item": null, "params": {"bevel": {"custom": "Steps"}}})).unwrap(); + let p = params(&s, id); + assert_eq!((p["bevel"].as_str(), p[effects::BEVEL_NAME].as_str()), (Some("custom"), Some("Steps"))); + assert_eq!(p[effects::BEVEL_PROFILE], json!([[0.0, 0.0], [0.0, 0.5], [0.5, 0.5], [0.5, 1.0], [1.0, 1.0]])); + let set = |bevel: Value| json!({"ids": [id.0], "index": 0, "item": null, "params": {"bevel": bevel}}); + s.execute("effect.setParams", &set(json!({"custom": "Example Bevel"}))).unwrap(); + assert_eq!(params(&s, id)[effects::BEVEL_NAME], "Example Bevel"); + for bad in [json!({"custom": 3}), json!({"custom": "Nope"}), json!({"name": "Steps"})] { + let undo = s.doc().unwrap().history.undo.len(); + assert!(s.execute("effect.setParams", &set(bad.clone())).is_err(), "{bad}"); + assert_eq!(s.doc().unwrap().history.undo.len(), undo, "{bad}: no undo step"); + } + let classic = rect(&mut s, 200); + s.execute( + "effect.apply", + &json!({"effect": effects::CLASSIC_EXTRUDE, "ids": [classic.0], "item": null, "params": {"bevel": {"custom": "Steps"}}}), + ) + .unwrap(); + assert_eq!(params(&s, classic)[effects::BEVEL_NAME], "Steps"); + // A built-in shape again draws that shape. + s.execute("effect.setParams", &set(json!("rounded"))).unwrap(); + assert!(matches!(effects::extrude_options(¶ms(&s, id)).bevel.map(|b| b.shape.id()), Some("rounded"))); + let _ = std::fs::remove_dir_all(&dir); +} + +/// `effect.apply` and `effect.setParams` given a custom bevel by name record its points as +/// `savedBevel`, so a replay draws that bevel after the bevels file no longer has it. +#[test] +fn a_replay_draws_the_custom_bevel_the_command_recorded() { + let dir = folder("replay"); + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 400, "height": 400})).unwrap(); + let id = rect(&mut s, 20); + s.attach_bevels_file(dir.join(bevels::FILE_NAME).to_string_lossy().to_string()); + s.execute("threeD.bevels.edit", &json!({})).unwrap(); + s.execute("document.activate", &json!({"index": 0})).unwrap(); + let apply = json!({"effect": effects::EXTRUDE, "ids": [id.0], "item": null, "params": {"bevel": {"custom": "Example Bevel"}}}); + s.execute("effect.apply", &apply).unwrap(); + let applied = params(&s, id); + let (cmd, recorded) = s.journal.last().unwrap().clone(); + assert_eq!(cmd, "effect.apply"); + assert_eq!(recorded[bevels::SAVED_BEVEL], applied[effects::BEVEL_PROFILE]); + let set = json!({"ids": [id.0], "index": 0, "item": null, "params": {"bevel": {"custom": "Example Bevel"}, "bevelWidth": 9}}); + s.execute("effect.setParams", &set).unwrap(); + let edited = params(&s, id); + let (_, set_recorded) = s.journal.last().unwrap().clone(); + assert_eq!(set_recorded[bevels::SAVED_BEVEL], applied[effects::BEVEL_PROFILE]); + // The bevels file no longer has the bevel: by name it is refused, and the replays draw it. + s.attach_bevels_file(dir.join("Other.vectorcraft").to_string_lossy().to_string()); + assert!(s.execute("effect.apply", &apply).is_err()); + s.execute("edit.undo", &json!({})).unwrap(); + s.execute("edit.undo", &json!({})).unwrap(); + assert!(s.doc().unwrap().doc.node(id).unwrap().appearance.effects.is_empty()); + s.replay("effect.apply", &recorded).unwrap(); + assert_eq!(params(&s, id), applied); + s.replay("effect.setParams", &set_recorded).unwrap(); + assert_eq!(params(&s, id), edited); + // Points given with the name are used in place of the file's. + let notch = json!([[0.0, 0.0], [0.2, 0.6], [0.7, 0.4], [1.0, 1.0]]); + let mut given = set.clone(); + given["savedBevel"] = notch.clone(); + s.execute("effect.setParams", &given).unwrap(); + assert_eq!((¶ms(&s, id)[effects::BEVEL_PROFILE], ¶ms(&s, id)[effects::BEVEL_NAME]), (¬ch, &json!("Example Bevel"))); + let _ = std::fs::remove_dir_all(&dir); +} + +#[test] +fn a_document_keeps_its_custom_bevels_without_the_bevels_file() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 300, "height": 300})).unwrap(); + let id = rect(&mut s, 100); + let notch = json!([[0, 0], [0.2, 0.6], [0.7, 0.4], [1, 1]]); + let custom = json!({"bevel": "custom", "bevelName": "Notch", "bevelProfile": notch, "bevelWidth": 12, "bevelHeight": 12}); + s.execute("effect.apply", &json!({"effect": effects::EXTRUDE, "ids": [id.0], "item": null, "params": custom})).unwrap(); + let ink = |s: &Session| { + vectorcraft_render::Renderer::new().render(&s.doc().unwrap().doc, 300, 300, vectorcraft_geom::Affine::IDENTITY, &Default::default()) + }; + let with_bevel = ink(&s); + // Saved and opened in a session that has no bevels file: the bevel is drawn the same. + let saved = s.execute("document.export", &json!({"format": "vectorcraft"})).unwrap()["dataBase64"].clone(); + let mut o = Session::new(); + o.execute("document.open", &json!({"name": "a.vectorcraft", "dataBase64": saved})).unwrap(); + assert_eq!(params(&o, id)[effects::BEVEL_PROFILE], params(&s, id)[effects::BEVEL_PROFILE]); + assert_eq!(ink(&o).pixels, with_bevel.pixels); + // The classic chamfer draws differently. + let set = json!({"ids": [id.0], "index": 0, "item": null, "params": {"bevel": "classic"}}); + o.execute("effect.setParams", &set).unwrap(); + assert_ne!(ink(&o).pixels, with_bevel.pixels); + o.execute("edit.undo", &json!({})).unwrap(); + assert_eq!(ink(&o).pixels, with_bevel.pixels); + // Points that do not make a bevel are refused before the document changes. + let bad = json!({"ids": [id.0], "index": 0, "item": null, "params": {"bevelProfile": [[0, 0], [0.5, 2], [1, 1]]}}); + assert!(o.execute("effect.setParams", &bad).unwrap_err().to_string().contains("bevelProfile must be")); +} + +#[test] +fn both_extrudes_take_a_custom_bevels_points_and_refuse_a_name_that_is_not_a_string() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 300, "height": 300})).unwrap(); + let notch = json!([[0, 0], [0.2, 0.6], [0.7, 0.4], [1, 1]]); + for effect in [effects::EXTRUDE, effects::CLASSIC_EXTRUDE] { + let id = rect(&mut s, 100); + let apply = |name: Value| json!({"effect": effect, "ids": [id.0], "item": null, "params": {"bevel": "custom", "bevelName": name, "bevelProfile": notch}}); + let before = s.doc().unwrap().doc.clone(); + let e = s.execute("effect.apply", &apply(json!(3))).unwrap_err().to_string(); + assert!(e.contains("bevelName must be a string"), "{effect}: {e}"); + assert_eq!(s.doc().unwrap().doc, before, "{effect}"); + s.execute("effect.apply", &apply(json!("Notch"))).unwrap(); + assert_eq!((¶ms(&s, id)[effects::BEVEL_PROFILE], ¶ms(&s, id)[effects::BEVEL_NAME]), (¬ch, &json!("Notch")), "{effect}"); + } +} + +#[test] +fn without_a_bevels_file_editing_is_refused_and_none_are_listed() { + let mut s = Session::new(); + s.execute("file.new", &json!({})).unwrap(); + let list = s.execute("threeD.bevels.list", &json!({})).unwrap(); + assert_eq!((list["bevels"].as_array().unwrap().len(), &list["file"]), (0, &Value::Null)); + assert!(s.execute("threeD.bevels.edit", &json!({})).is_err()); + assert!(s.execute("threeD.bevels.reload", &json!({})).is_err()); + // A file that is not a document lists no bevels and says why. + let dir = folder("unreadable"); + let file = dir.join(bevels::FILE_NAME); + std::fs::write(&file, b"not a document").unwrap(); + s.attach_bevels_file(file.to_string_lossy().to_string()); + let list = s.execute("threeD.bevels.list", &json!({})).unwrap(); + assert!(list["error"].is_string(), "{list}"); + assert!(s.execute("threeD.bevels.reload", &json!({})).is_err()); + let _ = std::fs::remove_dir_all(&dir); +} + +/// Automation roots that grant reading `read` alone. +fn read_roots(read: &[&std::path::Path]) -> Arc { + crate::file_access::AutomationRoots::new(read, &[]).unwrap().unwrap() +} + +#[test] +fn an_agent_outside_the_bevels_files_folder_sees_its_file_name_alone_and_cannot_reload_it() { + let dir = folder("roots-list"); + let (prefs, other) = (dir.join("prefs"), dir.join("other")); + std::fs::create_dir_all(&prefs).unwrap(); + std::fs::create_dir_all(&other).unwrap(); + let file = prefs.join(bevels::FILE_NAME); + std::fs::write(&file, b"not a drawing").unwrap(); + let (file, prefs_text) = (file.to_string_lossy().to_string(), prefs.to_string_lossy().to_string()); + let mut s = Session::new(); + s.attach_bevels_file(file.clone()); + let (outside, inside) = (read_roots(&[&other]), read_roots(&[&prefs])); + let list = crate::file_access::confine(Some(&outside), || s.execute("threeD.bevels.list", &json!({}))).unwrap(); + assert_eq!(list["file"], Value::Null, "{list}"); + let error = list["error"].as_str().unwrap(); + assert!(error.starts_with(bevels::FILE_NAME) && !error.contains(&prefs_text), "{error}"); + let list = crate::file_access::confine(Some(&inside), || s.execute("threeD.bevels.list", &json!({}))).unwrap(); + assert_eq!(list["file"].as_str(), Some(file.as_str())); + assert!(list["error"].as_str().unwrap().starts_with(&file), "{list}"); + // A good file now: an agent outside the folder cannot have it read. + std::fs::write(&file, vectorcraft_format::save_file(&bevels::starter())).unwrap(); + let e = crate::file_access::confine(Some(&outside), || s.execute("threeD.bevels.reload", &json!({}))).unwrap_err().to_string(); + assert!(e.contains("outside the read root") && e.ends_with(bevels::FILE_NAME) && !e.contains(&prefs_text), "{e}"); + let list = s.execute("threeD.bevels.list", &json!({})).unwrap(); + assert!(list["bevels"].as_array().unwrap().is_empty() && list["error"].is_string(), "not read again: {list}"); + let r = crate::file_access::confine(Some(&inside), || s.execute("threeD.bevels.reload", &json!({}))).unwrap(); + assert_eq!(r["count"], 1); + let _ = std::fs::remove_dir_all(&dir); +} + +#[test] +fn an_agent_edits_the_bevels_file_only_inside_its_read_roots() { + let dir = folder("roots-edit"); + let (prefs, other) = (dir.join("prefs"), dir.join("other")); + std::fs::create_dir_all(&other).unwrap(); + let file = prefs.join(bevels::FILE_NAME).to_string_lossy().to_string(); + let prefs_text = prefs.to_string_lossy().to_string(); + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 400, "height": 400})).unwrap(); + s.attach_bevels_file(file.clone()); + let first_doc = s.doc().unwrap().uid; + let outside = read_roots(&[&other]); + let edit = |s: &mut Session, roots: &Arc| { + crate::file_access::confine(Some(roots), || s.execute("threeD.bevels.edit", &json!({}))) + }; + // Refused before the folder or the file is made, or anything is opened. + let e = edit(&mut s, &outside).unwrap_err().to_string(); + assert!(e.ends_with(bevels::FILE_NAME) && !e.contains(&prefs_text), "{e}"); + assert!(!prefs.exists(), "no folder made"); + assert_eq!((s.documents().len(), s.doc().unwrap().uid), (1, first_doc)); + // From the 3D and Materials panel (no roots), the file is made and opened. + assert_eq!(s.execute("threeD.bevels.edit", &json!({})).unwrap()["created"], true); + assert_eq!(s.documents().len(), 2); + // Open already: still not brought to the front for an agent outside the folder. + s.execute("document.activate", &json!({"index": 0})).unwrap(); + assert!(edit(&mut s, &outside).is_err()); + assert_eq!((s.documents().len(), s.doc().unwrap().uid), (2, first_doc)); + // Inside the read roots: opened under them, with its path. + let inside = read_roots(&[&prefs]); + let mut agent = Session::new(); + agent.attach_bevels_file(file.clone()); + let r = edit(&mut agent, &inside).unwrap(); + assert_eq!((r["path"].as_str(), &r["created"]), (Some(file.as_str()), &json!(false))); + let st = agent.doc().unwrap(); + assert_eq!(st.path.as_deref(), Some(file.as_str())); + assert!(st.opened_by.as_ref().is_some_and(|r| Arc::ptr_eq(r, &inside)), "opened under the agent's roots"); + // A missing file inside the roots is still made first. + let fresh = dir.join("fresh").join(bevels::FILE_NAME).to_string_lossy().to_string(); + let mut agent = Session::new(); + agent.attach_bevels_file(fresh.clone()); + let r = edit(&mut agent, &read_roots(&[&dir])).unwrap(); + assert_eq!(r["created"], true); + assert!(std::path::Path::new(&fresh).is_file()); + assert_eq!(agent.doc().unwrap().path.as_deref(), Some(fresh.as_str())); + let _ = std::fs::remove_dir_all(&dir); +} diff --git a/crates/engine/src/tests/inline.rs b/crates/engine/src/tests/inline.rs index 1d68881b4d..37b72efa77 100644 --- a/crates/engine/src/tests/inline.rs +++ b/crates/engine/src/tests/inline.rs @@ -579,6 +579,9 @@ fn same_as_full_pass(full: &mut Session, fast: &mut Session, step: &dyn Fn(&mut /// natural size or anything else a symbol is measured with checks them all. #[test] fn refreshing_only_changed_trees_matches_the_full_pass() { + // Both sessions lay out type, and the test rescans the fonts: a font another test adds between + // the full pass and the fast one would change how the type resolves in only one of them. + let _fonts = crate::adding_fonts(); let setup = |s: &mut Session| { circle_symbol(s, "Tap", 10.0); circle_symbol(s, "Dot", 6.0); diff --git a/crates/engine/src/tests/livecorners.rs b/crates/engine/src/tests/livecorners.rs index 1ea6e5091f..288f0236d1 100644 --- a/crates/engine/src/tests/livecorners.rs +++ b/crates/engine/src/tests/livecorners.rs @@ -59,6 +59,107 @@ fn a_whole_rectangle_rounds_all_corners_and_given_corners_alone() { assert_eq!(corners(&s, id).1[3], CornerKind::Chamfer); } +/// The Corner menus of Rectangle Properties: a kind for all four corners or one, set on corners +/// with no radius too and leaving the radii as they are, in one undo step; the kind the corners +/// already have adds no step. +#[test] +fn rectangle_kind_menu_targets_all_or_one_corner_and_skips_noop_undo() { + let (mut s, id) = session(); + run(&mut s, json!({"corners": [1], "radius": 12})); + let steps = |s: &Session| s.doc().unwrap().history.undo.len(); + let undo = steps(&s); + run(&mut s, json!({"corners": [0, 1, 2, 3], "kind": "invertedRound"})); + assert_eq!(corners(&s, id).0, [0.0, 12.0, 0.0, 0.0]); + assert_eq!(corners(&s, id).1, [CornerKind::InvertedRound; 4]); + assert_eq!(steps(&s), undo + 1); + run(&mut s, json!({"corners": [0, 1, 2, 3], "kind": "invertedRound"})); + run(&mut s, json!({"corners": [2], "kind": "invertedRound"})); + assert_eq!(steps(&s), undo + 1, "no step when nothing changes"); + run(&mut s, json!({"corners": [2], "kind": "chamfer"})); + assert_eq!(corners(&s, id).1, [CornerKind::InvertedRound, CornerKind::InvertedRound, CornerKind::Chamfer, CornerKind::InvertedRound]); + assert_eq!(corners(&s, id).0, [0.0, 12.0, 0.0, 0.0]); + assert_eq!(steps(&s), undo + 2); +} + +/// A kind the corners already have leaves a rectangle saved stretched by an older version as it +/// is, alone or beside a rectangle the kind changes: its scale stays in its transform. +#[test] +fn a_kind_the_corners_have_leaves_a_stretched_rectangle() { + let (mut s, id) = session(); + let other = NodeId(s.execute("shape.rectangle", &json!({"x": 200, "y": 10, "width": 40, "height": 40})).unwrap()["id"].as_u64().unwrap()); + let stretched = LiveShape::Rectangle { + w: 50.0, + h: 60.0, + radii: [10.0; 4], + kinds: [CornerKind::Chamfer; 4], + radii_relative: false, + xf: Affine::translate((10.0, 10.0)) * Affine::scale_non_uniform(2.0, 1.0), + }; + { + let d = std::sync::Arc::make_mut(&mut s.doc_mut().unwrap().doc); + let NodeKind::Path { path, live: Some(live), .. } = &mut d.node_mut(id).unwrap().kind else { panic!("not live") }; + **live = stretched.clone(); + *path = live.to_path(); + } + let live = |s: &Session| node_path(s, id).1; + let steps = |s: &Session| s.doc().unwrap().history.undo.len(); + let undo = steps(&s); + run(&mut s, json!({"ids": [id.0], "kind": "chamfer"})); + assert_eq!(live(&s), Some(stretched.clone())); + assert_eq!(steps(&s), undo, "no step when nothing changes"); + run(&mut s, json!({"ids": [id.0, other.0], "kind": "chamfer"})); + assert_eq!(live(&s), Some(stretched)); + assert_eq!(corners(&s, other).1, [CornerKind::Chamfer; 4]); + assert_eq!(steps(&s), undo + 1); +} + +/// A radius is stored on a corner that stores a larger radius drawn at the new value, alone or +/// beside another rectangle; the radius every target already stores adds no undo step. +#[test] +fn a_radius_reaches_a_rectangle_that_already_draws_it() { + let (mut s, id) = session(); + let other = NodeId(s.execute("shape.rectangle", &json!({"x": 200, "y": 10, "width": 100, "height": 60})).unwrap()["id"].as_u64().unwrap()); + // 80 pt on every corner draws at 30 pt, half the 60 pt side. + run(&mut s, json!({"ids": [id.0], "radius": 80})); + assert_eq!(corners(&s, id).0, [80.0; 4]); + let (path, live) = node_path(&s, id); + let drawn = LiveCorners::new(&path, live.as_ref()).unwrap().drawn_radius(0); + assert!((drawn - 30.0).abs() < 1e-9, "draws at {drawn}"); + let steps = |s: &Session| s.doc().unwrap().history.undo.len(); + let undo = steps(&s); + run(&mut s, json!({"ids": [id.0], "corners": [1], "radius": 30})); + assert_eq!(corners(&s, id).0, [80.0, 30.0, 80.0, 80.0]); + assert_eq!(steps(&s), undo + 1); + run(&mut s, json!({"ids": [id.0, other.0], "corners": [0], "radius": 30})); + assert_eq!(corners(&s, id).0[0], 30.0); + assert_eq!(corners(&s, other).0[0], 30.0); + // The radius both already store adds no step. + run(&mut s, json!({"ids": [id.0, other.0], "corners": [0], "radius": 30})); + assert_eq!(steps(&s), undo + 2); +} + +/// `rectanglesOnly` sets the live rectangles among the selection and leaves a polygon as it is; an +/// action that records it holds no ids, so playing it sets the rectangles selected then. +#[test] +fn rectangles_only_sets_the_selected_rectangles_when_an_action_plays() { + let (mut s, id) = session(); + let polygon = NodeId(s.execute("shape.polygon", &json!({"cx": 300, "cy": 300, "radius": 40, "sides": 6})).unwrap()["id"].as_u64().unwrap()); + s.execute("select.set", &json!({"ids": [id.0, polygon.0]})).unwrap(); + let start = s.journal.len(); + run(&mut s, json!({"rectanglesOnly": true, "corners": [0], "kind": "chamfer"})); + assert_eq!(corners(&s, id).1[0], CornerKind::Chamfer); + let NodeKind::Path { live: Some(l), .. } = &s.doc().unwrap().doc.node(polygon).unwrap().kind else { panic!("not live") }; + let LiveShape::Polygon { kinds, .. } = &**l else { panic!("not a polygon") }; + assert!(kinds.iter().all(|k| *k == CornerKind::Round), "the polygon keeps its corners: {kinds:?}"); + let action = s.journal_for_action(start); + assert_eq!(action.len(), 1); + assert_eq!(action[0].1.get("ids"), None); + let other = NodeId(s.execute("shape.rectangle", &json!({"x": 200, "y": 10, "width": 40, "height": 40})).unwrap()["id"].as_u64().unwrap()); + s.execute("select.set", &json!({"ids": [other.0, polygon.0]})).unwrap(); + s.replay(&action[0].0, &action[0].1).unwrap(); + assert_eq!(corners(&s, other).1[0], CornerKind::Chamfer); +} + /// #938: `items` rounds several objects in one step, each its own corners (or all of them). #[test] fn items_round_several_objects_each_its_own_corners() { diff --git a/crates/engine/src/tests/params.rs b/crates/engine/src/tests/params.rs index ca72e66eec..38958ee4c8 100644 --- a/crates/engine/src/tests/params.rs +++ b/crates/engine/src/tests/params.rs @@ -707,12 +707,13 @@ fn an_effect_parameter_without_a_default_is_held_to_its_type() { use crate::cmd::params::undefaulted_type; use vectorcraft_render::effects::effect_catalog; // Read by checks of their own: a stored texture or a texture to load, an SVG filter and its axes, a Warp's - // map and the style of Crop Marks. + // map, the style of Crop Marks and a custom bevel's name and points. let own_check = |effect: &str, key: &str| match key { "textureImage" | "name" | "xml" => true, "axes" => effect == "svg.filter", "version" => effect.starts_with("warp."), "style" => effect == "cropMarks", + "bevelName" | "bevelProfile" => matches!(effect, "threeD.extrude" | "threeD.classicExtrude"), _ => false, }; let mut unlisted = vec![]; diff --git a/crates/engine/tests/scissors_snap.rs b/crates/engine/tests/scissors_snap.rs index f44b0e6f66..6d12bd6457 100644 --- a/crates/engine/tests/scissors_snap.rs +++ b/crates/engine/tests/scissors_snap.rs @@ -154,3 +154,184 @@ fn scissors_cuts_after_a_command_settles_a_deferred_move() { assert_eq!(session.doc().unwrap().history.undo.len(), undo_before + 1); } } + +/// Real Session composition: the hovered feedback must be the endpoint the actual split creates, +/// while the selected crossing owner, history and Undo/Redo contracts remain intact. +#[test] +fn review_8655_scissors_session_feedback_is_the_committed_cut_endpoint() { + let mut observed = Vec::new(); + for pixel_preview in [true, false] { + let mut session = Session::new(); + session.execute("file.new", &json!({"width":800,"height":600})).unwrap(); + let rectangle = + NodeId(session.execute("shape.rectangle", &json!({"x":100,"y":100,"width":100,"height":100})).unwrap()["id"].as_u64().unwrap()); + let crossing = NodeId(session.execute("shape.line", &json!({"x1":145,"y1":90,"x2":165,"y2":130})).unwrap()["id"].as_u64().unwrap()); + session.execute("select.set", &json!({"ids":[rectangle.0]})).unwrap(); + let view = ViewInfo { pixel_preview, ..ViewInfo::default() }; + session.select_tool("scissors", view).unwrap(); + let original = path(&session, rectangle); + let other = path(&session, crossing); + let selection_before = session.doc().unwrap().selection.clone(); + let undo_before = session.doc().unwrap().history.undo.len(); + let raw = Point::new(152.0, 101.5); + session.pointer(&PointerEvent::new(PointerKind::Move, raw.x, raw.y), view).unwrap(); + let overlays = session.overlays(view); + let markers: Vec<_> = overlays + .iter() + .filter_map(|o| match o { + Overlay::Anchor { p, color, filled: false, size } if *color == vectorcraft_tools::draw2::FEEDBACK && *size == 7.0 => Some(*p), + _ => None, + }) + .collect(); + let intersection = overlays.iter().any(|o| matches!(o, Overlay::Label { text, .. } if text == "intersect")); + assert_eq!(intersection, !pixel_preview, "CONTROL: native view boundary retains Smart Guides policy"); + for kind in [PointerKind::Down, PointerKind::Up] { + session.pointer(&PointerEvent::new(kind, raw.x, raw.y), view).unwrap(); + } + let opened = path(&session, rectangle); + assert!(!opened.is_closed()); + let anchors = &opened.subpaths[0].anchors; + assert_eq!(anchors.len(), 6); + let cut = anchors[0].p; + assert_eq!(anchors.last().unwrap().p, cut); + let expected = Point::new(if pixel_preview { 152.0 } else { 150.0 }, 100.0); + assert!(cut.distance(expected) < 1e-6, "CONTROL: actual cut geometry respects view snapping"); + assert!(cut.distance(raw) > 1.0, "CONTROL: feedback is projected to the path, not raw input"); + let selection_after = session.doc().unwrap().selection.clone(); + assert_eq!(selection_after.objects, [rectangle]); + assert_eq!(selection_after.partial(rectangle).unwrap().iter().copied().collect::>(), [(0, 0)]); + assert!(selection_after.segments.is_empty()); + assert_eq!(path(&session, crossing), other); + assert_eq!(session.doc().unwrap().history.undo.len(), undo_before + 1); + assert!( + session.overlays(view).iter().all(|o| !matches!(o, Overlay::Anchor { color, filled:false, size, .. } + if *color == vectorcraft_tools::draw2::FEEDBACK && *size == 7.0)), + "CONTROL: Up clears cut feedback" + ); + session.execute("edit.undo", &json!({})).unwrap(); + assert_eq!(path(&session, rectangle), original); + assert_eq!(path(&session, crossing), other); + assert_eq!(session.doc().unwrap().selection, selection_before); + assert_eq!(session.doc().unwrap().history.undo.len(), undo_before); + session.execute("edit.redo", &json!({})).unwrap(); + assert_eq!(path(&session, rectangle), opened); + assert_eq!(path(&session, crossing), other); + assert_eq!(session.doc().unwrap().selection, selection_after); + assert_eq!(session.doc().unwrap().history.undo.len(), undo_before + 1); + observed.push((pixel_preview, markers, cut)); + } + let endpoint_controls = review_8655_session_endpoint_controls(); + for (pixel_preview, markers, cut) in observed { + assert_eq!(markers.len(), 1, "REGRESSION: Pixel Preview{pixel_preview} needs one hollow7px FEEDBACK anchor"); + assert!(markers[0].distance(cut) < 1e-6, "REGRESSION: preview{markers:?} must mark the actual committed endpoint{cut:?}"); + } + for (markers, cut) in endpoint_controls { + assert_eq!(markers.len(), 1, "a successful interior/canonicalized cut has one marker"); + assert!(markers[0].distance(cut) < 1e-6, "marker{markers:?} must equal the actual Engine cut{cut:?}"); + } +} + +fn review_8655_session_markers(overlays: &[Overlay]) -> Vec { + overlays + .iter() + .filter_map(|o| match o { + Overlay::Anchor { p, color, filled: false, size } if *color == vectorcraft_tools::draw2::FEEDBACK && *size == 7.0 => Some(*p), + _ => None, + }) + .collect() +} + +fn review_8655_session_endpoint_controls() -> Vec<(Vec, Point)> { + let mut session = Session::new(); + session.execute("file.new", &json!({"width":800,"height":600})).unwrap(); + let line = NodeId(session.execute("shape.line", &json!({"x1":100,"y1":300,"x2":200,"y2":300})).unwrap()["id"].as_u64().unwrap()); + session.execute("select.set", &json!({"ids":[line.0]})).unwrap(); + let view = ViewInfo { smart_guides: false, snap_to_point: false, snap_to_grid: false, snap_to_pixel: false, ..ViewInfo::default() }; + session.select_tool("scissors", view).unwrap(); + let original = path(&session, line); + let document = json!(session.doc().unwrap().doc.as_ref()); + let selection = session.doc().unwrap().selection.clone(); + let undo = session.doc().unwrap().history.undo.len(); + let redo = session.doc().unwrap().history.redo.len(); + assert!(!original.is_closed()); + assert_eq!(original.subpaths[0].anchors.len(), 2, "CONTROL: ordinary minimal drawable open line"); + for endpoint in [Point::new(100.0, 300.0), Point::new(200.0, 300.0)] { + session.pointer(&PointerEvent::new(PointerKind::Move, endpoint.x, endpoint.y), view).unwrap(); + let endpoint_markers = review_8655_session_markers(&session.overlays(view)); + let error = session.pointer(&PointerEvent::new(PointerKind::Down, endpoint.x, endpoint.y), view).unwrap_err(); + assert!(error.to_string().contains("cannot split an open path at its end point"), "CONTROL: preserve baseline endpoint error: {error}"); + assert_eq!(json!(session.doc().unwrap().doc.as_ref()), document, "a failed endpoint cut changes no document data"); + assert_eq!(session.doc().unwrap().selection, selection); + assert_eq!(session.doc().unwrap().history.undo.len(), undo); + assert_eq!(session.doc().unwrap().history.redo.len(), redo); + assert!(endpoint_markers.is_empty(), "an endpoint that Engine rejects has no successful-cut feedback"); + session.pointer(&PointerEvent::new(PointerKind::Up, endpoint.x, endpoint.y), view).unwrap(); + } + let interior = Point::new(150.0, 300.0); + session.pointer(&PointerEvent::new(PointerKind::Move, interior.x, interior.y), view).unwrap(); + let interior_markers = review_8655_session_markers(&session.overlays(view)); + for kind in [PointerKind::Down, PointerKind::Up] { + session.pointer(&PointerEvent::new(kind, interior.x, interior.y), view).unwrap(); + } + let right_id = session.doc().unwrap().selection.objects[0]; + assert_ne!(right_id, line); + let right = path(&session, right_id); + let left = path(&session, line); + let actual_interior = right.subpaths[0].anchors[0].p; + assert!(actual_interior.distance(interior) < 1e-6); + assert_eq!(left.subpaths[0].anchors.last().unwrap().p, actual_interior); + assert_eq!(session.doc().unwrap().history.undo.len(), undo + 1); + session.execute("edit.undo", &json!({})).unwrap(); + assert_eq!(path(&session, line), original); + assert!(session.doc().unwrap().doc.node(right_id).is_none()); + assert_eq!(session.doc().unwrap().selection, selection); + + let (canonical_markers, canonical) = review_8655_session_canonical_control(session, view); + vec![(interior_markers, actual_interior), (canonical_markers, canonical)] +} + +fn review_8655_session_canonical_control(mut session: Session, view: ViewInfo) -> (Vec, Point) { + let closed = NodeId( + session + .execute( + "path.create", + &json!({"d":"M99.99995 100 C133.33328333333333 100 166.66661666666666 100 199.99995 100 L199.99995 200 L99.99995 200 Z"}), + ) + .unwrap()["id"] + .as_u64() + .unwrap(), + ); + let mut prefs = session.prefs.clone(); + prefs.gridline_every = 10.0; + prefs.grid_subdivisions = 1; + session.apply_prefs(prefs); + assert_eq!(session.doc().unwrap().doc.grid.spacing, 10.0); + assert_eq!(session.doc().unwrap().doc.grid.subdivisions, 1); + session.execute("select.set", &json!({"ids":[closed.0]})).unwrap(); + let grid = ViewInfo { snap_to_grid: true, ..view }; + let original_closed = path(&session, closed); + assert!(original_closed.is_closed()); + let canonical = original_closed.subpaths[0].anchors[0].p; + let (_, segment, t, projected, _) = original_closed.nearest(Point::new(100.0, 100.0)).unwrap(); + assert_eq!(segment, 0); + assert!(t > 0.0 && t <= 1e-6, "CONTROL: stored native cubic reaches actual canonicalization threshold: {t}"); + assert!(projected.distance(canonical) > 1e-5, "CONTROL: projected point differs from canonical stored anchor"); + let raw = Point::new(100.1, 100.2); + session.pointer(&PointerEvent::new(PointerKind::Move, raw.x, raw.y), grid).unwrap(); + let canonical_markers = review_8655_session_markers(&session.overlays(grid)); + let before = session.doc().unwrap().history.undo.len(); + for kind in [PointerKind::Down, PointerKind::Up] { + session.pointer(&PointerEvent::new(kind, raw.x, raw.y), grid).unwrap(); + } + let opened = path(&session, closed); + assert!(!opened.is_closed()); + let anchors = &opened.subpaths[0].anchors; + assert_eq!(anchors.first().unwrap().p, canonical, "Engine commits the original anchor rather than curve.eval(t)"); + assert_eq!(anchors.last().unwrap().p, canonical); + assert_eq!(session.doc().unwrap().history.undo.len(), before + 1); + session.execute("edit.undo", &json!({})).unwrap(); + assert_eq!(path(&session, closed), original_closed); + session.execute("edit.redo", &json!({})).unwrap(); + assert_eq!(path(&session, closed), opened); + (canonical_markers, canonical) +} diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 290623b48b..931512640a 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1012,6 +1012,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ ("help.about", "About VectorCraft", "", "{}"), ("help.checkForUpdates", "Check for Updates…", "", "{}"), ("help.commandPalette", "Search Commands…", "Cmd+Shift+/", "{}"), + ( + "help.clearRecentCommands", + "Clear Recent Commands", + "", + "{} empty the recent picks of Help › Search Commands (the list an empty search shows and the Recent Commands list), the saved list and the pick counts that rank the results; a pick of it is not kept as a recent pick or counted. Not enabled while no picks or counts are saved", + ), ( "help.discover", "VectorCraft Help…", @@ -1573,7 +1579,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.colorWheel", "Color Wheel Options", "", - "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, sliders?: none|oklch|hsl, harmony?: bool, harmonyRule?: complementary|splitComplementary|leftComplement|rightComplement|analogous|analogous2|triad|tetrad|tetrad2|tetrad3|compound|compound2|highContrast|highContrast3|pentagram, vision?: bool} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, pick the box's channel, as Box Channel does, and show no slider rows under the wheel or the box (none), OKLCH Sliders (oklch) or HSL Sliders (hsl), as the menu items of those names do: the box is a color field with the channel's strip at its right, and the field shows the other two components (hue: saturation across and brightness up; saturation: hue across and brightness up; brightness: hue across and saturation up; red: blue across and green up; green: blue across and red up; blue: red across and green up); OKLCH Sliders edit lightness 0 to 100 %, chroma 0 to 100 % of 0.4 and hue 0 to 360°, CSS Color 4's OKLCH of the display sRGB, and a color outside sRGB keeps L and H and takes the largest chroma that fits; HSL Sliders edit hue 0 to 360°, saturation 0 to 100 % and lightness 0 to 100 %, CSS Color 4's HSL of the display sRGB; harmony shows a marker on the wheel's ring for each other color of harmonyRule (the Color Guide's rule of that id; a rule's label is taken too), as Show Harmony and Harmony Rule do, and a click on a marker applies its color; vision shows Show Color Vision Preview's row under the wheel or the box, four chips with the current color as simulated for protanopia, deuteranopia and tritanopia (the simulations of view.proofSetup's protanopia, deuteranopia and tritanopia targets) and for achromatopsia (the gray with the color's CIE L*), each named with its hex value in its tooltip and to screen readers, and taking the keyboard focus; a click or a key on a chip does not apply its color; keys left out or null keep their values ({} reads them), params that are not an object, another key or a value off the list are an error and change nothing, oklch is an error while the working RGB space is not sRGB, the settings are kept with the preferences, and the command does not open the panel (window.panel {panel: \"colorWheel\"} does) (ui.inspect: ui.color_wheel) → {view, channel, sliders, harmony, harmonyRule, vision}", + "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, sliders?: none|oklch|hsl, gamut?: bool, harmony?: bool, harmonyRule?: complementary|splitComplementary|leftComplement|rightComplement|analogous|analogous2|triad|tetrad|tetrad2|tetrad3|compound|compound2|highContrast|highContrast3|pentagram, vision?: bool} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, pick the box's channel, as Box Channel does, and show no slider rows under the wheel or the box (none), OKLCH Sliders (oklch) or HSL Sliders (hsl), as the menu items of those names do: the box is a color field with the channel's strip at its right, and the field shows the other two components (hue: saturation across and brightness up; saturation: hue across and brightness up; brightness: hue across and saturation up; red: blue across and green up; green: blue across and red up; blue: red across and green up); OKLCH Sliders edit lightness 0 to 100 %, chroma 0 to 100 % of 0.4 and hue 0 to 360°, CSS Color 4's OKLCH of the display sRGB, and a color outside sRGB keeps L and H and takes the largest chroma that fits; HSL Sliders edit hue 0 to 360°, saturation 0 to 100 % and lightness 0 to 100 %, CSS Color 4's HSL of the display sRGB; gamut true grays out the parts of the wheel's square and the box's field whose colors the CMYK space cannot print (the out-of-gamut warning's test, as color.gamutCheck answers it), as Show Out-of-Gamut Colors does, and false shows them again; the shading is approximate: each cell of a 16 by 16 grid over the square or the field is grayed out or not by the color at its center, so a grayed cell can hold printable colors and a clear cell can hold colors that cannot print; harmony shows a marker on the wheel's ring for each other color of harmonyRule (the Color Guide's rule of that id; a rule's label is taken too), as Show Harmony and Harmony Rule do, and a click on a marker applies its color; vision shows Show Color Vision Preview's row under the wheel or the box, four chips with the current color as simulated for protanopia, deuteranopia and tritanopia (the simulations of view.proofSetup's protanopia, deuteranopia and tritanopia targets) and for achromatopsia (the gray with the color's CIE L*), each named with its hex value in its tooltip and to screen readers, and taking the keyboard focus; a click or a key on a chip does not apply its color; keys left out or null keep their values ({} reads them), params that are not an object, another key or a value off the list are an error and change nothing, oklch is an error while the working RGB space is not sRGB, the settings are kept with the preferences, and the command does not open the panel (window.panel {panel: \"colorWheel\"} does) (ui.inspect: ui.color_wheel) → {view, channel, sliders, gamut, harmony, harmonyRule, vision}", ), ( "ui.savePdfDialog", diff --git a/crates/three-d/src/lib.rs b/crates/three-d/src/lib.rs index c99a437efd..56a49aadf7 100644 --- a/crates/three-d/src/lib.rs +++ b/crates/three-d/src/lib.rs @@ -12,9 +12,9 @@ pub mod fold; mod solid; mod visibility; pub use solid::{ - Bevel, BevelShape, DepthPlane, Extrude, FaceMap, Facet, Inflate, MapCell, MeshFace, PlanarFace, SolidSurface, SurfaceKind, TOO_COMPLEX_SOLID, - View, extrude, extrude_face_map, extrude_mesh_face, extrude_side_size, extrude_surfaces, inflate, inflate_each, inflate_together, plane, - plane_face_map, plane_mesh_face, + Bevel, BevelProfile, BevelShape, DepthPlane, Extrude, FaceMap, Facet, Inflate, MapCell, MeshFace, PlanarFace, SolidSurface, SurfaceKind, + TOO_COMPLEX_SOLID, View, extrude, extrude_face_map, extrude_mesh_face, extrude_side_size, extrude_surfaces, inflate, inflate_each, + inflate_together, plane, plane_face_map, plane_mesh_face, }; pub use visibility::{VisibleFace, visible_faces}; mod shading; diff --git a/crates/three-d/src/solid.rs b/crates/three-d/src/solid.rs index 0ea03dcbf9..19905110ce 100644 --- a/crates/three-d/src/solid.rs +++ b/crates/three-d/src/solid.rs @@ -113,6 +113,8 @@ impl View { } /// The shape of a bevel's cross-section, from the cap's edge (0) to the side wall (1). +// A custom profile takes 258 bytes; an extrusion copies its bevel a few times. +#[allow(clippy::large_enum_variant)] #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] pub enum BevelShape { /// A straight 45° chamfer when width and height are equal. @@ -126,11 +128,73 @@ pub enum BevelShape { Step, /// A convex then concave S curve. Ogee, + /// A cross-section of the user's own, drawn as an open path ([`BevelProfile`]). + Custom(BevelProfile), +} + +/// A custom bevel's cross-section: points from the cap's edge, (0, 0), to the side wall, (1, 1), +/// each a (share of the width, share of the height) pair in 0..1, joined by straight lines. The +/// shares are kept to 1/32,768 in a fixed array, so the profile is `Copy` like the built-in shapes. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub struct BevelProfile { + points: [(u16, u16); BevelProfile::MAX_POINTS], + len: u8, +} + +impl BevelProfile { + /// The most points a profile holds. + pub const MAX_POINTS: usize = 64; + + /// A profile of `points`, or `None` unless there are 2 to [`Self::MAX_POINTS`] of them, every + /// share is a number in 0..1, and they start at (0, 0) and end at (1, 1). + pub fn new(points: &[(f64, f64)]) -> Option { + const END: f64 = 1e-6; + if !(2..=Self::MAX_POINTS).contains(&points.len()) || points.iter().any(|&(x, y)| !(0.0..=1.0).contains(&x) || !(0.0..=1.0).contains(&y)) { + return None; + } + let (first, last) = (points[0], points[points.len() - 1]); + if first.0 > END || first.1 > END || last.0 < 1.0 - END || last.1 < 1.0 - END { + return None; + } + let mut out = Self { points: [(0, 0); Self::MAX_POINTS], len: points.len() as u8 }; + let share = |v: f64| (v * f64::from(Self::ONE)).round() as u16; + for (slot, &(x, y)) in out.points.iter_mut().zip(points) { + *slot = (share(x), share(y)); + } + out.points[0] = (0, 0); + out.points[points.len() - 1] = (Self::ONE, Self::ONE); + Some(out) + } + + /// A whole share in the stored points: shares are kept to 1/32,768, so halves and quarters + /// stay exact. + const ONE: u16 = 1 << 15; + + /// The points, as (share of the width, share of the height). + pub fn points(&self) -> impl Iterator + '_ { + let share = |v: u16| f64::from(v) / f64::from(Self::ONE); + self.points[..usize::from(self.len)].iter().map(move |&(x, y)| (share(x), share(y))) + } + + /// The point at `s` (0..1), the points spread evenly along `s` and joined by straight lines. + fn at(&self, s: f64) -> (f64, f64) { + // A profile holds at least two points (`new`). + let len = usize::from(self.len).max(2); + let share = |v: u16| f64::from(v) / f64::from(Self::ONE); + let k = s * (len - 1) as f64; + let i = (k.floor() as usize).min(len - 2); + let f = k - i as f64; + let (a, b) = (self.points[i], self.points[i + 1]); + let (ax, ay, bx, by) = (share(a.0), share(a.1), share(b.0), share(b.1)); + (ax + (bx - ax) * f, ay + (by - ay) * f) + } } impl BevelShape { + /// The built-in shapes. pub const ALL: [BevelShape; 5] = [Self::Classic, Self::Rounded, Self::Cove, Self::Step, Self::Ogee]; + /// The shape's parameter value; `custom` for a [`BevelShape::Custom`] one. pub fn id(self) -> &'static str { match self { Self::Classic => "classic", @@ -138,9 +202,11 @@ impl BevelShape { Self::Cove => "cove", Self::Step => "step", Self::Ogee => "ogee", + Self::Custom(_) => "custom", } } + /// The built-in shape named `s`. pub fn parse(s: &str) -> Option { Self::ALL.into_iter().find(|b| b.id() == s) } @@ -150,6 +216,7 @@ impl BevelShape { let s = s.clamp(0.0, 1.0); let q = s * std::f64::consts::FRAC_PI_2; match self { + Self::Custom(profile) => profile.at(s), Self::Classic => (s, s), Self::Rounded => (1.0 - q.cos(), q.sin()), Self::Cove => (q.sin(), 1.0 - q.cos()), @@ -177,6 +244,11 @@ impl BevelShape { match self { Self::Classic => vec![0.0, 1.0], Self::Step => vec![0.0, 0.25, 0.5, 0.75, 1.0], + // Each of its points, where the straight lines between them turn. + Self::Custom(profile) => { + let last = (usize::from(profile.len) - 1) as f64; + (0..usize::from(profile.len)).map(|i| i as f64 / last).collect() + } _ => (0..=8).map(|i| f64::from(i) / 8.0).collect(), } } diff --git a/crates/three-d/src/solid/tests.rs b/crates/three-d/src/solid/tests.rs index 78d2fcdcbe..917290bff3 100644 --- a/crates/three-d/src/solid/tests.rs +++ b/crates/three-d/src/solid/tests.rs @@ -354,6 +354,40 @@ fn bevel_shapes_repeats_and_both_sides_change_the_surface() { } } +/// A custom bevel's points are its cross-section, joined by straight lines: two points make the +/// classic chamfer, and the step shape's points make the step shape's solid. Other points change +/// the surface. A profile must run from (0, 0) to (1, 1) with every share in 0..1. +#[test] +fn custom_bevel_profiles_shape_the_bevel() { + let (p, b) = shape(&square(0.0, 0.0, 100.0)); + let v = View { rotation_x: -20.0, rotation_y: 30.0, ..front() }; + let solid = |shape: BevelShape| { + let bevel = Bevel { shape, width: 12.0, height: 12.0, repeat: 2, space: 0.2, both_sides: true, ..Bevel::default() }; + extrude(&p, FillRule::EvenOdd, b, Extrude { bevel: Some(bevel), ..Extrude::default() }, v).unwrap() + }; + let custom = |pts: &[(f64, f64)]| BevelShape::Custom(BevelProfile::new(pts).unwrap()); + assert_eq!(solid(custom(&[(0.0, 0.0), (1.0, 1.0)])), solid(BevelShape::Classic)); + let step = [(0.0, 0.0), (0.0, 0.5), (0.5, 0.5), (0.5, 1.0), (1.0, 1.0)]; + assert_eq!(solid(custom(&step)), solid(BevelShape::Step)); + let notch = custom(&[(0.0, 0.0), (0.2, 0.6), (0.7, 0.4), (1.0, 1.0)]); + assert_ne!(solid(notch), solid(BevelShape::Classic)); + assert_eq!(notch.id(), "custom"); + assert_eq!(BevelShape::parse("custom"), None); + assert_eq!(notch.at(0.0), (0.0, 0.0)); + assert_eq!(notch.at(1.0), (1.0, 1.0)); + // The point a third of the way along is the second point, kept to 1/32,768. + let (x, y) = notch.at(1.0 / 3.0); + assert!(close(x, 0.2, 1e-4) && close(y, 0.6, 1e-4), "{x}, {y}"); + // Inside, the bevel carves the shape with the same points. + let inside = Bevel { shape: notch, width: 12.0, height: 12.0, inside: true, ..Bevel::default() }; + assert!(extrude(&p, FillRule::EvenOdd, b, Extrude { bevel: Some(inside), ..Extrude::default() }, v).is_ok()); + let too_many = vec![(0.5, 0.5); BevelProfile::MAX_POINTS + 1]; + for bad in [&[(0.0, 0.0)][..], &[(0.1, 0.0), (1.0, 1.0)], &[(0.0, 0.0), (1.0, 0.9)], &[(0.0, 0.0), (1.2, 0.5), (1.0, 1.0)], &too_many] { + assert_eq!(BevelProfile::new(bad), None, "{bad:?}"); + } + assert!(BevelProfile::new(&[(0.0, 0.0), (f64::NAN, 0.5), (1.0, 1.0)]).is_none()); +} + #[test] fn holes_stay_holes_in_the_caps_and_get_walls_of_their_own() { let mut b = square(0.0, 0.0, 100.0); diff --git a/crates/tools/src/draw2/anchor.rs b/crates/tools/src/draw2/anchor.rs index 1fe1fd72f3..66e2eea0b0 100644 --- a/crates/tools/src/draw2/anchor.rs +++ b/crates/tools/src/draw2/anchor.rs @@ -16,9 +16,9 @@ use serde_json::json; use vectorcraft_doc::NodeId; -use vectorcraft_geom::Point; +use vectorcraft_geom::{ParamCurve, Point}; -use super::{hit_anchor, hit_segment, insert_anchor, remove_anchor}; +use super::{FEEDBACK, hit_anchor, hit_segment, insert_anchor, remove_anchor}; use crate::direct::hit_handle; use crate::guides::{DrawSnap, HandleSnap}; use crate::{Action, Cursor, Mods, Overlay, PixelOp, PointerEvent, PointerKind, Tool, ToolContext, ToolKey}; @@ -95,10 +95,48 @@ enum SpaceResume { SpineHandle { id: NodeId, ai: usize, out: bool }, } +/// A cut chosen with the same anchor/segment priority for preview and press. +enum ScissorsCut { + Anchor { id: NodeId, si: usize, ai: usize }, + Segment { id: NodeId, si: usize, seg: usize, t: f64 }, +} + +impl ScissorsCut { + fn point(&self, cx: &ToolContext) -> Option { + let (id, si) = match *self { + Self::Anchor { id, si, .. } | Self::Segment { id, si, .. } => (id, si), + }; + let sp = cx.doc.node(id)?.path_data()?.subpaths.get(si)?; + if sp.anchors.len() < 2 { + return None; + } + let ai = match *self { + Self::Anchor { ai, .. } => ai, + Self::Segment { seg, t, .. } => { + if seg >= sp.segment_count() || !(0.0..=1.0).contains(&t) { + return None; + } + // path.split canonicalizes cuts near segment ends to the existing anchor. + if t <= 1e-6 { + seg + } else if t >= 1.0 - 1e-6 { + (seg + 1) % sp.anchors.len() + } else { + return Some(sp.segment(seg).eval(t)); + } + } + }; + let anchor = sp.anchors.get(ai)?; + // An open path cannot be split at either of its existing end points. + (sp.closed || (ai > 0 && ai + 1 < sp.anchors.len())).then_some(anchor.p) + } +} + /// The cursor reuses the last hover's point, with DrawSnap checking its target inputs. The /// Scissors-only inputs also bind the resolved point to the current cut eligibility. struct ScissorsHover { raw: Point, + shared: Point, snapped: Point, zoom: f64, isolation: Option, @@ -160,7 +198,7 @@ impl AnchorTool { /// Keep a shared art snap unless it prevents a cut the raw pointer could make. Outside art /// still supplies alignment and intersection guides; pixel and grid snapping keep precedence. - fn resolve_scissors_snap(&mut self, cx: &ToolContext, raw: Point, snapped: Point) -> Point { + fn scissors_point(cx: &ToolContext, raw: Point, snapped: Point) -> (Point, bool) { let eligible = |p| hit_anchor(cx, p, 0.0).is_some() || hit_segment(cx, p, cx.pick_tol()).is_some(); let fallback = (cx.smart_guides || cx.snap_to_point) && !cx.snaps_to_pixel(PixelOp::Drawing) @@ -168,14 +206,16 @@ impl AnchorTool { && snapped != raw && !eligible(snapped) && eligible(raw); - let snapped = if fallback { + (if fallback { raw } else { snapped }, fallback) + } + + fn resolve_scissors_snap(&mut self, cx: &ToolContext, raw: Point, shared: Point) -> Point { + let (snapped, fallback) = Self::scissors_point(cx, raw, shared); + if fallback { self.scissors_snap.clear(); - raw - } else { - snapped - }; + } self.scissors_hover = - Some(ScissorsHover { raw, snapped, zoom: cx.zoom, isolation: cx.isolation, selection_tolerance: cx.selection_tolerance }); + Some(ScissorsHover { raw, shared, snapped, zoom: cx.zoom, isolation: cx.isolation, selection_tolerance: cx.selection_tolerance }); snapped } @@ -198,18 +238,27 @@ impl AnchorTool { } let snapped = self.scissors_snap.press(cx, p, &[], None); let p = self.resolve_scissors_snap(cx, p, snapped); + match Self::scissors_cut(cx, p) { + Some(ScissorsCut::Anchor { id, si, ai }) => { + vec![Action::Exec("path.split".into(), json!({"id": id.0, "subpath": si, "anchor": ai}))] + } + Some(ScissorsCut::Segment { id, si, seg, t }) => { + vec![Action::Exec("path.split".into(), json!({"id": id.0, "subpath": si, "segment": seg, "t": t}))] + } + None => vec![], + } + } + + fn scissors_cut(cx: &ToolContext, p: Point) -> Option { let point = cx.point_tol(); // A path snap must not be pulled to a nearby anchor by the larger pick radius. // Shared anchor targets and the path's anchors use the same stored coordinates. let snapping = cx.smart_guides || cx.snap_to_point || cx.snaps_to_pixel(PixelOp::Drawing) || cx.snap_to_grid; let anchor_tol = if snapping { 0.0 } else { point }; if let Some((id, si, ai)) = hit_anchor(cx, p, anchor_tol) { - return vec![Action::Exec("path.split".into(), json!({"id": id.0, "subpath": si, "anchor": ai}))]; - } - match Self::scissors_segment(cx, p) { - Some((id, si, seg, t)) => vec![Action::Exec("path.split".into(), json!({"id": id.0, "subpath": si, "segment": seg, "t": t}))], - None => vec![], + return Some(ScissorsCut::Anchor { id, si, ai }); } + Self::scissors_segment(cx, p).map(|(id, si, seg, t)| ScissorsCut::Segment { id, si, seg, t }) } /// The Anchor Point tool as the Pen lends it with Alt held: an Alt-drag on a handle moves only @@ -694,8 +743,17 @@ impl Tool for AnchorTool { if matches!(self.state, State::Handle { .. }) { out.extend(self.guides.iter().cloned()); } - if self.id == "scissors" && self.current_scissors_hover(cx).is_some() { - out.extend_from_slice(self.scissors_snap.guides()); + if self.id == "scissors" + && let Some(h) = self.current_scissors_hover(cx) + { + // Selection priority can change without changing DrawSnap's geometry key. + let (p, _) = Self::scissors_point(cx, h.raw, h.shared); + if p == h.snapped { + out.extend_from_slice(self.scissors_snap.guides()); + } + if let Some(p) = Self::scissors_cut(cx, p).and_then(|cut| cut.point(cx)) { + out.push(Overlay::Anchor { p, color: FEEDBACK, filled: false, size: 7.0 }); + } } if cx.measurement_labels && let Some((p, dx, dy)) = self.measure diff --git a/crates/tools/src/draw2/anchor/tests.rs b/crates/tools/src/draw2/anchor/tests.rs index ba4bd4df27..d6d4896526 100644 --- a/crates/tools/src/draw2/anchor/tests.rs +++ b/crates/tools/src/draw2/anchor/tests.rs @@ -1049,3 +1049,239 @@ fn anchor_point_alt_drag_links_a_blend_spine_handle() { ); assert_eq!(tool.pointer(&c, &PointerEvent::new(PointerKind::Up, 190.0, 350.0).with_mods(alt)), vec![Action::Commit]); } + +fn review_8655_markers(tool: &AnchorTool, context: &ToolContext) -> Vec { + tool.overlays(context) + .into_iter() + .filter_map(|overlay| match overlay { + Overlay::Anchor { p, color, filled: false, size } if color == crate::draw2::FEEDBACK && size == 7.0 => Some(p), + _ => None, + }) + .collect() +} + +/// Compare the public overlay to geometry reconstructed from the real path.split action, +/// including points projected off the raw pointer and a rejected outside-art snap. +#[test] +fn review_8655_scissors_marker_matches_the_fresh_split_geometry() { + let paint = paint(); + let mut observed = Vec::new(); + for scenario in 0..5 { + let (mut d, mut target, mut selected) = if scenario == 1 { + scissors_crossing() + } else { + let (d, id) = doc_with_rect(); + (d, id, Selection::default()) + }; + if scenario == 3 { + let outside = d.alloc_id(); + d.insert( + Some(d.layers[0].id), + 1, + vectorcraft_doc::Node::path( + outside, + vectorcraft_geom::shapes::line(Point::new(150.0, 103.5), Point::new(350.0, 350.0)), + vectorcraft_doc::Appearance::default_art(), + ), + ) + .unwrap(); + } else if scenario == 4 { + let mut curve = vectorcraft_geom::SubPath::polyline(&[Point::new(100.0, 300.0), Point::new(200.0, 300.0)], false); + curve.anchors[0].h_out = Point::new(120.0, 340.0); + curve.anchors[1].h_in = Point::new(180.0, 340.0); + target = d.alloc_id(); + d.insert( + Some(d.layers[0].id), + 1, + vectorcraft_doc::Node::path(target, vectorcraft_geom::PathData::single(curve), vectorcraft_doc::Appearance::default_art()), + ) + .unwrap(); + } + selected.set([target]); + let (at, expected) = match scenario { + 0 => (Point::new(152.0, 101.5), Point::new(152.0, 100.0)), + 1 => (Point::new(152.0, 101.5), Point::new(150.0, 100.0)), + 2 => (Point::new(200.0, 104.25), Point::new(200.0, 100.0)), + 3 => (Point::new(150.0, 100.0), Point::new(150.0, 100.0)), + _ => (Point::new(150.0, 331.5), Point::new(150.0, 330.0)), + }; + let snapping = scenario == 1 || scenario == 3; + let context = ToolContext { + smart_guides: snapping, + snap_to_point: snapping, + snap_to_pixel: false, + snap_to_grid: false, + isolation: (scenario == 3).then_some(target), + ..cx(&d, &selected, &paint) + }; + let mut tool = AnchorTool::new("scissors"); + assert!(tool.pointer(&context, &PointerEvent::new(PointerKind::Move, at.x, at.y)).is_empty()); + let markers = review_8655_markers(&tool, &context); + let labels = scissors_labels(&tool, &context); + if scenario == 1 { + assert_eq!(labels, [("intersect".to_string(), expected)], "CONTROL: existing intersection guides remain"); + } else { + assert!(labels.is_empty(), "CONTROL: off/rejected snapping adds no guide: {labels:?}"); + } + assert_eq!(tool.cursor(&context, at, Mods::default()), Cursor::Scissors); + let actions = tool.pointer(&context, &PointerEvent::new(PointerKind::Down, at.x, at.y)); + let cut = scissors_cut_at(&d, target, &actions); + assert!(cut.distance(expected) < 1e-5, "CONTROL: scenario{scenario} actual split {cut:?}, expected{expected:?}"); + if scenario == 2 { + assert!(matches!(&actions[..], [Action::Exec(_, args)] if args["anchor"] == 1), "CONTROL: the actual stored anchor wins"); + } + if scenario == 0 || scenario == 4 { + assert!(cut.distance(at) > 1.0, "CONTROL: preview must show the path projection, not the raw point"); + } + observed.push((scenario, markers, cut)); + } + observed.extend(review_8655_endpoint_action_controls()); + // Every split/guide control above executes before the missing-feedback oracle on old code. + for (scenario, markers, cut) in observed { + assert_eq!(markers.len(), 1, "REGRESSION: scenario{scenario} needs exactly one hollow7px FEEDBACK anchor: {markers:?}"); + assert!(markers[0].distance(cut) < 1e-6, "REGRESSION: marker and actual fresh split disagree: {markers:?} versus{cut:?}"); + } +} + +#[test] +fn review_8655_scissors_selection_change_cannot_reuse_the_wrong_marker() { + let (mut d, rectangle) = doc_with_rect(); + let line = d.alloc_id(); + d.insert( + Some(d.layers[0].id), + 1, + vectorcraft_doc::Node::path( + line, + vectorcraft_geom::shapes::line(Point::new(120.0, 102.0), Point::new(240.0, 102.0)), + vectorcraft_doc::Appearance::default_art(), + ), + ) + .unwrap(); + let mut rectangle_selected = Selection::default(); + rectangle_selected.set([rectangle]); + let mut line_selected = Selection::default(); + line_selected.set([line]); + let paint = paint(); + // Only the selection changes: these contexts have the same document and DrawSnap key inputs. + let before = ToolContext { smart_guides: false, snap_to_point: false, ..cx(&d, &rectangle_selected, &paint) }; + let after = ToolContext { smart_guides: false, snap_to_point: false, ..cx(&d, &line_selected, &paint) }; + assert_eq!(before.revision, after.revision); + assert!(std::ptr::eq(before.doc, after.doc)); + let at = Point::new(150.0, 101.6); + let mut tool = AnchorTool::new("scissors"); + tool.pointer(&before, &PointerEvent::new(PointerKind::Move, at.x, at.y)); + let old_markers = review_8655_markers(&tool, &before); + let mut fresh = AnchorTool::new("scissors"); + let old_cut = scissors_cut_at(&d, rectangle, &fresh.pointer(&before, &PointerEvent::new(PointerKind::Down, at.x, at.y))); + let new_cut = scissors_cut_at(&d, line, &fresh.pointer(&after, &PointerEvent::new(PointerKind::Down, at.x, at.y))); + assert!(old_cut.distance(Point::new(150.0, 100.0)) < 1e-6, "CONTROL: selected rectangle beats nearer unselected line"); + assert!(new_cut.distance(Point::new(150.0, 102.0)) < 1e-6, "CONTROL: fresh selection changes the actual split owner"); + assert!(old_cut.distance(new_cut) > 1.0); + let stale = review_8655_markers(&tool, &after); + assert!(stale.iter().all(|p| p.distance(new_cut) < 1e-6), "no unchanged-key selection switch may show the old cut point: {stale:?}"); + tool.pointer(&after, &PointerEvent::new(PointerKind::Move, at.x, at.y)); + let new_markers = review_8655_markers(&tool, &after); + let actions = tool.pointer(&after, &PointerEvent::new(PointerKind::Down, at.x, at.y)); + assert!(scissors_cut_at(&d, line, &actions).distance(new_cut) < 1e-6); + assert_eq!(old_markers.len(), 1, "REGRESSION: valid first selection has feedback"); + assert!(old_markers[0].distance(old_cut) < 1e-6); + assert_eq!(new_markers.len(), 1, "REGRESSION: a fresh hover uses the fresh selected owner"); + assert!(new_markers[0].distance(new_cut) < 1e-6); +} + +#[test] +fn review_8655_scissors_feedback_clears_on_miss_alt_stale_and_leave() { + let (d, _) = doc_with_rect(); + let selected = Selection::default(); + let paint = paint(); + let context = ToolContext { smart_guides: false, snap_to_point: false, ..cx(&d, &selected, &paint) }; + let at = Point::new(170.0, 201.0); + let mut tool = AnchorTool::new("scissors"); + tool.pointer(&context, &PointerEvent::new(PointerKind::Move, at.x, at.y)); + let valid = review_8655_markers(&tool, &context); + // A context change must not keep a geometrically obsolete point visible before rehover. + let stale = ToolContext { zoom: 2.0, smart_guides: false, snap_to_point: false, ..cx(&d, &selected, &paint) }; + assert!(tool.overlays(&stale).is_empty(), "CONTROL: stale zoom shows neither guides nor marker"); + tool.pointer(&context, &PointerEvent::new(PointerKind::Move, 20.0, 20.0)); + assert!(tool.pointer(&context, &PointerEvent::new(PointerKind::Down, 20.0, 20.0)).is_empty()); + assert!(tool.overlays(&context).is_empty(), "CONTROL: a true miss has no cut feedback"); + tool.pointer(&context, &PointerEvent::new(PointerKind::Move, at.x, at.y)); + let alt = Mods { alt: true, ..Mods::default() }; + let event = PointerEvent::new(PointerKind::Down, at.x, at.y); + let mut add = AnchorTool::new("addAnchor"); + assert_eq!(tool.pointer(&context, &event.with_mods(alt)), add.pointer(&context, &event), "CONTROL: Alt remains Add Anchor Point"); + assert!(tool.overlays(&context).is_empty(), "CONTROL: Alt has no Scissors marker"); + tool.pointer(&context, &PointerEvent::new(PointerKind::Move, at.x, at.y)); + tool.hover_ended(&context); + assert!(tool.overlays(&context).is_empty(), "CONTROL: leaving clears the marker and guides"); + assert_eq!(valid.len(), 1, "REGRESSION: the initial valid cut needs visible feedback"); + assert!(valid[0].distance(Point::new(170.0, 200.0)) < 1e-6); +} + +/// The successful point is owned by path.split's consumer, including endpoint rejection and +/// its canonical anchor threshold. Keep the emitted Down action itself unchanged. +fn review_8655_endpoint_action_controls() -> Vec<(usize, Vec, Point)> { + let paint = paint(); + let (open_doc, rectangle, selected) = scissors_crossing(); + let open_cx = ToolContext { smart_guides: false, snap_to_point: false, ..cx(&open_doc, &selected, &paint) }; + let mut tool = AnchorTool::new("scissors"); + for (anchor, endpoint) in [(0, Point::new(145.0, 90.0)), (1, Point::new(165.0, 130.0))] { + tool.pointer(&open_cx, &PointerEvent::new(PointerKind::Move, endpoint.x, endpoint.y)); + let endpoint_markers = review_8655_markers(&tool, &open_cx); + let actions = tool.pointer(&open_cx, &PointerEvent::new(PointerKind::Down, endpoint.x, endpoint.y)); + let [Action::Exec(command, args)] = &actions[..] else { panic!("CONTROL: preserve the original endpoint Down action: {actions:?}") }; + assert_eq!(command, "path.split"); + assert_eq!(args["anchor"], anchor); + let owner = NodeId(args["id"].as_u64().unwrap()); + assert_ne!(owner, rectangle); + assert!(!open_doc.node(owner).unwrap().path_data().unwrap().subpaths[0].closed); + assert_eq!(scissors_cut_at(&open_doc, owner, &actions), endpoint); + assert!(endpoint_markers.is_empty(), "an open path's end point has no successful-cut marker"); + tool.pointer(&open_cx, &PointerEvent::new(PointerKind::Up, endpoint.x, endpoint.y)); + } + let interior = Point::new(155.0, 110.0); + tool.pointer(&open_cx, &PointerEvent::new(PointerKind::Move, interior.x, interior.y)); + let interior_markers = review_8655_markers(&tool, &open_cx); + let actions = tool.pointer(&open_cx, &PointerEvent::new(PointerKind::Down, interior.x, interior.y)); + let [Action::Exec(_, args)] = &actions[..] else { panic!("CONTROL: interior open path emits split: {actions:?}") }; + assert!(args.get("segment").is_some()); + let owner = NodeId(args["id"].as_u64().unwrap()); + assert!(scissors_cut_at(&open_doc, owner, &actions).distance(interior) < 1e-6); + + let (mut d, other_rectangle) = doc_with_rect(); + // Keep the unrelated fixture rectangle away: its exact(100,100) anchor must not steal + // the grid contact from the selected near-endpoint cubic. + d.node_mut(other_rectangle).unwrap().transform(vectorcraft_geom::Affine::translate((0.0, 250.0)), true); + d.grid = vectorcraft_doc::GridPrefs { spacing: 10.0, subdivisions: 1 }; + let start = Point::new(99.99995, 100.0); + // Explicit collinear cubic handles make t linear; a handle-free rectangle's cubic t + // would be about0.000408 here and would not exercise the consumer's1e-6 threshold. + let path = vectorcraft_geom::PathData::from_bezpath(&vectorcraft_geom::BezPath::from_vec(vec![ + vectorcraft_geom::PathEl::MoveTo(start), + vectorcraft_geom::PathEl::CurveTo(Point::new(133.33328333333333, 100.0), Point::new(166.66661666666666, 100.0), Point::new(199.99995, 100.0)), + vectorcraft_geom::PathEl::LineTo(Point::new(199.99995, 200.0)), + vectorcraft_geom::PathEl::LineTo(Point::new(99.99995, 200.0)), + vectorcraft_geom::PathEl::ClosePath, + ])); + let id = d.alloc_id(); + d.insert(Some(d.layers[0].id), 1, vectorcraft_doc::Node::path(id, path, vectorcraft_doc::Appearance::default_art())).unwrap(); + let mut selected = Selection::default(); + selected.set([id]); + let context = ToolContext { snap_to_grid: true, smart_guides: false, snap_to_point: false, ..cx(&d, &selected, &paint) }; + let raw = Point::new(100.1, 100.2); + let mut tool = AnchorTool::new("scissors"); + tool.pointer(&context, &PointerEvent::new(PointerKind::Move, raw.x, raw.y)); + let markers = review_8655_markers(&tool, &context); + let actions = tool.pointer(&context, &PointerEvent::new(PointerKind::Down, raw.x, raw.y)); + let [Action::Exec(command, args)] = &actions[..] else { panic!("CONTROL: near-end grid contact emits split: {actions:?}") }; + assert_eq!(command, "path.split"); + assert_eq!(args["id"], id.0); + assert_eq!(args["segment"], 0); + let t = args["t"].as_f64().unwrap(); + assert!(t > 0.0 && t <= 1e-6, "CONTROL: actual emitted t reaches the consumer's anchor canonicalization: {t}"); + let projected = scissors_cut_at(&d, id, &actions); + assert!(projected.distance(Point::new(100.0, 100.0)) < 1e-6); + assert!(projected.distance(start) > 1e-5, "CONTROL: raw curve evaluation differs from the committed canonical anchor"); + assert!(scissors_labels(&tool, &context).is_empty(), "grid contact adds no Smart Guide label"); + vec![(5, interior_markers, interior), (6, markers, start)] +} diff --git a/crates/ui-egui/src/chrome.rs b/crates/ui-egui/src/chrome.rs index 261534e643..511967d45f 100644 --- a/crates/ui-egui/src/chrome.rs +++ b/crates/ui-egui/src/chrome.rs @@ -157,8 +157,7 @@ pub fn app_bar(app: &mut VectorcraftApp, ui: &mut Ui) { }) .inner; if clicked && enabled { - app.ui.palette_open = !app.ui.palette_open; - app.ui.palette_query.clear(); + crate::palette::toggle(app); } if learn { let shown = crate::panels::learn::visible(&app.ui); diff --git a/crates/ui-egui/src/dialogs/revolve.rs b/crates/ui-egui/src/dialogs/revolve.rs index 1812f41d42..568acdb121 100644 --- a/crates/ui-egui/src/dialogs/revolve.rs +++ b/crates/ui-egui/src/dialogs/revolve.rs @@ -6,7 +6,7 @@ use egui::{Align2, FontId, Id, Pos2, Sense, Stroke, vec2}; use serde_json::{Value, json}; use vectorcraft_doc::Unit; -use vectorcraft_effects::{CLASSIC_EXTRUDE, CLASSIC_REVOLVE, EXTRUDE, INFLATE, REVOLVE, ROTATION_PRESETS}; +use vectorcraft_effects::{BEVEL_NAME, BEVEL_PROFILE, CLASSIC_EXTRUDE, CLASSIC_REVOLVE, EXTRUDE, INFLATE, REVOLVE, ROTATION_PRESETS}; use crate::state::Dialog; use crate::theme::Tokens; @@ -233,11 +233,11 @@ fn solid_controls(app: &VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog, id: & } else if object && d.str("__tab") != "rotation" { let unit = app.session.general_unit(); if id == CLASSIC_EXTRUDE { - super::three_d_classic::object_controls(ui, d, unit); + super::three_d_classic::object_controls(app, ui, d, unit); } else if id == CLASSIC_REVOLVE { super::three_d_classic::revolve_controls(ui, d, unit); } else if id == EXTRUDE { - extrude_controls(ui, d, unit); + extrude_controls(app, ui, d, unit); } else { heading(ui, tl!("Object")); number(ui, d, "depth", tl!("Depth"), (0.0, 2000.0), "", 1, Some(unit)); @@ -252,8 +252,108 @@ fn solid_controls(app: &VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog, id: & } } +/// A Bevel Shape menu entry: (shown label, value, the custom bevel's name and points). +pub(crate) type BevelChoice = (String, Value, Option<(String, Value)>); + +/// The entries of [`bevel_choice`]'s menu for form `fields`, and how many are built in. The +/// built-in labels are translated; custom bevels show their names as they are. The effect's own +/// custom bevel, the panel's [`OWN_BEVEL`] else the form's, is listed unless the file lists it by +/// name with the same points; while another entry has its label, " (document)" is added to it. +pub(crate) fn bevel_options(app: &VectorcraftApp, fields: &serde_json::Map, effect: &str) -> (Vec, usize) { + let mut options: Vec = super::effect::own_choices(effect, "bevel", false) + .unwrap_or_default() + .into_iter() + .map(|(label, value)| (tl!(label).to_string(), json!(value), None)) + .collect(); + let builtin = options.len(); + for b in app.session.bevels.bevels() { + options.push((b.name.clone(), json!("custom"), Some((b.name.clone(), b.profile_json())))); + } + let custom = fields.get("bevel").and_then(Value::as_str) == Some("custom"); + let own = match fields.get(OWN_BEVEL).and_then(Value::as_array).map(Vec::as_slice) { + Some([n, p]) => Some((n.as_str().unwrap_or_default().to_string(), p.clone())), + _ => fields + .get(BEVEL_PROFILE) + .filter(|p| custom && !p.is_null()) + .map(|p| (fields.get(BEVEL_NAME).and_then(Value::as_str).unwrap_or_default().to_string(), p.clone())), + }; + if let Some((n, p)) = own + && !options[builtin..].iter().any(|(_, _, c)| c.as_ref().is_some_and(|(cn, cp)| *cn == n && *cp == p)) + { + let mut shown = if n.is_empty() { tl!("Custom").to_string() } else { n.clone() }; + // Each pass makes the label longer, so this ends once no entry has it. + while options.iter().any(|(l, _, _)| *l == shown) { + shown = crate::i18n::fmt(tl!("{name} (document)"), &[("name", &shown)]); + } + options.push((shown, json!("custom"), Some((n, p)))); + } + (options, builtin) +} + +/// The form field where the 3D and Materials panel puts the first selected effect's custom bevel, +/// `[name, points]`, so Bevel Shape lists it while a mixed selection unsets the shown bevel. +pub(crate) const OWN_BEVEL: &str = "__ownBevel"; + +/// The Bevel Shape menu of Extrude & Bevel and Extrude & Bevel (Classic) (`effect`): None and the +/// built-in shapes, then the custom bevels of the bevels file, and the effect's own custom bevel +/// when the file does not list it (a document from elsewhere carries its points). Picking a +/// custom bevel stores its name and a copy of its points. In the 3D and Materials panel, Edit +/// Bevels… opens the bevels file (`__editBevels`, which the panel runs). +pub(super) fn bevel_choice(app: &VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog, effect: &str) { + const KEY: &str = "bevel"; + let (options, builtin) = bevel_options(app, &d.fields, effect); + let name = d.fields.get(BEVEL_NAME).and_then(Value::as_str).unwrap_or_default().to_string(); + let points = d.fields.get(BEVEL_PROFILE).filter(|v| !v.is_null()).cloned(); + let custom = d.fields.get(KEY).and_then(Value::as_str) == Some("custom"); + let is = |c: &Option<(String, Value)>| c.as_ref().is_some_and(|(n, p)| *n == name && Some(p) == points.as_ref()); + let default = vectorcraft_effects::default_params(effect).and_then(|p| p.get(KEY).cloned()).unwrap_or(Value::Null); + let mixed = d.fields.get(KEY).is_some_and(Value::is_null); + let value = d.fields.get(KEY).filter(|v| !v.is_null()).cloned().unwrap_or_else(|| default.clone()); + let current = if custom { + options[builtin..].iter().position(|(_, _, c)| is(c)).map(|i| i + builtin) + } else { + options[..builtin].iter().position(|(_, v, _)| *v == value) + }; + ui.horizontal(|ui| { + ui.spacing_mut().item_spacing.x = 6.0; + label(ui, tl!("Bevel Shape")); + let labels: Vec<&str> = options.iter().map(|(l, _, _)| l.as_str()).collect(); + let shown = current.and_then(|i| labels.get(i)).copied().unwrap_or(""); + let width = VALUE_W + rail_width(ui) + 6.0; + // Marked by index, not label: a custom bevel's name can match another entry's label. + let picked = widgets::combo(ui, ("three-d-choice", KEY), shown, width, |ui| { + let mut chosen = None; + for (i, l) in labels.iter().enumerate() { + if ui.add(egui::Button::selectable(current == Some(i), *l)).clicked() { + chosen = Some(i); + } + } + chosen + }); + if let Some(k) = picked + && let Some((_, v, c)) = options.get(k) + { + d.fields.insert(KEY.into(), v.clone()); + if let Some((n, p)) = c { + d.fields.insert(BEVEL_NAME.into(), json!(n)); + d.fields.insert(BEVEL_PROFILE.into(), p.clone()); + } + } + let default_label = options.iter().find(|(_, v, _)| *v == default).map_or("", |(l, _, _)| l.as_str()); + if reset_dot(ui, KEY, mixed || value != default, default_label) { + d.fields.insert(KEY.into(), default.clone()); + } + }); + if d.bool("__panel") { + let enabled = app.session.bevels.path().is_some(); + if ui.add_enabled(enabled, egui::Button::new(tl!("Edit Bevels…"))).clicked() { + d.fields.insert("__editBevels".into(), json!(true)); + } + } +} + /// Extrude & Bevel's depth, twist, taper, cap and bevel. -fn extrude_controls(ui: &mut egui::Ui, d: &mut Dialog, unit: Unit) { +fn extrude_controls(app: &VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog, unit: Unit) { heading(ui, tl!("Object")); number(ui, d, "depth", tl!("Depth"), (0.0, 2000.0), "", 1, Some(unit)); number(ui, d, "twist", tl!("Twist"), (0.0, 360.0), "°", 1, None); @@ -261,9 +361,7 @@ fn extrude_controls(ui: &mut egui::Ui, d: &mut Dialog, unit: Unit) { choice(ui, d, "cap", c3("Cap"), &[(json!(true), c3("Solid")), (json!(false), c3("Hollow"))]); ui.add_space(10.0); bevel_heading(ui, d); - let shapes: Vec<(Value, &str)> = - super::effect::own_choices(EXTRUDE, "bevel", false).unwrap_or_default().into_iter().map(|(label, value)| (json!(value), label)).collect(); - choice(ui, d, "bevel", tl!("Bevel Shape"), &shapes); + bevel_choice(app, ui, d, EXTRUDE); ui.add_enabled_ui(d.str("bevel") != "none", |ui| { number(ui, d, "bevelWidth", tl!("Width"), (0.0, 1000.0), "", 1, Some(unit)); number(ui, d, "bevelHeight", tl!("Height"), (0.0, 1000.0), "", 1, Some(unit)); diff --git a/crates/ui-egui/src/dialogs/three_d_classic.rs b/crates/ui-egui/src/dialogs/three_d_classic.rs index b3f1ebd3d9..f25251f574 100644 --- a/crates/ui-egui/src/dialogs/three_d_classic.rs +++ b/crates/ui-egui/src/dialogs/three_d_classic.rs @@ -13,15 +13,15 @@ use super::revolve::{c3, choice, heading, label, light_list, light_record, numbe use crate::state::Dialog; use crate::theme::Tokens; -/// Depth and cap, then the bevel: its shape, its height and whether it is added around the shape -/// or carved into it. -pub(super) fn object_controls(ui: &mut egui::Ui, d: &mut Dialog, unit: Unit) { +/// Depth and cap, then the bevel: its shape (a custom one included), its height and whether it is +/// added around the shape or carved into it. +pub(super) fn object_controls(app: &crate::VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog, unit: Unit) { heading(ui, tl!("Object")); number(ui, d, "depth", tl!("Depth"), (0.0, 2000.0), "", 1, Some(unit)); choice(ui, d, "cap", c3("Cap"), &[(json!(true), c3("Solid")), (json!(false), c3("Hollow"))]); ui.add_space(10.0); heading(ui, c3("Bevel")); - choice(ui, d, "bevel", tl!("Bevel Shape"), &options("bevel")); + super::revolve::bevel_choice(app, ui, d, CLASSIC_EXTRUDE); ui.add_enabled_ui(d.str("bevel") != "none", |ui| { number(ui, d, "bevelHeight", tl!("Height"), (1.0, 100.0), "", 1, Some(unit)); toggle(ui, d, "bevelInside", tl!("Bevel Inside"), false); @@ -438,11 +438,6 @@ pub(super) fn surface_controls(ui: &mut egui::Ui, d: &mut Dialog) { } } -/// The values of Extrude & Bevel (Classic)'s `key` as the dropdowns list them, (value, label). -fn options(key: &str) -> Vec<(Value, &'static str)> { - options_of(CLASSIC_EXTRUDE, key) -} - /// The values of classic 3D effect `effect`'s `key` as the dropdowns list them, (value, label). fn options_of(effect: &str, key: &str) -> Vec<(Value, &'static str)> { super::effect::own_choices(effect, key, false).unwrap_or_default().into_iter().map(|(label, value)| (json!(value), label)).collect() diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 42ed1f3972..4e061919a9 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -586,6 +586,7 @@ font-technology Variable Променливи {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Изглед „Колело“ Box View Изглед „Квадрат“ + Show Out-of-Gamut Colors Показване на цветовете извън цветовата гама Box Channel Канал на квадрата Color box Цветови квадрат Color Wheel Options Опции на цветното колело @@ -3141,6 +3142,11 @@ digits Malayalam Малаялам Edit Arrowheads Редактиране на върхове на стрелки Edit Arrowheads… Редактиране на върхове на стрелки… Reload Arrowheads Презареждане на върхове на стрелки + Bevels Фаски + Edit Bevels Редактиране на фаски + Edit Bevels… Редактиране на фаски… + {name} (document) {name} (документ) + Reload Bevels Презареждане на фаски Reset Rotate View Нулиране на изгледа на завъртане Rotate View to Selection Завъртане на изгледа спрямо селекцията Reset the rows to the artwork's colors Нулиране на редовете към цветовете на илюстрацията @@ -3571,6 +3577,7 @@ digits Malayalam Малаялам Recent Commands Последни команди No recent commands Няма последни команди Type to search commands, tools, panels and effects Въведете текст, за да търсите команди, инструменти, панели и ефекти + Clear Recent Commands Изчистване на последните команди Search commands Търсене на команди Search Commands… Търсене на команди… Secondary Вторичен diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 86787e50a2..6377d2ba1a 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -819,6 +819,7 @@ {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Prikaz kotača Box View Prikaz kvadrata + Show Out-of-Gamut Colors Prikaži boje izvan gamuta Box Channel Kanal kvadrata Color box Kvadrat boje Color Wheel Options Opcije kotača boja @@ -4323,6 +4324,11 @@ theme Appearance Izgled Edit Arrowheads Uredi vrhove strelica Edit Arrowheads… Uredi vrhove strelica… Reload Arrowheads Ponovo učitaj vrhove strelica + Bevels Zakošenja + Edit Bevels Uredi zakošenja + Edit Bevels… Uredi zakošenja… + {name} (document) {name} (dokument) + Reload Bevels Ponovo učitaj zakošenja Stroke Options Opcije poteza Width Profiles Profili širine Apply Graphic Style Primijeni grafički stil @@ -4649,6 +4655,7 @@ font-technology Variable Varijabilni Recent Commands Nedavne naredbe No recent commands Nema nedavnih naredbi Type to search commands, tools, panels and effects Upišite za pretragu naredbi, alata, panela i efekata + Clear Recent Commands Očisti nedavne naredbe Dashed Line Isprekidana linija Panel menu Meni panela Unembed… Poništi ugrađivanje… diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 1ed98b321b..323b8f6638 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -887,6 +887,7 @@ arrowhead Target Diana {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Visualització de roda Box View Visualització de quadre + Show Out-of-Gamut Colors Mostra els colors fora de gama Box Channel Canal del quadre Color box Quadre de color Color Wheel Options Opcions de la roda de colors @@ -3984,6 +3985,11 @@ digits Malayalam Malaiàlam Edit Arrowheads Edita les puntes de fletxa Edit Arrowheads… Edita les puntes de fletxa… Reload Arrowheads Torna a carregar les puntes de fletxa + Bevels Bisells + Edit Bevels Edita els bisells + Edit Bevels… Edita els bisells… + {name} (document) {name} (document) + Reload Bevels Torna a carregar els bisells Reset Rotate View Restableix la rotació de la vista Reset Ruler Origin Restableix l’origen de les regles Reset the rows to the artwork's colors Restableix les files als colors de l’obra @@ -4786,6 +4792,7 @@ digits Malayalam Malaiàlam Recent Commands Ordres recents No recent commands No hi ha ordres recents Type to search commands, tools, panels and effects Escriviu per cercar ordres, eines, panells i efectes + Clear Recent Commands Esborra les ordres recents Search commands Cerca ordres Search Commands… Cerca ordres… Search Fonts Folder Cerca a la carpeta de tipus de lletra @@ -7262,7 +7269,10 @@ liquify-list-end {0}, {1} {0} i {1} @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) l’objecte no té cap efecte 3D (Extrudeix i bisella, Revoluciona, Infla o Gira) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` ha de ser un objecte que només contingui `mode`, amb el valor shaded o wireframe @msg its 3D effect builds no solid el seu efecte 3D no construeix cap sòlid -@msg bevel must be none or one of {_1} bevel ha de ser none o un de {_1} +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel ha de ser none, un de {_1}, o custom amb {BEVEL_PROFILE} +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom necessita {BEVEL_PROFILE}, els punts del bisell +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} ha de ser una cadena +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} ha de tenir de 2 a {most} punts [x, y], cada proporció entre 0 i 1, des de [0, 0] (la vora de la tapa) fins a [1, 1] (la paret lateral) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} no pot construir sòlids a partir d’aquesta il·lustració: les seves instàncies de símbol, fusions i grups de retall contenen massa objectes @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} no pot construir un sòlid a partir de la instància del símbol «{symbol}»: la il·lustració del símbol no està disponible @msg {_1}: the clipping path is too complex to cut the art with {_1}: el traçat de retall és massa complex per retallar-hi la il·lustració diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index d421df2ee3..abf34f7517 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -831,6 +831,7 @@ {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Zobrazení kola Box View Zobrazení čtverce + Show Out-of-Gamut Colors Zobrazit barvy mimo gamut Box Channel Kanál čtverce Color box Barevný čtverec Color Wheel Options Možnosti barevného kola @@ -4432,6 +4433,11 @@ theme Appearance Motiv Edit Arrowheads Upravit šipky Edit Arrowheads… Upravit šipky… Reload Arrowheads Znovu načíst šipky + Bevels Zkosení + Edit Bevels Upravit zkosení + Edit Bevels… Upravit zkosení… + {name} (document) {name} (dokument) + Reload Bevels Znovu načíst zkosení Stroke Options Možnosti tahu Width Profiles Profily šířky Apply Graphic Style Použít grafický styl @@ -4758,6 +4764,7 @@ font-technology Variable Variabilní Recent Commands Nedávné příkazy No recent commands Žádné nedávné příkazy Type to search commands, tools, panels and effects Pište pro hledání příkazů, nástrojů, panelů a efektů + Clear Recent Commands Vymazat seznam nedávných příkazů Dashed Line Čárkovaná čára Panel menu Nabídka panelu Unembed… Zrušit vložení… @@ -6852,7 +6859,10 @@ mark-style Japanese Japonské @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) objekt nemá žádný 3D efekt (Vysunutí a zkosení, Rotační těleso, Nafouknutí ani Otočit) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` musí být objekt obsahující pouze `mode` s hodnotou shaded nebo wireframe @msg its 3D effect builds no solid jeho 3D efekt nevytváří žádné těleso -@msg bevel must be none or one of {_1} bevel musí být none nebo jedno z {_1} +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel musí být none, jedno z {_1} nebo custom s {BEVEL_PROFILE} +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom vyžaduje {BEVEL_PROFILE}, body zkosení +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} musí být řetězec +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} musí mít 2 až {most} bodů [x, y], každý podíl mezi 0 a 1, od [0, 0] (hrana čelní plochy) do [1, 1] (boční stěna) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} nemůže z této kresby vytvořit tělesa: její instance symbolů, prolnutí a ořezové skupiny obsahují příliš mnoho objektů @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} nemůže vytvořit těleso z instance symbolu „{symbol}“: kresba symbolu není k dispozici @msg {_1}: the clipping path is too complex to cut the art with {_1}: ořezová cesta je příliš složitá na oříznutí kresby diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 67d9904e84..b679e704b7 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -432,7 +432,10 @@ liquify-list-end {0}, {1} {0} og {1} @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) objektet har ingen 3D-effekt (Ekstrudér og facet, Omdrej, Pust op eller Rotér) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` skal være et objekt, der kun indeholder `mode` med værdien shaded eller wireframe @msg its 3D effect builds no solid dens 3D-effekt danner intet legeme -@msg bevel must be none or one of {_1} bevel skal være none eller en af {_1} +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel skal være none, en af {_1} eller custom med {BEVEL_PROFILE} +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom kræver {BEVEL_PROFILE}, facettens punkter +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} skal være en streng +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} skal være 2 til {most} punkter [x, y], hver andel mellem 0 og 1, fra [0, 0] (dækfladens kant) til [1, 1] (sidevæggen) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} kan ikke danne legemer af denne grafik: dens symbolforekomster, blandinger og beskæringsgrupper indeholder for mange objekter @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} kan ikke danne et legeme af forekomsten af symbolet "{symbol}": symbolets grafik er ikke tilgængelig @msg {_1}: the clipping path is too complex to cut the art with {_1}: beskæringskurven er for kompleks til at skære grafikken med @@ -3528,6 +3531,7 @@ liquify-list-end {0}, {1} {0} og {1} {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Hjulvisning Box View Kvadratvisning + Show Out-of-Gamut Colors Vis farver uden for gamut Box Channel Kvadratets kanal Color box Farvekvadrat Color Wheel Options Indstillinger for farvehjul @@ -6886,6 +6890,11 @@ theme Appearance Udseende Edit Arrowheads Redigér pilespidser Edit Arrowheads… Redigér pilespidser… Reload Arrowheads Genindlæs pilespidser + Bevels Facetter + Edit Bevels Redigér facetter + Edit Bevels… Redigér facetter… + {name} (document) {name} (dokument) + Reload Bevels Genindlæs facetter Stroke Options Konturindstillinger Width Profiles Breddeprofiler Apply Graphic Style Anvend grafikstil @@ -7201,6 +7210,7 @@ font-technology Variable Variable Recent Commands Seneste kommandoer No recent commands Ingen seneste kommandoer Type to search commands, tools, panels and effects Skriv for at søge i kommandoer, værktøjer, paneler og effekter + Clear Recent Commands Ryd seneste kommandoer Dashed Line Stiplet linje Panel menu Panelmenu Unembed… Ophæv integrering… diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 8b96d0744d..a1506cc95e 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -590,6 +590,7 @@ font-technology Variable Variabel {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Kreisansicht Box View Quadratansicht + Show Out-of-Gamut Colors Farben außerhalb des Farbumfangs einblenden Box Channel Kanal des Quadrats Color box Farbquadrat Color Wheel Options Optionen für den Farbkreis @@ -3209,6 +3210,11 @@ digits Malayalam Malayalam Edit Arrowheads Pfeilspitzen bearbeiten Edit Arrowheads… Pfeilspitzen bearbeiten… Reload Arrowheads Pfeilspitzen neu laden + Bevels Abgeflachte Kanten + Edit Bevels Abgeflachte Kanten bearbeiten + Edit Bevels… Abgeflachte Kanten bearbeiten… + {name} (document) {name} (Dokument) + Reload Bevels Abgeflachte Kanten neu laden Rotate View Ansicht drehen Reset Rotate View Ansichtsdrehung zurücksetzen Rotate View to Selection Ansicht nach Auswahl drehen @@ -3656,6 +3662,7 @@ digits Malayalam Malayalam Recent Commands Zuletzt verwendete Befehle No recent commands Keine zuletzt verwendeten Befehle Type to search commands, tools, panels and effects Tippen, um Befehle, Werkzeuge, Bedienfelder und Effekte zu suchen + Clear Recent Commands Liste der zuletzt verwendeten Befehle leeren Search commands Befehle suchen Search Commands… Befehle suchen… Secondary Sekundär @@ -6418,7 +6425,10 @@ lighting Light Licht @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) das Objekt hat keinen 3D-Effekt (Extrudieren und abgeflachte Kante, Kreiseln, Aufblasen oder Drehen) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` muss ein Objekt sein, das nur `mode` mit dem Wert shaded oder wireframe enthält @msg its 3D effect builds no solid sein 3D-Effekt erzeugt keinen Körper -@msg bevel must be none or one of {_1} bevel muss none oder einer der folgenden Werte sein: {_1} +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel muss none, einer der Werte {_1} oder custom mit {BEVEL_PROFILE} sein +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom benötigt {BEVEL_PROFILE}, die Punkte der abgeflachten Kante +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} muss eine Zeichenfolge sein +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} muss 2 bis {most} Punkte [x, y] enthalten, jeder Anteil zwischen 0 und 1, von [0, 0] (Kante der Deckfläche) bis [1, 1] (Seitenwand) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} kann aus diesem Bildmaterial keine Körper erstellen: Seine Symbolinstanzen, Angleichungen und Schnittgruppen enthalten zu viele Objekte @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} kann keinen Körper aus der Instanz des Symbols „{symbol}“ erstellen: Das Bildmaterial des Symbols ist nicht verfügbar @msg {_1}: the clipping path is too complex to cut the art with {_1}: Der Schnittpfad ist zu komplex, um das Bildmaterial damit zu beschneiden diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index ede78d2f99..833d7edf6a 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -565,6 +565,7 @@ font-technology Variable Μεταβλητές {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Προβολή τροχού Box View Προβολή τετραγώνου + Show Out-of-Gamut Colors Εμφάνιση χρωμάτων εκτός χρωματικής γκάμας Box Channel Κανάλι τετραγώνου Color box Τετράγωνο χρώματος Color Wheel Options Επιλογές χρωματικού τροχού @@ -4067,6 +4068,11 @@ digits Malayalam Μαλαγιάλαμ Edit Arrowheads Επεξεργασία αιχμών βελών Edit Arrowheads… Επεξεργασία αιχμών βελών… Reload Arrowheads Επαναφόρτωση αιχμών βελών + Bevels Λοξοτμήσεις + Edit Bevels Επεξεργασία λοξοτμήσεων + Edit Bevels… Επεξεργασία λοξοτμήσεων… + {name} (document) {name} (έγγραφο) + Reload Bevels Επαναφόρτωση λοξοτμήσεων Reset Rotate View Επαναφορά περιστροφής προβολής Rotate View to Selection Περιστροφή προβολής ως προς την επιλογή Reset the rows to the artwork's colors Επαναφορά γραμμών στα χρώματα του σχεδίου @@ -4392,6 +4398,7 @@ digits Malayalam Μαλαγιάλαμ Recent Commands Πρόσφατες εντολές No recent commands Δεν υπάρχουν πρόσφατες εντολές Type to search commands, tools, panels and effects Πληκτρολογήστε για αναζήτηση εντολών, εργαλείων, πλαισίων και εφέ + Clear Recent Commands Εκκαθάριση πρόσφατων εντολών Search commands Αναζήτηση εντολών Search Commands… Αναζήτηση εντολών… Secondary Δευτερεύον @@ -6235,7 +6242,10 @@ variable-list-end {0}, {1} {0} και {1} @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) το αντικείμενο δεν έχει εφέ 3D (Εξώθηση και λοξότμηση, Περιστροφή γύρω από άξονα, Φούσκωμα ή Περιστροφή) @msg `render` must be an object holding only `mode`, set to shaded or wireframe το `render` πρέπει να είναι αντικείμενο που περιέχει μόνο `mode`, με τιμή shaded ή wireframe @msg its 3D effect builds no solid το εφέ 3D του δεν δημιουργεί στερεό -@msg bevel must be none or one of {_1} το bevel πρέπει να είναι none ή ένα από τα {_1} +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} το bevel πρέπει να είναι none, ένα από τα {_1} ή custom με {BEVEL_PROFILE} +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points το bevel custom χρειάζεται το {BEVEL_PROFILE}, τα σημεία της λοξότμησης +@msg {BEVEL_NAME} must be a string το {BEVEL_NAME} πρέπει να είναι συμβολοσειρά +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) το {BEVEL_PROFILE} πρέπει να έχει 2 έως {most} σημεία [x, y], κάθε αναλογία μεταξύ 0 και 1, από [0, 0] (η ακμή της ακραίας όψης) έως [1, 1] (το πλευρικό τοίχωμα) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1}: δεν μπορούν να δημιουργηθούν στερεά από αυτό το σχέδιο· οι παρουσίες συμβόλων, οι αναμείξεις και οι ομάδες αποκοπής του περιέχουν πάρα πολλά αντικείμενα @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label}: δεν μπορεί να δημιουργηθεί στερεό από την παρουσία του συμβόλου «{symbol}»· το σχέδιο του συμβόλου δεν είναι διαθέσιμο @msg {_1}: the clipping path is too complex to cut the art with {_1}: η διαδρομή αποκοπής είναι πολύ σύνθετη για να κόψει το σχέδιο diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 3b65dc93e6..2877211c1a 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -610,6 +610,7 @@ font-technology Variable Variables {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Vista de rueda Box View Vista de cuadro + Show Out-of-Gamut Colors Mostrar colores fuera de gama Box Channel Canal del cuadro Color box Cuadro de color Color Wheel Options Opciones de la rueda de color @@ -3247,6 +3248,11 @@ digits Malayalam Malayálam Edit Arrowheads Editar puntas de flecha Edit Arrowheads… Editar puntas de flecha… Reload Arrowheads Volver a cargar puntas de flecha + Bevels Biseles + Edit Bevels Editar biseles + Edit Bevels… Editar biseles… + {name} (document) {name} (documento) + Reload Bevels Volver a cargar biseles Reset Rotate View Restablecer rotación de vista Rotate View to Selection Rotar vista según la selección Reset the rows to the artwork's colors Restablecer las filas a los colores de la ilustración @@ -3689,6 +3695,7 @@ digits Malayalam Malayálam Recent Commands Comandos recientes No recent commands No hay comandos recientes Type to search commands, tools, panels and effects Escriba para buscar comandos, herramientas, paneles y efectos + Clear Recent Commands Borrar comandos recientes Search commands Buscar comandos Search Commands… Buscar comandos… Secondary Secundario @@ -6825,7 +6832,10 @@ mark-style Japanese Japonesas @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) el objeto no tiene ningún efecto 3D (Extrusión y biselado, Revolución, Inflar o Rotar) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` debe ser un objeto que solo contenga `mode`, con el valor shaded o wireframe @msg its 3D effect builds no solid su efecto 3D no construye ningún sólido -@msg bevel must be none or one of {_1} bevel debe ser none o uno de estos: {_1} +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel debe ser none, uno de estos: {_1}, o custom con {BEVEL_PROFILE} +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom necesita {BEVEL_PROFILE}, los puntos del bisel +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} debe ser una cadena +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} debe tener de 2 a {most} puntos [x, y], cada proporción entre 0 y 1, desde [0, 0] (el borde de la tapa) hasta [1, 1] (la pared lateral) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} no puede construir sólidos a partir de esta ilustración: sus instancias de símbolo, fusiones y grupos de recorte contienen demasiados objetos @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} no puede construir un sólido a partir de la instancia del símbolo «{symbol}»: la ilustración del símbolo no está disponible @msg {_1}: the clipping path is too complex to cut the art with {_1}: el trazado de recorte es demasiado complejo para recortar la ilustración diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index e30f74a924..8bc5b257d0 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -817,6 +817,7 @@ {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Ympyränäkymä Box View Ruutunäkymä + Show Out-of-Gamut Colors Näytä väriavaruuden ulkopuoliset värit Box Channel Ruudun kanava Color box Väriruutu Color Wheel Options Väriympyrän asetukset @@ -4349,6 +4350,11 @@ theme Appearance Ulkoasu Edit Arrowheads Muokkaa nuolenkärkiä Edit Arrowheads… Muokkaa nuolenkärkiä… Reload Arrowheads Lataa nuolenkärjet uudelleen + Bevels Viisteet + Edit Bevels Muokkaa viisteitä + Edit Bevels… Muokkaa viisteitä… + {name} (document) {name} (asiakirja) + Reload Bevels Lataa viisteet uudelleen Stroke Options Viivan asetukset Width Profiles Leveysprofiilit Apply Graphic Style Käytä grafiikkatyyliä @@ -4668,6 +4674,7 @@ font-technology Variable Muuttuvat Recent Commands Viimeisimmät komennot No recent commands Ei viimeisimpiä komentoja Type to search commands, tools, panels and effects Kirjoita hakeaksesi komentoja, työkaluja, paneeleita ja tehosteita + Clear Recent Commands Tyhjennä viimeisimmät komennot Dashed Line Katkoviiva Panel menu Paneelivalikko Unembed… Poista upotus… @@ -6753,7 +6760,10 @@ mark-style Japanese Japanilainen @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) objektilla ei ole 3D-tehostetta (Pursota ja viistä, Pyöräytä, Täytä ilmalla tai Kierrä) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` on oltava objekti, jossa on vain `mode` arvolla shaded tai wireframe @msg its 3D effect builds no solid sen 3D-tehoste ei muodosta kappaletta -@msg bevel must be none or one of {_1} bevel-arvon on oltava none tai jokin seuraavista: {_1} +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel-arvon on oltava none, jokin seuraavista: {_1}, tai custom yhdessä arvon {BEVEL_PROFILE} kanssa +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom tarvitsee arvon {BEVEL_PROFILE}, viisteen pisteet +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} on oltava merkkijono +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) arvossa {BEVEL_PROFILE} on oltava vähintään 2 ja enintään {most} pistettä [x, y], kukin osuus väliltä 0 ja 1, pisteestä [0, 0] (päätypinnan reuna) pisteeseen [1, 1] (sivuseinä) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} ei voi muodostaa kappaleita tästä kuvituksesta: sen symbolien esiintymät, sulautukset ja leikkausryhmät sisältävät liikaa objekteja @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} ei voi muodostaa kappaletta symbolin ”{symbol}” esiintymästä: symbolin kuvitus ei ole käytettävissä @msg {_1}: the clipping path is too complex to cut the art with {_1}: leikkauspolku on liian monimutkainen kuvituksen leikkaamiseen diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 58b9bece25..5a184597a3 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -611,6 +611,7 @@ font-technology Variable Variables {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Affichage roue Box View Affichage carré + Show Out-of-Gamut Colors Afficher les couleurs hors gamme Box Channel Couche du carré Color box Carré de couleur Color Wheel Options Options de la roue chromatique @@ -3235,6 +3236,11 @@ digits Malayalam Malayalam Edit Arrowheads Modifier les pointes de flèche Edit Arrowheads… Modifier les pointes de flèche… Reload Arrowheads Recharger les pointes de flèche + Bevels Biseaux + Edit Bevels Modifier les biseaux + Edit Bevels… Modifier les biseaux… + {name} (document) {name} (document) + Reload Bevels Recharger les biseaux Reset Rotate View Réinitialiser la rotation de l’affichage Rotate View to Selection Faire pivoter l’affichage selon la sélection Reset the rows to the artwork's colors Réinitialiser les lignes avec les couleurs de l’illustration @@ -3677,6 +3683,7 @@ digits Malayalam Malayalam Recent Commands Commandes récentes No recent commands Aucune commande récente Type to search commands, tools, panels and effects Tapez pour rechercher des commandes, des outils, des panneaux et des effets + Clear Recent Commands Effacer les commandes récentes Search commands Chercher des commandes Search Commands… Rechercher des commandes… Secondary Secondaire @@ -6417,7 +6424,10 @@ lighting Light Lumière @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) l’objet n’a aucun effet 3D (Extrusion et biseautage, Révolution, Gonfler ou Rotation) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` doit être un objet ne contenant que `mode`, avec la valeur shaded ou wireframe @msg its 3D effect builds no solid son effet 3D ne construit aucun volume -@msg bevel must be none or one of {_1} bevel doit valoir none ou l’une de ces valeurs : {_1} +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel doit valoir none, l’une des valeurs {_1}, ou custom avec {BEVEL_PROFILE} +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom nécessite {BEVEL_PROFILE}, les points du biseau +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} doit être une chaîne +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} doit contenir de 2 à {most} points [x, y], chaque proportion entre 0 et 1, de [0, 0] (le bord de la face) à [1, 1] (la paroi latérale) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} ne peut pas construire de volumes à partir de cette illustration : ses occurrences de symbole, dégradés de formes et groupes de découpe contiennent trop d’objets @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} ne peut pas construire de volume à partir de l’occurrence du symbole « {symbol} » : l’illustration du symbole n’est pas disponible @msg {_1}: the clipping path is too complex to cut the art with {_1} : le tracé de découpe est trop complexe pour découper l’illustration diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index b1d375789d..33d52397f5 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -3798,6 +3798,7 @@ arrowhead Feather પીંછું No recent commands કોઈ તાજેતરના આદેશો નથી Type to search commands, tools, panels and effects આદેશો, ટૂલ્સ, પેનલ્સ અને ઇફેક્ટ્સ શોધવા માટે લખો Recent તાજેતરના + Clear Recent Commands તાજેતરના આદેશો સાફ કરો Search commands આદેશો શોધો Search images છબીઓ શોધો Searching… શોધી રહ્યા છીએ… @@ -4815,6 +4816,7 @@ arrowhead Feather પીંછું {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View વ્હીલ વ્યૂ Box View બૉક્સ વ્યૂ + Show Out-of-Gamut Colors ગેમટ બહારના રંગો બતાવો Box Channel બૉક્સ ચેનલ Color box રંગ બૉક્સ Color Wheel Options રંગ વ્હીલ વિકલ્પો diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index bd75d6dbd9..6eeec8d99c 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -1273,6 +1273,7 @@ arrowhead Feather पंख {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View व्हील व्यू Box View बॉक्स व्यू + Show Out-of-Gamut Colors गैमट से बाहर के रंग दिखाएँ Box Channel बॉक्स चैनल Color box कलर बॉक्स Color Wheel Options कलर व्हील ऑप्शन्स @@ -4610,6 +4611,11 @@ arrowhead Feather पंख Edit Arrowheads एरोहेड्स संपादित करें Edit Arrowheads… एरोहेड्स संपादित करें… Reload Arrowheads एरोहेड्स फिर से लोड करें + Bevels बेवल्स + Edit Bevels बेवल्स संपादित करें + Edit Bevels… बेवल्स संपादित करें… + {name} (document) {name} (दस्तावेज़) + Reload Bevels बेवल्स फिर से लोड करें Reset Rotate View व्यू घुमाएँ रीसेट करें Reset Ruler Origin रूलर ओरिजिन रीसेट करें Reset Symbol Instance सिंबल इंस्टेंस रीसेट करें @@ -5141,6 +5147,7 @@ arrowhead Feather पंख Recent Commands हाल के आदेश No recent commands कोई हाल का आदेश नहीं Type to search commands, tools, panels and effects आदेश, टूल, पैनल्स और इफ़ेक्ट्स खोजने के लिए टाइप करें + Clear Recent Commands हाल के आदेश साफ़ करें Search commands आदेश खोजें Search Commands… कमांड खोजें… Search Fonts Folder खोज फ़ॉन्ट फ़ोल्डर @@ -9167,7 +9174,10 @@ liquify-list-end {0}, {1} {0} और {1} @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) ऑब्जेक्ट पर कोई 3D इफ़ेक्ट नहीं है (एक्सट्रूडेड और बेवेल, रिवॉल्व, फुलाएँ या घुमाव) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` केवल `mode` वाला ऑब्जेक्ट होना चाहिए, जिसका मान shaded या wireframe हो @msg its 3D effect builds no solid इसका 3D इफ़ेक्ट कोई ठोस नहीं बनाता -@msg bevel must be none or one of {_1} bevel को none या {_1} में से एक होना चाहिए +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel को none, {_1} में से एक, या {BEVEL_PROFILE} के साथ custom होना चाहिए +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom के लिए {BEVEL_PROFILE} चाहिए, यानी बेवल के बिंदु +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} एक स्ट्रिंग होना चाहिए +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} में 2 से {most} [x, y] बिंदु होने चाहिए, हर हिस्सा 0 और 1 के बीच, [0, 0] (सिरे की सतह का किनारा) से [1, 1] (बगल की दीवार) तक @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} इस आर्ट से ठोस नहीं बना सकता: इसके सिंबल इंस्टेंस, ब्लेंड और क्लिपिंग ग्रुप में बहुत अधिक ऑब्जेक्ट हैं @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} सिंबल "{symbol}" के इंस्टेंस से ठोस नहीं बना सकता: सिंबल का आर्ट उपलब्ध नहीं है @msg {_1}: the clipping path is too complex to cut the art with {_1}: क्लिपिंग पाथ आर्ट को काटने के लिए बहुत जटिल है diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 32b47d6928..3ad8bb09ef 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -814,6 +814,7 @@ arrowhead Target Céltábla {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Körnézet Box View Négyzetnézet + Show Out-of-Gamut Colors Színtartományon kívüli színek megjelenítése Box Channel Négyzet csatornája Color box Színnégyzet Color Wheel Options Színkör beállításai @@ -3823,6 +3824,11 @@ mark-style Japanese Japán Edit Arrowheads Nyílhegyek szerkesztése Edit Arrowheads… Nyílhegyek szerkesztése… Reload Arrowheads Nyílhegyek újratöltése + Bevels Élletörések + Edit Bevels Élletörések szerkesztése + Edit Bevels… Élletörések szerkesztése… + {name} (document) {name} (dokumentum) + Reload Bevels Élletörések újratöltése Reset Rotate View Nézetforgatás visszaállítása Rotate View to Selection Nézet elforgatása a kijelöléshez Reset the rows to the artwork's colors Sorok visszaállítása a grafika színeire @@ -4323,6 +4329,7 @@ mark-style Japanese Japán Recent Commands Legutóbbi parancsok No recent commands Nincsenek legutóbbi parancsok Type to search commands, tools, panels and effects Gépeljen parancsok, eszközök, panelek és effektusok kereséséhez + Clear Recent Commands Legutóbbi parancsok listájának törlése Search commands Parancsok keresése Search Commands… Parancsok keresése… Search Fonts Folder Keresés betűtípusmappában @@ -6837,7 +6844,10 @@ variable-list-end {0}, {1} {0} és {1} @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) az objektumnak nincs 3D effektusa (Kihúzás és élletörés, Forgatás tengely körül, Felfújás vagy Elforgatás) @msg `render` must be an object holding only `mode`, set to shaded or wireframe a `render` csak `mode` mezőt tartalmazó objektum lehet, shaded vagy wireframe értékkel @msg its 3D effect builds no solid a 3D effektusa nem hoz létre testet -@msg bevel must be none or one of {_1} a bevel értéke none vagy ezek egyike lehet: {_1} +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} a bevel értéke none, ezek egyike: {_1}, vagy custom lehet {BEVEL_PROFILE} megadásával +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points a bevel custom értékéhez {BEVEL_PROFILE} kell, az élletörés pontjai +@msg {BEVEL_NAME} must be a string {BEVEL_NAME}: karakterlánc kell +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE}: legalább 2 és legfeljebb {most} [x, y] pont kell, minden arány 0 és 1 között, [0, 0]-tól (a fedőlap éle) [1, 1]-ig (az oldalfal) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1}: ebből a rajzból nem hozható létre test: a szimbólumpéldányai, összemosásai és vágócsoportjai túl sok objektumot tartalmaznak @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label}: nem hozható létre test a(z) „{symbol}” szimbólum példányából: a szimbólum rajza nem érhető el @msg {_1}: the clipping path is too complex to cut the art with {_1}: a vágóútvonal túl összetett a rajz kivágásához diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index e714005ced..85ef6beb39 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -314,7 +314,10 @@ @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) objek tidak memiliki efek 3D (Ekstrusi & bevel, Revolusi, Gelembungkan, atau Putar) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` harus berupa objek yang hanya berisi `mode`, bernilai shaded atau wireframe @msg its 3D effect builds no solid efek 3D-nya tidak membangun bentuk padat -@msg bevel must be none or one of {_1} bevel harus none atau salah satu dari {_1} +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel harus none, salah satu dari {_1}, atau custom dengan {BEVEL_PROFILE} +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom memerlukan {BEVEL_PROFILE}, yaitu titik-titik bevel +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} harus berupa string +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} harus berisi 2 sampai {most} titik [x, y], masing-masing bernilai antara 0 dan 1, dari [0, 0] (tepi tutup) hingga [1, 1] (dinding samping) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} tidak dapat membangun bentuk padat dari karya ini: instans simbol, blend, dan grup klipingnya berisi terlalu banyak objek @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} tidak dapat membangun bentuk padat dari instans simbol "{symbol}": karya simbol tidak tersedia @msg {_1}: the clipping path is too complex to cut the art with {_1}: jalur kliping terlalu rumit untuk memotong karya @@ -1405,6 +1408,7 @@ {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Tampilan roda Box View Tampilan kotak + Show Out-of-Gamut Colors Tampilkan warna di luar gamut Box Channel Saluran kotak Color box Kotak warna Color Wheel Options Opsi roda warna @@ -4752,6 +4756,11 @@ theme Appearance Tampilan Edit Arrowheads Edit mata panah Edit Arrowheads… Edit mata panah… Reload Arrowheads Muat ulang mata panah + Bevels Bentuk bevel + Edit Bevels Edit bentuk bevel + Edit Bevels… Edit bentuk bevel… + {name} (document) {name} (dokumen) + Reload Bevels Muat ulang bentuk bevel Stroke Options Opsi goresan Width Profiles Profil lebar Apply Graphic Style Terapkan gaya grafis @@ -5067,6 +5076,7 @@ font-technology Variable Variabel Recent Commands Perintah terbaru No recent commands Tidak ada perintah terbaru Type to search commands, tools, panels and effects Ketik untuk mencari perintah, alat, panel, dan efek + Clear Recent Commands Kosongkan perintah terbaru Dashed Line Garis putus-putus Panel menu Menu panel Unembed… Lepaskan sematan… diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index c6d33bd420..d900c1cada 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -612,6 +612,7 @@ font-technology Variable Variabili {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Vista ruota Box View Vista riquadro + Show Out-of-Gamut Colors Mostra colori fuori gamma Box Channel Canale del riquadro Color box Riquadro colore Color Wheel Options Opzioni ruota dei colori @@ -3294,6 +3295,11 @@ digits Malayalam Malayalam Edit Arrowheads Modifica punte di freccia Edit Arrowheads… Modifica punte di freccia… Reload Arrowheads Ricarica punte di freccia + Bevels Smussi + Edit Bevels Modifica smussi + Edit Bevels… Modifica smussi… + {name} (document) {name} (documento) + Reload Bevels Ricarica smussi Rotate View Ruota vista Reset Rotate View Reimposta rotazione vista Rotate View to Selection Ruota vista in base alla selezione @@ -3741,6 +3747,7 @@ digits Malayalam Malayalam Recent Commands Comandi recenti No recent commands Nessun comando recente Type to search commands, tools, panels and effects Digita per cercare comandi, strumenti, pannelli ed effetti + Clear Recent Commands Cancella comandi recenti Search commands Cerca comandi Search Commands… Cerca comandi… Secondary Secondario @@ -6465,7 +6472,10 @@ lighting Light Luce @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) l'oggetto non ha alcun effetto 3D (Estrusione e smusso, Rivoluzione, Gonfia o Ruota) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` deve essere un oggetto che contiene solo `mode`, con valore shaded o wireframe @msg its 3D effect builds no solid il suo effetto 3D non costruisce alcun solido -@msg bevel must be none or one of {_1} bevel deve essere none o uno dei seguenti: {_1} +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel deve essere none, uno dei seguenti: {_1}, oppure custom con {BEVEL_PROFILE} +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom richiede {BEVEL_PROFILE}, i punti dello smusso +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} deve essere una stringa +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} deve contenere da 2 a {most} punti [x, y], ogni proporzione tra 0 e 1, da [0, 0] (il bordo della faccia) a [1, 1] (la parete laterale) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} non può costruire solidi da questo disegno: le sue istanze di simbolo, fusioni e gruppi di ritaglio contengono troppi oggetti @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} non può costruire un solido dall'istanza del simbolo «{symbol}»: il disegno del simbolo non è disponibile @msg {_1}: the clipping path is too complex to cut the art with {_1}: il tracciato di ritaglio è troppo complesso per ritagliare il disegno diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 94e97ff884..824dca728a 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -868,6 +868,7 @@ digits Malayalam マラヤーラム数字 {name1} {value1}, {name2} {value2} {name1} {value1}、{name2} {value2} Wheel View ホイール表示 Box View ボックス表示 + Show Out-of-Gamut Colors 色域外のカラーを表示 Box Channel ボックスのチャンネル Color box カラーボックス Color Wheel Options カラーホイールオプション @@ -3269,6 +3270,11 @@ mark-style Japanese 日本式 Edit Arrowheads 矢印を編集 Edit Arrowheads… 矢印を編集… Reload Arrowheads 矢印を再読み込み + Bevels ベベル一覧 + Edit Bevels ベベルを編集 + Edit Bevels… ベベルを編集… + {name} (document) {name} (ドキュメント) + Reload Bevels ベベルを再読み込み Reset the rows to the artwork's colors 行をアートワークのカラーにリセット Color Theme Picker カラーテーマピッカー Undo Changes 変更を取り消し @@ -3608,6 +3614,7 @@ mark-style Japanese 日本式 Recent Commands 最近使ったコマンド No recent commands 最近使ったコマンドはありません Type to search commands, tools, panels and effects 入力してコマンド、ツール、パネル、効果を検索 + Clear Recent Commands 最近使ったコマンドを消去 Search commands コマンドを検索 Secondary セカンダリ Select All Art on Layer レイヤー上のすべてのアートを選択 @@ -6514,7 +6521,10 @@ lighting Light ライト @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) オブジェクトに 3D 効果 (押し出しとベベル、回転体、膨張、回転) がありません @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` は `mode` だけを持ち、その値が shaded または wireframe のオブジェクトにしてください @msg its 3D effect builds no solid 3D 効果からソリッドが作成されません -@msg bevel must be none or one of {_1} bevel には none または {_1} のいずれかを指定してください +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel には none、{_1} のいずれか、または {BEVEL_PROFILE} を付けた custom を指定してください +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom にはベベルのポイントを表す {BEVEL_PROFILE} が必要です +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} は文字列にしてください +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} には 2 個から {most} 個の [x, y] ポイントを、各値を 0 から 1 までの割合として、[0, 0] (端面の縁) から [1, 1] (側面の壁) まで指定してください @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} はこのアートからソリッドを作成できません。シンボルインスタンス、ブレンド、クリッピンググループに含まれるオブジェクトが多すぎます @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} はシンボル「{symbol}」のインスタンスからソリッドを作成できません。シンボルのアートを使用できません @msg {_1}: the clipping path is too complex to cut the art with {_1}: クリッピングパスが複雑すぎるため、アートを切り抜けません diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 554965c203..d2d4e56e24 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -2941,6 +2941,7 @@ {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View წრის ხედი Box View კვადრატის ხედი + Show Out-of-Gamut Colors ფერთა გამის გარეთ მყოფი ფერების ჩვენება Box Channel კვადრატის არხი Color box ფერის კვადრატი Color Wheel Options ფერთა წრის პარამეტრები @@ -6169,6 +6170,11 @@ theme Appearance იერსახე Edit Arrowheads ისრის წვერების რედაქტირება Edit Arrowheads… ისრის წვერების რედაქტირება… Reload Arrowheads ისრის წვერების ხელახლა ჩატვირთვა + Bevels წაკვეთები + Edit Bevels წაკვეთების რედაქტირება + Edit Bevels… წაკვეთების რედაქტირება… + {name} (document) {name} (დოკუმენტი) + Reload Bevels წაკვეთების ხელახლა ჩატვირთვა Stroke Options კონტურის პარამეტრები Width Profiles სიგანის პროფილები Apply Graphic Style გრაფიკული სტილის გამოყენება @@ -6459,6 +6465,7 @@ font-technology Variable ცვლადი Recent Commands ბოლოდროინდელი ბრძანებები No recent commands ბოლოდროინდელი ბრძანებები არ არის Type to search commands, tools, panels and effects აკრიფეთ ბრძანებების, ხელსაწყოების, პანელებისა და ეფექტების მოსაძებნად + Clear Recent Commands ბოლო ბრძანებების სიის გასუფთავება Dashed Line ტირეებიანი ხაზი Panel menu პანელის მენიუ Unembed… ჩაშენების მოხსნა… @@ -8175,7 +8182,10 @@ arrowhead Feather ბუმბული @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) ობიექტს არ აქვს 3D ეფექტი (ამოწევა და წაკვეთა, ბრუნვა, გაბერვა ან შემობრუნება) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` უნდა იყოს ობიექტი, რომელიც შეიცავს მხოლოდ `mode`-ს, მნიშვნელობით shaded ან wireframe @msg its 3D effect builds no solid მისი 3D ეფექტი სხეულს არ ქმნის -@msg bevel must be none or one of {_1} bevel უნდა იყოს none ან ერთ-ერთი: {_1} +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel უნდა იყოს none, ერთ-ერთი: {_1}, ან custom და {BEVEL_PROFILE} +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom მოითხოვს {BEVEL_PROFILE}, წაკვეთის წერტილები +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} უნდა იყოს სტრიქონი +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} უნდა შეიცავდეს 2-დან {most}-მდე [x, y] წერტილს, თითოეული წილი 0-სა და 1-ს შორის, [0, 0]-დან (ბოლო წახნაგის კიდე) [1, 1]-მდე (გვერდითი კედელი) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1}: ამ ნახატიდან სხეულების შექმნა შეუძლებელია: მისი სიმბოლოს ეგზემპლარები, გადასვლები და მომჭრელი ჯგუფები ზედმეტად ბევრ ობიექტს შეიცავს @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label}: სიმბოლოს „{symbol}“ ეგზემპლარიდან სხეულის შექმნა შეუძლებელია: სიმბოლოს ნახატი მიუწვდომელია @msg {_1}: the clipping path is too complex to cut the art with {_1}: მომჭრელი ტრაექტორია ზედმეტად რთულია ნახატის მოსაჭრელად diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index f987f89d50..4a59572606 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -861,6 +861,7 @@ digits Malayalam 말라얄람어 {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View 휠 보기 Box View 상자 보기 + Show Out-of-Gamut Colors 색상 범위를 벗어난 색상 표시 Box Channel 상자 채널 Color box 색상 상자 Color Wheel Options 색상환 옵션 @@ -3258,6 +3259,11 @@ mark-style Japanese 일본식 Edit Arrowheads 화살촉 편집 Edit Arrowheads… 화살촉 편집… Reload Arrowheads 화살촉 다시 불러오기 + Bevels 베벨 목록 + Edit Bevels 베벨 편집 + Edit Bevels… 베벨 편집… + {name} (document) {name}(문서) + Reload Bevels 베벨 다시 불러오기 Reset the rows to the artwork's colors 행을 아트웍 색상으로 재설정 Color Theme Picker 색상 테마 피커 Undo Changes 변경 내용 실행 취소 @@ -3599,6 +3605,7 @@ mark-style Japanese 일본식 Recent Commands 최근 명령 No recent commands 최근 명령 없음 Type to search commands, tools, panels and effects 입력하여 명령, 도구, 패널 및 효과 검색 + Clear Recent Commands 최근 명령 목록 지우기 Search commands 명령 검색 Secondary 보조 Select All Art on Layer 레이어의 모든 아트웍 선택 @@ -6435,7 +6442,10 @@ lighting Light 광원 @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) 개체에 3D 효과(돌출 및 경사, 회전체, 부풀리기 또는 회전)가 없습니다 @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render`는 값이 shaded 또는 wireframe인 `mode`만 있는 객체여야 합니다 @msg its 3D effect builds no solid 3D 효과가 입체를 만들지 않습니다 -@msg bevel must be none or one of {_1} bevel은 none 또는 {_1} 중 하나여야 합니다 +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel은 none, {_1} 중 하나 또는 {BEVEL_PROFILE}을(를) 함께 지정한 custom이어야 합니다 +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom에는 베벨의 포인트인 {BEVEL_PROFILE}이(가) 필요합니다 +@msg {BEVEL_NAME} must be a string {BEVEL_NAME}은(는) 문자열이어야 합니다 +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE}은(는) 2개에서 {most}개의 [x, y] 포인트여야 하며, 각 값은 0과 1 사이의 비율이고 [0, 0](끝면의 가장자리)에서 [1, 1](옆면 벽)까지여야 합니다 @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1}은(는) 이 아트로 입체를 만들 수 없습니다. 심볼 인스턴스, 블렌드, 클리핑 그룹에 개체가 너무 많습니다 @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label}은(는) 심볼 “{symbol}”의 인스턴스로 입체를 만들 수 없습니다. 심볼의 아트를 사용할 수 없습니다 @msg {_1}: the clipping path is too complex to cut the art with {_1}: 클리핑 패스가 너무 복잡하여 아트를 자를 수 없습니다 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index ba4237363f..51402d1964 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -1397,6 +1397,7 @@ liquify-list-end {0}, {1} {0} en {1} {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Wielweergave Box View Vakweergave + Show Out-of-Gamut Colors Kleuren buiten gamut tonen Box Channel Kanaal van het vak Color box Kleurvak Color Wheel Options Opties voor kleurenwiel @@ -4757,6 +4758,11 @@ theme Appearance Vormgeving Edit Arrowheads Pijlpunten bewerken Edit Arrowheads… Pijlpunten bewerken… Reload Arrowheads Pijlpunten opnieuw laden + Bevels Afschuiningen + Edit Bevels Afschuiningen bewerken + Edit Bevels… Afschuiningen bewerken… + {name} (document) {name} (document) + Reload Bevels Afschuiningen opnieuw laden Stroke Options Lijnopties Width Profiles Breedteprofielen Apply Graphic Style Grafische stijl toepassen @@ -5072,6 +5078,7 @@ font-technology Variable Variabel Recent Commands Recente opdrachten No recent commands Geen recente opdrachten Type to search commands, tools, panels and effects Typ om opdrachten, gereedschappen, panelen en effecten te zoeken + Clear Recent Commands Recente opdrachten wissen Dashed Line Streepjeslijn Panel menu Paneelmenu Unembed… Insluiten ongedaan maken… @@ -8600,7 +8607,10 @@ mark-style Japanese Japans @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) het object heeft geen 3D-effect (Extruderen en afschuinen, Draaien, Opblazen of Roteren) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` moet een object zijn met alleen `mode`, ingesteld op shaded of wireframe @msg its 3D effect builds no solid het 3D-effect ervan maakt geen massief object -@msg bevel must be none or one of {_1} bevel moet none of een van {_1} zijn +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel moet none, een van {_1} of custom met {BEVEL_PROFILE} zijn +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom heeft {BEVEL_PROFILE} nodig, de punten van de afschuining +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} moet een tekenreeks zijn +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} moet 2 tot {most} punten [x, y] bevatten, elk aandeel tussen 0 en 1, van [0, 0] (de rand van de bovenkant) tot [1, 1] (de zijwand) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} kan van deze illustratie geen massieve objecten maken: de symboolinstanties, vermengingen en knipgroepen ervan bevatten te veel objecten @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} kan geen massief object maken van de instantie van symbool "{symbol}": de illustratie van het symbool is niet beschikbaar @msg {_1}: the clipping path is too complex to cut the art with {_1}: het knippad is te complex om de illustratie mee uit te knippen diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 121b39497e..128f165b52 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -780,6 +780,7 @@ {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Widok koła Box View Widok kwadratu + Show Out-of-Gamut Colors Pokaż kolory poza gamutem Box Channel Kanał kwadratu Color box Kwadrat koloru Color Wheel Options Opcje koła kolorów @@ -4297,6 +4298,11 @@ theme Appearance Wygląd Edit Arrowheads Edytuj groty strzałek Edit Arrowheads… Edytuj groty strzałek… Reload Arrowheads Wczytaj ponownie groty strzałek + Bevels Fazy + Edit Bevels Edytuj fazy + Edit Bevels… Edytuj fazy… + {name} (document) {name} (dokument) + Reload Bevels Wczytaj ponownie fazy Stroke Options Opcje obrysu Width Profiles Profile szerokości Apply Graphic Style Zastosuj styl graficzny @@ -4601,6 +4607,7 @@ font-technology Variable Zmienne Recent Commands Ostatnie polecenia No recent commands Brak ostatnich poleceń Type to search commands, tools, panels and effects Pisz, aby szukać poleceń, narzędzi, paneli i efektów + Clear Recent Commands Wyczyść listę ostatnich poleceń Dashed Line Linia przerywana Panel menu Menu panelu Unembed… Wyodrębnij… @@ -6677,7 +6684,10 @@ mark-style Japanese Japońskie @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) obiekt nie ma efektu 3D (Wyciągnięcie i fazowanie, Obrót, Nadmuchanie ani Obróć) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` musi być obiektem zawierającym tylko `mode` o wartości shaded lub wireframe @msg its 3D effect builds no solid jego efekt 3D nie tworzy żadnej bryły -@msg bevel must be none or one of {_1} bevel musi mieć wartość none lub jedną z: {_1} +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel musi mieć wartość none, jedną z: {_1}, albo custom z {BEVEL_PROFILE} +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom wymaga {BEVEL_PROFILE}, punktów fazy +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} musi być ciągiem znaków +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} musi zawierać od 2 do {most} punktów [x, y], każdy udział od 0 do 1, od [0, 0] (krawędź ściany czołowej) do [1, 1] (ściana boczna) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} nie może utworzyć brył z tej kompozycji: jej wystąpienia symboli, przejścia i grupy przycinające zawierają zbyt wiele obiektów @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} nie może utworzyć bryły z wystąpienia symbolu „{symbol}”: kompozycja symbolu jest niedostępna @msg {_1}: the clipping path is too complex to cut the art with {_1}: ścieżka przycinająca jest zbyt złożona, aby przyciąć nią kompozycję diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index eb87e137ce..a86792c918 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -549,6 +549,7 @@ antiAlias Sharp Nítido {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Exibição em Roda Box View Exibição em Caixa + Show Out-of-Gamut Colors Mostrar Cores Fora do Gamut Box Channel Canal da Caixa Color box Caixa de cor Color Wheel Options Opções da Roda de Cores @@ -2707,6 +2708,11 @@ digits Malayalam Malaiala Edit Arrowheads Editar Pontas de Seta Edit Arrowheads… Editar Pontas de Seta… Reload Arrowheads Recarregar Pontas de Seta + Bevels Chanfros + Edit Bevels Editar Chanfros + Edit Bevels… Editar Chanfros… + {name} (document) {name} (documento) + Reload Bevels Recarregar Chanfros Rotate View Girar Visualização Reset Rotate View Redefinir Visualização Girada Rotate View to Selection Girar Visualização para a Seleção @@ -3115,6 +3121,7 @@ digits Malayalam Malaiala Recent Commands Comandos recentes No recent commands Nenhum comando recente Type to search commands, tools, panels and effects Digite para pesquisar comandos, ferramentas, painéis e efeitos + Clear Recent Commands Limpar Comandos Recentes Search commands Pesquisar comandos Secondary Secundária Section Symbol Símbolo de Seção @@ -6800,7 +6807,10 @@ mark-style Japanese Japonesas @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) o objeto não tem efeito 3D (Extrusão e Bisel, Revolver, Inflar ou Girar) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` deve ser um objeto que contenha apenas `mode`, com o valor shaded ou wireframe @msg its 3D effect builds no solid seu efeito 3D não constrói nenhum sólido -@msg bevel must be none or one of {_1} bevel deve ser none ou um de {_1} +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel deve ser none, um de {_1}, ou custom com {BEVEL_PROFILE} +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom precisa de {BEVEL_PROFILE}, os pontos do chanfro +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} deve ser uma string +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} deve ter de 2 a {most} pontos [x, y], cada proporção entre 0 e 1, de [0, 0] (a borda da tampa) a [1, 1] (a parede lateral) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} não pode construir sólidos a partir desta arte: suas instâncias de símbolo, mesclagens e grupos de recorte contêm objetos demais @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} não pode construir um sólido a partir da instância do símbolo “{symbol}”: a arte do símbolo não está disponível @msg {_1}: the clipping path is too complex to cut the art with {_1}: o caminho de recorte é complexo demais para recortar a arte diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index e094b9097c..d924dfeb2a 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -608,6 +608,7 @@ font-technology Variable Вариативные {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Вид «Круг» Box View Вид «Квадрат» + Show Out-of-Gamut Colors Показать цвета вне цветового охвата Box Channel Канал квадрата Color box Цветовой квадрат Color Wheel Options Параметры цветового круга @@ -3277,6 +3278,11 @@ digits Malayalam Малаялам Edit Arrowheads Редактировать стрелки Edit Arrowheads… Редактировать стрелки… Reload Arrowheads Перезагрузить стрелки + Bevels Фаски + Edit Bevels Редактировать фаски + Edit Bevels… Редактировать фаски… + {name} (document) {name} (документ) + Reload Bevels Перезагрузить фаски Rotate View Повернуть вид Reset Rotate View Сбросить поворот вида Rotate View to Selection Повернуть вид по выделению @@ -3722,6 +3728,7 @@ digits Malayalam Малаялам Recent Commands Недавние команды No recent commands Нет недавних команд Type to search commands, tools, panels and effects Начните вводить для поиска команд, инструментов, панелей и эффектов + Clear Recent Commands Очистить список недавних команд Search commands Поиск команд Search Commands… Поиск команд… Secondary Вторичный @@ -6463,7 +6470,10 @@ lighting Light Свет @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) у объекта нет 3D-эффекта (Выдавливание и фаска, Вращение, Надувание или Повернуть) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` должен быть объектом только с полем `mode` со значением shaded или wireframe @msg its 3D effect builds no solid его 3D-эффект не строит тела -@msg bevel must be none or one of {_1} bevel должен быть none или одним из: {_1} +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel должен быть none, одним из: {_1}, или custom с {BEVEL_PROFILE} +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points для bevel custom нужен {BEVEL_PROFILE}, точки фаски +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} должно быть строкой +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} должен содержать от 2 до {most} точек [x, y], каждая доля от 0 до 1, от [0, 0] (край торца) до [1, 1] (боковая стенка) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1}: нельзя построить тела из этой иллюстрации: её экземпляры символов, переходы и обтравочные группы содержат слишком много объектов @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label}: нельзя построить тело из экземпляра символа «{symbol}»: иллюстрация символа недоступна @msg {_1}: the clipping path is too complex to cut the art with {_1}: обтравочный контур слишком сложен, чтобы обрезать им иллюстрацию diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 531c479fd1..042e4fd36d 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -593,6 +593,7 @@ font-technology Variable Variabla {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Hjulvy Box View Rutvy + Show Out-of-Gamut Colors Visa färger utanför färgomfånget Box Channel Rutans kanal Color box Färgruta Color Wheel Options Alternativ för färghjulet @@ -3167,6 +3168,11 @@ digits Malayalam Malayalam Edit Arrowheads Redigera pilspetsar Edit Arrowheads… Redigera pilspetsar… Reload Arrowheads Läs in pilspetsar igen + Bevels Fasningar + Edit Bevels Redigera fasningar + Edit Bevels… Redigera fasningar… + {name} (document) {name} (dokument) + Reload Bevels Läs in fasningar igen Reset Rotate View Återställ Rotera vy Rotate View to Selection Rotera vyn efter markeringen Reset the rows to the artwork's colors Återställ raderna till teckningens färger @@ -3597,6 +3603,7 @@ digits Malayalam Malayalam Recent Commands Senaste kommandon No recent commands Inga senaste kommandon Type to search commands, tools, panels and effects Skriv för att söka efter kommandon, verktyg, paneler och effekter + Clear Recent Commands Rensa senaste kommandon Search commands Sök kommandon Search Commands… Sök kommandon… Secondary Sekundär @@ -6330,7 +6337,10 @@ lighting Light Ljus @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) objektet har ingen 3D-effekt (Extrudera och fasa, Rotera runt axel, Blås upp eller Rotera) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` måste vara ett objekt som bara innehåller `mode`, med värdet shaded eller wireframe @msg its 3D effect builds no solid dess 3D-effekt bygger ingen solid -@msg bevel must be none or one of {_1} bevel måste vara none eller något av {_1} +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel måste vara none, något av {_1} eller custom med {BEVEL_PROFILE} +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom kräver {BEVEL_PROFILE}, fasningens punkter +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} måste vara en sträng +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} måste vara 2 till {most} punkter [x, y], varje andel mellan 0 och 1, från [0, 0] (ändytans kant) till [1, 1] (sidoväggen) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} kan inte bygga solider av den här teckningen: dess symbolinstanser, blandningar och urklippsgrupper innehåller för många objekt @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} kan inte bygga en solid av instansen av symbolen ”{symbol}”: symbolens teckning är inte tillgänglig @msg {_1}: the clipping path is too complex to cut the art with {_1}: urklippsbanan är för komplex för att klippa teckningen med diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index 783d5de2b0..42657490c7 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -4103,6 +4103,22 @@ fn three_d_refusals_translate_with_their_values() { (refuse(vectorcraft_effects::validate_three_d(&rect, CLASSIC_EXTRUDE, &json!({"depth": "deep"}))), "must be a number", vec!["`depth`"]), (refuse(vectorcraft_effects::validate_three_d(&instance, EXTRUDE, &json!({}))), "the symbol's art isn't available", vec!["Mine 7"]), (refuse(vectorcraft_effects::three_d_wireframe_in(None, &rect).map(drop)), "has no 3D effect", vec![]), + ( + refuse(vectorcraft_effects::validate_three_d(&rect, EXTRUDE, &json!({"bevel": "wavy"}))), + "or custom with", + vec!["none", "classic", "custom", "bevelProfile"], + ), + ( + refuse(vectorcraft_effects::validate_three_d(&rect, EXTRUDE, &json!({"bevel": "custom"}))), + "the bevel's points", + vec!["custom", "bevelProfile"], + ), + (refuse(vectorcraft_effects::validate_three_d(&rect, CLASSIC_EXTRUDE, &json!({"bevelName": 3}))), "must be a string", vec!["bevelName"]), + ( + refuse(vectorcraft_effects::validate_three_d(&rect, EXTRUDE, &json!({"bevel": "custom", "bevelProfile": [[0, 0]]}))), + "each share between", + vec!["bevelProfile", "[x, y]", "[0, 0]", "[1, 1]"], + ), ]; for (e, english, _) in &errors { assert!(e.starts_with("invalid parameters for `effect.apply`: ") && e.contains(english), "{e}"); @@ -6558,7 +6574,8 @@ const NAMED_KEYS: &[(&str, &[&str])] = &[ ("axis must be \"vertical\", \"horizontal\" or an angle in degrees, not `{v}`", &["axis"]), ("balance must be between 0 and 100", &["balance"]), ("before must name a panel", &["before"]), - ("bevel must be none or one of {_1}", &["bevel", "none"]), + ("bevel custom needs {BEVEL_PROFILE}, the bevel's points", &["bevel", "custom"]), + ("bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE}", &["bevel", "none", "custom"]), ("brightness must be dark|mediumDark|mediumLight|light", &["brightness", "dark", "mediumDark", "mediumLight", "light"]), ("clip must be true or false", &["clip"]), ("collapsed must be true or false", &["collapsed"]), diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 449afeb91e..aabaebdb26 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -591,6 +591,7 @@ font-technology Variable Değişken {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Tekerlek Görünümü Box View Kutu Görünümü + Show Out-of-Gamut Colors Gamut Dışı Renkleri Göster Box Channel Kutu Kanalı Color box Renk kutusu Color Wheel Options Renk Tekerleği Seçenekleri @@ -3012,6 +3013,11 @@ digits Malayalam Malayalam Edit Arrowheads Ok Uçlarını Düzenle Edit Arrowheads… Ok Uçlarını Düzenle… Reload Arrowheads Ok Uçlarını Yeniden Yükle + Bevels Eğimler + Edit Bevels Eğimleri Düzenle + Edit Bevels… Eğimleri Düzenle… + {name} (document) {name} (belge) + Reload Bevels Eğimleri Yeniden Yükle Reset Rotate View Döndürme Görünümünü Sıfırla Rotate View to Selection Görünümü Seçime Döndür Reset the rows to the artwork's colors Satırları resmin renklerine göre sıfırlayın @@ -3477,6 +3483,7 @@ digits Malayalam Malayalam Recent Commands Son komutlar No recent commands Son komut yok Type to search commands, tools, panels and effects Komutları, araçları, panelleri ve efektleri aramak için yazın + Clear Recent Commands Son Komutları Temizle Search commands Komutları arayın Search Commands… Arama Komutları… Secondary İkincil @@ -6156,7 +6163,10 @@ lighting Light Işık @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) nesnenin 3 boyutlu efekti yok (Ekstrüzyon ve Eğim, Eksen Etrafında Döndür, Şişir veya Döndür) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render`, yalnızca değeri shaded veya wireframe olan `mode` içeren bir nesne olmalıdır @msg its 3D effect builds no solid 3 boyutlu efekti hiçbir katı oluşturmuyor -@msg bevel must be none or one of {_1} bevel, none veya {_1} değerlerinden biri olmalıdır +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel; none, {_1} değerlerinden biri veya {BEVEL_PROFILE} ile custom olmalıdır +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom için {BEVEL_PROFILE}, yani eğimin noktaları gerekir +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} bir dize olmalıdır +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE}, 2 ile {most} arasında [x, y] noktası olmalıdır; her oran 0 ile 1 arasında, [0, 0] (uç yüzeyin kenarı) ile [1, 1] (yan duvar) arasında @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} bu resimden katı oluşturamaz: sembol örnekleri, karışımları ve kırpma grupları çok fazla nesne içeriyor @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label}, “{symbol}” sembolünün örneğinden katı oluşturamaz: sembolün resmi kullanılamıyor @msg {_1}: the clipping path is too complex to cut the art with {_1}: kırpma yolu resmi kesmek için çok karmaşık diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 81d245dc58..21e33075ce 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -606,6 +606,7 @@ font-technology Variable Варіативні {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Вигляд «Коло» Box View Вигляд «Квадрат» + Show Out-of-Gamut Colors Показати кольори поза колірним охопленням Box Channel Канал квадрата Color box Колірний квадрат Color Wheel Options Параметри колірного кола @@ -3286,6 +3287,11 @@ digits Malayalam Малаялам Edit Arrowheads Редагувати стрілки Edit Arrowheads… Редагувати стрілки… Reload Arrowheads Перезавантажити стрілки + Bevels Фаски + Edit Bevels Редагувати фаски + Edit Bevels… Редагувати фаски… + {name} (document) {name} (документ) + Reload Bevels Перезавантажити фаски Rotate View Повернути вид Reset Rotate View Скинути поворот виду Rotate View to Selection Повернути вид за виділенням @@ -3733,6 +3739,7 @@ digits Malayalam Малаялам Recent Commands Нещодавні команди No recent commands Немає нещодавніх команд Type to search commands, tools, panels and effects Почніть вводити для пошуку команд, інструментів, панелей та ефектів + Clear Recent Commands Очистити список нещодавніх команд Search commands Пошук команд Search Commands… Пошук команд… Secondary Вторинний @@ -6445,7 +6452,10 @@ lighting Light Світло @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) об’єкт не має 3D-ефекту (Видавлювання та фаска, Обертання, Надування або Повернути) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` має бути об’єктом лише з полем `mode` зі значенням shaded або wireframe @msg its 3D effect builds no solid його 3D-ефект не будує тіла -@msg bevel must be none or one of {_1} bevel має бути none або одним з: {_1} +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel має бути none, одним з: {_1}, або custom з {BEVEL_PROFILE} +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points для bevel custom потрібен {BEVEL_PROFILE}, точки фаски +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} має бути рядком +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} має містити від 2 до {most} точок [x, y], кожна частка від 0 до 1, від [0, 0] (край торця) до [1, 1] (бічна стінка) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1}: не вдається побудувати тіла з цієї ілюстрації: її екземпляри символів, переходи та відсічні групи містять забагато об’єктів @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label}: не вдається побудувати тіло з екземпляра символу «{symbol}»: ілюстрація символу недоступна @msg {_1}: the clipping path is too complex to cut the art with {_1}: відсічний контур надто складний, щоб обрізати ним ілюстрацію diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index c957923f47..fbe7fc0517 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -725,6 +725,7 @@ font-technology Variable Biến thiên {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View Hiển thị bánh xe Box View Hiển thị hộp + Show Out-of-Gamut Colors Hiện màu ngoài dải màu Box Channel Kênh của hộp Color box Hộp màu Color Wheel Options Tùy chọn bánh xe màu @@ -3597,6 +3598,11 @@ mark-style Japanese Kiểu Nhật Edit Arrowheads Chỉnh sửa đầu mũi tên Edit Arrowheads… Chỉnh sửa đầu mũi tên… Reload Arrowheads Tải lại đầu mũi tên + Bevels Các kiểu vát + Edit Bevels Chỉnh sửa kiểu vát + Edit Bevels… Chỉnh sửa kiểu vát… + {name} (document) {name} (tài liệu) + Reload Bevels Tải lại kiểu vát Rotate View Xoay chế độ xem Reset Rotate View Đặt lại xoay chế độ xem Rotate View to Selection Xoay chế độ xem theo vùng chọn @@ -4087,6 +4093,7 @@ mark-style Japanese Kiểu Nhật Recent Commands Lệnh gần đây No recent commands Không có lệnh gần đây Type to search commands, tools, panels and effects Nhập để tìm kiếm lệnh, công cụ, bảng và hiệu ứng + Clear Recent Commands Xóa lệnh gần đây Search commands Tìm kiếm lệnh Search Commands… Tìm kiếm lệnh… Search Fonts Folder Tìm kiếm thư mục phông chữ @@ -6197,7 +6204,10 @@ liquify-list-end {0}, {1} {0} và {1} @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) đối tượng không có hiệu ứng 3D (Kéo dài & vát, Xoay tròn, Phình hoặc Xoay) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` phải là một đối tượng chỉ chứa `mode`, với giá trị shaded hoặc wireframe @msg its 3D effect builds no solid hiệu ứng 3D của nó không tạo ra khối nào -@msg bevel must be none or one of {_1} bevel phải là none hoặc một trong {_1} +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel phải là none, một trong {_1}, hoặc custom kèm {BEVEL_PROFILE} +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom cần {BEVEL_PROFILE}, các điểm của kiểu vát +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} phải là một chuỗi +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} phải có từ 2 đến {most} điểm [x, y], mỗi tỷ lệ từ 0 đến 1, từ [0, 0] (cạnh của mặt đầu) đến [1, 1] (thành bên) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1} không thể tạo khối từ hình vẽ này: các phiên bản ký hiệu, hòa trộn và nhóm cắt của nó chứa quá nhiều đối tượng @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label} không thể tạo khối từ phiên bản của ký hiệu “{symbol}”: không có hình vẽ của ký hiệu @msg {_1}: the clipping path is too complex to cut the art with {_1}: đường dẫn cắt quá phức tạp để cắt hình vẽ diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index b562520a9a..d421813a89 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -557,6 +557,7 @@ antiAlias Sharp 锐利 {name1} {value1}, {name2} {value2} {name1} {value1},{name2} {value2} Wheel View 色轮视图 Box View 方块视图 + Show Out-of-Gamut Colors 显示超出色域的颜色 Box Channel 方块色版 Color box 颜色方块 Color Wheel Options 色轮选项 @@ -3137,6 +3138,11 @@ digits Malayalam 马拉雅拉姆数字 Edit Arrowheads 编辑箭头 Edit Arrowheads… 编辑箭头… Reload Arrowheads 重新载入箭头 + Bevels 斜角列表 + Edit Bevels 编辑斜角 + Edit Bevels… 编辑斜角… + {name} (document) {name} (文档) + Reload Bevels 重新载入斜角 Reset Rotate View 重置旋转视图 Rotate View to Selection 按所选对象旋转视图 Reset the rows to the artwork's colors 将各行重置为图稿的颜色 @@ -3549,6 +3555,7 @@ digits Malayalam 马拉雅拉姆数字 Recent Commands 最近使用的命令 No recent commands 没有最近使用的命令 Type to search commands, tools, panels and effects 输入以搜索命令、工具、面板和效果 + Clear Recent Commands 清除最近使用的命令 Search commands 搜索命令 Search Commands… 搜索命令… Secondary 次要 @@ -6715,7 +6722,10 @@ lighting Light 光源 @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) 该对象没有 3D 效果(突出与斜角、回转、膨胀或旋转) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` 必须是只含 `mode` 的对象,值为 shaded 或 wireframe @msg its 3D effect builds no solid 其 3D 效果未生成任何实体 -@msg bevel must be none or one of {_1} bevel 必须是 none 或 {_1} 之一 +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel 必须是 none、{_1} 之一,或带 {BEVEL_PROFILE} 的 custom +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom 需要 {BEVEL_PROFILE},即斜角的点 +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} 必须是字符串 +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} 必须是 2 到 {most} 个 [x, y] 点,每个比例在 0 到 1 之间,从 [0, 0](端面的边缘)到 [1, 1](侧壁) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1}无法从此图稿生成实体:其符号实例、混合和剪切组包含的对象过多 @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label}无法从符号“{symbol}”的实例生成实体:该符号的图稿不可用 @msg {_1}: the clipping path is too complex to cut the art with {_1}:剪切路径过于复杂,无法用来剪切图稿 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 0c98bdc4f9..f2a8306713 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -574,6 +574,7 @@ font-technology Variable 可變 {name1} {value1}, {name2} {value2} {name1} {value1},{name2} {value2} Wheel View 色輪檢視 Box View 方塊檢視 + Show Out-of-Gamut Colors 顯示超出色域的顏色 Box Channel 方塊色版 Color box 顏色方塊 Color Wheel Options 色輪選項 @@ -4583,6 +4584,11 @@ digits Malayalam 馬來亞拉姆數字 Edit Arrowheads 編輯箭頭 Edit Arrowheads… 編輯箭頭… Reload Arrowheads 重新載入箭頭 + Bevels 斜角清單 + Edit Bevels 編輯斜角 + Edit Bevels… 編輯斜角… + {name} (document) {name} (文件) + Reload Bevels 重新載入斜角 Rotate View 旋轉檢視 Reset Rotate View 重設旋轉檢視 Rotate View to Selection 依選取範圍旋轉檢視 @@ -5028,6 +5034,7 @@ digits Malayalam 馬來亞拉姆數字 Recent Commands 最近使用的指令 No recent commands 沒有最近使用的指令 Type to search commands, tools, panels and effects 輸入以搜尋指令、工具、面板與效果 + Clear Recent Commands 清除最近使用的指令 Search commands 搜尋指令 Search Commands… 搜尋指令… Secondary 次要 @@ -6563,7 +6570,10 @@ lighting Light 光源 @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) 此物件沒有 3D 效果 (突出與斜角、迴轉、膨脹或旋轉) @msg `render` must be an object holding only `mode`, set to shaded or wireframe `render` 必須是只含 `mode` 的物件,值為 shaded 或 wireframe @msg its 3D effect builds no solid 其 3D 效果沒有產生任何實體 -@msg bevel must be none or one of {_1} bevel 必須是 none 或 {_1} 其中之一 +@msg bevel must be none or one of {_1}, or custom with {BEVEL_PROFILE} bevel 必須是 none、{_1} 其中之一,或帶有 {BEVEL_PROFILE} 的 custom +@msg bevel custom needs {BEVEL_PROFILE}, the bevel's points bevel custom 需要 {BEVEL_PROFILE},也就是斜角的點 +@msg {BEVEL_NAME} must be a string {BEVEL_NAME} 必須是字串 +@msg {BEVEL_PROFILE} must be 2 to {most} [x, y] points, each share between 0 and 1, from [0, 0] (the cap's edge) to [1, 1] (the side wall) {BEVEL_PROFILE} 必須是 2 到 {most} 個 [x, y] 點,每個比例介於 0 和 1 之間,從 [0, 0](端面的邊緣)到 [1, 1](側壁) @msg {_1} can't build solids from this art: its symbol instances, blends and clipping groups hold too many objects {_1}無法從此圖稿產生實體:其符號實例、漸變和剪裁群組包含的物件過多 @msg {label} can't build a solid from the instance of symbol "{symbol}": the symbol's art isn't available {label}無法從符號「{symbol}」的實例產生實體:該符號的圖稿無法使用 @msg {_1}: the clipping path is too complex to cut the art with {_1}:剪裁路徑過於複雜,無法用來剪裁圖稿 diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 860a17572c..5152a29901 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -809,8 +809,13 @@ fn run_ui_part7(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option crate::dialogs::safe_mode::open(app), "help.copyTroubleshootingInfo" => crate::troubleshooting::copy(app), "help.commandPalette" => { - app.ui.palette_open = !app.ui.palette_open; - app.ui.palette_query.clear(); + crate::palette::toggle(app); + Ok(Value::Null) + } + // A pick of it in the search is recorded and counted first, and then cleared with the rest. + "help.clearRecentCommands" => { + app.ui.recent_commands.clear(); + app.ui.command_uses = Default::default(); Ok(Value::Null) } // Closing asks Save / Don't Save / Cancel for modified documents first (`unsaved`). diff --git a/crates/ui-egui/src/menus/state.rs b/crates/ui-egui/src/menus/state.rs index 07469338fc..2e941c0af1 100644 --- a/crates/ui-egui/src/menus/state.rs +++ b/crates/ui-egui/src/menus/state.rs @@ -273,6 +273,7 @@ pub fn enabled(app: &VectorcraftApp, id: &str) -> bool { "view.rotateToSelection" | crate::addons::arrange::ZOOM => app.session.active().is_some_and(|d| !d.selection.objects.is_empty()), id if id.starts_with("file.openRecent") => recent_slot(app, id).is_some(), "file.clearRecent" => !app.ui.recent_files.is_empty(), + "help.clearRecentCommands" => !app.ui.recent_commands.is_empty() || !app.ui.command_uses.is_empty(), id if id.starts_with("type.recentFont") => { id["type.recentFont".len()..].parse::().is_ok_and(|n| n >= 1 && n <= app.recent_fonts().len()) && app.session.active().is_some() } diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index ef7975b9a0..d1db926bf9 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -1013,6 +1013,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ ("help.about", "About VectorCraft", "", "{}"), ("help.checkForUpdates", "Check for Updates…", "", "{}"), ("help.commandPalette", "Search Commands…", "Cmd+Shift+/", "{}"), + ( + "help.clearRecentCommands", + "Clear Recent Commands", + "", + "{} empty the recent picks of Help › Search Commands (the list an empty search shows and the Recent Commands list), the saved list and the pick counts that rank the results; a pick of it is not kept as a recent pick or counted. Not enabled while no picks or counts are saved", + ), ( "help.discover", "VectorCraft Help…", @@ -1574,7 +1580,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.colorWheel", "Color Wheel Options", "", - "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, sliders?: none|oklch|hsl, harmony?: bool, harmonyRule?: complementary|splitComplementary|leftComplement|rightComplement|analogous|analogous2|triad|tetrad|tetrad2|tetrad3|compound|compound2|highContrast|highContrast3|pentagram, vision?: bool} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, pick the box's channel, as Box Channel does, and show no slider rows under the wheel or the box (none), OKLCH Sliders (oklch) or HSL Sliders (hsl), as the menu items of those names do: the box is a color field with the channel's strip at its right, and the field shows the other two components (hue: saturation across and brightness up; saturation: hue across and brightness up; brightness: hue across and saturation up; red: blue across and green up; green: blue across and red up; blue: red across and green up); OKLCH Sliders edit lightness 0 to 100 %, chroma 0 to 100 % of 0.4 and hue 0 to 360°, CSS Color 4's OKLCH of the display sRGB, and a color outside sRGB keeps L and H and takes the largest chroma that fits; HSL Sliders edit hue 0 to 360°, saturation 0 to 100 % and lightness 0 to 100 %, CSS Color 4's HSL of the display sRGB; harmony shows a marker on the wheel's ring for each other color of harmonyRule (the Color Guide's rule of that id; a rule's label is taken too), as Show Harmony and Harmony Rule do, and a click on a marker applies its color; vision shows Show Color Vision Preview's row under the wheel or the box, four chips with the current color as simulated for protanopia, deuteranopia and tritanopia (the simulations of view.proofSetup's protanopia, deuteranopia and tritanopia targets) and for achromatopsia (the gray with the color's CIE L*), each named with its hex value in its tooltip and to screen readers, and taking the keyboard focus; a click or a key on a chip does not apply its color; keys left out or null keep their values ({} reads them), params that are not an object, another key or a value off the list are an error and change nothing, oklch is an error while the working RGB space is not sRGB, the settings are kept with the preferences, and the command does not open the panel (window.panel {panel: \"colorWheel\"} does) (ui.inspect: ui.color_wheel) → {view, channel, sliders, harmony, harmonyRule, vision}", + "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, sliders?: none|oklch|hsl, gamut?: bool, harmony?: bool, harmonyRule?: complementary|splitComplementary|leftComplement|rightComplement|analogous|analogous2|triad|tetrad|tetrad2|tetrad3|compound|compound2|highContrast|highContrast3|pentagram, vision?: bool} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, pick the box's channel, as Box Channel does, and show no slider rows under the wheel or the box (none), OKLCH Sliders (oklch) or HSL Sliders (hsl), as the menu items of those names do: the box is a color field with the channel's strip at its right, and the field shows the other two components (hue: saturation across and brightness up; saturation: hue across and brightness up; brightness: hue across and saturation up; red: blue across and green up; green: blue across and red up; blue: red across and green up); OKLCH Sliders edit lightness 0 to 100 %, chroma 0 to 100 % of 0.4 and hue 0 to 360°, CSS Color 4's OKLCH of the display sRGB, and a color outside sRGB keeps L and H and takes the largest chroma that fits; HSL Sliders edit hue 0 to 360°, saturation 0 to 100 % and lightness 0 to 100 %, CSS Color 4's HSL of the display sRGB; gamut true grays out the parts of the wheel's square and the box's field whose colors the CMYK space cannot print (the out-of-gamut warning's test, as color.gamutCheck answers it), as Show Out-of-Gamut Colors does, and false shows them again; the shading is approximate: each cell of a 16 by 16 grid over the square or the field is grayed out or not by the color at its center, so a grayed cell can hold printable colors and a clear cell can hold colors that cannot print; harmony shows a marker on the wheel's ring for each other color of harmonyRule (the Color Guide's rule of that id; a rule's label is taken too), as Show Harmony and Harmony Rule do, and a click on a marker applies its color; vision shows Show Color Vision Preview's row under the wheel or the box, four chips with the current color as simulated for protanopia, deuteranopia and tritanopia (the simulations of view.proofSetup's protanopia, deuteranopia and tritanopia targets) and for achromatopsia (the gray with the color's CIE L*), each named with its hex value in its tooltip and to screen readers, and taking the keyboard focus; a click or a key on a chip does not apply its color; keys left out or null keep their values ({} reads them), params that are not an object, another key or a value off the list are an error and change nothing, oklch is an error while the working RGB space is not sRGB, the settings are kept with the preferences, and the command does not open the panel (window.panel {panel: \"colorWheel\"} does) (ui.inspect: ui.color_wheel) → {view, channel, sliders, gamut, harmony, harmonyRule, vision}", ), ( "ui.savePdfDialog", diff --git a/crates/ui-egui/src/palette.rs b/crates/ui-egui/src/palette.rs index db045eeed4..69e4d5e17c 100644 --- a/crates/ui-egui/src/palette.rs +++ b/crates/ui-egui/src/palette.rs @@ -1126,6 +1126,11 @@ impl CommandUses { } } + /// Whether no command is counted. + pub(crate) fn is_empty(&self) -> bool { + self.uses.is_empty() + } + /// The count of `id`'s picks as a grade from 0 (never picked) to 9: the base-2 logarithm of /// the count plus one, so 1 pick gives 1, 3 give 2, 7 give 3, and so on. fn grade(&self, id: &str) -> u8 { @@ -1201,6 +1206,13 @@ pub(crate) fn recent_list_open(ctx: &egui::Context) -> bool { egui::Popup::is_id_open(ctx, recent_list_id()) } +/// Opens the palette with an empty search when it is closed, and closes it when it is open. +pub(crate) fn toggle(app: &mut VectorcraftApp) { + app.ui.palette_open = !app.ui.palette_open; + app.ui.palette_query.clear(); + app.ui.palette_toggled = true; +} + pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { // The widget that had the keyboard focus when the palette opened takes it back when the palette // closes, unless a modal window is up (a pick opened a dialog, which focuses its own first @@ -1209,6 +1221,11 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { let focus_id = egui::Id::unique("palette-focus-before"); let field_id = egui::Id::unique("palette-field"); let sel_id = egui::Id::unique("palette-selected"); + // A toggle can close the palette and open it again before it is drawn closed, as two runs of its + // command in one step do, so the palette forgets its highlight after any toggle. + if std::mem::take(&mut app.ui.palette_toggled) { + ctx.data_mut(|d| d.remove::(sel_id)); + } // The Recent Commands rows drawn in the last frame, so a pick with the keyboard, which leaves the // focus on its row, gives the focus back too. let rows_id = egui::Id::unique("palette-recent-rows"); @@ -1587,18 +1604,18 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { app.ui.palette_open = false; // A pick goes first in Recent Commands before it runs, and stays there when it ran or // opened a dialog, even when the dialog is then canceled. A refused pick puts the list - // back as it was. Only a pick that stays in the list is counted. - let before = (id != PALETTE_TOGGLE).then(|| app.ui.recent_commands.clone()); + // back as it was. The pick is counted with it, before it runs, so Clear Recent Commands + // clears its own pick and count, and a refused pick puts the counts back too. + let before = (id != PALETTE_TOGGLE).then(|| (app.ui.recent_commands.clone(), app.ui.command_uses.clone())); if before.is_some() { remember(&mut app.ui.recent_commands, &id, |c| entries.list.iter().any(|e| e.id == c)); + app.ui.command_uses.count(&id); } - let picked = run_pick(app, &id); - if let Some(before) = before { - if picked == Picked::Refused { - app.ui.recent_commands = before; - } else { - app.ui.command_uses.count(&id); - } + if run_pick(app, &id) == Picked::Refused + && let Some((recent, uses)) = before + { + app.ui.recent_commands = recent; + app.ui.command_uses = uses; } } else if outside { app.ui.palette_open = false; @@ -1957,6 +1974,10 @@ mod tests { remember(&mut list, id, |_| true); } assert_eq!(list, ["j", "i", "h", "g", "f", "e", "d", "c"]); + // A palette toggle saved before its picks were left out takes none of the eight places. + let mut list: Vec = [PALETTE_TOGGLE, "a", "b", "c", "d", "e", "f", "g"].map(str::to_string).into(); + remember(&mut list, "h", |_| true); + assert_eq!(list, ["h", "a", "b", "c", "d", "e", "f", "g"]); let entries = build(Lang::EN); let many: Vec = entries.iter().take(MAX_RECENT_COMMANDS + 2).map(|e| e.id.clone()).collect(); assert_eq!(recent(&entries, &many).len(), MAX_RECENT_COMMANDS); @@ -2461,6 +2482,27 @@ mod tests { assert_eq!(open.app.ui.command_uses.grade(id), 1); } + /// A refused pick leaves the recent picks and the pick counts saved before it as they were. + #[test] + fn a_refused_pick_leaves_the_earlier_counts_as_they_were() { + let id = "edit.findReplace"; + let mut open = Open::new("find and replace", WINDOW); + open.app.ui.recent_commands = vec!["paint.swap".into(), "object.group".into()]; + for _ in 0..2 { + open.app.ui.command_uses.count("paint.swap"); + } + open.app.ui.command_uses.count("object.group"); + let (recent, uses) = (open.app.ui.recent_commands.clone(), open.app.ui.command_uses.clone()); + let k = open.listed().iter().position(|c| c == id).expect("the search finds Find and Replace…"); + open.frame(vec![]); + open.press(egui::Key::ArrowDown, k); + open.press(egui::Key::Enter, 1); + assert!(open.app.ui.dialog.is_none(), "no document: the pick is refused"); + assert_eq!(open.app.ui.recent_commands, recent); + assert_eq!(open.app.ui.command_uses, uses); + assert_eq!(open.app.ui.command_uses.grade(id), 0); + } + /// #6376: with nothing picked yet, Recent Commands shows a dimmed No recent commands row. #[test] fn recent_commands_without_picks_show_a_dimmed_row() { @@ -2526,6 +2568,71 @@ mod tests { assert_eq!(open.app.ui.recent_commands, ["paint.swap", "object.group"]); } + /// A pick of Clear Recent Commands empties the recent picks without keeping itself, so the + /// empty search then says what to type, and the saved UI state holds an empty list. + #[test] + fn clear_recent_commands_empties_the_recent_picks() { + const CLEAR: &str = "help.clearRecentCommands"; + let mut open = Open::new("clear recent commands", WINDOW); + open.app.ui.recent_commands = vec!["paint.swap".into(), "object.group".into()]; + assert!(menus::enabled(&open.app, CLEAR)); + let k = open.listed().iter().position(|id| id == CLEAR).expect("the command's result"); + open.frame(vec![]); + open.press(egui::Key::ArrowDown, k); + assert_eq!(open.highlighted(), k); + open.press(egui::Key::Enter, 1); + assert!(!open.app.ui.palette_open, "the palette closes"); + assert!(open.app.ui.recent_commands.is_empty(), "{:?}", open.app.ui.recent_commands); + assert!(!menus::enabled(&open.app, CLEAR), "not enabled with nothing to clear"); + let saved: serde_json::Value = serde_json::to_value(&open.app.ui).unwrap(); + assert_eq!(saved["recent_commands"], serde_json::json!([])); + open.app.ui.palette_query.clear(); + open.app.ui.palette_open = true; + let nodes = open.frame(vec![]); + assert!(rows(&nodes).is_empty(), "{:?}", rows(&nodes)); + let labels = labels(&nodes); + assert!(labels.iter().any(|l| l == tl!("Type to search commands, tools, panels and effects")), "{labels:?}"); + // Run as a command, it empties the list too. + open.app.ui.recent_commands = vec!["paint.swap".into()]; + open.app.run(CLEAR, serde_json::json!({})).unwrap(); + assert!(open.app.ui.recent_commands.is_empty()); + // A saved id the list leaves out (a plug-in that is not loaded) still counts, and is cleared. + open.app.ui.recent_commands = vec!["plugin.notLoaded.filter".into()]; + assert!(menus::enabled(&open.app, CLEAR)); + open.app.run(CLEAR, serde_json::json!({})).unwrap(); + assert!(open.app.ui.recent_commands.is_empty()); + } + + /// Clear Recent Commands also empties the pick counts, and a pick of it from the search is not + /// counted afterward; with counts left and no recent picks, it is still enabled. + #[test] + fn clear_recent_commands_also_clears_the_pick_counts() { + const CLEAR: &str = "help.clearRecentCommands"; + let mut open = Open::new("clear recent commands", WINDOW); + open.app.ui.recent_commands = vec!["paint.swap".into()]; + for _ in 0..3 { + open.app.ui.command_uses.count("paint.swap"); + } + open.app.ui.command_uses.count("object.group"); + let k = open.listed().iter().position(|id| id == CLEAR).expect("the command's result"); + open.frame(vec![]); + open.press(egui::Key::ArrowDown, k); + assert_eq!(open.highlighted(), k); + open.press(egui::Key::Enter, 1); + assert!(open.app.ui.recent_commands.is_empty(), "{:?}", open.app.ui.recent_commands); + assert_eq!(open.app.ui.command_uses, CommandUses::default(), "the pick of Clear is not counted either"); + let saved: crate::state::UiState = serde_json::from_value(serde_json::to_value(&open.app.ui).unwrap()).unwrap(); + assert_eq!(saved.command_uses, CommandUses::default()); + assert!(!menus::enabled(&open.app, CLEAR)); + // Counts without recent picks (Recent Commands emptied some other way) still enable it, + // and running it as a command empties them. + open.app.ui.command_uses.count("paint.swap"); + assert!(menus::enabled(&open.app, CLEAR), "enabled while a count is saved"); + open.app.run(CLEAR, serde_json::json!({})).unwrap(); + assert_eq!(open.app.ui.command_uses, CommandUses::default()); + assert_eq!(open.app.ui.command_uses.grade("paint.swap"), 0); + } + /// The palette opens again with its first row highlighted, even when it shows the same rows. #[test] fn the_palette_opens_again_with_its_first_row_highlighted() { @@ -2583,6 +2690,30 @@ mod tests { assert_eq!(open.app.ui.recent_commands, ["paint.swap", "object.group"]); } + /// A palette that its command closes and opens again before it is drawn closed starts at its + /// first row, so Enter on an empty search runs the last pick. + #[test] + fn the_palette_toggled_closed_and_open_between_frames_starts_at_its_first_row() { + let mut open = Open::new("", WINDOW); + open.app = VectorcraftApp::new(vectorcraft_testkit::fixtures::Fixture::Multi.session(), crate::Services::default()); + open.app.ui.recent_commands = vec!["paint.swap".into(), "object.group".into()]; + open.app.ui.palette_open = true; + open.frame(vec![]); + open.press(egui::Key::ArrowDown, 1); + assert_eq!(open.highlighted(), 1); + open.app.run("help.commandPalette", json!({})).unwrap(); + assert!(!open.app.ui.palette_open, "the command closes the palette"); + open.app.run("help.commandPalette", json!({})).unwrap(); + assert!(open.app.ui.palette_open, "and opens it again"); + open.frame(vec![]); + assert_eq!(open.highlighted(), 0); + let before = open.app.session.active().unwrap().history.undo.len(); + open.press(egui::Key::Enter, 1); + assert!(!open.app.ui.palette_open, "the palette closes"); + assert_eq!(open.app.session.active().unwrap().history.undo.len(), before + 1, "{}", open.app.ui.status); + assert_eq!(open.app.ui.recent_commands, ["paint.swap", "object.group"]); + } + /// A pick of the palette's own toggle is not recorded, and one saved earlier is not listed, so /// Enter on an empty search runs the last other pick. #[test] diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index 04086f0b81..5a04384e55 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -96,8 +96,9 @@ pub(crate) fn field_width(ui: &Ui) -> f32 { } /// The Corner Radius field of a live rectangle's properties: [`corner_radius`], which a new value -/// sets on those corners. The link behind it is the `singleCornerRadius` preference: off, a field -/// for each of the four corners follows, each setting its own corner. +/// sets on those corners. The link behind it is the `singleCornerRadius` preference: on, a Corner +/// menu follows that sets the kind of all four corners; off, a row for each of the four corners +/// follows, each with a radius field and a Corner menu that set its own corner. pub(crate) fn corner_radius_row(app: &mut VectorcraftApp, ui: &mut Ui, n: &Node, id: &str) { let fw = field_width(ui); let single = app.session.prefs.single_corner_radius; @@ -111,27 +112,97 @@ pub(crate) fn corner_radius_row(app: &mut VectorcraftApp, ui: &mut Ui, n: &Node, transform::set_pref(app, "singleCornerRadius", !single); } }); - if !single { + if single { + corner_kind_row(app, ui, n, id, fw); + } else { corner_fields(app, ui, n, id, fw); } } +/// The Corner menu of a live rectangle whose corners share one radius field: the kind of all four +/// corners, also while some of them are Direct-Selected, blank when they differ. A pick sets it on +/// every corner of each selected live rectangle ([`set_rectangle_kinds`]). +fn corner_kind_row(app: &mut VectorcraftApp, ui: &mut Ui, n: &Node, id: &str, width: f32) { + let Some(lc) = LiveCorners::of(n) else { return }; + let current = lc.style(&lc.all()).1; + ui.horizontal(|ui| { + dim_label(ui, tl!("Corner:")); + if let Some(kind) = corner_kind_menu(ui, (id, "kind"), tl!("Corner:"), current, width) { + set_rectangle_kinds(app, kind, None); + } + }); +} + +/// Set `kind` on corner `corner` (every corner for None) of each selected live rectangle +/// ([`set_rectangle_corners`]). +fn set_rectangle_kinds(app: &mut VectorcraftApp, kind: CornerKind, corner: Option) { + set_rectangle_corners(app, json!({"kind": kind}), corner); +} + +/// Run `object.setLiveShape` with `p` (a `kind` or `radius`) on corner `corner` (every corner for +/// None) of each selected live rectangle, leaving other selected objects as they are: one undo +/// step, or none when nothing changes. +fn set_rectangle_corners(app: &mut VectorcraftApp, mut p: Value, corner: Option) { + p["corners"] = corner.map_or(json!([0, 1, 2, 3]), |k| json!([k])); + // The edit the tool computes on another thread comes first: the rectangles are the ones + // selected after it. + match app.session.finish_tool_edit() { + Ok(reqs) => crate::canvas::apply_requests(app, Ok(reqs)), + Err(e) => { + app.status(e.to_string()); + return; + } + } + if app.session.active().is_none() { + return; + } + // The live rectangles of the selection when it runs, so an action that records it acts on the + // rectangles selected when it plays. + p["rectanglesOnly"] = json!(true); + if let Err(e) = app.run("object.setLiveShape", p) { + app.status(e); + } +} + +/// A menu of the corner kinds, `width` wide, showing `current` (blank for None) and named `name` +/// for screen readers. Returns the kind picked. +fn corner_kind_menu(ui: &mut Ui, id: impl std::hash::Hash, name: &str, current: Option, width: f32) -> Option { + let names: Vec<&str> = CornerKind::ALL.iter().map(|k| crate::dialogs::corners::kind_label(*k)).collect(); + let shown = current.map_or("", crate::dialogs::corners::kind_label); + crate::widgets::dropdown_names_named(ui, id, Some(name), shown, &names, width).and_then(|i| CornerKind::ALL.get(i).copied()) +} + /// The corners of a live rectangle in the order their fields show, with their labels. fn rectangle_corners() -> [(usize, &'static str); 4] { [(0, tl!("Top Left:")), (1, tl!("Top Right:")), (2, tl!("Bottom Right:")), (3, tl!("Bottom Left:"))] } -/// One Corner Radius field per corner of a live rectangle, each on its own row with its label, -/// the fields in line. +/// One Corner Radius field and one Corner menu per corner of a live rectangle, each pair on its own +/// row with the corner's label, the fields and menus in line; in a panel too narrow for that, each +/// menu goes on the row under its field. A value typed or a kind picked is set on that corner +/// alone, of each selected live rectangle ([`set_rectangle_corners`]). fn corner_fields(app: &mut VectorcraftApp, ui: &mut Ui, n: &Node, id: &str, width: f32) { let Some(lc) = LiveCorners::of(n) else { return }; let unit = app.session.general_unit(); - egui::Grid::new((id, "corners")).num_columns(2).spacing(vec2(6.0, 4.0)).show(ui, |ui| { + let widest = |names: &mut dyn Iterator| names.map(|t| crate::widgets::dim_label_width(ui, t)).fold(0.0, f32::max); + let labels = widest(&mut rectangle_corners().into_iter().map(|(_, label)| label)); + // The longest kind name, with the room the menu's button gives around it and its arrow. + let menu_width = width.max(widest(&mut CornerKind::ALL.into_iter().map(crate::dialogs::corners::kind_label)) + 26.0); + // The two gaps between the grid's three columns are 6 points each. + let in_line = labels + width + menu_width + 12.0 <= ui.available_width(); + egui::Grid::new((id, "corners")).num_columns(if in_line { 3 } else { 2 }).spacing(vec2(6.0, 4.0)).show(ui, |ui| { for (k, label) in rectangle_corners() { dim_label(ui, label); if let Some(v) = crate::widgets::num_field_named(ui, (id, "corner", k), Some(label), Some(lc.radius(k)), unit, width) { // A negative radius typed in rounds nothing: the command takes 0 or more. - app.run("object.setLiveShape", json!({"radius": v.max(0.0), "corners": [k]})).ok(); + set_rectangle_corners(app, json!({"radius": v.max(0.0)}), Some(k)); + } + if !in_line { + ui.end_row(); + ui.label(""); + } + if let Some(kind) = corner_kind_menu(ui, (id, "kind", k), label, Some(lc.kind(k)), menu_width) { + set_rectangle_kinds(app, kind, Some(k)); } ui.end_row(); } @@ -819,6 +890,8 @@ mod tests_color_wheel; #[cfg(test)] mod tests_color_wheel_box; #[cfg(test)] +mod tests_color_wheel_gamut; +#[cfg(test)] mod tests_color_wheel_harmony; #[cfg(test)] mod tests_color_wheel_vision; diff --git a/crates/ui-egui/src/panels/color_wheel.rs b/crates/ui-egui/src/panels/color_wheel.rs index 78f10e0cf6..6b3d563ed0 100644 --- a/crates/ui-egui/src/panels/color_wheel.rs +++ b/crates/ui-egui/src/panels/color_wheel.rs @@ -12,6 +12,11 @@ //! Brightness, Red, Green or Blue). The field shows the other two components on the Color //! Picker's axes. //! +//! Show Out-of-Gamut Colors grays out the cells of the wheel's square and the box's field whose +//! colors the CMYK space cannot print, by the out-of-gamut warning's test ([`Cms::out_of_gamut`]), +//! on a [`GAMUT_CELLS`] by [`GAMUT_CELLS`] grid kept until the channel, its value, the color +//! settings or the loaded profiles change. +//! //! Show Harmony puts a marker on the ring for each other color of the harmony rule picked under //! Harmony Rule (the Color Guide's rules whose colors each have a hue of their own), filled with //! that color. The markers follow the current color, and a click on one applies its color as a @@ -31,13 +36,13 @@ //! (). The choice is kept with the //! preferences too. //! -//! The view, the channel, the slider rows, Show Harmony, Harmony Rule and Show Color Vision -//! Preview are kept with the preferences (`ui.colorWheel`). +//! The view, the channel, the slider rows, Show Out-of-Gamut Colors, Show Harmony, Harmony Rule +//! and Show Color Vision Preview are kept with the preferences (`ui.colorWheel`). use egui::{Color32, Rect, Sense, Stroke, StrokeKind, Ui, UiBuilder, pos2, vec2}; use serde::{Deserialize, Serialize}; use serde_json::{Value, json}; -use vectorcraft_color::cms::{self, Cms, ProofSetup, ProofTarget}; +use vectorcraft_color::cms::{self, Cms, ColorSettings, ProofSetup, ProofTarget}; use vectorcraft_color::harmony::Harmony; use vectorcraft_color::oklab::{self, CHROMA_FULL}; use vectorcraft_color::{Color, Paint, hsb_to_rgb, hsl_to_rgb, rgb_to_hsb, rgb_to_hsl}; @@ -94,6 +99,9 @@ pub struct Settings { pub channel: Channel, #[serde(deserialize_with = "deserialize_sliders")] pub sliders: Sliders, + /// Show Out-of-Gamut Colors: gray out the colors the CMYK space cannot print. + #[serde(deserialize_with = "deserialize_flag")] + pub gamut: bool, /// Show Harmony: markers on the ring for the other colors of `harmony_rule`. #[serde(deserialize_with = "deserialize_flag")] pub harmony: bool, @@ -146,6 +154,7 @@ impl Default for Settings { view: View::default(), channel: Channel::default(), sliders: Sliders::default(), + gamut: false, harmony: false, harmony_rule: Harmony::Complementary, vision: false, @@ -199,11 +208,11 @@ pub fn deserialize_settings<'de, D: serde::Deserializer<'de>>(d: D) -> Result Result { @@ -214,7 +223,7 @@ pub(crate) fn command(app: &mut VectorcraftApp, p: &Value) -> Result Result<(), String> { - const KEYS: [&str; 6] = ["view", "channel", "sliders", "harmony", "harmonyRule", "vision"]; + const KEYS: [&str; 7] = ["view", "channel", "sliders", "gamut", "harmony", "harmonyRule", "vision"]; match p { Value::Null => {} Value::Object(o) => { @@ -243,6 +252,11 @@ pub(crate) fn set(settings: &mut Settings, p: &Value, cms: &Cms) -> Result<(), S set.sliders = sliders; } } + let key = "gamut"; + match p.get(key) { + None | Some(Value::Null) => {} + Some(v) => set.gamut = v.as_bool().ok_or_else(|| format!("`{key}` must be true or false"))?, + } let key = "harmony"; match p.get(key) { None | Some(Value::Null) => {} @@ -265,9 +279,9 @@ pub(crate) fn set(settings: &mut Settings, p: &Value, cms: &Cms) -> Result<(), S Ok(()) } -/// The panel menu: Wheel View and Box View, and Box Channel while the box shows; HSL Sliders and -/// OKLCH Sliders; Show Harmony and Harmony Rule while the wheel shows; and Show Color Vision -/// Preview. +/// The panel menu: Wheel View and Box View, and Box Channel while the box shows; Show Out-of-Gamut +/// Colors; HSL Sliders and OKLCH Sliders; Show Harmony and Harmony Rule while the wheel shows; and +/// Show Color Vision Preview. pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) { let set = app.ui.color_wheel.clone(); for (label, view) in [(tl!("Wheel View"), View::Wheel), (tl!("Box View"), View::Box)] { @@ -285,6 +299,9 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) { }); }); ui.separator(); + if menu_item(ui, tl!("Show Out-of-Gamut Colors"), true, set.gamut) { + command(app, &json!({ "gamut": !set.gamut })).ok(); + } let on = set.sliders == Sliders::Hsl; if menu_item(ui, tl!("HSL Sliders"), true, on) { let sliders = if on { Sliders::None } else { Sliders::Hsl }; @@ -318,6 +335,64 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) { } } +/// The cells across and down of the grid the out-of-gamut shading tests. +pub(crate) const GAMUT_CELLS: usize = 16; + +/// The cells of a field whose colors are out of the CMYK gamut, a row per [`GAMUT_CELLS`] from the +/// top: bit `i` of a row is its cell `i` from the left. +pub(crate) type GamutGrid = [u16; GAMUT_CELLS]; + +/// The out-of-gamut cells of the box of channel `ch` at strip value `z` through `cms`, each tested +/// at its center by the out-of-gamut warning's test ([`Cms::out_of_gamut`]) on the working-RGB +/// color of a pick there, before any conversion to CMYK or Lab in [`stored`]. The wheel's square is +/// the box of [`Channel::Hue`] at the ring's hue. +pub(crate) fn gamut_grid(cms: &Cms, ch: Channel, z: f32) -> GamutGrid { + let n = GAMUT_CELLS as f32; + let mut grid = [0; GAMUT_CELLS]; + for (row, bits) in grid.iter_mut().enumerate() { + for col in 0..GAMUT_CELLS { + let (x, y) = ((col as f32 + 0.5) / n, (row as f32 + 0.5) / n); + // A gray has no hue, and the hue a gray keeps does not change its color. + let [r, g, b] = cms.srgb_to_rgb(hsb_to_rgb(box_pick(ch, z, x, y, [0.0; 3]))); + if cms.out_of_gamut(&Color::rgb(r, g, b)) { + *bits |= 1 << col; + } + } + } + grid +} + +/// What the out-of-gamut grid depends on: the channel, its value's bits, the color settings and +/// [`cms::profiles_generation`], which changes when a profile is loaded again under the same name. +pub(crate) type GamutKey = (Channel, u32, ColorSettings, u64); + +/// The grid for `key` from `slot`, computed with `compute` and kept in `slot` when `slot` holds +/// another key's. +pub(crate) fn cached_grid(slot: &mut Option<(GamutKey, GamutGrid)>, key: GamutKey, compute: impl FnOnce() -> GamutGrid) -> GamutGrid { + match slot { + Some((k, grid)) if *k == key => *grid, + _ => { + let grid = compute(); + *slot = Some((key, grid)); + grid + } + } +} + +/// Panel state: the out-of-gamut grid drawn last and its [`GamutKey`]. +pub(crate) const GAMUT: &str = "color-wheel-gamut"; + +/// The out-of-gamut grid of channel `ch` at value `z` through `cms`, kept in the panel state so a +/// frame with the same channel, value, color settings and loaded profiles does not test the colors +/// again. +fn gamut_shade(ui: &Ui, cms: &Cms, ch: Channel, z: f32) -> GamutGrid { + let mut slot = pstate::>(ui.ctx(), GAMUT); + let key = (ch, z.to_bits(), cms.settings().clone(), cms::profiles_generation()); + let grid = cached_grid(&mut slot, key, || gamut_grid(cms, ch, z)); + set_pstate(ui.ctx(), GAMUT, slot); + grid +} + /// The display values of HSB `hsb` in `ch`'s space, from 0 to 1: hue, saturation and brightness, /// or red, green and blue. fn box_values(ch: Channel, hsb: [f32; 3]) -> [f32; 3] { @@ -362,16 +437,19 @@ fn strip_number(ch: Channel, hsb: [f32; 3]) -> (f64, &'static str, f64) { } /// The box in a `size` × `size` area: the field of channel `ch` and its strip, on HSB `hsb`, with -/// markers when `marked`. Returns the HSB a click, a drag, a key or a screen reader's action picks, -/// and its phase. -fn show_box(ui: &mut Ui, ch: Channel, hsb: [f32; 3], marked: bool, size: f32) -> Option<([f32; 3], Live)> { +/// markers when `marked` and the field's out-of-gamut cells grayed out when `gamut`. Returns the +/// HSB a click, a drag, a key or a screen reader's action picks, and its phase. +fn show_box(ui: &mut Ui, ch: Channel, hsb: [f32; 3], marked: bool, size: f32, gamut: Option<&Cms>) -> Option<([f32; 3], Live)> { let (z, x, y) = box_pos(ch, hsb); let mut pick = None; + let grid = gamut.map(|cms| gamut_shade(ui, cms, ch, z)); + let shade = grid.as_ref().map_or(&[][..], |g| &g[..]); ui.horizontal_top(|ui| { ui.spacing_mut().item_spacing.x = STRIP_GAP; let field = vec2((size - STRIP_GAP - STRIP).max(1.0), size); let at = |x: f32, y: f32| widgets::hsb32(box_pick(ch, z, x, y, hsb)); - if let (Some((x, y)), phase) = widgets::color_field(ui, "color-wheel-box", (tl!("Color box"), ch.field_axes()), field, (x, y), marked, &at) { + let labels = (tl!("Color box"), ch.field_axes()); + if let (Some((x, y)), phase) = widgets::color_field_shaded(ui, "color-wheel-box", labels, field, (x, y), marked, (&at, shade)) { pick = Some((box_pick(ch, z, x, y, hsb), phase)); } // The hue strip shows the whole spectrum; the others change only their own component. @@ -789,6 +867,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { (c, _) => display_hsb(&cms, &c.unwrap_or(app.session.last_solid)), }; let marked = color.is_some(); + let gamut = app.ui.color_wheel.gamut.then_some(&*cms); let mut pick: Option<([f32; 3], Live)> = None; ui.horizontal_top(|ui| { ui.vertical(|ui| { @@ -797,7 +876,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { }); let size = ui.available_width().min(MAX_WHEEL); if app.ui.color_wheel.view == View::Box { - pick = show_box(ui, app.ui.color_wheel.channel, hsb, marked, size); + pick = show_box(ui, app.ui.color_wheel.channel, hsb, marked, size, gamut); return; } let ring = widgets::hue_ring(ui, "color-wheel-ring", tl!("Hue ring"), size, hsb[0], marked); @@ -807,7 +886,11 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { [FieldAxis { name: tl!("Saturation"), units: 100.0, suffix: "%" }, FieldAxis { name: tl!("Brightness"), units: 100.0, suffix: "%" }]; let at = |x: f32, y: f32| widgets::hsb32([hsb[0], x, 1.0 - y]); let name = tl!("Saturation and brightness"); - let (field, field_phase) = widgets::color_field(&mut field_ui, "field", (name, axes), square.size(), (hsb[1], 1.0 - hsb[2]), marked, &at); + // The square is the hue box at the ring's hue, so it shares the box's grid. + let grid = gamut.map(|cms| gamut_shade(ui, cms, Channel::Hue, box_pos(Channel::Hue, hsb).0)); + let shade = grid.as_ref().map_or(&[][..], |g| &g[..]); + let pos = (hsb[1], 1.0 - hsb[2]); + let (field, field_phase) = widgets::color_field_shaded(&mut field_ui, "field", (name, axes), square.size(), pos, marked, (&at, shade)); // Show Harmony: the rule's other colors for the current one, which follow it. While a press // is held on a marker, the ring's drag under it picks nothing. let set = &app.ui.color_wheel; diff --git a/crates/ui-egui/src/panels/properties/tests.rs b/crates/ui-egui/src/panels/properties/tests.rs index 613eb73793..bc41fef557 100644 --- a/crates/ui-egui/src/panels/properties/tests.rs +++ b/crates/ui-egui/src/panels/properties/tests.rs @@ -1575,11 +1575,11 @@ fn direct_selected_corners_show_their_kind_and_radius() { // The whole path selected. app.run("select.set", json!({"ids": [star]})).unwrap(); assert!(!shows(&tall(&mut app, &ctx, vec![]), "Corner:"), "no corner selected"); - // A live rectangle's corner: its own Corner Radius row, once. + // A live rectangle's corner: its own Corner Radius row and Corner menu, once each. let r = rect(&mut app, 20.0, 20.0, 60.0, 40.0).as_u64().unwrap(); app.run("select.anchors", json!({"id": r, "anchors": [[0, 1]], "mode": "set"})).unwrap(); let texts = tall(&mut app, &ctx, vec![]); - assert!(!shows(&texts, "Corner:"), "{texts:?}"); + assert_eq!(texts.iter().filter(|(t, _)| t == "Corner:").count(), 1, "{texts:?}"); assert_eq!(texts.iter().filter(|(t, _)| t == "Corner Radius:").count(), 1, "{texts:?}"); } diff --git a/crates/ui-egui/src/panels/tests_color_wheel.rs b/crates/ui-egui/src/panels/tests_color_wheel.rs index 103e3f4823..9fb93ea928 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel.rs @@ -1072,7 +1072,7 @@ fn ui_color_wheel_sets_and_reads_the_sliders() { assert_eq!(app.run("ui.colorWheel", json!({})).unwrap()["sliders"], json!("none")); assert_eq!(app.run("ui.colorWheel", json!({"sliders": "hwb"})).unwrap_err(), "`sliders` must be none, oklch or hsl"); let got = app.run("ui.colorWheel", json!({"sliders": "oklch"})).unwrap(); - let want = json!({"view": "box", "channel": "red", "harmony": false, "harmonyRule": "complementary", "vision": false, "sliders": "oklch"}); + let want = json!({"view": "box", "channel": "red", "gamut": false, "harmony": false, "harmonyRule": "complementary", "vision": false, "sliders": "oklch"}); assert_eq!(got, want); let e = app.run("ui.colorWheel", json!({"view": "wheel", "sliders": "hwb"})).unwrap_err(); assert_eq!(e, "`sliders` must be none, oklch or hsl"); diff --git a/crates/ui-egui/src/panels/tests_color_wheel_box.rs b/crates/ui-egui/src/panels/tests_color_wheel_box.rs index d0f35ee13c..ac054cc519 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel_box.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel_box.rs @@ -167,7 +167,7 @@ fn the_strip_takes_the_arrow_keys_and_screen_readers_actions() { #[test] fn ui_color_wheel_sets_and_reads_the_view_and_the_channel() { let mut app = VectorcraftApp::new(Session::new(), Default::default()); - let harmony = json!({"sliders": "none", "harmony": false, "harmonyRule": "complementary", "vision": false}); + let harmony = json!({"sliders": "none", "gamut": false, "harmony": false, "harmonyRule": "complementary", "vision": false}); let with = |v: serde_json::Value| { let mut v = v; v.as_object_mut().unwrap().extend(harmony.as_object().unwrap().clone()); @@ -217,9 +217,9 @@ fn ui_color_wheel_rejects_other_params() { let e = app.run("ui.colorWheel", json!([1])).unwrap_err(); assert_eq!(e, "the params must be an object, not [1]"); let e = app.run("ui.colorWheel", json!({"veiw": "wheel"})).unwrap_err(); - assert_eq!(e, "unknown parameter `veiw`; the command takes: view, channel, sliders, harmony, harmonyRule, vision"); + assert_eq!(e, "unknown parameter `veiw`; the command takes: view, channel, sliders, gamut, harmony, harmonyRule, vision"); let e = app.run("ui.colorWheel", json!({"view": "wheel", "chanel": "blue"})).unwrap_err(); - assert_eq!(e, "unknown parameter `chanel`; the command takes: view, channel, sliders, harmony, harmonyRule, vision"); + assert_eq!(e, "unknown parameter `chanel`; the command takes: view, channel, sliders, gamut, harmony, harmonyRule, vision"); assert_eq!(app.ui.color_wheel, Settings { view: View::Box, channel: Channel::Red, ..Default::default() }, "an error changes nothing"); } @@ -277,7 +277,7 @@ fn ui_color_wheel_answers_junk_params_without_a_panic() { #[test] fn the_settings_are_kept_and_read_leniently() { let ui = crate::UiState { - color_wheel: Settings { view: View::Box, channel: Channel::Blue, vision: true, ..Default::default() }, + color_wheel: Settings { view: View::Box, channel: Channel::Blue, gamut: true, vision: true, ..Default::default() }, color_rgb_percent: true, ..Default::default() }; diff --git a/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs b/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs new file mode 100644 index 0000000000..3de5f2a7fd --- /dev/null +++ b/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs @@ -0,0 +1,265 @@ +//! The Color Wheel panel's Show Out-of-Gamut Colors: the grid of out-of-gamut cells, its cache, the +//! wheel's square and the box sharing it, `ui.colorWheel {gamut}`, the panel menu and the saved +//! setting. + +use egui::vec2; +use egui_kittest::Harness; +use egui_kittest::kittest::Queryable; +use serde_json::json; +use vectorcraft_color::cms::{self, Cms, ColorSettings}; +use vectorcraft_color::{Color, hsb_to_rgb}; +use vectorcraft_engine::Session; + +use super::color_wheel::{GAMUT, GAMUT_CELLS, GamutGrid, GamutKey, Settings, View, box_pick, cached_grid, gamut_grid, show}; +use crate::VectorcraftApp; +use crate::dialogs::color_picker::Channel; + +/// Whether cell `col` of row `row` (from the top-left) of `grid` is out of gamut. +fn marked(grid: &GamutGrid, col: usize, row: usize) -> bool { + (grid[row] >> col) & 1 == 1 +} + +/// An app with a selected rectangle filled with `fill`, its Color Wheel panel on `view` with Show +/// Out-of-Gamut Colors set to `gamut`. +fn app(fill: &str, view: &str, gamut: bool) -> VectorcraftApp { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 200, "height": 200})).unwrap(); + app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 50, "height": 50})).unwrap(); + app.run("paint.setFill", json!({"color": fill})).unwrap(); + app.run("ui.colorWheel", json!({"view": view, "channel": "hue", "gamut": gamut})).unwrap(); + app +} + +fn harness(app: VectorcraftApp) -> Harness<'static, VectorcraftApp> { + let mut h = Harness::builder().with_size(vec2(260.0, 320.0)).build_ui_state(|ui, app: &mut VectorcraftApp| show(app, ui), app); + h.run_steps(2); + h +} + +/// The grid the panel drew last, with its key. +fn drawn(h: &Harness<'static, VectorcraftApp>) -> Option<(GamutKey, GamutGrid)> { + super::pstate::>(&h.ctx, GAMUT) +} + +/// At hue 240° the field's top-right cell is nearly pure blue, which the CMYK space cannot print, +/// and its bottom-left cell is nearly black, which it can. Each cell is the color a pick at its +/// center stores, tested as the out-of-gamut warning tests it. +#[test] +fn the_hue_grid_marks_blue_and_leaves_black() { + let cms = Cms::default(); + let grid = gamut_grid(&cms, Channel::Hue, 240.0 / 360.0); + let last = GAMUT_CELLS - 1; + assert!(marked(&grid, last, 0), "{grid:04x?}"); + assert!(!marked(&grid, 0, last), "{grid:04x?}"); + for row in 0..GAMUT_CELLS { + for col in 0..GAMUT_CELLS { + let n = GAMUT_CELLS as f32; + let hsb = box_pick(Channel::Hue, 240.0 / 360.0, (col as f32 + 0.5) / n, (row as f32 + 0.5) / n, [0.0; 3]); + let [r, g, b] = cms.srgb_to_rgb(hsb_to_rgb(hsb)); + assert_eq!(marked(&grid, col, row), cms.out_of_gamut(&Color::rgb(r, g, b)), "cell {col}, {row}"); + } + } +} + +/// In the Blue box at full blue, the field's bottom-left cell (no red, no green) is nearly pure +/// blue. +#[test] +fn an_rgb_box_marks_its_own_cells() { + let grid = gamut_grid(&Cms::default(), Channel::Blue, 1.0); + assert!(marked(&grid, 0, GAMUT_CELLS - 1), "{grid:04x?}"); +} + +/// With uncalibrated CMYK as the CMYK space every color counts as printable, as the out-of-gamut +/// warning has it, so no cell is marked. +#[test] +fn uncalibrated_cmyk_marks_nothing() { + let cms = Cms::new(&ColorSettings { cmyk: cms::DEVICE_CMYK.into(), ..ColorSettings::default() }).unwrap(); + assert_eq!(gamut_grid(&cms, Channel::Hue, 240.0 / 360.0), [0; GAMUT_CELLS]); +} + +/// The cache computes a grid once per key: the same channel, value, color settings and profile +/// generation reuse it, and a change of any of them computes it again. +#[test] +fn the_cache_computes_once_per_key() { + let mut slot = None; + let mut runs = 0; + let settings = ColorSettings::default(); + let mut get = |slot: &mut Option<(GamutKey, GamutGrid)>, key: GamutKey| { + cached_grid(slot, key, || { + runs += 1; + [runs; GAMUT_CELLS] + }) + }; + let key = (Channel::Hue, 0.5f32.to_bits(), settings.clone(), 0); + assert_eq!(get(&mut slot, key.clone()), [1; GAMUT_CELLS]); + assert_eq!(get(&mut slot, key.clone()), [1; GAMUT_CELLS], "the same key is not computed again"); + assert_eq!(get(&mut slot, (Channel::Hue, 0.25f32.to_bits(), settings.clone(), 0)), [2; GAMUT_CELLS]); + assert_eq!(get(&mut slot, (Channel::Red, 0.25f32.to_bits(), settings.clone(), 0)), [3; GAMUT_CELLS]); + let device = ColorSettings { cmyk: cms::DEVICE_CMYK.into(), ..settings }; + assert_eq!(get(&mut slot, (Channel::Red, 0.25f32.to_bits(), device.clone(), 0)), [4; GAMUT_CELLS]); + assert_eq!(get(&mut slot, (Channel::Red, 0.25f32.to_bits(), device, 1)), [5; GAMUT_CELLS], "a profile loaded again"); +} + +/// A profile loaded again under the same name can change which colors are printable while the +/// color settings stay the same, so the panel tests the colors again after a profile is +/// registered. +#[test] +fn the_grid_is_computed_again_after_a_profile_is_loaded() { + let mut h = harness(app("#3366cc", "box", true)); + let Some((before, _)) = drawn(&h) else { panic!("the box drew no grid") }; + /// Unregisters the profile when dropped, also after a failed assertion. + struct Unregister(&'static str); + impl Drop for Unregister { + fn drop(&mut self) { + cms::unregister_icc(self.0); + } + } + let name = "Color Wheel Gamut Reload CMYK"; + let bytes = cms::icc_bytes(cms::GENERIC_CMYK).unwrap(); + cms::register_icc(&bytes, Some(name.into())).unwrap(); + let _unregister = Unregister(name); + h.run_steps(2); + let Some((after, _)) = drawn(&h) else { panic!("the box drew no grid") }; + assert_eq!((after.0, after.1, &after.2), (before.0, before.1, &before.2)); + assert!(after.3 > before.3, "the key follows the loaded profiles: {} then {}", before.3, after.3); +} + +/// The wheel's square is the hue box at the ring's hue: both draw the same grid, under one key, so +/// a switch between them does not test the colors again. +#[test] +fn the_wheel_and_the_hue_box_shade_the_same_cells() { + let mut h = harness(app("#3366cc", "wheel", true)); + let cms = cms::active(); + let Some((key, grid)) = drawn(&h) else { panic!("the wheel drew no grid") }; + let z = f32::from_bits(key.1); + assert_eq!((key.0, &key.2), (Channel::Hue, cms.settings())); + assert!((z * 360.0 - 220.0).abs() < 0.5, "the ring's hue: {}", z * 360.0); + assert_eq!(grid, gamut_grid(&cms, Channel::Hue, z)); + h.state_mut().run("ui.colorWheel", json!({"view": "box"})).unwrap(); + h.run_steps(2); + // Other tests in this process may register profiles between the frames, which changes the + // key's profile generation; the channel, value, settings and grid stay the same. + let Some((boxed, boxed_grid)) = drawn(&h) else { panic!("the box drew no grid") }; + assert_eq!((boxed.0, boxed.1, &boxed.2, boxed_grid), (key.0, key.1, &key.2, grid)); +} + +/// With Show Out-of-Gamut Colors off, the panel tests no colors. +#[test] +fn with_the_setting_off_no_grid_is_computed() { + let h = harness(app("#3366cc", "box", false)); + assert_eq!(drawn(&h), None); +} + +/// `ui.colorWheel {gamut}` sets the setting and keeps the others; a key set to null keeps its value +/// while the other keys apply; a value that is not true or false is an error that changes nothing, +/// translated where messages are. +#[test] +fn ui_color_wheel_sets_gamut() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + let with = |v: serde_json::Value| { + let mut v = v; + let rest = json!({"sliders": "none", "harmony": false, "harmonyRule": "complementary", "vision": false}); + v.as_object_mut().unwrap().extend(rest.as_object().unwrap().clone()); + v + }; + app.run("ui.colorWheel", json!({"view": "box"})).unwrap(); + assert_eq!(app.run("ui.colorWheel", json!({"gamut": true})).unwrap(), with(json!({"view": "box", "channel": "hue", "gamut": true}))); + let e = app.run("ui.colorWheel", json!({"view": "wheel", "gamut": "yes"})).unwrap_err(); + assert_eq!(e, "`gamut` must be true or false"); + assert_eq!(app.ui.color_wheel, Settings { view: View::Box, gamut: true, ..Default::default() }, "an error changes nothing"); + assert_eq!(app.run("ui.colorWheel", json!({"gamut": null})).unwrap()["gamut"], json!(true), "null keeps the value"); + app.run("ui.colorWheel", json!({"channel": "red"})).unwrap(); + let got = app.run("ui.colorWheel", json!({"view": "wheel", "channel": null, "gamut": null})).unwrap(); + assert_eq!(got, with(json!({"view": "wheel", "channel": "red", "gamut": true})), "null keeps a value while the other keys apply"); + let got = app.run("ui.colorWheel", json!({"view": null, "gamut": false})).unwrap(); + assert_eq!(got, with(json!({"view": "wheel", "channel": "red", "gamut": false})), "a null view keeps the view while gamut applies"); + for code in ["de", "fr", "ja", "zh-hans"] { + let lang = crate::i18n::Lang::from_code(code).expect("registered"); + let shown = crate::i18n::message(lang, &e); + assert_ne!(shown, e, "{code}"); + assert!(shown.contains("`gamut`"), "{code}: {shown}"); + } +} + +/// The setting survives a JSON round trip of the preferences, and a saved value that is not true +/// or false reads as off without losing the other settings. +#[test] +fn the_gamut_setting_is_kept_and_read_leniently() { + let ui = crate::UiState { color_wheel: Settings { view: View::Box, gamut: true, ..Default::default() }, ..Default::default() }; + let saved = serde_json::to_value(&ui).unwrap(); + assert_eq!(saved["color_wheel"]["gamut"], json!(true)); + let back: crate::UiState = serde_json::from_value(saved.clone()).unwrap(); + assert_eq!(back.color_wheel, ui.color_wheel); + let mut odd = saved; + odd["color_wheel"] = json!({"view": "box", "channel": "red", "gamut": "yes"}); + let back: crate::UiState = serde_json::from_value(odd).unwrap(); + assert_eq!(back.color_wheel, Settings { view: View::Box, channel: Channel::Red, gamut: false, ..Default::default() }); +} + +/// The panel menu's Show Out-of-Gamut Colors is checked while the setting is on, and switches it. +#[test] +fn the_panel_menu_switches_the_shading() { + let app = app("#ff0000", "wheel", false); + let mut fonts = false; + let mut h = Harness::builder().with_size(vec2(260.0, 360.0)).build_ui_state( + move |ui, app: &mut VectorcraftApp| { + // The fonts, which draw the check mark, take effect from the next frame. + if !fonts { + crate::theme::install_fonts(ui.ctx()); + fonts = true; + return; + } + assert!(super::panel_menu_items(app, ui, super::color_wheel::ID)); + }, + app, + ); + h.run_steps(3); + h.get_by_label(" Show Out-of-Gamut Colors").click(); + h.run_steps(2); + assert!(h.state().ui.color_wheel.gamut); + assert!(h.query_by_label("✓ Show Out-of-Gamut Colors").is_some()); + h.get_by_label("✓ Show Out-of-Gamut Colors").click(); + h.run_steps(2); + assert!(!h.state().ui.color_wheel.gamut); +} + +/// The edge runs between the marked cells and the others, inside the grid only, and bits past the +/// grid's width are not cells. +#[test] +fn the_edge_runs_between_marked_and_unmarked_cells() { + assert_eq!(crate::widgets::shade_edges(&[0b01, 0b00]), vec![[(1, 0), (1, 1)], [(0, 1), (1, 1)]]); + assert_eq!(crate::widgets::shade_edges(&[0b11, 0b11]), Vec::<[(usize, usize); 2]>::new(), "all marked"); + assert_eq!(crate::widgets::shade_edges(&[0b100]), Vec::<[(usize, usize); 2]>::new(), "bit 2 is past a 1 × 1 grid"); + assert_eq!(crate::widgets::shade_edges(&[]), Vec::<[(usize, usize); 2]>::new()); +} + +/// The gray covers each marked cell and no other, and each edge is drawn dark, then light on top. +#[test] +fn the_gray_covers_the_marked_cells_only() { + use egui::{Pos2, Rect, Shape}; + let ctx = egui::Context::default(); + let rect = Rect::from_min_size(Pos2::new(10.0, 20.0), vec2(16.0, 16.0)); + let mut out = ctx.run_ui(egui::RawInput::default(), |ui| crate::widgets::shade_cells(ui.painter(), rect, &[0b01, 0b10])); + out.textures_delta.clear(); + let grays: Vec = out + .shapes + .iter() + .filter_map(|c| match &c.shape { + Shape::Rect(r) if r.fill == crate::widgets::SHADE => Some(r.rect), + _ => None, + }) + .collect(); + let cell = |col: f32, row: f32| Rect::from_min_size(Pos2::new(10.0 + col * 8.0, 20.0 + row * 8.0), vec2(8.0, 8.0)); + assert_eq!(grays, vec![cell(0.0, 0.0), cell(1.0, 1.0)]); + let lines: Vec<(f32, egui::Color32)> = out + .shapes + .iter() + .filter_map(|c| match &c.shape { + Shape::LineSegment { stroke, .. } => Some((stroke.width, stroke.color)), + _ => None, + }) + .collect(); + let dark = vec![(2.0, egui::Color32::BLACK); 4]; + let light = vec![(1.0, egui::Color32::WHITE); 4]; + assert_eq!(lines, [dark, light].concat(), "four edges, dark under light"); +} diff --git a/crates/ui-egui/src/panels/tests_color_wheel_vision.rs b/crates/ui-egui/src/panels/tests_color_wheel_vision.rs index 31bb3bc48b..8a0cb95ee5 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel_vision.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel_vision.rs @@ -225,7 +225,7 @@ fn the_panel_menu_turns_the_row_on_and_off() { #[test] fn ui_color_wheel_sets_and_reads_the_settings() { let mut app = VectorcraftApp::new(Session::new(), Default::default()); - let settings = |view: &str, vision: bool| json!({"view": view, "channel": "hue", "harmony": false, "harmonyRule": "complementary", "vision": vision, "sliders": "none"}); + let settings = |view: &str, vision: bool| json!({"view": view, "channel": "hue", "gamut": false, "harmony": false, "harmonyRule": "complementary", "vision": vision, "sliders": "none"}); assert_eq!(app.run("ui.colorWheel", json!({})).unwrap(), settings("wheel", false)); assert_eq!(app.run("ui.colorWheel", json!({"vision": true})).unwrap(), settings("wheel", true)); assert_eq!(crate::control::inspect(&app, &egui::Context::default())["ui"]["color_wheel"]["vision"], true); @@ -236,7 +236,7 @@ fn ui_color_wheel_sets_and_reads_the_settings() { assert_eq!(app.run("ui.colorWheel", json!(5)).unwrap_err(), "the params must be an object, not 5"); assert_eq!( app.run("ui.colorWheel", json!({"visoin": false})).unwrap_err(), - "unknown parameter `visoin`; the command takes: view, channel, sliders, harmony, harmonyRule, vision" + "unknown parameter `visoin`; the command takes: view, channel, sliders, gamut, harmony, harmonyRule, vision" ); assert!(app.ui.color_wheel.vision); assert_eq!(app.run("ui.colorWheel", json!({"vision": null})).unwrap()["vision"], true); diff --git a/crates/ui-egui/src/panels/tests_three_d.rs b/crates/ui-egui/src/panels/tests_three_d.rs index 1226b292d7..eeb0af53ce 100644 --- a/crates/ui-egui/src/panels/tests_three_d.rs +++ b/crates/ui-egui/src/panels/tests_three_d.rs @@ -253,6 +253,128 @@ fn a_change_reaches_each_selected_3d_effect_and_no_other_effect() { assert_eq!(fx(c)[0].params, c_shadow); } +/// A custom bevel picked in the panel sends its name and points with `bevel`, to the effects that +/// take a bevel only, and another custom bevel replaces them. +#[test] +fn a_custom_bevel_sends_its_name_and_points() { + let mut app = app(); + let a = app.session.active().unwrap().selection.objects[0].0; + set_type(&mut app, "extrude").unwrap(); + let b = app.run("shape.rectangle", json!({"x": 250, "y": 100, "width": 100, "height": 100})).unwrap()["id"].as_u64().unwrap(); + app.run("effect.apply", json!({"effect": "threeD.inflate", "item": null})).unwrap(); + app.run("select.set", json!({"ids": [a, b]})).unwrap(); + let ctx = egui::Context::default(); + let pick = |name: &str, points: Value| { + Map::from_iter([ + ("bevel".to_string(), json!("custom")), + (vectorcraft_effects::BEVEL_NAME.to_string(), json!(name)), + (vectorcraft_effects::BEVEL_PROFILE.to_string(), points), + ]) + }; + let notch = json!([[0.0, 0.0], [0.2, 0.6], [0.7, 0.4], [1.0, 1.0]]); + send(&mut app, &ctx, pick("Notch", notch.clone()), false); + let fx = |app: &VectorcraftApp, id: u64| { + app.session.active().unwrap().doc.node(vectorcraft_doc::NodeId(id)).unwrap().appearance.effects[0].params.clone() + }; + let p = fx(&app, a); + assert_eq!( + (&p["bevel"], &p[vectorcraft_effects::BEVEL_NAME], &p[vectorcraft_effects::BEVEL_PROFILE]), + (&json!("custom"), &json!("Notch"), ¬ch) + ); + assert!(fx(&app, b).get(vectorcraft_effects::BEVEL_PROFILE).is_none()); + let steps = json!([[0.0, 0.0], [0.0, 0.5], [0.5, 0.5], [0.5, 1.0], [1.0, 1.0]]); + send(&mut app, &ctx, pick("Steps", steps.clone()), false); + let p = fx(&app, a); + assert_eq!((&p[vectorcraft_effects::BEVEL_NAME], &p[vectorcraft_effects::BEVEL_PROFILE]), (&json!("Steps"), &steps)); +} + +/// With one Extrude & Bevel on a custom bevel and one without, picking that custom bevel sends its +/// name and points too, though the form already held them, so both effects take it. +#[test] +fn a_custom_bevel_picked_for_a_mixed_selection_reaches_every_effect() { + let mut app = app(); + let notch = json!([[0.0, 0.0], [0.2, 0.6], [0.7, 0.4], [1.0, 1.0]]); + let custom = json!({"bevel": "custom", "bevelName": "Notch", "bevelProfile": notch}); + app.run("effect.apply", json!({"effect": "threeD.extrude", "item": null, "params": custom})).unwrap(); + let a = app.session.active().unwrap().selection.objects[0].0; + let b = app.run("shape.rectangle", json!({"x": 250, "y": 100, "width": 100, "height": 100})).unwrap()["id"].as_u64().unwrap(); + app.run("effect.apply", json!({"effect": "threeD.extrude", "item": null})).unwrap(); + app.run("select.set", json!({"ids": [a, b]})).unwrap(); + let mut fields = target(&app).map(|t| vectorcraft_effects::merged_params(&t.effect, &t.params)).unwrap().as_object().cloned().unwrap(); + super::mark_mixed(&app, &mut fields); + assert_eq!((&fields["bevel"], &fields[vectorcraft_effects::BEVEL_NAME]), (&Value::Null, &json!("Notch"))); + let before = Value::Object(fields.clone()); + fields.insert("bevel".into(), json!("custom")); + let changed = changed_settings(&before, &Value::Object(fields)); + assert_eq!(Value::Object(changed.clone()), json!({"bevel": "custom", "bevelName": "Notch", "bevelProfile": notch})); + send(&mut app, &egui::Context::default(), changed, false); + let st = app.session.active().unwrap(); + for id in [a, b] { + let p = &st.doc.node(vectorcraft_doc::NodeId(id)).unwrap().appearance.effects[0].params; + assert_eq!((&p["bevel"], &p[vectorcraft_effects::BEVEL_PROFILE]), (&json!("custom"), ¬ch), "{id}"); + } +} + +/// Two custom bevels the bevels file does not list: the mixed selection unsets the shown points, +/// and Bevel Shape still lists the first effect's own bevel, which then reaches both effects. +#[test] +fn a_mixed_selection_still_lists_the_first_effects_own_custom_bevel() { + use crate::dialogs::revolve::{OWN_BEVEL, bevel_options}; + let mut app = app(); + let notch = json!([[0.0, 0.0], [0.2, 0.6], [0.7, 0.4], [1.0, 1.0]]); + let steps = json!([[0.0, 0.0], [0.0, 0.5], [0.5, 0.5], [0.5, 1.0], [1.0, 1.0]]); + let custom = |name: &str, points: &Value| json!({"bevel": "custom", "bevelName": name, "bevelProfile": points}); + app.run("effect.apply", json!({"effect": "threeD.extrude", "item": null, "params": custom("Notch", ¬ch)})).unwrap(); + let a = app.session.active().unwrap().selection.objects[0].0; + let b = app.run("shape.rectangle", json!({"x": 250, "y": 100, "width": 100, "height": 100})).unwrap()["id"].as_u64().unwrap(); + app.run("effect.apply", json!({"effect": "threeD.extrude", "item": null, "params": custom("Steps", &steps)})).unwrap(); + app.run("select.set", json!({"ids": [a, b]})).unwrap(); + let mut fields = target(&app).map(|t| vectorcraft_effects::merged_params(&t.effect, &t.params)).unwrap().as_object().cloned().unwrap(); + let own = super::own_bevel(&fields).unwrap(); + super::mark_mixed(&app, &mut fields); + assert_eq!(fields[vectorcraft_effects::BEVEL_PROFILE], Value::Null); + fields.insert(OWN_BEVEL.into(), own); + let (options, builtin) = bevel_options(&app, &fields, "threeD.extrude"); + assert_eq!(options.len(), builtin + 1); + let (label, value, picked) = options[builtin].clone(); + assert_eq!((label.as_str(), value), ("Notch", json!("custom"))); + let (name, points) = picked.unwrap(); + assert_eq!(points, notch); + // Picking it sends the whole bevel to both effects. + fields.remove(OWN_BEVEL); + let before = Value::Object(fields.clone()); + fields.insert(vectorcraft_effects::BEVEL_NAME.into(), json!(name)); + fields.insert(vectorcraft_effects::BEVEL_PROFILE.into(), points); + send(&mut app, &egui::Context::default(), changed_settings(&before, &Value::Object(fields)), false); + let st = app.session.active().unwrap(); + for id in [a, b] { + let p = &st.doc.node(vectorcraft_doc::NodeId(id)).unwrap().appearance.effects[0].params; + assert_eq!((&p[vectorcraft_effects::BEVEL_NAME], &p[vectorcraft_effects::BEVEL_PROFILE]), (&json!("Notch"), ¬ch), "{id}"); + } +} + +/// An effect's own custom bevel named like a bevel of the bevels file with other points is listed +/// under its own label, so Bevel Shape does not show two entries of one name. +#[test] +fn an_own_custom_bevel_named_like_a_file_bevel_gets_its_own_label() { + use crate::dialogs::revolve::bevel_options; + let dir = std::env::temp_dir().join(format!("vectorcraft-ui-bevels-own-label-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(&dir).unwrap(); + let mut app = app(); + app.session.attach_bevels_file(dir.join(vectorcraft_engine::cmd::bevels::FILE_NAME).to_string_lossy().to_string()); + app.run("threeD.bevels.edit", json!({})).unwrap(); + let file = app.session.bevels.get("Example Bevel").unwrap().profile_json(); + let other = json!([[0.0, 0.0], [0.5, 0.5], [1.0, 1.0]]); + assert_ne!(file, other); + let fields = json!({"bevel": "custom", "bevelName": "Example Bevel", "bevelProfile": other}).as_object().cloned().unwrap(); + let (options, builtin) = bevel_options(&app, &fields, "threeD.extrude"); + let _ = std::fs::remove_dir_all(&dir); + let labels: Vec<&str> = options[builtin..].iter().map(|(l, _, _)| l.as_str()).collect(); + assert_eq!(labels, ["Example Bevel", "Example Bevel (document)"]); + assert_eq!(options[builtin + 1].2, Some(("Example Bevel".to_string(), other))); +} + #[test] fn the_panel_finds_a_3d_effect_on_a_fill() { let mut app = app(); diff --git a/crates/ui-egui/src/panels/three_d.rs b/crates/ui-egui/src/panels/three_d.rs index 61993a8581..64bc5e08f3 100644 --- a/crates/ui-egui/src/panels/three_d.rs +++ b/crates/ui-egui/src/panels/three_d.rs @@ -11,10 +11,11 @@ use egui::Ui; use serde_json::{Map, Value, json}; use vectorcraft_doc::{Effect, Node, NodeId, NodeKind}; -use vectorcraft_effects::{CLASSIC_EXTRUDE, CLASSIC_REVOLVE, EXTRUDE, INFLATE, THREE_D_TYPES, is_three_d}; +use vectorcraft_effects::{BEVEL_NAME, BEVEL_PROFILE, CLASSIC_EXTRUDE, CLASSIC_REVOLVE, EXTRUDE, INFLATE, THREE_D_TYPES, is_three_d}; use super::{live_run, pstate, set_pstate}; use crate::VectorcraftApp; +use crate::dialogs::revolve::OWN_BEVEL; use crate::dialogs::three_d_materials as materials; use crate::state::Dialog; use crate::theme::Tokens; @@ -155,9 +156,11 @@ pub(crate) fn send(app: &mut VectorcraftApp, ctx: &egui::Context, changed: Map = pending .iter() - .filter(|(k, _)| takes.get(k.as_str()).is_some() && (k.as_str() != "lights" || *same_lights)) + .filter(|(k, _)| (takes.get(k.as_str()).is_some() || custom_bevel(k)) && (k.as_str() != "lights" || *same_lights)) .map(|(k, v)| (k.clone(), v.clone())) .collect(); (!params.is_empty()) @@ -240,13 +243,19 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { } // The applied effect's settings in the dialog's form, with the controls' own state. let mut fields = vectorcraft_effects::merged_params(&t.effect, &t.params).as_object().cloned().unwrap_or_default(); + let own_bevel = own_bevel(&fields); mark_mixed(app, &mut fields); fields.extend(pstate::>(&ctx, UI_STATE)); fields.insert("__effect".into(), json!(t.effect)); fields.insert("__panel".into(), json!(true)); + if let Some(own) = own_bevel { + fields.insert(OWN_BEVEL.into(), own); + } let mut d = Dialog { kind: ID.into(), fields }; let before = crate::dialogs::form::params(&d); crate::dialogs::revolve::controls(app, ui, &mut d); + d.fields.remove(OWN_BEVEL); + let edit_bevels = d.fields.remove("__editBevels").is_some(); let action = d.fields.remove(materials::ACTION).and_then(|v| materials::Action::from_value(&v)); let state: Map = d .fields @@ -259,6 +268,14 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { let changed = changed_settings(&before, &after); let dragging = ctx.input(|i| i.pointer.any_down()); send(app, &ctx, changed, dragging); + // Bevel Shape's Edit Bevels…: the bevels file opens as a document of its own. + if edit_bevels { + finish(app, &ctx); + if let Err(e) = app.run("threeD.bevels.edit", json!({})) { + app.ui.status = e; + } + return; + } if quick_actions_shown(&d) { ui.add_space(10.0); let t = Tokens::get(ui.ctx()); @@ -581,10 +598,30 @@ pub(crate) fn mark_mixed(app: &VectorcraftApp, fields: &mut Map) } } +/// The custom bevel of an effect's settings `fields`, `[name, points]`, when its `bevel` is +/// `"custom"` with points (the Bevel Shape menu lists it while a mixed selection unsets them). +pub(crate) fn own_bevel(fields: &Map) -> Option { + let points = fields.get(BEVEL_PROFILE).filter(|v| !v.is_null())?; + let name = fields.get(BEVEL_NAME).and_then(Value::as_str).unwrap_or_default(); + (fields.get("bevel").and_then(Value::as_str) == Some("custom")).then(|| json!([name, points])) +} + /// The settings whose values differ between `before` and `after`, with their values in `after`. +/// A change to a custom bevel (`bevel` `"custom"`, its name or its points) sends all three, so an +/// effect of a mixed selection that had none takes the whole bevel. pub(crate) fn changed_settings(before: &Value, after: &Value) -> Map { let Some(after) = after.as_object() else { return Map::new() }; - after.iter().filter(|(k, v)| before.get(k.as_str()) != Some(*v)).map(|(k, v)| (k.clone(), v.clone())).collect() + let mut changed: Map = + after.iter().filter(|(k, v)| before.get(k.as_str()) != Some(*v)).map(|(k, v)| (k.clone(), v.clone())).collect(); + let custom = ["bevel", BEVEL_NAME, BEVEL_PROFILE]; + if after.get("bevel").and_then(Value::as_str) == Some("custom") && custom.iter().any(|k| changed.contains_key(*k)) { + for k in custom { + if let Some(v) = after.get(k) { + changed.insert(k.into(), v.clone()); + } + } + } + changed } #[cfg(test)] diff --git a/crates/ui-egui/src/panels/transform/tests.rs b/crates/ui-egui/src/panels/transform/tests.rs index dbb92b3cd4..75ae9f2594 100644 --- a/crates/ui-egui/src/panels/transform/tests.rs +++ b/crates/ui-egui/src/panels/transform/tests.rs @@ -136,6 +136,101 @@ fn a_polygon_shows_its_polygon_properties() { assert!(live(&app).polygon_sides_equal()); } +/// A live rectangle's Rectangle Properties show one Corner menu for all four corners while Corner +/// Radius is linked, blank when the corners' kinds differ, and one per corner when it is unlinked, +/// in the Transform panel and the Properties panel's Transform section. +#[test] +fn a_rectangle_shows_linked_and_unlinked_corner_types() { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.run("file.new", json!({"width": 300, "height": 300})).unwrap(); + app.run("shape.rectangle", json!({"x": 50, "y": 50, "width": 120, "height": 80, "radius": 10})).unwrap(); + let count = |shown: &[String], t: &str| shown.iter().filter(|s| *s == t).count(); + let draws = [show as fn(&mut VectorcraftApp, &mut Ui), crate::panels::properties::transform_section]; + set_pref(&mut app, "singleCornerRadius", true); + for draw in draws { + let shown = texts(&mut app, draw); + assert_eq!((count(&shown, "Corner:"), count(&shown, "Round")), (1, 1), "{shown:?}"); + } + // Kinds that differ leave the linked menu blank. + app.run("object.setLiveShape", json!({"kind": "chamfer", "corners": [2]})).unwrap(); + for draw in draws { + let shown = texts(&mut app, draw); + assert_eq!((count(&shown, "Corner:"), count(&shown, "Round"), count(&shown, "Chamfer")), (1, 0, 0), "{shown:?}"); + } + set_pref(&mut app, "singleCornerRadius", false); + for draw in draws { + let shown = texts(&mut app, draw); + for t in ["Top Left:", "Top Right:", "Bottom Right:", "Bottom Left:"] { + assert_eq!(count(&shown, t), 1, "{t} in {shown:?}"); + } + assert_eq!((count(&shown, "Round"), count(&shown, "Chamfer")), (3, 1), "{shown:?}"); + } +} + +/// A corner kind set with no live rectangle selected leaves the selected polygon, the document and +/// its undo history as they are. +#[test] +fn a_rectangle_corner_kind_without_a_selected_rectangle_changes_nothing() { + use vectorcraft_geom::shapes::CornerKind::Chamfer; + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.run("file.new", json!({"width": 300, "height": 300})).unwrap(); + app.run("shape.polygon", json!({"cx": 150, "cy": 150, "radius": 40, "sides": 6})).unwrap(); + let st = app.session.active().unwrap(); + let (before, steps) = (st.doc.clone(), st.history.undo.len()); + crate::panels::set_rectangle_kinds(&mut app, Chamfer, None); + crate::panels::set_rectangle_kinds(&mut app, Chamfer, Some(2)); + let st = app.session.active().unwrap(); + assert!(st.doc == before, "the document changed"); + assert_eq!(st.history.undo.len(), steps); +} + +/// A corner kind picked while a Shape Builder merge is computed on another thread applies the +/// merge first, and sets the kind on the live rectangles selected after it. +#[test] +fn a_rectangle_corner_kind_applies_a_merge_on_another_thread_first() { + use vectorcraft_geom::shapes::CornerKind::Chamfer; + use vectorcraft_tools::{Mods, PointerEvent, PointerKind}; + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.run("file.new", json!({"width": 800, "height": 200})).unwrap(); + for k in 0..40 { + app.run("shape.rectangle", json!({"x": k * 10, "y": 0, "width": 20, "height": 20})).unwrap(); + } + app.run("select.all", json!({})).unwrap(); + app.run("tool.select", json!({"tool": "shapeBuilder"})).unwrap(); + let view = app.view_info(); + let at = |kind| PointerEvent { + kind, + pos: vectorcraft_geom::Point::new(15.0, 10.0), + mods: Mods::default(), + pressure: 1.0, + backquote: false, + pen: None, + }; + crate::canvas::dispatch(&mut app, &at(PointerKind::Move), view); + app.session.tool_poll(view, true).unwrap(); + crate::canvas::dispatch(&mut app, &at(PointerKind::Down), view); + crate::canvas::dispatch(&mut app, &at(PointerKind::Up), view); + assert!(app.session.tool_editing()); + crate::panels::set_rectangle_kinds(&mut app, Chamfer, None); + assert!(!app.session.tool_editing()); + let st = app.session.active().unwrap(); + let labels: Vec<_> = st.history.undo.iter().rev().take(2).map(|e| e.label.as_str()).collect(); + assert_eq!(labels, ["Live Shape", "Shape Builder"]); + let kinds: Vec<_> = st + .selection + .objects + .iter() + .filter_map(|id| match &st.doc.node(*id)?.kind { + NodeKind::Path { live: Some(l), .. } => match &**l { + LiveShape::Rectangle { kinds, .. } => Some(*kinds), + _ => None, + }, + _ => None, + }) + .collect(); + assert!(!kinds.is_empty() && kinds.iter().all(|k| *k == [Chamfer; 4]), "{kinds:?}"); +} + /// #3451: a live ellipse shows pie start/end angles and Invert Pie in the Transform panel and /// the Properties panel's Transform section; typed angles update the shape. #[test] diff --git a/crates/ui-egui/src/prefs_dialog/tests.rs b/crates/ui-egui/src/prefs_dialog/tests.rs index 1684ad2b39..c79ca22470 100644 --- a/crates/ui-egui/src/prefs_dialog/tests.rs +++ b/crates/ui-egui/src/prefs_dialog/tests.rs @@ -2030,6 +2030,37 @@ fn description_line_rects(ctx: &egui::Context) -> DescriptionRects { DescriptionRects { column, line } } +/// Scrolls the field list with the wheel until the last text `label` in `texts` lies wholly inside +/// the list, above the spacing and the gap over the description line, and stays put there (the +/// wheel scrolls smoothly over several frames) → the texts of the last frame. +fn scroll_into_view(a: &mut VectorcraftApp, ctx: &egui::Context, mut texts: Vec<(String, egui::Rect)>, label: &str) -> Vec<(String, egui::Rect)> { + let wheel = egui::Event::MouseWheel { + unit: egui::MouseWheelUnit::Point, + delta: egui::vec2(0.0, -40.0), + phase: egui::TouchPhase::Move, + modifiers: Default::default(), + source: egui::MouseWheelSource::Unknown, + }; + let at = |texts: &[(String, egui::Rect)]| texts.iter().rev().find(|(t, _)| t == label).map(|(_, r)| *r); + let inside = |r: Option| { + let DescriptionRects { column, line } = description_line_rects(ctx); + let bottom = line.min.y - DESCRIPTION_GAP - ctx.global_style().spacing.item_spacing.y; + let list = egui::Rect::from_min_max(column.min, egui::pos2(column.max.x, bottom)); + r.is_some_and(|r| list.contains_rect(r)) + }; + for _ in 0..80 { + let shown = inside(at(&texts)); + let next = description_frame(a, ctx, if shown { vec![] } else { vec![wheel.clone()] }).0; + let still = shown && at(&next) == at(&texts); + texts = next; + if still { + break; + } + } + assert!(inside(at(&texts)), "`{label}` lies wholly inside the field list: {texts:?}"); + texts +} + /// A row with no sentence leaves the description line empty, also after another category's row /// was described, and the dialog keeps its size. #[test] @@ -2517,7 +2548,7 @@ fn hovering_a_plugins_and_scratch_disks_row_shows_its_description() { }; let rows = [ ("Additional Plug-ins Folder:", "pluginsFolder"), - ("Plug-in Instruction Budget", "pluginInstructionBudget"), + ("Plug-in Instruction", "pluginInstructionBudget"), ("Primary:", "scratchPrimary"), ("Secondary:", "scratchSecondary"), ]; @@ -2614,31 +2645,10 @@ fn hovering_a_user_interface_row_shows_its_description() { ("Language:", "interfaceLanguage"), ]; let sentences: Vec<_> = rows.iter().map(|(_, key)| descriptions::description(key).unwrap_or_else(|| panic!("`{key}` has a sentence"))).collect(); - // The Language row is under the bottom of the list: the wheel scrolls it wholly into view. - let wheel = egui::Event::MouseWheel { - unit: egui::MouseWheelUnit::Point, - delta: egui::vec2(0.0, -40.0), - phase: egui::TouchPhase::Move, - modifiers: Default::default(), - source: egui::MouseWheelSource::Unknown, - }; + // The Language row is under the bottom of the list: the wheel scrolls it into view. let mut texts = texts; for (i, (label, _)) in rows.iter().enumerate() { - for _ in 0..20 { - if texts.iter().any(|(t, _)| t == label) { - break; - } - texts = whole_texts_frame(&mut a, &ctx, vec![wheel.clone()]); - } - // The wheel scrolls smoothly over several frames: wait until the row stays put. - for _ in 0..60 { - let next = description_frame(&mut a, &ctx, vec![]).0; - let still = row(&next, label) == row(&texts, label); - texts = next; - if still { - break; - } - } + texts = scroll_into_view(&mut a, &ctx, texts, label); description_frame(&mut a, &ctx, vec![egui::Event::PointerMoved(row(&texts, label))]); let (after, _) = description_frame(&mut a, &ctx, vec![]); for (j, sentence) in sentences.iter().enumerate() { @@ -2705,30 +2715,9 @@ fn hovering_a_performance_row_shows_its_description() { } let sentences: Vec<_> = rows.iter().map(|(_, key)| descriptions::description(key).unwrap_or_else(|| panic!("`{key}` has a sentence"))).collect(); // The last rows can be under the bottom of the list: the wheel scrolls them into view. - let wheel = egui::Event::MouseWheel { - unit: egui::MouseWheelUnit::Point, - delta: egui::vec2(0.0, -40.0), - phase: egui::TouchPhase::Move, - modifiers: Default::default(), - source: egui::MouseWheelSource::Unknown, - }; let mut texts = texts; for (i, (label, _)) in rows.iter().enumerate() { - for _ in 0..20 { - if texts.iter().any(|(t, _)| t == label) { - break; - } - texts = description_frame(&mut a, &ctx, vec![wheel.clone()]).0; - } - // The wheel scrolls smoothly over several frames: wait until the row stays put. - for _ in 0..60 { - let next = description_frame(&mut a, &ctx, vec![]).0; - let still = row(&next, label) == row(&texts, label); - texts = next; - if still { - break; - } - } + texts = scroll_into_view(&mut a, &ctx, texts, label); description_frame(&mut a, &ctx, vec![egui::Event::PointerMoved(row(&texts, label))]); let (after, _) = description_frame(&mut a, &ctx, vec![]); for (j, sentence) in sentences.iter().enumerate() { @@ -2791,30 +2780,9 @@ fn hovering_a_file_handling_row_shows_its_description() { ]; let sentences: Vec<_> = rows.iter().map(|(_, key)| descriptions::description(key).unwrap_or_else(|| panic!("`{key}` has a sentence"))).collect(); // The last rows can be under the bottom of the list: the wheel scrolls them into view. - let wheel = egui::Event::MouseWheel { - unit: egui::MouseWheelUnit::Point, - delta: egui::vec2(0.0, -40.0), - phase: egui::TouchPhase::Move, - modifiers: Default::default(), - source: egui::MouseWheelSource::Unknown, - }; let mut texts = texts; for (i, (label, _)) in rows.iter().enumerate() { - for _ in 0..20 { - if texts.iter().any(|(t, _)| t == label) { - break; - } - texts = description_frame(&mut a, &ctx, vec![wheel.clone()]).0; - } - // The wheel scrolls smoothly over several frames: wait until the row stays put. - for _ in 0..60 { - let next = description_frame(&mut a, &ctx, vec![]).0; - let still = row(&next, label) == row(&texts, label); - texts = next; - if still { - break; - } - } + texts = scroll_into_view(&mut a, &ctx, texts, label); description_frame(&mut a, &ctx, vec![egui::Event::PointerMoved(row(&texts, label))]); let (after, _) = description_frame(&mut a, &ctx, vec![]); for (j, sentence) in sentences.iter().enumerate() { diff --git a/crates/ui-egui/src/shortcuts/tests.rs b/crates/ui-egui/src/shortcuts/tests.rs index 8966517692..091741a655 100644 --- a/crates/ui-egui/src/shortcuts/tests.rs +++ b/crates/ui-egui/src/shortcuts/tests.rs @@ -2119,13 +2119,16 @@ fn the_command_search_that_opens_while_enter_is_down_waits_for_a_new_press() { // The empty search lists the recent picks, so the last pick is the highlighted result. app.ui.recent_commands = vec!["paint.swap".into()]; app.ui.palette_open = true; + let before = undo_len(&app); for repeat in 0..4 { held.press(&mut app); assert!(app.ui.palette_open, "repeat {repeat}: it stays open"); + assert_eq!(undo_len(&app), before, "repeat {repeat}: nothing ran"); } held.release(&mut app); held.press(&mut app); assert!(!app.ui.palette_open, "a new press runs the highlighted result"); + assert_eq!(undo_len(&app), before + 1, "Swap Fill and Stroke ran on the rectangle: {}", app.ui.status); } /// Enter on a command search result whose menu item opens a dialog (Create Gradient Mesh…) opens diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 5f8e0bb5bf..8bbd8e2815 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -664,6 +664,11 @@ pub struct UiState { pub status_notes: Option<(String, Vec)>, pub palette_open: bool, pub palette_query: String, + /// Set when the palette's shortcut, its command or the search icon opens or closes the palette, + /// so that the palette starts at its first row the next time it is drawn, even when it closed + /// and opened again before then. Not saved. + #[serde(skip)] + pub palette_toggled: bool, /// Screen mode: 0 normal, 1 full screen with menu, 2 full screen, 3 presentation. Not saved: /// the app always starts in Normal Screen Mode, with its menus and panels (#472: a saved /// Presentation Mode came back on restart with no way out). @@ -842,8 +847,9 @@ pub struct UiState { /// of an RGB field, `ui.colorPanel`, [`crate::panels::color::deserialize_rgb_percent`]). #[serde(default, deserialize_with = "crate::panels::color::deserialize_rgb_percent")] pub color_rgb_percent: bool, - /// Color Wheel panel: the wheel or the box, the box's channel, the slider rows and the color - /// vision row (`ui.colorWheel`, [`crate::panels::color_wheel::deserialize_settings`]). + /// Color Wheel panel: the wheel or the box, the box's channel, the slider rows, the + /// out-of-gamut shading and the color vision row + /// (`ui.colorWheel`, [`crate::panels::color_wheel::deserialize_settings`]). #[serde(default, deserialize_with = "crate::panels::color_wheel::deserialize_settings")] pub color_wheel: crate::panels::color_wheel::Settings, /// Swatches panel: Show Recent Colors in its panel menu, which draws the panel's Recent Colors @@ -1336,6 +1342,7 @@ impl Default for UiState { status_notes: None, palette_open: false, palette_query: String::new(), + palette_toggled: false, screen_mode: 0, tiled: false, tile_layout: crate::canvas::TileLayout::Grid, diff --git a/crates/ui-egui/src/tests/taskbar.rs b/crates/ui-egui/src/tests/taskbar.rs index 1615681f57..6caf92cc81 100644 --- a/crates/ui-egui/src/tests/taskbar.rs +++ b/crates/ui-egui/src/tests/taskbar.rs @@ -744,6 +744,148 @@ fn the_shape_properties_popup_keeps_its_corner_dropdown() { assert!(!kinds.is_empty() && kinds.iter().all(|k| *k == vectorcraft_geom::shapes::CornerKind::Chamfer), "{kinds:?}"); } +/// A rectangle's Corner menu in the popup sets the kind of all four corners in one undo step while +/// Corner Radius is linked; picking the kind they already have adds no step. Unlinked, each +/// corner's menu sets that corner alone. +#[test] +fn the_shape_properties_popup_changes_a_rectangle_corner_type() { + use vectorcraft_geom::shapes::CornerKind::{Chamfer, Round}; + let mut app = app(); + app.run("tool.select", json!({"tool": "selection"})).unwrap(); + app.run("prefs.set", json!({"key": "singleCornerRadius", "value": true})).unwrap(); + let rect = id(app.run("shape.rectangle", json!({"x": 40, "y": 40, "width": 80, "height": 60, "radius": 10})).unwrap()); + select(&mut app, &[rect]); + let kinds = |app: &VectorcraftApp| match live(app, rect) { + vectorcraft_doc::LiveShape::Rectangle { kinds, radii, .. } => (kinds, radii), + l => panic!("{l:?}"), + }; + let steps = |app: &VectorcraftApp| app.session.active().unwrap().history.undo.len(); + let (ctx, texts) = click_lock_slot(&mut app); + let click = |app: &mut VectorcraftApp, p: Pos2| { + let press = |pressed| Event::PointerButton { pos: p, button: PointerButton::Primary, pressed, modifiers: Default::default() }; + frame(app, &ctx, vec![Event::PointerMoved(p), press(true), press(false)]); + frame(app, &ctx, vec![]) + }; + // The open list's entry for `name`, drawn after the closed menu that may show the same name. + let entry = |texts: &[(String, Rect)], name: &str| texts.iter().rev().find(|(t, _)| t == name).map(|(_, r)| r.center()).unwrap(); + let before = steps(&app); + let texts = click(&mut app, at(&texts, "Round")); + let texts = click(&mut app, entry(&texts, "Chamfer")); + assert_eq!(kinds(&app), ([Chamfer; 4], [10.0; 4]), "all four corners, radii kept"); + assert_eq!(steps(&app), before + 1, "one undo step"); + let texts = click(&mut app, at(&texts, "Chamfer")); + // The list is open: its Chamfer row shows as well as the closed menu's, and the pick closes it. + assert_eq!(texts.iter().filter(|(t, _)| t == "Chamfer").count(), 2, "{texts:?}"); + assert!(texts.iter().any(|(t, _)| t == "Inverted Round"), "{texts:?}"); + let texts = click(&mut app, entry(&texts, "Chamfer")); + assert!(!texts.iter().any(|(t, _)| t == "Inverted Round"), "the pick closes the list: {texts:?}"); + assert_eq!(steps(&app), before + 1, "the same kind adds no undo step"); + + app.run("prefs.set", json!({"key": "singleCornerRadius", "value": false})).unwrap(); + let texts = frame(&mut app, &ctx, vec![]); + assert_eq!(texts.iter().filter(|(t, _)| t == "Chamfer").count(), 4, "{texts:?}"); + // The first menu is the top left corner's. + let texts = click(&mut app, at(&texts, "Chamfer")); + click(&mut app, entry(&texts, "Round")); + assert_eq!(kinds(&app), ([Round, Chamfer, Chamfer, Chamfer], [10.0; 4])); + assert_eq!(steps(&app), before + 2); + app.run("edit.undo", json!({})).unwrap(); + assert_eq!(kinds(&app).0, [Chamfer; 4]); +} + +/// One Transform panel frame `width` points wide: the texts drawn, with their rectangles. +fn panel_frame(app: &mut VectorcraftApp, ctx: &egui::Context, width: f32, events: Vec) -> Vec<(String, Rect)> { + let screen = Rect::from_min_size(Pos2::ZERO, vec2(width, 700.0)); + let input = egui::RawInput { screen_rect: Some(screen), events, ..Default::default() }; + let mut out = ctx.run_ui(input, |ui| crate::panels::transform::show(app, ui)); + out.textures_delta.clear(); + shapes_text(&out.shapes.iter().map(|c| c.shape.clone()).collect::>()) +} + +/// With several rectangles selected, the linked Corner menu sets the kind on every corner of each +/// of them, also when the rectangle the panel shows already has it, and leaves a selected polygon +/// as it is. +#[test] +fn the_linked_corner_menu_sets_every_selected_rectangle() { + use vectorcraft_geom::shapes::CornerKind::{Chamfer, Round}; + let mut app = app(); + app.run("prefs.set", json!({"key": "singleCornerRadius", "value": true})).unwrap(); + let a = id(app.run("shape.rectangle", json!({"x": 20, "y": 20, "width": 80, "height": 60, "radius": 8})).unwrap()); + let b = id(app.run("shape.rectangle", json!({"x": 200, "y": 20, "width": 80, "height": 60, "radius": 8})).unwrap()); + let polygon = id(app.run("shape.polygon", json!({"cx": 200, "cy": 200, "radius": 40, "sides": 6})).unwrap()); + app.run("object.setLiveShape", json!({"ids": [a], "kind": "chamfer"})).unwrap(); + select(&mut app, &[a, b, polygon]); + let kinds = |app: &VectorcraftApp, id: u64| match live(app, id) { + vectorcraft_doc::LiveShape::Rectangle { kinds, .. } => kinds, + l => panic!("{l:?}"), + }; + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx); + let click = |app: &mut VectorcraftApp, p: Pos2| { + let press = |pressed| Event::PointerButton { pos: p, button: PointerButton::Primary, pressed, modifiers: Default::default() }; + panel_frame(app, &ctx, 300.0, vec![Event::PointerMoved(p), press(true), press(false)]); + panel_frame(app, &ctx, 300.0, vec![]) + }; + panel_frame(&mut app, &ctx, 300.0, vec![]); + let texts = panel_frame(&mut app, &ctx, 300.0, vec![]); + let steps = app.session.active().unwrap().history.undo.len(); + let texts = click(&mut app, at(&texts, "Chamfer")); + let entry = texts.iter().rev().find(|(t, _)| t == "Chamfer").map(|(_, r)| r.center()).unwrap(); + click(&mut app, entry); + assert_eq!((kinds(&app, a), kinds(&app, b)), ([Chamfer; 4], [Chamfer; 4])); + let vectorcraft_doc::LiveShape::Polygon { kinds: sides, .. } = live(&app, polygon) else { panic!("not a polygon") }; + assert!(sides.iter().all(|k| *k == Round), "the polygon keeps its corners: {sides:?}"); + assert_eq!(app.session.active().unwrap().history.undo.len(), steps + 1, "one undo step"); + app.run("edit.undo", json!({})).unwrap(); + assert_eq!(kinds(&app, b), [Round; 4]); +} + +/// Unlinked, a corner's radius field rounds that corner of each selected rectangle and leaves a +/// selected polygon as it is. +#[test] +fn an_unlinked_corner_radius_leaves_other_selected_shapes() { + let mut app = app(); + app.run("prefs.set", json!({"key": "singleCornerRadius", "value": false})).unwrap(); + let rect = id(app.run("shape.rectangle", json!({"x": 20, "y": 20, "width": 80, "height": 60, "radius": 7})).unwrap()); + let polygon = id(app.run("shape.polygon", json!({"cx": 200, "cy": 200, "radius": 40, "sides": 6})).unwrap()); + select(&mut app, &[rect, polygon]); + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx); + panel_frame(&mut app, &ctx, 300.0, vec![]); + let texts = panel_frame(&mut app, &ctx, 300.0, vec![]); + // The top left corner's field is the first that shows the radius. + let p = at(&texts, "7 pt"); + let press = |pressed| Event::PointerButton { pos: p, button: PointerButton::Primary, pressed, modifiers: Default::default() }; + panel_frame(&mut app, &ctx, 300.0, vec![Event::PointerMoved(p), press(true), press(false)]); + panel_frame(&mut app, &ctx, 300.0, vec![]); + panel_frame(&mut app, &ctx, 300.0, vec![Event::Text("15".into())]); + let enter = Event::Key { key: egui::Key::Enter, physical_key: None, pressed: true, repeat: false, modifiers: Default::default() }; + panel_frame(&mut app, &ctx, 300.0, vec![enter]); + panel_frame(&mut app, &ctx, 300.0, vec![]); + let vectorcraft_doc::LiveShape::Rectangle { radii, .. } = live(&app, rect) else { panic!("not a rectangle") }; + assert_eq!(radii, [15.0, 7.0, 7.0, 7.0]); + let vectorcraft_doc::LiveShape::Polygon { radii, .. } = live(&app, polygon) else { panic!("not a polygon") }; + assert!(radii.iter().all(|r| *r == 0.0), "the polygon keeps its corners: {radii:?}"); +} + +/// Unlinked, the four corner rows keep their Corner menus inside a panel at its narrowest. +#[test] +fn the_unlinked_corner_menus_fit_a_narrow_panel() { + let mut app = app(); + app.run("prefs.set", json!({"key": "singleCornerRadius", "value": false})).unwrap(); + let rect = id(app.run("shape.rectangle", json!({"x": 20, "y": 20, "width": 80, "height": 60, "radius": 8})).unwrap()); + app.run("object.setLiveShape", json!({"ids": [rect], "kind": "invertedRound"})).unwrap(); + select(&mut app, &[rect]); + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx); + let width = 220.0; + panel_frame(&mut app, &ctx, width, vec![]); + let texts = panel_frame(&mut app, &ctx, width, vec![]); + let menus: Vec<_> = texts.iter().filter(|(t, _)| t.starts_with("Inverted")).collect(); + assert_eq!(menus.len(), 4, "{texts:?}"); + assert!(menus.iter().all(|(_, r)| r.right() <= width), "{menus:?}"); +} + /// Every other selection keeps Lock: a plain closed path, a star (a plain path), a path with live /// corners, a group and several objects. The Direct Selection tool keeps it for a basic shape. #[test] diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index 090156e861..b67df13c7f 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -38,11 +38,13 @@ use chips::gradient_chip_colors; pub use chips::{ProxyClicks, chip_button, chip_button_named, fill_stroke_proxy, gradient_chip, paint_chip, proxy_chip, swatch_tile}; pub use color::{ FieldAxis, Live, MarkerResponse, RingResponse, SliderValue, WheelAxes, WheelResponse, channel_slider, channel_slider_named, - channel_slider_stepped, channel_slider_valued, color_field, color_mesh, color_slider, color_slider_named, color_slider_stepped, - color_slider_valued, harmony_wheel, hex_field, hex_field_named, hsb32, hue_ring, recolor_wheel, region_texture, ring_markers, ring_square, - segment_color, segment_color_on, segmented_wheel, stepped_area, wheel_of, + channel_slider_stepped, channel_slider_valued, color_field, color_field_shaded, color_mesh, color_slider, color_slider_named, + color_slider_stepped, color_slider_valued, harmony_wheel, hex_field, hex_field_named, hsb32, hue_ring, recolor_wheel, region_texture, + ring_markers, ring_square, segment_color, segment_color_on, segmented_wheel, stepped_area, wheel_of, }; pub(crate) use color::{HEX_FIELD_CHARS, color_rail_bar, focus_by_pointer, hex_text, pointer_phase}; +#[cfg(test)] +pub(crate) use color::{SHADE, shade_cells, shade_edges}; pub use drag::{ PanelDrag, RowClick, SwatchRows, apply_row_click, art_drag_doc, art_drop, doc_preview, drag_art, drag_ghost, drag_source, drop_target_outline, ghost_row, row_click, diff --git a/crates/ui-egui/src/widgets/color.rs b/crates/ui-egui/src/widgets/color.rs index a14689b57c..8f5ec8b2d9 100644 --- a/crates/ui-egui/src/widgets/color.rs +++ b/crates/ui-egui/src/widgets/color.rs @@ -402,11 +402,26 @@ fn focus_outline(ui: &Ui, resp: &Response, rect: Rect) { pub fn color_field( ui: &mut Ui, id: impl std::hash::Hash, - (name, axes): (&str, [FieldAxis<'_>; 2]), + labels: (&str, [FieldAxis<'_>; 2]), size: Vec2, pos: (f32, f32), marked: bool, color_at: &dyn Fn(f32, f32) -> Color32, +) -> (Option<(f32, f32)>, Live) { + color_field_shaded(ui, id, labels, size, pos, marked, (color_at, &[])) +} + +/// A [`color_field`] with the cells `shade` marks grayed out under its marker, each run of them +/// edged with a dark and a light line. `shade` holds a row of an n × n grid over the field for each +/// of its n rows (16 at most) from the top, and bit `i` of a row marks its cell `i` from the left. +pub fn color_field_shaded( + ui: &mut Ui, + id: impl std::hash::Hash, + (name, axes): (&str, [FieldAxis<'_>; 2]), + size: Vec2, + pos: (f32, f32), + marked: bool, + (color_at, shade): (&dyn Fn(f32, f32) -> Color32, &[u16]), ) -> (Option<(f32, f32)>, Live) { use egui::accesskit::{Action, ActionData}; let t = Tokens::get(ui.ctx()); @@ -415,6 +430,7 @@ pub fn color_field( focus_on_press(&resp); let painter = ui.painter_at(rect.expand(6.0)); painter.add(color_mesh(rect, (32, 32), color_at)); + shade_cells(&painter, rect, shade); painter.rect_stroke(rect, 0.0, Stroke::new(1.0, t.border), StrokeKind::Outside); focus_outline(ui, &resp, rect); let (x, y) = pos; @@ -465,6 +481,55 @@ pub fn color_field( (None, Live::Idle) } +/// The gray over a shaded cell of a [`color_field_shaded`]. +pub(crate) const SHADE: Color32 = Color32::from_rgba_premultiplied(96, 96, 96, 192); + +/// Whether cell `col` of row `row` of `shade` is marked; a cell outside the grid is not. +fn shaded(shade: &[u16], col: usize, row: usize) -> bool { + col < shade.len().min(16) && shade.get(row).is_some_and(|bits| (bits >> col) & 1 == 1) +} + +/// The lines between the marked and the unmarked cells of `shade` (see [`color_field_shaded`]), +/// each from one grid point to the next, as (column, row) from the top-left corner. +pub(crate) fn shade_edges(shade: &[u16]) -> Vec<[(usize, usize); 2]> { + let n = shade.len().min(16); + let mut edges = Vec::new(); + for row in 0..n { + for col in 0..n { + let here = shaded(shade, col, row); + if col + 1 < n && here != shaded(shade, col + 1, row) { + edges.push([(col + 1, row), (col + 1, row + 1)]); + } + if row + 1 < n && here != shaded(shade, col, row + 1) { + edges.push([(col, row + 1), (col + 1, row + 1)]); + } + } + } + edges +} + +/// Gray out the cells `shade` marks over `rect`, and draw the lines between them and the others +/// dark under light. +pub(crate) fn shade_cells(painter: &egui::Painter, rect: Rect, shade: &[u16]) { + let n = shade.len().min(16); + if n == 0 { + return; + } + let cell = rect.size() / n as f32; + let at = |(col, row): (usize, usize)| rect.min + vec2(col as f32 * cell.x, row as f32 * cell.y); + for row in 0..n { + for col in (0..n).filter(|&col| shaded(shade, col, row)) { + painter.rect_filled(Rect::from_min_size(at((col, row)), cell), 0.0, SHADE); + } + } + let edges = shade_edges(shade); + for stroke in [Stroke::new(2.0, Color32::BLACK), Stroke::new(1.0, Color32::WHITE)] { + for [a, b] in &edges { + painter.line_segment([at(*a), at(*b)], stroke); + } + } +} + /// A smoothly shaded colour area: a `cols` × `rows` grid over `rect` with `color_at(x, y)` (0..1 /// each, y down) at its vertices. pub fn color_mesh(rect: Rect, (cols, rows): (u32, u32), color_at: &dyn Fn(f32, f32) -> Color32) -> egui::Shape { diff --git a/docs/control-protocol.md b/docs/control-protocol.md index 079b26ac0f..64926171bb 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -272,12 +272,12 @@ My Themes tab lists the saved themes; every action runs a command (`colorTheme.s Color Wheel panel (`window.panel {panel: "colorWheel"}`): a hue ring around a saturation and brightness square. A pick runs the commands the Color panel's sliders run: `paint.setFill` or `paint.setStroke` with `keepModel`, `paint.editGradient` for a gradient's selected stop, and `paint.freeform.setPoint` for a freeform gradient's selected -point (the first stop or point when none is selected). `ui.colorWheel {view?, channel?, harmony?, harmonyRule?, vision?}` -shows the wheel or the box (a color field with a channel strip at its right), picks the box's channel, shows the -other colors of a harmony rule as markers on the wheel's ring, and shows or hides the color vision row; it returns -the settings, and `ui.inspect` reports them as `ui.color_wheel`. -The key `sliders` shows OKLCH Sliders, HSL Sliders or -neither (`"oklch"`, `"hsl"` or `"none"`; `"oklch"` is an error while the active document's RGB space, its assigned +point (the first stop or point when none is selected). `ui.colorWheel {view?, channel?, sliders?, gamut?, harmony?, +harmonyRule?, vision?}` shows the wheel or the box (a color field with a channel strip at its right), picks the box's +channel, shows OKLCH Sliders, HSL Sliders or neither, grays out the colors the CMYK space cannot print, shows the +other colors of a harmony rule as markers on the wheel's ring, and shows or hides the color vision row; it returns the +settings, and `ui.inspect` reports them as `ui.color_wheel`. +The key `sliders` takes (`"oklch"`, `"hsl"` or `"none"`; `"oklch"` is an error while the active document's RGB space, its assigned profile or else the working RGB space, is not sRGB), and the settings carry it too. Edit Colors dialogs: `ui.colorBalanceDialog` opens Adjust Colors (`colorBalance`: fields `mode` `gray`/`rgb`/`cmyk`/ diff --git a/docs/effects-parity.md b/docs/effects-parity.md index 1f3810d984..a3ba859915 100644 --- a/docs/effects-parity.md +++ b/docs/effects-parity.md @@ -179,9 +179,9 @@ VectorCraft choices; an original approximation, never compared with another appl | Item | Ours | |---|---| | Revolve | initial: live, editable profile, rotation and light gizmos, default-on Cap with continuous curved rims that also closes a partial sweep's cut sides, smooth vector shading and round seam joins, overlapping faces drawn in the order of their depths where they overlap, SVG/PDF output, Expand Appearance ([revolve.md](revolve.md), #846) | -| Extrude & Bevel, Inflate, Rotate | initial: live, round seam joins, depth, twist, taper, solid or hollow caps, five original bevel shapes, Inflate volume, both sides, twist, taper and cap, Rotate of every fill and stroke, groups and layers turned about one shared axis (#4506), contours that cross, touch or overlap merged first ([three-d.md](three-d.md)), Position presets, rotation and light gizmos, SVG/PDF output, Expand Appearance ([three-d.md](three-d.md)) | +| Extrude & Bevel, Inflate, Rotate | initial: live, round seam joins, depth, twist, taper, solid or hollow caps, five original bevel shapes and custom bevels drawn as open paths in the bevels file ([add custom bevel paths](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/add-custom-bevel-paths.html), [three-d.md](three-d.md#custom-bevels)), Inflate volume, both sides, twist, taper and cap, Rotate of every fill and stroke, groups and layers turned about one shared axis (#4506), contours that cross, touch or overlap merged first ([three-d.md](three-d.md)), Position presets, rotation and light gizmos, SVG/PDF output, Expand Appearance ([three-d.md](three-d.md)) | | Materials panel, lighting, ray-traced render | Window › 3D and Materials panel with the object types (Plane, Extrude, Revolve, Inflate) and the Object, Rotation and Lighting settings of the applied effect, Render Settings › Wireframe, which draws the live effect as the edges of its faces, and Quick Actions › Expand as Wireframes ([three-d.md](three-d.md#3d-and-materials-panel)); one to ten directional lights with per-light Color (opaque RGB, white by default), Intensity, Rotation, Height, Softness and neutral Ambient Light, Revolve and colored Inflate use smooth vector shading; Extrude & Bevel and Rotate retain planar shading; original Standard, Diffuse, Top Left and Right lighting rigs; shadows behind or below the object from the first light, blurred by its Softness ([three-d.md](three-d.md#shadows)); the Materials tab's Graphics, document symbols mapped onto Extrude & Bevel's caps and onto a plane, moved with an artboard handle, and wrapped around Extrude & Bevel's walls and bevels and around Revolve's side ([three-d.md](three-d.md#graphics)); no base materials, graphics on Inflate, or ray tracing | -| 3D (Classic): Extrude & Bevel, Revolve, Rotate | Extrude & Bevel (Classic) initial: live, round seam joins, Extrude Depth, Cap, five original bevel shapes with Height and Bevel Extent In or Out, Position presets and rotation gizmo, Perspective, Wireframe, No Shading, Diffuse and Plastic surfaces with one to ten lights, Light Intensity, Ambient Light, Highlight Intensity and Size, Blend Steps, Black, Custom, Black Overprint or no Shading Color ([Black Overprint](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=188)), Draw Hidden Faces ([create 3D objects](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/create-3d-objects.html)); Revolve (Classic) initial: live, round seam joins, Angle, Cap, Offset from the left or right edge, Position presets and rotation gizmo, Perspective, the same four surfaces, lights, highlight, Blend Steps and Shading Color, groups and layers revolved about one shared axis (same page); Rotate (Classic) initial: live, round seam joins, every fill and stroke turned as one plane, Position presets and rotation gizmo, Perspective, No Shading and Diffuse surfaces with lights, Ambient Light, Blend Steps and Shading Color ([rotate objects in 3D](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/rotate-objects-in-3d.html)); Preserve Spot Colors in all three, unavailable with a Custom Shading Color ([Preserve Spot Color](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=260)); all three: a lighting sphere on the Lighting tab whose lights drag, move to the back or front, and are added at the front center or deleted down to one ([lighting options](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=272)); all three: the track cube (face, edge, Shift and ring drags, keyboard steps; [three-d.md](three-d.md#track-cube)); Map Art for Extrude & Bevel (Classic) and Revolve (Classic): one document symbol on each numbered surface, surface navigation with visible and hidden marks and a red outline on the artboard, move, scale and rotate on the surface laid out flat, Scale to Fit, Clear, Clear All, Shade Artwork, Invisible Geometry, kept by Expand Appearance and exports, `threeD.mapArt` ([map artwork to a 3D object](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=189)) | +| 3D (Classic): Extrude & Bevel, Revolve, Rotate | Extrude & Bevel (Classic) initial: live, round seam joins, Extrude Depth, Cap, five original bevel shapes and the custom bevels with Height and Bevel Extent In or Out, Position presets and rotation gizmo, Perspective, Wireframe, No Shading, Diffuse and Plastic surfaces with one to ten lights, Light Intensity, Ambient Light, Highlight Intensity and Size, Blend Steps, Black, Custom, Black Overprint or no Shading Color ([Black Overprint](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=188)), Draw Hidden Faces ([create 3D objects](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/create-3d-objects.html)); Revolve (Classic) initial: live, round seam joins, Angle, Cap, Offset from the left or right edge, Position presets and rotation gizmo, Perspective, the same four surfaces, lights, highlight, Blend Steps and Shading Color, groups and layers revolved about one shared axis (same page); Rotate (Classic) initial: live, round seam joins, every fill and stroke turned as one plane, Position presets and rotation gizmo, Perspective, No Shading and Diffuse surfaces with lights, Ambient Light, Blend Steps and Shading Color ([rotate objects in 3D](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/rotate-objects-in-3d.html)); Preserve Spot Colors in all three, unavailable with a Custom Shading Color ([Preserve Spot Color](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=260)); all three: a lighting sphere on the Lighting tab whose lights drag, move to the back or front, and are added at the front center or deleted down to one ([lighting options](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=272)); all three: the track cube (face, edge, Shift and ring drags, keyboard steps; [three-d.md](three-d.md#track-cube)); Map Art for Extrude & Bevel (Classic) and Revolve (Classic): one document symbol on each numbered surface, surface navigation with visible and hidden marks and a red outline on the artboard, move, scale and rotate on the surface laid out flat, Scale to Fit, Clear, Clear All, Shade Artwork, Invisible Geometry, kept by Expand Appearance and exports, `threeD.mapArt` ([map artwork to a 3D object](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=189)) | | Turntable (30.0 beta) | none | | Export 3D objects (OBJ, USDA, glTF) | initial: Asset Export's Export 3D Object, and the 3D and Materials panel's Export 3D Object button (which then shows Asset Export with the new assets selected, [three-d.md](three-d.md#3d-and-materials-panel)), collect an object with Extrude & Bevel, Revolve, Inflate or Rotate as a 3D asset, and Export writes its solids as a USDA (the default), USDZ, glTF or OBJ mesh with a material in each solid's paint color (`assets.add3D`, `assets.set3DFormat`, `assets.export3D`); graphics mapped onto a plane or Extrude & Bevel's caps are exported as PNG textures of those faces, flat and unlit; no graphics on Revolve's side, no materials and no shading ([3D export help](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/export-3d-vector-artwork.html)) | diff --git a/docs/gaps.md b/docs/gaps.md index c7192aebff..5132520ee6 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Gaps -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-19 · **Change:** minor (G12: Brushes panel: item right-click context menu (Brush Options, Duplicate Brush, Delete Brush) with selection handling; 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: 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; G4 and G13 Missing lists drop the shipped Touch Type, Snap to Glyph and Dimension tool, and G13's snapping entry keeps only what is still missing, the partial Snapping panel and the items not yet checked (#8387); G13 keeps one estimate (13–23 h); estimates unchanged; previously: 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: 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; 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: G4 type: modal Check Spelling dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: Type: the Middle Eastern & South Asian composers are done as a per-paragraph choice with the Standard composers (#4935); G5: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); estimate unchanged (3–13 h); previously: Tech Circuit brush library, G5; previously: G5: built-in Weather Icons symbol library (Sun, Moon, Cloud, Rain, Thunder, Snow); estimate 5–15 → 4–14 h; previously: 3D: the seams of white-light Extrude & Bevel, Inflate and Rotate, and the face seams of the 3D (Classic) effects, have round joins instead of miters; previously: PDF import: preserve Type 3 font text runs as named groups , or as live text in TextAs::Text mode if ToUnicode exists on non-colour fonts (TextAs::Outlines produces grouped outlines), #6740; scores and estimates unchanged; previously: 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: oversized editing artboard import; Glyphs panel: Alternates for Current Selection applies an OpenType feature value (`salt=2`) to the selected letter alone, so an Arabic word stays joined, and Entire Font lists the unencoded glyphs, #5514; #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: G5: built-in Energy Beams brush library; estimate 5–15 → 4–14 h; previously minor: G5: built-in Skill Icons symbol library; estimate 6–16 → 5–15 h; previously minor: ruler double-click adds a guide at the pointer, #5239; G5: built-in Status Effects graphic style library; estimate 7–17 → 6–16 h; MCP docs catch-up for UI Frames and Map Markers; previously minor: G5: built-in Inventory Icons symbol library; estimate 8–18 → 7–17 h; previously minor: G9: `.ai` save names a variable font instance's design-space setting, #6388; previously minor: G5: built-in Game Trails brush library; estimate 9–19 → 8–18 h; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: docs tidy-up, no content change: stray notes at the top moved into the revision table; scores and estimates unchanged; previously minor: G5: built-in Game HUD graphic style library; estimate 10–20 → 9–19 h; previously minor: G5: built-in Map Markers symbol library; estimate 11–21 → 10–20 h; 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: G2: Effect Gallery thumbnails and in-dialog preview; estimate 1–2 h → 0; 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: built-in UI Frames symbol library with default 9-slice; estimate 11–21 h; previously minor: G5: dynamic symbol part on-canvas takes opacity, blend, gradient and pattern; docs Overlap/auto-corners sync; estimate 12–22 h; previously minor: interim macOS cursor delivery, #2292; native validation pending; 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, Pattern brush auto corners and Global Edit Shift-click leave-out moved from Missing to Done (code already shipped); 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; G9: EPS gradients drawn as abutting strips import as one gradient, without seams; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; #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; Indian-language hyphenation review and license allowlist, #4947; opening a slow file shows a progress window, part of #5930; Hindi catalog and contributor loanword preferences; agent wording pass complete; wider native proofreading welcome; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); scores and estimates unchanged; a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window; scores and estimates unchanged; large images in CMYK documents are shrunk before they are separated into ink planes (#4155); scores and estimates unchanged; `.ai` paths with a Calligraphic brush open brushed, with the 6D Art Pen's channels, and Windows reads the pen's tilt and barrel rotation, #372; scores and estimates unchanged; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; a slow first frame is waited for instead of restarting without the graphics adapter, and the menu bar no longer waits for the installed fonts' scan; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-19 · **Change:** minor (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: 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: 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; G4 and G13 Missing lists drop the shipped Touch Type, Snap to Glyph and Dimension tool, and G13's snapping entry keeps only what is still missing, the partial Snapping panel and the items not yet checked (#8387); G13 keeps one estimate (13–23 h); estimates unchanged; previously: 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: 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; 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: G4 type: modal Check Spelling dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: Type: the Middle Eastern & South Asian composers are done as a per-paragraph choice with the Standard composers (#4935); G5: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); estimate unchanged (3–13 h); previously: Tech Circuit brush library, G5; previously: G5: built-in Weather Icons symbol library (Sun, Moon, Cloud, Rain, Thunder, Snow); estimate 5–15 → 4–14 h; previously: 3D: the seams of white-light Extrude & Bevel, Inflate and Rotate, and the face seams of the 3D (Classic) effects, have round joins instead of miters; previously: PDF import: preserve Type 3 font text runs as named groups , or as live text in TextAs::Text mode if ToUnicode exists on non-colour fonts (TextAs::Outlines produces grouped outlines), #6740; scores and estimates unchanged; previously: 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: oversized editing artboard import; Glyphs panel: Alternates for Current Selection applies an OpenType feature value (`salt=2`) to the selected letter alone, so an Arabic word stays joined, and Entire Font lists the unencoded glyphs, #5514; #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: G5: built-in Energy Beams brush library; estimate 5–15 → 4–14 h; previously minor: G5: built-in Skill Icons symbol library; estimate 6–16 → 5–15 h; previously minor: ruler double-click adds a guide at the pointer, #5239; G5: built-in Status Effects graphic style library; estimate 7–17 → 6–16 h; MCP docs catch-up for UI Frames and Map Markers; previously minor: G5: built-in Inventory Icons symbol library; estimate 8–18 → 7–17 h; previously minor: G9: `.ai` save names a variable font instance's design-space setting, #6388; previously minor: G5: built-in Game Trails brush library; estimate 9–19 → 8–18 h; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: docs tidy-up, no content change: stray notes at the top moved into the revision table; scores and estimates unchanged; previously minor: G5: built-in Game HUD graphic style library; estimate 10–20 → 9–19 h; previously minor: G5: built-in Map Markers symbol library; estimate 11–21 → 10–20 h; 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: G2: Effect Gallery thumbnails and in-dialog preview; estimate 1–2 h → 0; 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: built-in UI Frames symbol library with default 9-slice; estimate 11–21 h; previously minor: G5: dynamic symbol part on-canvas takes opacity, blend, gradient and pattern; docs Overlap/auto-corners sync; estimate 12–22 h; previously minor: interim macOS cursor delivery, #2292; native validation pending; 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, Pattern brush auto corners and Global Edit Shift-click leave-out moved from Missing to Done (code already shipped); 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; G9: EPS gradients drawn as abutting strips import as one gradient, without seams; Tools stays beside the canvas with left-side panels; new gradients follow document color mode; Selection QoL: marquee modes and visible feedback, #5313; #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; Indian-language hyphenation review and license allowlist, #4947; opening a slow file shows a progress window, part of #5930; Hindi catalog and contributor loanword preferences; agent wording pass complete; wider native proofreading welcome; an image zoomed in on is separated, colorized or proofed only where it shows (#4155); scores and estimates unchanged; a document's first frame renders on the render worker, so opening a heavy file no longer freezes the window; scores and estimates unchanged; large images in CMYK documents are shrunk before they are separated into ink planes (#4155); scores and estimates unchanged; `.ai` paths with a Calligraphic brush open brushed, with the 6D Art Pen's channels, and Windows reads the pen's tilt and barrel rotation, #372; scores and estimates unchanged; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; a slow first frame is waited for instead of restarting without the graphics adapter, and the menu bar no longer waits for the installed fonts' scan; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) > Scissors snapping update (2026-11-11): with Alt released, hover and cuts use the Pen's path, alignment, intersection and anchor snaps (#6470). Scores and estimates unchanged. @@ -10,6 +10,8 @@ ## Feature submission evidence +**Scissors cut-point preview (#8655):** A native point marker shows the anchor or position on a curve that the current Scissors click targets, including the existing snapping rules. Hovering changes no artwork; an ineligible or stale hover has no marker. Existing cut and Alt Add Anchor behavior are retained. Focused tool and Session regressions live in `crates/tools/src/draw2/anchor/tests.rs` and `crates/engine/tests/scissors_snap.rs`. Scores and estimates are unchanged. + Draft enhancement #5804: Preferences › File Handling can select a raster editor through the native picker, with a private draft outside engine preferences and generic dialog fields. OK saves it, Cancel discards it, and Reset restores PhotoCraft. With Use System Defaults off, a missing chosen editor falls back to PhotoCraft, then the system default; validation and launch failures are reported. Control/MCP and synthetic input cannot choose an application or run external Edit Original. Web behavior, parity scores and estimates are unchanged; macOS/Linux smoke tests remain pending. **2026-11-19 revision:** merged main while preserving the private raster-editor choice; no parity rescore. @@ -962,6 +964,7 @@ trap, and the defaults (0.25 pt, 100%, 40%) are VectorCraft's own, the pages giv | Date | Change | Summary | |---|---|---| +| 2026-11-19 | minor | Scissors previews its actual anchor or curve cut point with a native point marker while hovering, retaining existing snapping, Alt Add Anchor and cut behavior (#8655). Scores and estimates unchanged. | | 2026-11-19 | minor | G12: Brushes panel item right-click context menu offering Brush Options…, Duplicate Brush, and Delete Brush (disabled if the last remaining brush); right-clicking an unselected brush selects it first, and right-clicking within a multi-selection preserves it offering Duplicate Brushes / Delete Brushes; headless tests in `crates/ui-egui/src/panels/brushes/tests.rs`; scores and estimates unchanged. | | 2026-11-19 | minor | G12: Links panel row context menu (Relink…, Go To Link, Update Link, Edit Original, Show in Folder, Embed Image / Unembed…); right-clicking an unselected link row selects it first, and right-clicking within a multi-selection preserves it; headless tests in `crates/ui-egui/src/panels/tests_links.rs`; scores and estimates unchanged. | | 2026-11-18 | minor | G12: Layers panel context menu on guide rows (Release Guide, Duplicate, Delete Guide, Lock/Unlock, Hide/Show); regression tests in `crates/ui-egui/src/panels/layers/tests.rs`; scores and estimates unchanged. | diff --git a/docs/mcp.md b/docs/mcp.md index 19fb8f4218..91a9612304 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -684,11 +684,16 @@ field does, and `false` shows them from 0 to 255 again. `ui.colorRgbPercent` (To palette and Keyboard Shortcuts) switches between the two and answers true when the fields show in percent. `ui.colorWheel {"view": "box", "channel": "red"}` shows the Color Wheel panel's box (a color field with the channel's strip at its right) in place of the wheel, as the panel menu's Box View and Box Channel do, and `"view": "wheel"` -shows the wheel again. `{"harmony": true, "harmonyRule": "triad"}` puts a marker on the wheel's ring for each other +shows the wheel again. `"gamut": true` grays out the parts of the wheel's square and the box's field whose colors +the CMYK space cannot print, as the panel menu's Show Out-of-Gamut Colors does, and `false` shows them again. The +test is the out-of-gamut warning's, which `color.gamutCheck` answers for one color. The shading is approximate: the +panel tests the color at the center of each cell of a 16 by 16 grid over the square or the field and grays out the +whole cell or none of it, so a grayed cell can hold printable colors and a clear cell can hold colors that cannot +print. `{"harmony": true, "harmonyRule": "triad"}` puts a marker on the wheel's ring for each other color of a Color Guide harmony rule, as Show Harmony and Harmony Rule do; the wheel takes the 15 rules whose colors each have a hue of their own (not `monochromatic`, `shades`, `complementary2`, `triad2`, `triad3` or `highContrast2`). Keys left out keep their values. Params that are not an object, another key or a value off -the list return an error and change nothing. The command returns `{view, channel, harmony, harmonyRule, vision}`, +the list return an error and change nothing. The command returns `{view, channel, sliders, gamut, harmony, harmonyRule, vision}`, and the settings are kept with the preferences. `ui.colorWheel {"sliders": "oklch"}` shows the Color Wheel panel's OKLCH Sliders (L, C and H rows under the wheel or @@ -3499,6 +3504,16 @@ enabled while the document has a saved view. In the desktop app the views are li checked when it opens: past 25, blank or repeated names, and views without a finite centre and a positive zoom are dropped. +## Recent commands + +Help › Search Commands… keeps the last commands, tools, panels and effects picked from it, most recent first: an +empty search lists them, and so does the Recent Commands list beside the search field. The desktop app saves the ids +with the UI state, and also how many times each command was picked, which ranks the results. +`help.clearRecentCommands {}` (Clear Recent Commands) empties the list, the saved ids and the pick counts, and +returns `null`. A pick of it in the search is not kept as a recent pick or counted. It is a UI command, so it needs +the desktop app (`--connect`); `command_list` gives it `enabled: false` while no ids and no counts are saved. Saved ids +the list leaves out, such as those of a plug-in that is not loaded, count as saved and are cleared with the rest. + ## Messages over the window `app.toast {message, level?, seconds?}` shows a short message over the desktop app's window without stopping work @@ -5215,7 +5230,7 @@ it, masks that member's solids ([three-d.md](three-d.md#groups)). `threeD.extrude`: `depth` (points, 0..2000, default 50), `twist` (degrees, 0..360, 0), `taper` (1..100%, 100), `cap` (true solid, false hollow), `bevel` (`none`, `classic`, `rounded`, `cove`, `step`, `ogee`), `bevelWidth` and `bevelHeight` (points, default 4), `bevelRepeat` (1..32), `bevelSpace` (0..90%), `bevelInside`, -`bevelBothSides`. `threeD.inflate`: `depth` (points, default 0), `twist` (degrees, 0..360, 0), `taper` (1..100%, 100), `cap` (true +`bevelBothSides`; `bevel` `custom` with `bevelName` and `bevelProfile` is a custom bevel (below). `threeD.inflate`: `depth` (points, default 0), `twist` (degrees, 0..360, 0), `taper` (1..100%, 100), `cap` (true solid, false open behind), `volume` (0..100%, default 50), `bothSides`. All three take `rotationX/Y/Z` (degrees, -180..180, default the Off-Axis Front position -21.88/-23.4/9.06), `perspectiveAngle` and the lighting parameters as Revolve. See [three-d.md](three-d.md) for the Position presets, @@ -5227,12 +5242,47 @@ points returns "The shape is too complex for a 3D effect", and one whose faces d has so many points across so many of its grid's cells that filling the grid would pass its work limit. `threeD.rotate` takes up to 65,536 points. +Custom bevels come from the bevels file, `Bevels.vectorcraft` next to the preferences (none on the web or in runs +with `VECTORCRAFT_NO_PREFS`). `threeD.bevels.edit` (3D and Materials panel › Bevel Shape › Edit Bevels…) opens it, +and first creates it with one example bevel when it is missing. Each symbol whose art is one open path is one bevel, +named after the symbol and listed after the built-in shapes. These rules are VectorCraft's own: the path runs from its +first anchor at the cap's edge to its last at the side wall, across the page across the bevel's width and down the +page along its height, and curves are cut into straight lines of at most 64 points. The file is read when the app +starts and again each time VectorCraft saves it; `threeD.bevels.reload` reads it again. A file larger than 64 MB is +not read, at most 256 symbols are read, and a symbol that is not one open path, has more than 4,096 anchors, is cut +into more than 8,192 straight lines, needs more point-to-line distances to simplify than are left of the 40,000,000 +the file may take, has ends that are not apart both across and down, or repeats an earlier name is +listed in `skipped`. `threeD.bevels.list` +returns each bevel's `name` and `points`, the `file` path, the `skipped` symbols and any read `error`. + +Under automation read roots, the bevels file counts as a path the client did not give. `threeD.bevels.list` returns +`file` as `null` when the file is outside the read roots, and its `error` names the file by its file name; the bevels, +`skipped` and the reason stay. `threeD.bevels.edit` and `threeD.bevels.reload` refuse a file outside the read roots +with the root-check error, naming the file by its file name: `edit` then makes no folder or file and neither opens the +file nor brings it to the front, and `reload` does not read it. Inside the read roots, `edit` opens the file under the +client's roots. The 3D and Materials panel's Edit Bevels… is not confined. + +`threeD.extrude` and `threeD.classicExtrude` take `bevel: {"custom": name}` in `effect.apply` and `effect.setParams`, +and store it as `bevel: "custom"` with `bevelName` and `bevelProfile`, a copy of the points (`[[x, y], …]`, 2 to 64 +shares 0..1 of the width and height from `[0, 0]` to `[1, 1]`), so the document draws the bevel without the file. An +unknown name, `custom` without `bevelProfile`, points that do not run from `[0, 0]` to `[1, 1]` within 0..1, or a +`bevelName` that is not a string is refused and the document is not changed. The command's journal entry records the +points as `savedBevel`, and `savedBevel` given with `{"custom": name}` is used in place of the file's points, so a +replay draws the same bevel after the file changes or drops the name. The help page +[Add custom bevel paths](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/add-custom-bevel-paths.html) +describes custom bevels drawn as open paths and kept as symbols in a bevels document. + +```json +{"name":"run_command","arguments":{"command":"threeD.bevels.list","params":{}}} +{"name":"run_command","arguments":{"command":"effect.apply","params":{"effect":"threeD.extrude","item":null,"params":{"bevel":{"custom":"Example Bevel"},"bevelWidth":8,"bevelHeight":8}}}} +``` + ## Extrude & Bevel (Classic) `effect.apply {effect: "threeD.classicExtrude", params: {...}, ids?, item?}` is Effect › 3D and Materials › 3D (Classic) › Extrude & Bevel (Classic)…. It builds the same solid as `threeD.extrude` and draws its faces with the classic surfaces. Parameters: `depth` (points, 0..2000, default 50), `cap` (true solid, false hollow), `bevel` (`none`, -`classic`, `rounded`, `cove`, `step`, `ogee`), `bevelHeight` (points, 1..100, default 4; the bevel is as wide as it +`classic`, `rounded`, `cove`, `step`, `ogee`, or a custom bevel as for `threeD.extrude`), `bevelHeight` (points, 1..100, default 4; the bevel is as wide as it is tall), `bevelInside` (false adds the bevel around the shape, true carves it into the shape), `rotationX/Y/Z` and `perspectiveAngle` as above, and the surface: @@ -7515,7 +7565,7 @@ and files saved without it open with it off. ## Live Corners -`object.setLiveShape {id?, ids?, radius?, kind?, corners?, items?}` sets the corners of any path (one undo step): a live +`object.setLiveShape {id?, ids?, radius?, kind?, corners?, rectanglesOnly?, items?}` sets the corners of any path (one undo step): a live rectangle's or polygon's, a star's, a pen path's. A corner is an anchor where two sides, straight or curved, meet at an angle (not an open path's ends, not a smooth anchor, not one the sides run straight on through); a curved side is trimmed to what the cut leaves of it. `radius` (pt) and `kind` @@ -7534,7 +7584,9 @@ or keeps its size with Scale Corners off), and a rectangle from a file that kept (elliptical corners) gets circular ones in document units when its corners are next set. Dragging a corner widget rounds the corners whose widgets show (every corner, or the Direct-Selected ones) on every selected path at once, outlining in red those that reach their limit; the Selection tool shows the widgets of live rectangles and polygons, -the Direct Selection tool those of any path. Several objects each with their own corners are one call: +the Direct Selection tool those of any path. `rectanglesOnly: true` sets them on the live rectangles among the targets +alone and leaves the other objects as they are (the Rectangle Properties corner fields and menus send it with the +selection, so an action that records them acts on the rectangles selected when it plays). Several objects each with their own corners are one call: `items: [{id, corners?}]` in place of `ids` and `corners`. Alt-clicking one cycles their kind and double-clicking one opens Corners (`ui.corners {id?, corners?}`, dialog `corners`: `kind`, `radius`; OK runs `object.setLiveShape`). `view.shapeWidgets {on?}` (desktop app, the Hide Shape Widgets and Show Shape Widgets button in the Control bar of the @@ -12416,6 +12468,27 @@ on an open path that are not drawn because they fall before the path's start can {"name":"run_command","arguments":{"command":"text.touchType","params":{"id":7,"start":1,"dx":10,"dy":4}}} ``` +## Retype tracking + +`type.retype {fonts?}` turns selected outlined text back into point text when its shapes are glyphs of a font the app +has. A line of three or more glyphs gets the spacing that most of its gaps share as its tracking, in 1/1000 em. Retype +tries the value rounded to a whole number first when it is within 0.05 of one, then the value as measured. The font's +advances and pair kerning are left out of the measure, and word spaces are counted after the tracking. The tracking is +kept when the tracked type draws the whole line in place, or more of it from its start than untracked type does. When +untracked type also draws the whole line, for example when gaps are as wide as whole spaces, the line stays untracked +if the tracking is under one unit or the tracked type would drop a gap one space wide, so `a b c` stays `a b c`. +Otherwise the tracked type is kept, and only gaps wider than the tracking alone keep spaces (narrower gaps, when +tracking tighter than a space gives each space a negative advance). Glyphs tracked tighter than a quarter em stay on +one line as long as each one starts after the one before it. Negative tracking is set only on a line that is opaque, +uses the Normal blend mode, has a solid fill or none and has no stroke; other tightly spaced lines split into one object +per glyph. A line splits where its type stops drawing the outlines in place, and the glyphs after the split take the +tracking their own gaps give. These rules are VectorCraft's own. Each entry of the result's `fonts` list has +`tracking`. + +```json +{"name":"run_command","arguments":{"command":"type.retype","params":{}}} +``` + ## Retype panel `type.retypeFonts {count?}` lists the fonts whose glyphs match the selected outlined text. It compares each selected path diff --git a/docs/roadmap.md b/docs/roadmap.md index 5cbca497e6..ee2eaa9e3f 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -1,6 +1,6 @@ # Roadmap: milestones and what's next -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-19 · **Change:** minor (M11: 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: M5: 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 (an edit that changes more than half of the frame, or a change of more than the view and the document, still renders it whole at once), and edits that go on once the view is still don't put off its render (#8688); scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); M11: a tool drag held near an edge of the canvas scrolls the view, #8551; 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: M4: 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: M4: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, #8200; 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: M4: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, #8128; 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: M1: 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; M1: an Alt-drag in the Layers panel copies a row above or below its own place, #8237; 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; M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; 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: M7: Check Spelling modal dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: 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; M10/G5: Neon & Glow built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); previously: Tech Circuit brush library, G5; 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: 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; Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: M10/G5: Energy Beams brush library; MCP docs list Energy Beams; previously minor: M10/G5: Skill Icons symbol library; MCP docs list Skill Icons; previously minor: M10/G5: Status Effects graphic style library; MCP docs catch-up for symbol libraries; previously minor: M10/G5: Inventory Icons built-in symbol library; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: M10/G5: Game HUD graphic style library; previously minor: resizable icon-strip flyouts and bottom-aligned panel footers, #5713; previously minor: M10/G5: Map Markers built-in symbol library; 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: G2: Effect Gallery thumbnails and in-dialog preview are in; 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; interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; 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; M4/M7: `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; M4/M7: `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; numeric fields step on wheel hover without taking keyboard focus, #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; 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; Indian-language hyphenation review and license allowlist, #4947; Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; shape tools move the selection from its centre point and turn it from the zone outside a box corner, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (M11: 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: M5: 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 (an edit that changes more than half of the frame, or a change of more than the view and the document, still renders it whole at once), and edits that go on once the view is still don't put off its render (#8688); scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); M11: a tool drag held near an edge of the canvas scrolls the view, #8551; 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: M4: 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: M4: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, #8200; 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: M4: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, #8128; 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: M1: 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; M1: an Alt-drag in the Layers panel copies a row above or below its own place, #8237; 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; M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; 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: M7: Check Spelling modal dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: 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; M10/G5: Neon & Glow built-in graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); previously: Tech Circuit brush library, G5; 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: 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; Live Paint Bucket fills faces crossed in one drag (#6373); previously: #6404: transform-aware Eyedropper character copying; scores and estimates unchanged; previously: M10/G5: Energy Beams brush library; MCP docs list Energy Beams; previously minor: M10/G5: Skill Icons symbol library; MCP docs list Skill Icons; previously minor: M10/G5: Status Effects graphic style library; MCP docs catch-up for symbol libraries; previously minor: M10/G5: Inventory Icons built-in symbol library; previously minor: Edit › Edit Custom Dictionary…: its dialog adds, deletes and changes the custom dictionary's words, #4936; previously minor: M10/G5: Game HUD graphic style library; previously minor: resizable icon-strip flyouts and bottom-aligned panel footers, #5713; previously minor: M10/G5: Map Markers built-in symbol library; 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: G2: Effect Gallery thumbnails and in-dialog preview are in; 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; interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; 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; M4/M7: `.ai`/EPS type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page, #6147; M4/M7: `.ai`/EPS type from the text document lays its lines out closer to the file's page, within limits, #6137; numeric fields step on wheel hover without taking keyboard focus, #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; 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; Indian-language hyphenation review and license allowlist, #4947; Hindi catalog and contributor loanword preferences; full wording review in progress; Effect dialogs: a colour swatch beside a hex colour opens the Color Picker, #5365; shape tools move the selection from its centre point and turn it from the zone outside a box corner, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) > > Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865). > @@ -26,6 +26,8 @@ ## Feature submission evidence +**Scissors cut-point preview (#8655):** A native point marker shows the anchor or position on a curve that the current Scissors click targets, including the existing snapping rules. Hovering changes no artwork; an ineligible or stale hover has no marker. Existing cut and Alt Add Anchor behavior are retained. Focused tool and Session regressions live in `crates/tools/src/draw2/anchor/tests.rs` and `crates/engine/tests/scissors_snap.rs`. Scores and estimates are unchanged. + Draft enhancement #5804: Preferences › File Handling can select a raster editor through the native picker, with a private draft outside engine preferences and generic dialog fields. OK saves it, Cancel discards it, and Reset restores PhotoCraft. With Use System Defaults off, a missing chosen editor falls back to PhotoCraft, then the system default; validation and launch failures are reported. Control/MCP and synthetic input cannot choose an application or run external Edit Original. Web behavior, parity scores and estimates are unchanged; macOS/Linux smoke tests remain pending. **2026-11-19 revision:** merged main while preserving the private raster-editor choice; no parity rescore. @@ -177,12 +179,12 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule |---|---|---|---| | M0 | Skeleton + vertical slice | ✅ done | — | | M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (path and compound-path interior selection follows enabled fill rows (#6625); a marquee leaves locked or hidden guide paths out inside groups, as clicks do (#8538); hidden-fill and no-fill stroke cap/join CPU regressions passed; document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them) | 4–6 | -| M2 | Drawing tools + smart guides | ✅ mostly done (Eraser preserves fill outside fixed and varied tip sweeps and Alt-drag marquees on fill-only open paths and keeps their compound holes; clipping masks retain surviving contours or empty geometry in the same node; ordinary Group/Layer paints and evaluated gradient placements are preserved when the stored paint reproduces their appearance; hidden Rasterize and Along/Across stroke rows do not block visible gradients; replacement-art effects, plug-ins/Rasterize, along/across-stroke gradients and placements that cannot be reproduced keep their existing fitting; stroked open paths retain main behavior (#6582); #3380 deletion creates independent selected path pieces and keeps bounds-fitted gradients in place; endpoint highlighting remains open; Polygon/Star exact-size count persistence, with repeated-drag, tool-switch and Cancel regression coverage; Curvature point markers without direction handles (#1236, in part); Direct Selection segment click/Delete preserves neighboring edges, #1278; Flare, Reshape, Live Corners widget dragging and per-corner radii and kinds landed, on any path's corners; Shaper rough-shape recognition and orientation steps, the remaining Pen modifier nuances; Shaper Groups with editable sources and separate fill/stroke edits landed; custom ruler origin with drag preview, active-artboard reset, relative X/Y fields and native round-trip (#1212); construction widget/refinements pending); a shape just drawn moves by its centre point and turns from the zone outside a corner with its tool still active (#5477); Tangent and straight-segment perpendicular snapping use saved Smart Guides Geometric Guides preferences and Control bar quick access (#2537), including the existing Snap to Glyph and Alignment Guides toggles (#6164); no View submenu; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123); Scissors hover and cuts use the Pen's path/align/intersect/anchor snaps, with Alt Add Anchor and cut endpoint selection retained (#6470) | 12–18 | +| M2 | Drawing tools + smart guides | ✅ mostly done (Eraser preserves fill outside fixed and varied tip sweeps and Alt-drag marquees on fill-only open paths and keeps their compound holes; clipping masks retain surviving contours or empty geometry in the same node; ordinary Group/Layer paints and evaluated gradient placements are preserved when the stored paint reproduces their appearance; hidden Rasterize and Along/Across stroke rows do not block visible gradients; replacement-art effects, plug-ins/Rasterize, along/across-stroke gradients and placements that cannot be reproduced keep their existing fitting; stroked open paths retain main behavior (#6582); #3380 deletion creates independent selected path pieces and keeps bounds-fitted gradients in place; endpoint highlighting remains open; Polygon/Star exact-size count persistence, with repeated-drag, tool-switch and Cancel regression coverage; Curvature point markers without direction handles (#1236, in part); Direct Selection segment click/Delete preserves neighboring edges, #1278; Flare, Reshape, Live Corners widget dragging and per-corner radii and kinds landed, on any path's corners; Shaper rough-shape recognition and orientation steps, the remaining Pen modifier nuances; Shaper Groups with editable sources and separate fill/stroke edits landed; custom ruler origin with drag preview, active-artboard reset, relative X/Y fields and native round-trip (#1212); construction widget/refinements pending); a shape just drawn moves by its centre point and turns from the zone outside a corner with its tool still active (#5477); Tangent and straight-segment perpendicular snapping use saved Smart Guides Geometric Guides preferences and Control bar quick access (#2537), including the existing Snap to Glyph and Alignment Guides toggles (#6164); no View submenu; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123); Scissors hover and cuts use the Pen's path/align/intersect/anchor snaps, with Alt Add Anchor and cut endpoint selection retained (#6470); Scissors previews the current anchor or curve cut point (#8655) | 12–18 | | M3 | Paint & appearance (swatches, color, gradient, stroke, appearance, transparency, styles) | ✅ done (M3.7–M3.98): swatches, groups, libraries, tints, Lab spots and Registration; Eyedropper copies transformed character dimensions (#6404) and styles highlighted text only (atomic transparency rejection); Eyedropper reads visible locked and outside-isolation sources (#1251); Color Picker, Color panel (its spectrum grows with a resized panel, #8005), Color Guide, Color Themes, Edit Colors and Recolor Artwork (screen-bounded Edit chip list, #3416; native Lab entry and swatch libraries in the picker, Assign-row menus, #8031/#4028); gradients that follow every transform, the annotator, linked stops, freeform gradients, focal points, gradients on strokes and Expand; visible strokes when paint is added to inherited None/zero-width art (#1253); stroke geometry, arrowheads, dashes fitted to corners, stroke on type, width profiles and the Width tool (Shift-double-click enables adjoining adjustment in Width Point Edit; finite-arithmetic follow-up regressions and full CI passed ([Validation evidence](target-app-parity.md#evidence-what-ships-today-by-area))), Scale Strokes and preview bounds; Appearance targeting, container appearance, target circles, Expand Appearance; knockout, isolation, blend accuracy, CMYK blending, overprint, Attributes, masks and clipping, Flatten Transparency; graphic styles, links and libraries; CSS library export preserves fractional linear and radial gradient stop positions. Left: freeform gradients in SVG/PDF, mixed spot/process gradients in SVG and PDF gradients mixing a spot color with RGB or Lab stops export as stops or process colors; PDF export writes dithered gradient fills with spot stops, and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, as images in process colors; confirm the Scale Strokes & Effects default; Recolor model selection is available through the engine and MCP only (#2520); the dialog retains its existing controls; Library panels' lists (swatch, Color Book, brush, symbol and graphic style libraries) fill a taller panel above its footer (#2992; scores and estimates unchanged); Graphic Styles list fills a taller panel above its footer (#2992; scores and estimates unchanged); Swatches list fills a taller panel above its footer (#1638; `the_list_fills_a_tall_panel_above_its_footer`; scores and estimates unchanged); | 4–8 | | M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths (#8128; estimates unchanged); Production Preflight checks fonts, overflow, links and image resolution with clickable findings and automatic rechecking (VectorCraft addition; estimates unchanged); PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; a `TJ` over more than 65 lines (the 64 its fill pass finished, kept back, and the open one) stays a filled object and a stroked one for each part (#8543; estimates unchanged); PDF import: type filled and stroked after a page of type filled only (more than 64 lines) comes in as one filled and stroked type object again, with or without a path between, and a `TJ` over more lines than are kept with a glyph kept as an outline still stays a filled object and a stroked one for each part (#8549 follow-up; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding no text (#6971; scores and estimates unchanged); | 3–6 (existing scope; Affinity export unestimated) | | M5 | Performance | 🟡 background render + caches + MT done; text thread overlays index repeated selection lookups, keeping the first lookup and singleton selections direct (#6543); `vectorcraft-cli bench` and `vectorcraft-cli perf` (budget suite); opaque solid-fill knockout paths draw once in hard-edge/supersampled raster export, with analytical-AA compositing unchanged; file format v2 opens 3× faster (50k paths: 722 → 244 ms); raster effects (glows, shadows, blur, feather) no longer force the whole frame single-threaded (filtered offscreen per effect, verified equal to the single-threaded reference); Craquelure/Mosaic Tiles/Stained Glass distance searches optimized with pixel-invariance checks and the `texture_drag_perf` probe (#1257); effect-heavy demos need a clean-machine benchmark; in the web build an edit while the view of a heavy document moves draws only the part it changed into the last frame (#8688); dirty-region rendering, GPU backend spike pending | 15–25 | | M6 | Path operations (Pathfinder, Shape Builder, offset…) | ✅ mostly done (live compound shapes: Make, Alt-click a Shape Mode, member modes, Release, Expand (#4522); single-result Pathfinder names and SVG IDs retained (#1293); Divide open-cutting-path geometry, appearance and history verified (#1307; existing segment cap remains); Simplify preview/counts and rewritten-path component selection verified (#1272; the slider opens at the Auto-Simplify level; a Direct Selection part of a path simplifies on its own); Compound appearance and member fill-rule edits verified (#1197); Boolean precision on almost-horizontal edges fixed and the property tests made deterministic; Shape Builder gap detection, large-offset bug open); Shape Builder Gap Detection shares Live Paint’s spatial gap finder and temporary merge bridges (#2526); Custom is capped at 72 pt in the existing options dialog | 3–6 | -| M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); 🟡 Retype phase 1: `type.retype` turns outlined text that exactly matches an available font back into point text (#4934); Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders, vertical type pending | 45–60 | +| M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); 🟡 Retype phase 1: `type.retype` turns outlined text that exactly matches an available font back into point text (#4934), keeping even spacing as tracking; Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders, vertical type pending | 45–60 | | M8 | Transform & distort (Puppet Warp, Liquify tools, Envelopes, Blends, Perspective Grid) | ✅ done (M8.1–M8.20 on 2026-10-06, fidelity pass): Liquify Tool Options with one shared brush, pen pressure, hold-to-apply, a safe scope and incremental strokes; tool options that last; Puppet Warp rotation, multi-select, Control bar and a rest-shape session that follows Undo; Width tool on compound paths; Envelope dialogs with preview, Reset with Warp/Mesh, full Envelope Options, type/images/symbols/appearance/gradients/patterns distorted on canvas and in every export, warps that keep their frame, Edit Contents, mesh handles and Control bar; Blend Options, anchor-targeted Blend tool, editable spine, keys picked on the canvas, faithful interpolation and knockout; Anchor Point spine conversion/handle editing and selection priority (#2544), with #2425 Shift reshape preserved; Perspective Grid with Define Grid, presets, lock/snap/rulers, widgets, the 1–4 plane switch, movable planes, Perspective Selection scale/copy/perpendicular/Transform Again, and type and symbols truly projected with Edit Text. Left: Anti-Alias and Preserve Shape output, warp-envelope point editing, brush interpolation in blends, Free Transform/Scale/Reflect along a rotated box | 2–4 | | M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders, vertical type pending | 45–60 | | M8 | Transform & distort (Puppet Warp, Liquify tools, Envelopes, Blends, Perspective Grid) | ✅ done (M8.1–M8.20 on 2026-10-06, fidelity pass): Liquify Tool Options with one shared brush, pen pressure, hold-to-apply, a safe scope and incremental strokes; tool options that last; Puppet Warp rotation, multi-select, Control bar and a rest-shape session that follows Undo; Width tool on compound paths; Envelope dialogs with preview, Reset with Warp/Mesh, full Envelope Options, type/images/symbols/appearance/gradients/patterns distorted on canvas and in every export, warps that keep their frame, Edit Contents, mesh handles and Control bar; Blend Options, anchor-targeted Blend tool, editable spine, keys picked on the canvas, faithful interpolation and knockout; Anchor Point spine conversion/handle editing and selection priority (#2544), with #2425 Shift reshape preserved; Perspective Grid with Define Grid, presets, lock/snap/rulers, widgets, the 1–4 plane switch, movable planes, Perspective Selection scale/copy/perpendicular/Transform Again, and type and symbols truly projected with Edit Text. Left: Anti-Alias and Preserve Shape output, warp-envelope point editing, brush interpolation in blends, Free Transform/Scale/Reflect along a rotated box; #5179 curved-spine redraw bounds include rotated keys and steps (two focused CPU regressions) | 2–4 | @@ -234,6 +236,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours | Date | Change | Summary | |---|---|---| | 2026-11-19 | minor | M11: View › 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; a ruler drag or double-click makes no guide meanwhile (#8363). Scores and estimates unchanged | +| 2026-11-19 | minor | Scissors previews its actual anchor or curve cut point with a native point marker while hovering, retaining existing snapping, Alt Add Anchor and cut behavior (#8655). Scores and estimates unchanged. | | 2026-11-19 | minor | M5: 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 (an edit that changes more than half of the frame, or a change of more than the view and the document, still renders it whole at once), and edits that go on once the view is still don't put off its render (#8688). Scores and estimates unchanged. | | 2026-11-18 | minor | M10/G5: Media Controls joins Basic Shapes, UI Frames, Map Markers, Inventory Icons, Skill Icons and Weather Icons as a seventh built-in symbol library (Play, Pause, Stop, Skip Next, Shuffle, Repeat; original procedural vector symbols generated in code, no default 9-slice); G5 estimate decremented to 2–12 h, milestone estimates unchanged | | 2026-11-18 | minor | M7/G4: Retype phase 1 (#4934): `type.retype` turns outlined text that exactly matches an available font back into point text. Scores and estimates unchanged | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index fa726b2359..c70ca289b6 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 (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: 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 whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; 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-20 · **Change:** minor (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 whose pieces are all one curve split at anchors follows that curve's parameter, so a top object saved with its sides' curves in pieces draws as its `.ai` drawn art, #7097; 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). > @@ -30,6 +30,8 @@ ## Feature submission evidence +**Scissors cut-point preview (#8655):** A native point marker shows the anchor or position on a curve that the current Scissors click targets, including the existing snapping rules. Hovering changes no artwork; an ineligible or stale hover has no marker. Existing cut and Alt Add Anchor behavior are retained. Focused tool and Session regressions live in `crates/tools/src/draw2/anchor/tests.rs` and `crates/engine/tests/scissors_snap.rs`. Scores and estimates are unchanged. + `window.panel.float` updates an existing native panel window's supplied position and size (#8391). Positions use the main window's content origin. Omitted coordinates and dimensions keep their current native values, including after an OS window move or resize. Evidence: `panel_docking::native_tests::an_explicit_float_command_updates_an_existing_native_windows_geometry` covers panel, group and column commands. Scores and estimates are unchanged. EPS embedded fonts, 2026-11-09 (#6023–#6067): the fonts an EPS carries draw their glyphs instead of being set as type in an installed font: composite (Type 0) fonts with the 8/8 mapping, plain Type 42 fonts (characters from their glyph names or character map, widths from the font), CID-keyed fonts over CMaps (Type 0 and Type 2 CIDFonts, CIDFonts in a FontSet's Compact Font Format data, base-font CMaps, named CIDFonts over predefined Unicode CMaps set as type) and embedded Type 1 fonts; the show operators' spacing along the baseline is kept as tracking, `kshow` included. Each step is charged to the interpreter's budgets. Hand-written test files only (no corpus file uses these fonts); scores and estimates unchanged. Evidence: `crates/eps/src/import/tests_composite.rs`, `tests_type42.rs`, `tests_cid.rs`, `tests_type1.rs`; details in [file-format-parity.md](file-format-parity.md). @@ -277,7 +279,7 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | Area | Weight | Done | Main gaps | One agent (h) | Kind | |---|---:|---:|---|---:|---| | Selection, transform & align tools | 6 | 85% | Direct Selection segment click/Delete corrected (#1278); deletion splits an ordinary contour into selected sibling objects with bounds-fitted gradients kept in place (#3380, deletion only; `crates/engine/tests/it/delete_path_pieces.rs`); open-path anchor Delete keeps gaps; Select › Start Global Edit finds the paths, compound paths and symbol instances of the selected object's shape (Appearance, Size and artboard options) and gives an edit of one to all of them in proportion, as one undo step (#3521), and on a group the groups like it, an edit inside one reaching the same object in the others (#4939), and a Shift-click on a highlighted match leaves it out; the Align panel menu's Align to Glyph Bounds › Point Text and Area Text measure type by its glyphs' ink for Align and Distribute (#4231); remaining: Free Transform/Scale/Reflect along a rotated box, Global Edit of rotated copies, transform nuances (no-op anchor Align history regression-tested, #1180 follow-up) | 4–6 | estimated; fill-stack selection regression-tested (`crates/engine/tests/path_fill_hits.rs`, #6625); cap/join follow-up CPU regressions passed; Global Edit regression-tested (`crates/engine/src/tests/globaledit.rs`; Quick Action, menu label and Escape in `panels::properties::tests::start_global_edit_quick_action_and_escape`) | -| Drawing tools (Pen, Curvature, Pencil, shapes, Shaper) | 7 | 85% | Shaper construction widget, Pencil/Pen nuances, Blob Brush options, Touch Type, Dimension tool; see [ui-parity.md](ui-parity.md) | 8–13 | estimated; Curvature point display regression-tested (#1236, in part); Polygon/Star exact-size count persistence regression-covered; Live Corners' Relative rounding done (#3091), score unchanged; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123), score and hours unchanged; the Pen, Smart Pen and Curvature tool show the measurement readout with the rubber band off (#7043), score, gaps and hours unchanged; Scissors shares the Pen's path/align/intersect/anchor snaps (#6470), source and headless regressions below; Eraser preserves fill-only open-path area outside fixed and varied tip sweeps and Alt-drag marquees, including compound holes; clipping masks keep their remaining contours and empty-mask role; ordinary Group/Layer paints and evaluated gradient placements are preserved when the stored paint reproduces their appearance; replacement-art effects, plug-ins/Rasterize, along/across-stroke gradients and placements that cannot be reproduced keep their existing fitting; stroked open paths retain main behavior and result structure (#6582; `crates/engine/tests/eraser_open_fill.rs`), score and hours unchanged | +| Drawing tools (Pen, Curvature, Pencil, shapes, Shaper) | 7 | 85% | Shaper construction widget, Pencil/Pen nuances, Blob Brush options, Touch Type, Dimension tool; see [ui-parity.md](ui-parity.md) | 8–13 | estimated; Curvature point display regression-tested (#1236, in part); Polygon/Star exact-size count persistence regression-covered; Live Corners' Relative rounding done (#3091), score unchanged; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123), score and hours unchanged; the Pen, Smart Pen and Curvature tool show the measurement readout with the rubber band off (#7043), score, gaps and hours unchanged; Scissors shares the Pen's path/align/intersect/anchor snaps (#6470), source and headless regressions below; Eraser preserves fill-only open-path area outside fixed and varied tip sweeps and Alt-drag marquees, including compound holes; clipping masks keep their remaining contours and empty-mask role; ordinary Group/Layer paints and evaluated gradient placements are preserved when the stored paint reproduces their appearance; replacement-art effects, plug-ins/Rasterize, along/across-stroke gradients and placements that cannot be reproduced keep their existing fitting; stroked open paths retain main behavior and result structure (#6582; `crates/engine/tests/eraser_open_fill.rs`), score and hours unchanged; Scissors cut-point preview covered in tool and Session regressions (#8655), scores and hours unchanged | | Path operations, Pathfinder, Shape Builder, Live Paint | 5 | 80% | Shape Builder on the reporter's file (#937: art past 4,096 segments is cut by lines again; unconfirmed on the file itself); gap detection shares Live Paint’s finder, with a 72 pt custom cap and the existing options; Live Paint Gap Options | 4–8 | estimated; Shape Builder Gap Detection shares Live Paint’s spatial gap finder and temporary merge bridges (#2526); Custom is capped at 72 pt in the existing options dialog (lowered from 86%: open issues); compound attributes regression-tested (#1197); single-result source names survive SVG export/import (#1293), with [SVG ID semantics](https://www.w3.org/TR/SVG2/struct.html#IDAttribute) and original-shape tests; Simplify component selection and preview regression-tested (#1272); Simplify of a Direct Selection part of a path regression-tested (`tests/simplify_part.rs`); Divide open-cutting-path geometry and appearance regression-tested (#1307); the Shape Builder's edge-source grid is bounded in memory and files a segment once per cell (`planar.rs` test `rect_index_holds_a_bounded_number_of_references`); live compound shapes (Make, Alt-click, member Shape Modes, Release, Expand, saved and exported) regression-tested (#4522); Live Paint Bucket face drags, including narrow faces and one Undo, regression-tested (#6373) | | Colour, swatches, gradients, patterns, mesh, recolor | 7 | 92% | Picker Lab entry, picker libraries and Assign-row menus complete the deferred #4028 UI paths (#8031); scores and estimates unchanged; Eyedropper copies effective character dimensions across text transforms (#6404); 30.0's gradient additions are done (dither, perceptual blending, presets); freeform gradients in SVG/PDF, mixed spot/process gradients in SVG, PDF gradients mixing a spot color with RGB or Lab stops, and dithered spot gradient fills and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, which PDF export writes as images in process colors| 4–7 | estimated; Recolor model selection is available through the engine and MCP (#2520), and the dialog's color sliders (HSB, RGB, CMYK, Lab, Tint for a spot color) edit the selected row's new color in its mode, and the Edit tab's Global Adjust sliders (Saturation, Brightness, Temperature, Luminosity, -100% to 100%) change every recolored color at once (lowered from 96%: target moved); unpainted zero-width stroke restoration fixed (#1253), score and hours unchanged; Eyedropper source reads regression-tested (#1251); screen-bounded Recolor Edit chip list (#3416), score and hours unchanged; a point on a gradient mesh's outline locates on its edge on every side (#7006: `mesh_locate_takes_a_point_on_any_side_of_the_outline`, `mesh_add_line_exactly_on_the_edge_needs_no_tolerance`), score and hours unchanged; Color panel spectrum grows with the resized panel (#8005) | | Strokes, brushes, width profiles | 5 | 88% | Shift-double-click adjoining adjustment is implemented; brush libraries are done (fifteen generated libraries including Tech Circuit, Decorative, Engraving, Arrows, Stipple, Pressure Sensitive, Ink and Wash, Bristle Brushes, Game Trails, Energy Beams and Dry Media, User Defined, Other Library…, Save Brushes); Art brush Overlap and Pattern brush auto corners are done; remaining: pen pressure on macOS, Stylus Wheel, more built-in brush libraries, tilt, bearing and rotation for Art, Pattern and Bristle brushes and on native Wayland and the web | 8–15 | estimated; width-point creation and adjoining adjustment regression-tested; dialog layout reviewed; evidence below; finite-arithmetic follow-up regressions and full CI passed (evidence below) | @@ -1182,6 +1184,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - With Smart Guides › Transform Tools on, a Free Transform shear (Cmd/Ctrl on a side handle) shows its angle next to the pointer, as the Shear tool does, and a handle drag that turns from a scale into a shear and back shows only the current operation's value ([the help page](https://helpx.adobe.com/illustrator/desktop/measure-and-align/grids-and-guides/smart-guides-options.html)). The angle's sign and its one decimal place are VectorCraft's own rule, the same as the Shear tool's label (tools `xform::free::tests::shear_drag_shows_its_angle_with_transform_tools_guides`, `a_handle_drag_that_changes_operation_relabels_it`). - Native macOS menu bar, vector tool cursors, a command palette (Help › Search Commands…), middle-button panning with any tool. Native menus explicitly end tracking on command selection, outside window presses and Escape; menu updates wait until tracking ends, and a dismissing press never starts a canvas gesture (M14.8). - Help › Search Commands… is the first item of the Help menu in the window, with its shortcut and a separator after it; in the native macOS menu bar it is the first item below the system's search field. This is VectorCraft's own order and does not raise a score (`menus::tests::help_starts_with_search_commands`, `tests::nativemenu::the_mac_help_menu_starts_with_search_commands`). + - Clear Recent Commands (`help.clearRecentCommands`), found through Help › Search Commands…, empties the Recent Commands list, the list an empty search shows, the saved list and the pick counts that rank the results. A pick of it is not kept as a recent pick or counted, and it is enabled while a pick or a count is saved. This is VectorCraft's own behavior (`palette` tests `clear_recent_commands_empties_the_recent_picks`, `clear_recent_commands_also_clears_the_pick_counts`). - A Recent Commands button beside the Help › Search Commands field lists the last eight commands, tools, panels and effects picked from the palette, most recent first, with a command picked again moved to the top. A pick is recorded when it runs or opens a dialog, even if the dialog is then canceled; a pick that is refused because its menu item is dimmed, its tool can't be chosen or its panel can't be shown is not recorded, unless it opened a dialog. Choosing a row closes the palette and runs it as a pick of the same result does; with no picks yet the list shows a dimmed No recent commands row, and a command that is not available now, such as a filter of a plug-in that is not loaded, is left out until it comes back. The ids are saved with the UI state. While the list is open, Up and Down move through its rows, wrapping at the ends, and Escape closes the list before the palette. This is VectorCraft's own addition and does not raise a score (#6376; `palette` tests `recent_commands_*`, `a_recent_command_runs_what_its_pick_runs`, `the_keys_wrap_within_recent_commands`, `escape_closes_recent_commands_before_the_palette`). - With an empty search, or one of spaces only, the Help › Search Commands field lists the picks of the Recent Commands list (at most eight, leaving out a filter of a plug-in that is not loaded) under a Recent heading, most recent first, with the first highlighted and no result count, so opening the palette and pressing Enter picks the last pick again; when no callout can point at the highlighted pick's home, the line under the list still says where it is. A pick that is dimmed now shows why in the status line, as from a search, and keeps its place in the list. With no picks yet it lists no results and shows a dimmed Type to search commands, tools, panels and effects line. A pick of Search Commands… itself is not recorded. The palette opens with its first result highlighted and its list scrolled to the top. This is VectorCraft's own behavior (`palette` tests `an_empty_search_lists_the_recent_picks_most_recent_first`, `an_empty_search_without_picks_says_what_to_type`, `enter_on_an_empty_search_runs_the_last_pick_again`, `the_palette_opens_again_with_its_first_row_highlighted`, `the_palette_toggle_is_not_a_recent_pick`, `a_click_on_a_recent_pick_runs_it_and_moves_it_first`, `a_pick_says_whether_it_ran_opened_a_dialog_or_was_refused`, `a_refused_pick_is_not_recorded`, `a_pick_that_opens_a_dialog_is_recorded_even_when_canceled`, `under_the_recent_picks_the_footer_names_a_home_out_of_view`). - The app bar's search control is a field showing a magnifier, "Search commands" and the Help › Search Commands… shortcut. The field shows no shortcut when the shortcut is cleared or too long to fit beside the text; the tooltip and the screen-reader name still give it. A click on the field, or Enter or Space while it has the keyboard focus, toggles the command palette as the shortcut does, and the palette's popup holds the text field. While the field has the focus, the app's existing rule for a focused control keeps the app's own keys off, so Enter does not open Move and Tab moves the focus on. While a dialog is open the field and the icon are drawn disabled and do nothing, as the shortcut does. Screen readers name the field and the icon Search commands, with the shortcut. As the bar narrows, the community button goes first, then Explore tutorials, then the field becomes the magnifier icon, then the workspace switcher narrows to 64 points, then the icon goes; Safe Mode's label keeps its room first. The field is wider than the icon, so the community button and Explore tutorials go at wider bars than they did beside the icon. This is VectorCraft's own addition and does not raise a score (`chrome::tests`: `the_app_bar_gives_up_its_right_hand_controls_in_order`, `a_wide_app_bar_shows_a_search_field_with_the_palette_shortcut`, `the_search_field_follows_the_palettes_shortcut`, `a_long_shortcut_leaves_the_search_hint_readable`, `a_click_on_the_search_field_opens_the_palette`, `the_search_icon_has_the_fields_name_and_both_are_disabled_under_a_dialog`, `the_keyboard_opens_the_palette_from_the_search_field`, `a_narrowing_app_bar_turns_the_search_field_into_the_icon`). @@ -1473,6 +1476,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur With Direct Selection, Shift pressed during the drag of a curved segment keeps both of its handles at right angles to the line between its anchors, on the same side and at the same length (`path.reshapeSegment {perpendicular}`). Shift held while any segment is dragged with the Anchor Point tool or the Pen with Alt does the same. With the Anchor Point tool, Shift held at the press on an anchor (or a selected blend's spine point) moves it, handles and all, instead of pulling out handles; Shift kept down keeps the move at 45° steps, and a Shift-click that doesn't move leaves the anchor as it was (`path.moveAnchor`). A selected blend spine's segment dragged with the Anchor Point tool, or a curved one dragged with Direct Selection, bends the same way (`object.blend.spine.reshapeSegment`). - **Live Corners:** drag a live rectangle's corner widgets (Selection or Direct Selection) to round all corners, with a radius readout; with Direct Selection, select corner anchors to show and round just those corners (#381). Each corner keeps its own radius and kind (Round, Inverted Round, Chamfer): Alt-click a widget to cycle the kind, double-click it for the Corners dialog, and the Properties and Transform radius fields set the selected corners (`object.setLiveShape {corners, radius, kind}`). A link toggle behind Corner Radius (the `singleCornerRadius` preference) switches the panels to a field for each corner of a live rectangle: Top Left, Top Right, Bottom Right and Bottom Left. Corners stay circular when the rectangle is scaled unevenly or along its own sides when rotated (the radius keeps its size, or scales by the mean scale with Scale Corners on); only a shear distorts them. On a rectangle that isn't square every corner is the same circle: a radius past half the shorter side stops there for all of them, the widgets sit on the corners as drawn and turn the edited corners red at that limit, CSS export writes the drawn radii, and rectangles saved stretched by older versions get circular corners when their corners are next set (#442). Live Corners work on any path's corners too, as on a rectangle's (#511): a star's, a live polygon's (which also shows them to the Selection tool, has a Corner Radius field in the Properties and Transform panels and keeps its radius as its sides change) and a pen path's, wherever two sides meet at an angle at an anchor that isn't smooth: curved sides too, trimmed to what the cut leaves of them (#1144). Direct Selection shows the widgets of every corner, or of the corners holding selected anchors; each corner is a circle tangent to both sides, drawn no larger than takes its cut halfway along its shorter side; a path keeps its uncut outline so its corners stay editable, and the same command, dialog, angle preference and View › Hide Corner Widget apply. With Direct Selection a click on a widget (no drag) selects its corner, as a click on the corner's anchor does, so the next drag on it rounds that corner alone; Shift-click toggles it (#1239). While a corner widget is dragged with the Selection tool the bounding box hides, so the rounding shows against the path alone (#1229). A round corner next to a curved side curves smoothly instead of sticking out of the shape (#1547, fixes #1512). View › Hide Edges hides the Live Corners widgets, the bounding box and the type widget, and the selection tools then do not answer a press on them or change the cursor over them. + - **Rectangle Properties corner type:** a live rectangle's Rectangle Properties (Transform panel, the Properties panel's Transform section and the Contextual Task Bar's Shape Properties) have a Corner menu with Round, Inverted Round and Chamfer. With Corner Radius linked, one menu sets the kind of every corner of each selected rectangle, also corners with no radius, and shows blank when the shown rectangle's kinds differ; unlinked, each corner's row has its own menu beside its radius field, or under it in a panel too narrow for both; the unlinked radius fields and menus leave other selected paths and polygons as they are. A pick is one undo step, and picking the kind the corners already have adds none (`object.setLiveShape {kind, rectanglesOnly, corners}`); an action that records them acts on the rectangles selected when it plays. The help page says a rectangle's corner type can be set for each corner or for all of them at once ([the help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-live-shapes/live-shape-properties.html)); tying the number of menus to the Corner Radius link, the blank value and the undo steps are VectorCraft's own rules (`a_rectangle_shows_linked_and_unlinked_corner_types`, `the_shape_properties_popup_changes_a_rectangle_corner_type`, `the_linked_corner_menu_sets_every_selected_rectangle`, `the_unlinked_corner_menus_fit_a_narrow_panel`, `an_unlinked_corner_radius_leaves_other_selected_shapes`, `a_rectangle_corner_kind_without_a_selected_rectangle_changes_nothing`, `rectangle_kind_menu_targets_all_or_one_corner_and_skips_noop_undo`, `rectangles_only_sets_the_selected_rectangles_when_an_action_plays`, `a_radius_reaches_a_rectangle_that_already_draws_it`). - **Polygon side widget:** a selected live polygon shows a small diamond beside the middle of the right side of its bounding box, with the Selection tool and with the Rectangle, Rounded Rectangle, Ellipse, Polygon and Star tools, while the bounding box and the edges are shown. Dragging the widget sets the polygon's side count, from 3 to 11, as [the help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-live-shapes/add-or-remove-sides-from-polygons.html) describes; typed counts in the Transform panel and `object.setLiveShape` still go from 3 to 1000. A drag down adds one side and a drag up removes one for every 12 screen pixels along the box's own vertical axis, and the pointer shows the count while measurement labels are on. A polygon of more than 11 sides keeps its count until the drag goes up, which gives it 11. The drag sends `object.setLiveShape {sides}`, so the polygon keeps its center, radius and rotation; the release adds one undo step when the count changed and none when it ends where it began, and Escape puts the count back. The widget's look and place, the drag direction, the step and the rule for more than 11 sides are VectorCraft's own (`crates/tools/src/sidewidget.rs`). - **Hide/Show Shape Widgets:** with the Rectangle, Rounded Rectangle, Ellipse, Polygon or Star tool, the Control bar shows a Hide Shape Widgets button, which reads Show Shape Widgets while the widgets are hidden (`view.shapeWidgets {on?}`). [The help page](https://helpx.adobe.com/illustrator/using/live-shapes.html) describes this Control panel button, offered with any live shape drawing tool, as switching the on-canvas widgets of selected shapes off and on. While they are hidden, a selected live rectangle's or polygon's corner widgets, a live ellipse's pie widgets and a live polygon's side widget are not drawn, and the Selection tool and those shape tools do not answer a press, a double-click or the cursor on their place (a shape tool draws from there). The bounding box and its handles, the center point and Direct Selection's corner widgets (View › Hide Corner Widget) stay as they are. The setting is on by default, kept with the interface state across sessions and tool switches, and adds no undo step. Its scope beyond the shape tools, its default and what it leaves shown are VectorCraft's own rules (tests `hidden_shape_widgets_leave_the_bounding_box`, `the_shape_tools_control_bar_hides_and_shows_the_shape_widgets`, `shape_widgets_command_toggles_and_takes_on`, `hidden_shape_widgets_do_not_answer_a_shape_tool` and `hidden_shape_widgets_leave_direct_selections_corners`). - **Blend spine Anchor Point tool (#2544):** on a selected blend, dragging a spine corner makes symmetric Smooth handles; the tool displays and picks existing spine handles when switched to, drags one independently or retracts it on click, and clicking a point with handles retracts both. The spine is edited live without moving its key objects. Windows native canvas checks and screenshots reviewed: symmetric and independent handles, corner/retraction, Shift constraints and perpendicular reshaping, tool switching, key preservation, Undo/Redo, save/reopen, hidden handles and overlapping Path/Blend priority (PR #2643). Behaviour reference: [public path-editing documentation](https://helpx.adobe.com/illustrator/using/adjust-path-segments.html). @@ -1961,7 +1965,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Swatch library and Recolor Artwork parameters:** the `swatch.library.*` commands, `swatch.resetDefaults`, the graphic style library save, load and add, the `recolor.*` commands and `color.harmony`'s `limitTo` refuse parameters of the wrong form, such as `names: "Grays"`, `limitTo: 5` or `includeImages: "false"`. Errors name the parameter, except that a `limitTo` that is not a string, such as `5`, gets an unknown-library error. A `null` counts as left out except for `recolor.apply`'s `model`, which must be a string when given. - **OKLCH Sliders (Color Wheel panel):** as VectorCraft's own addition, the Color Wheel panel's menu item OKLCH Sliders (`ui.colorWheel {sliders: "oklch"}`, kept with the preferences) shows L, C and H rows under the wheel or the box that edit the color by the OKLCH lightness (0 to 100 %), chroma (0 to 100 % of 0.4) and hue (0 to 360°) of its display sRGB, as CSS Color 4 defines them (https://www.w3.org/TR/css-color-4/#specifying-oklab-oklch). Each track dims the colors outside sRGB, and a tick on the C track marks the largest chroma sRGB holds at the row's L and H; a color outside sRGB keeps L and H and takes the largest chroma that fits, and the C row keeps the chroma asked for. The rows take the arrow keys after a click and report their names, values, ranges and adjust actions to screen readers. While the active document's RGB space (its assigned profile, else the working RGB space of Edit › Color Settings) is not sRGB, the unchecked item is gray and `ui.colorWheel {sliders: "oklch"}` answers an error; rows shown before the space changed are gray, and the checked item still hides them. `color.convert {color, to: "oklch"}` answers the same L, C and H for a color inside sRGB. For a color outside sRGB, it clips the display RGB to 0 to 1 first, so its L, C and H can differ from the rows' values. Evidence: `crates/color/src/oklab.rs` tests; `convert_to_oklch_answers_lightness_chroma_and_hue` in `crates/engine/src/tests/colormgmt.rs`; the OKLCH tests in `crates/ui-egui/src/panels/tests_color_wheel.rs`, `the_oklch_tracks_dim_the_colors_outside_srgb_and_the_tick_marks_the_largest_chroma` and `oklch_sliders_are_gray_after_the_working_space_changes` among them. Scores and estimates are unchanged. - **HSL Sliders (Color Wheel panel):** as VectorCraft's own addition, the Color Wheel panel's menu item HSL Sliders (`ui.colorWheel {sliders: "hsl"}`, kept with the preferences) shows H, S and L rows in place of OKLCH Sliders that edit the color by the hue (0 to 360°), saturation and lightness (0 to 100 %) of its display sRGB, as CSS Color 4 defines HSL (https://www.w3.org/TR/css-color-4/#the-hsl-notation). A pick goes from display sRGB into the working RGB space as the wheel's picks do, and the rows keep the hue of a gray. The rows take the arrow keys after a click and report their names, values, ranges and adjust actions to screen readers. Evidence: `hsl_follows_css_color_4` and `hsl_roundtrip` in `crates/color/src/lib.rs`; the HSL tests in `crates/ui-egui/src/panels/tests_color_wheel.rs`, `a_gray_keeps_the_hsl_hue_it_was_given` among them. Scores and estimates are unchanged. - - **Color Wheel panel (part of #978):** Window › Color Wheel shows the Fill and Stroke proxy beside a hue ring around a square with saturation across and brightness up. It edits what the Color panel's sliders edit (the active proxy's color, the selected gradient stop or freeform point) through the same paint commands, and a drag is one undo step. Alt paints the other proxy, and Shift steps the ring by 45°. A pick goes from display sRGB into the working RGB space; an RGB, CMYK or Lab color keeps its model, and a Gray color or a tint of a global swatch becomes a process color in the document's color mode. A click gives the ring or the square the keyboard focus, and the arrow keys then step the color; both report their names and values to screen readers, and the Color Picker's color field takes the same keys. The panel menu's Box View puts a box in the wheel's place: a color field with a channel strip at its right for Hue, Saturation, Brightness, Red, Green or Blue (Box Channel), on the Color Picker's axes, kept with the preferences (`ui.colorWheel`); the strip and the Color Picker's channel slider take the arrow keys after a click. The panel menu's Show Harmony marks the other colors of a harmony rule (Harmony Rule) on the ring; the markers follow the current color, and a click on a marker applies its color (`ui.colorWheel {harmony, harmonyRule}`). Scores and estimates are unchanged. + - **Color Wheel panel (part of #978):** Window › Color Wheel shows the Fill and Stroke proxy beside a hue ring around a square with saturation across and brightness up. It edits what the Color panel's sliders edit (the active proxy's color, the selected gradient stop or freeform point) through the same paint commands, and a drag is one undo step. Alt paints the other proxy, and Shift steps the ring by 45°. A pick goes from display sRGB into the working RGB space; an RGB, CMYK or Lab color keeps its model, and a Gray color or a tint of a global swatch becomes a process color in the document's color mode. A click gives the ring or the square the keyboard focus, and the arrow keys then step the color; both report their names and values to screen readers, and the Color Picker's color field takes the same keys. The panel menu's Box View puts a box in the wheel's place: a color field with a channel strip at its right for Hue, Saturation, Brightness, Red, Green or Blue (Box Channel), on the Color Picker's axes, kept with the preferences (`ui.colorWheel`); the strip and the Color Picker's channel slider take the arrow keys after a click. Show Out-of-Gamut Colors grays out the parts of the square and the box's field whose colors the CMYK space cannot print, by the out-of-gamut warning's test on a 16 by 16 grid (`ui.colorWheel {gamut}`). The panel menu's Show Harmony marks the other colors of a harmony rule (Harmony Rule) on the ring; the markers follow the current color, and a click on a marker applies its color (`ui.colorWheel {harmony, harmonyRule}`). Scores and estimates are unchanged. - **Colour:** a Color Picker (colour field, H/S/B/R/G/B channel slider, HSB/RGB/Lab/CMYK fields, hex, web-only snapping, out-of-gamut correction); the Color panel shows a selected colour in its own model and, with nothing selected, the new-art defaults in the mode picked last, which it keeps between sessions; Alt-click paints the other proxy; proxies look through groups and show "?" for mixed paint; Invert, Complement, Apply Last Color (`,`) and Apply Last Gradient (`.`) keep the colour model; every paint command feeds the recent colours. The Color Guide has 21 harmony rules, Steps and Variation options and Limit to Library. Adjust Color Balance (its Global mode shifts tints) and Saturate preview live; Edit Colors and Recolor also reach meshes, images and patterns. Recolor Artwork has colour reduction, five recolour methods, presets, Limit to Library, a colour-wheel Edit tab and Edit Color Group; a local Color Themes panel saves five-colour themes. Fill/Stroke chips open swatch and mixer popovers (the Properties panel has the Control bar's Fill and Stroke chips, Stroke link and weight spinner, with nothing selected too), panels have Illustrator's Window menu keys (Align Shift+F7, Transform Shift+F8, Pathfinder Cmd+Shift+F9, Layers F7, Character Cmd+T…; every panel can be given one in Edit › Keyboard Shortcuts), and Eyedropper Options pick up and apply chosen attributes (Alt and Shift+Alt, image pixels). An ICC CMYK profile converts straight into the RGB working space (not through sRGB, so a wider space such as Wide Gamut RGB keeps colours sRGB can't hold) with the colour settings' black-point compensation, on the canvas and in RGB exports alike (the built-in Generic CMYK compensates both ways, so RGB black separated to a rich black displays as black again). Fills and strokes can overprint (Attributes panel, Overprint Black options), and CMYK documents blend in inks on screen, in PDF and when flattening. Document Color Mode converts the art, symbols, pattern tiles and swatches through the colour settings: Gray stays Gray, RGB grays separate into light grays in cyan, magenta and yellow only, darker four-color grays and a rich black, or go on the black plate only with `grays: "black"` (also for `document.open {colorMode}`). **Color panel spectrum mode tooltip (part of #7235):** hovering the spectrum names the displayed mode (Grayscale, RGB, HSB, CMYK, Web Safe RGB or Lab), including after Shift-clicking to switch modes and with Show Options or Hide Options. Hovering changes no paint or undo history. Spectrum rendering and vertical resizing remain open. Evidence: `spectrum_tooltip_names_its_displayed_mode` and `spectrum_tooltip_follows_shift_cycle_without_painting` in `crates/ui-egui/tests/color_working_components.rs`. Scores and estimates unchanged. @@ -3058,6 +3062,10 @@ The public pages describe Retype finding the fonts that match selected outlined The identify-fonts page has the Retype panel list ten matching fonts ordered by closeness, with five more on request, previews in one of three text sizes and the user's own sample text ([identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html)). Window › Retype shows the Retype panel. Find Matching Fonts (`retype.find`, on `type.retypeFonts`) lists the fonts whose glyphs the selected shapes exactly match, comparing up to 96 loaded fonts with those of the document's live type first, so a matching font past that limit is not listed; Find more font matches adds five. The 96-font limit is VectorCraft's own. The order is VectorCraft's own: by how many shapes each font matches, then by how closely. The sample sizes (Small, Medium, Large) and the 100-character sample text limit are VectorCraft's own too. Each row shows a sample in the font, in the size the panel menu sets and with the text typed in the panel, and a click on a row sets the font on the selected live type. Tested in `crates/engine/src/cmd/retype_fonts_tests.rs` and `crates/ui-egui/src/panels/retype/tests.rs`. Opening the panel from the Type menu, the context menu and the Properties panel's Quick Actions, filtering the list by font source and favorites, near matches, installed fonts not yet loaded and images remain. +## Retype tracking (2026-11-19) + +#4934 asks Retype to match the tracking of outlined text. `type.retype` now sets a line whose glyphs most gaps space evenly apart with that spacing as tracking, keeps gaps one space wide as word spaces when untracked type draws them, and sets negative tracking only on opaque, Normal lines with a solid fill or none and no stroke. These rules are VectorCraft's own. Each line is laid out and compared with the outlines before it is kept; a line its tracked type would move a glyph of is checked again untracked, and the glyphs after a split take the tracking their own gaps give. Tested by round trips through Create Outlines (a tracked line with a word space; uneven, tight and fractional tracking; kerned pairs in tight tracking; spaced letters that need no tracking; translucent overlapping glyphs) and by the measure's layout budget, in `crates/engine/src/cmd/retype_tests.rs`. + ## Control bar: Paragraph section while type is selected (2026-11-06) With type selected, the Control bar shows a Paragraph: link and the Align left, Align center and Align right buttons after its Character controls, as the public documentation has the Control panel format paragraphs while the Type tool is in use, with a way to the Paragraph panel ([Paragraph panel overview](https://helpx.adobe.com/illustrator/using/formatting-paragraphs.html)), and its alignment buttons align text as the Paragraph panel's do ([Align text](https://helpx.adobe.com/illustrator/using/align-text.html)). A button aligns the selected type (`text.setStyle {justify}`, one undo step) and the shared alignment shows selected; the link opens the Paragraph panel in a popover under it, as Character: opens the Character panel. Keeping to the three alignments that don't justify is our choice, for the bar's room; the popover has all seven. Short of room the bar leaves controls out from its right end: the inline X/Y/W/H fields, the Distribute and Align buttons, area type's vertical alignment, then these buttons and last the link, keeping room for the Transform link; on a 1536 pt bar with one point type object, the buttons show (pinned by a headless test, #5372). @@ -3123,6 +3131,7 @@ Edit › Copy and Cut put the selected ruler guides on the clipboard, with the s | Date | Change | Summary | |---|---|---| | 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. | +| 2026-11-19 | minor | Scissors previews its actual anchor or curve cut point with a native point marker while hovering, retaining existing snapping, Alt Add Anchor and cut behavior (#8655). Scores and estimates unchanged. | | 2026-11-19 | minor | Performance: 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). Evidence added; scores and estimates unchanged. | | 2026-11-19 | minor | Artboard tool: Shift held once a move or an Alt-drag copy of an artboard is under way keeps it to the level, upright or 45° line from General › Constrain Angle, and snaps slide it along that line; a Shift-press still draws an artboard inside another or marquee-selects (#2497), #8580. Scores and estimates unchanged. | | 2026-11-18 | minor | Layers panel: context menu on guide rows (Release Guide, Duplicate, Delete Guide, Lock/Unlock, Hide/Show) with one-step undo; regression tests in `crates/ui-egui/src/panels/layers/tests.rs`; scores and estimates unchanged. | diff --git a/docs/three-d.md b/docs/three-d.md index 35b097f4ac..dda534b90e 100644 --- a/docs/three-d.md +++ b/docs/three-d.md @@ -106,7 +106,7 @@ object is where the art was. | Twist | 0° to 360°: the back face turned against the front, the walls following in slices. | | Taper | 1–100 %: the back face's size against the front's. Without a twist, each wall (and each bevel band) stays flat, so it is one face, not cut into slices. | | Cap | **Solid** closes the front and back; **Hollow** leaves them open, showing the insides of the walls. | -| Bevel Shape | **None**, **Classic** (a straight chamfer), **Rounded** (convex quarter round), **Cove** (concave), **Step** (two steps) or **Ogee** (an S curve). Our own cross-sections. | +| Bevel Shape | **None**, **Classic** (a straight chamfer), **Rounded** (convex quarter round), **Cove** (concave), **Step** (two steps) or **Ogee** (an S curve). Our own cross-sections. After them come the custom bevels ([Custom bevels](#custom-bevels)). | | Width, Height | How far the bevel reaches across the face and along the depth (0–1,000 pt each). The height is limited to the depth (half of it on each side with Bevel both sides). | | Repeat, Space | The cross-section repeated 1–32 times across the width, with a share (0–90 %) of the width flat between repeats. | | Bevel Inside | The bevel carved into the shape (the front face shrinks) instead of added around it (the walls stand outside the art). | @@ -118,6 +118,28 @@ sharp point with the bevel outside, a narrow notch with it inside) whose miter w cut square across instead; at the other corners the miter is limited to four times the width. A bevel wider than a narrow part of the shape folds over itself. Each facet has a seam ([Seams](#seams)). +### Custom bevels + +The public [Add custom bevel paths](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/add-custom-bevel-paths.html) +page describes a custom bevel as one open path saved as a symbol in a bevels document, then listed in the Bevel menu. +VectorCraft keeps its custom bevels in `Bevels.vectorcraft`, a native document next to the preferences (none on the +web or in runs with `VECTORCRAFT_NO_PREFS`). The layout below is VectorCraft's own. + +- **Edit Bevels…** under Bevel Shape in the 3D and Materials panel (`threeD.bevels.edit`) opens the file, and first + creates it with one example bevel when it is missing. +- Each symbol whose art is one open path (alone or in groups of one member) is one bevel, named after the symbol and + listed after the built-in shapes in the Bevel Shape menus of Extrude & Bevel and Extrude & Bevel (Classic). +- The path runs from its first anchor, at the cap's edge, to its last, at the side wall. Across the page is across + the bevel's width and down the page is along its height, whichever way the path is drawn. Points past its ends are + held to them, curves are cut into straight lines, and a path is simplified to at most 64 points. +- A custom bevel takes Width, Height, Repeat, Space, Bevel Inside and Bevel both sides like the built-in shapes. +- The file is read when the app starts and again each time VectorCraft saves it; `threeD.bevels.reload` reads it + again. A file larger than 64 MB is not read, at most 256 symbols are read, and a symbol that is not one open path, + has more than 4,096 anchors, is cut into more than 8,192 straight lines, has ends that are not apart both across and down, or repeats an earlier name is listed + in `skipped` by `threeD.bevels.list`. +- An effect that uses a custom bevel keeps its name and a copy of its points, so the document draws it the same way + without the bevels file. + ## Inflate The shape puffed out like a cushion: its outline stays where the art is and the surface rises towards the @@ -605,7 +627,7 @@ is VectorCraft's own. ## Parameters (`effect.apply`, `effect.setParams`) `threeD.extrude`: `depth`, `twist`, `taper` (%), `cap`, `bevel` (`none`, `classic`, `rounded`, `cove`, `step`, -`ogee`), `bevelWidth`, `bevelHeight`, `bevelRepeat`, `bevelSpace` (%), `bevelInside`, `bevelBothSides`. +`ogee`, or `custom` with `bevelName` and `bevelProfile`; `{custom: name}` takes a bevel of the bevels file), `bevelWidth`, `bevelHeight`, `bevelRepeat`, `bevelSpace` (%), `bevelInside`, `bevelBothSides`. `threeD.inflate`: `depth`, `volume` (%), `bothSides`. All three take the view and lighting parameters Revolve uses: `rotationX`, `rotationY`, `rotationZ`, `perspectiveAngle` (degrees), `shade`, `lightColor` (`#rrggbb`, default `#ffffff`), `lightIntensity` (%), `lightRotation`, `lightHeight` (degrees), `lightSoftness` (%), `ambient` (%, to 200), `lightBehind`. Lengths are points and scale with the object (Scale Strokes & Effects). @@ -630,7 +652,8 @@ out, perspective). No Adobe software, assets, presets or bevel shapes were used. solid is built for ([Fills and strokes](#fills-and-strokes)), and only the first light casts a shadow ([Shadows](#shadows)). Graphics map onto planar faces, Extrude & Bevel's side as one surface unrolled flat, and Revolve's side only ([Graphics](#graphics)). -- The bevel shapes and their names are our own; custom bevel paths are not supported. +- The bevel shapes and their names are our own. Custom bevels come from VectorCraft's own bevels file + ([Custom bevels](#custom-bevels)) and are cut into straight lines. - Visibility is a painter's algorithm: faces of a closed solid turned away are left out, and the rest are drawn back to front, with a flat cap or flat back turned toward the viewer drawn after all of them. Concave solids seen at steep angles can overlap wrongly; open (hollow) solids show both sides. Twisted walls and bevels are diff --git a/docs/type-parity.md b/docs/type-parity.md index d97f5bc105..5e3a648745 100644 --- a/docs/type-parity.md +++ b/docs/type-parity.md @@ -56,7 +56,7 @@ against Illustrator's public documentation; **estimated** unless noted. | 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 | | Caret: the arrows and Delete step over whole clusters (Thai consonant with its marks, combining accents, emoji); Backspace removes one character | done | in text with right-to-left characters the arrows move in visual order and stop on both sides of a character drawn with no width, such as a zero width non-joiner | | Touch Type tool | done | moves, scales and rotates one character through its kerning, baseline shift, scales and rotation (`text.touchType`); a character with a preceding logical character on the same line can move along the line in either reading direction; the first logical character moves only up and down. Positive `dx` follows reading order. These direction rules are VectorCraft's choices. | -| Retype (identify fonts in outlines/images) | partial | Phase 1 (#4934): Type › Retype (`type.retype`) turns outlined glyphs back into point text when each shape is exactly a glyph of a loaded font, a font the document uses or a family named in `fonts` (the same up to uniform scale, rotation and translation): one object per line, in that font and size, at the same baseline and turn, with the first glyph's fill and stroke, in one undo step; shapes that match no font stay as they are and are reported. Window › Retype shows the Retype panel, which lists the fonts whose glyphs exactly match at least one selected outlined shape, comparing up to 96 loaded fonts with those of the document's live type first, ranked by how many shapes each matches, with samples, and sets a listed font on selected live type (`retype.find`, `type.retypeFonts`). Missing (phase 2): near or fuzzy matches (another version of the font, simplified outlines, glyphs merged into one path), opening the panel from the Type menu, the context menu and the Properties panel's Quick Actions, filtering the list by font source and favorites, installed fonts not yet loaded, area text for several lines, tracking, text in images. Public behaviour: [identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html), [apply to live text](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html) | +| Retype (identify fonts in outlines/images) | partial | Phase 1 (#4934): Type › Retype (`type.retype`) turns outlined glyphs back into point text when each shape is exactly a glyph of a loaded font, a font the document uses or a family named in `fonts` (the same up to uniform scale, rotation and translation): one object per line, in that font and size, at the same baseline and turn, with the first glyph's fill and stroke, in one undo step; shapes that match no font stay as they are and are reported. Evenly spaced glyphs keep their spacing as tracking (gaps one space wide stay word spaces when type draws them; VectorCraft's own rules, checked against the layout). Window › Retype shows the Retype panel, which lists the fonts whose glyphs exactly match at least one selected outlined shape, comparing up to 96 loaded fonts with those of the document's live type first, ranked by how many shapes each matches, with samples, and sets a listed font on selected live type (`retype.find`, `type.retypeFonts`). Missing (phase 2): near or fuzzy matches (another version of the font, simplified outlines, glyphs merged into one path), opening the panel from the Type menu, the context menu and the Properties panel's Quick Actions, filtering the list by font source and favorites, installed fonts not yet loaded, area text for several lines, text in images. Public behaviour: [identify fonts](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/identify-fonts-using-retype.html), [apply to live text](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/apply-retype-suggested-fonts-to-live-text.html) | | Snap to Glyph | done | View › Snap to Glyph (`view.snapToGlyph`): with Smart Guides on, new point type and drawing tools snap to live-text baselines and glyph bounds, the corners of each glyph's box included, turning with rotated type (#5112; `guides::tests::a_drawn_point_lands_on_a_corner_of_a_glyphs_bounds`, `Targets::for_drawing`, `tools::text_tests::snap_to_glyph_lines_up_new_point_type_with_a_baseline`). With Alignment Guides on as well, and Snap to Grid and Snap to Pixel off, both ends of a Measure or Measure & Inspect drag snap to those guides and show them during the drag (`Targets::for_measure`, `xform::measure::tests::its_ends_land_on_glyph_guides_with_snap_to_glyph`). That the Measure tools take the guides is VectorCraft's choice; they leave out Anchor Point, which [the help page](https://helpx.adobe.com/illustrator/desktop/design-with-text/special-characters-glyphs/snap-to-glyph.html) limits to the Pen tool and objects moved with the Selection tool. Character panel menu › Show Snap to Glyph Options: Baseline, x-height, Glyph Bounds, Proximity Guides, Angular Guides and Anchor Point each turn their guides on or off (`view.snapToGlyph.options`, all on by default; #4232), after a Snap to Glyph checkbox for View › Snap to Glyph; showing them scrolls the panel to them (#5273) | | Thai, Lao, Khmer, Myanmar: shaping (marks, reordering), lines broken between words, word-by-word caret and double-click | done | words found by ICU4X's line segmenter: dictionaries on the desktop, LSTM models on the web | | Middle Eastern: bidirectional layout, Paragraph Direction | done | PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import still needs ActualText support (#6165); separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 5ddb973430..8f273db4ed 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,6 @@ # UI and interaction parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (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: Graphic Styles panel: right-click item context menu for tiles and rows with Options, Duplicate, Delete, Redefine, Break Link; 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); Canvas context menu: a right-click on a path offers Simplify… next to Smooth…, opening the Simplify slider, or the Simplify dialog kept for next time, as Object › Path › Simplify… does, #8344; scores and estimates unchanged; previously: 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: : selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: Layersselected 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: 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: 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: 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); scores and estimates unchanged; previously: Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: 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: Layers panel: Alt over the list shows the copy cursor while rows or the selected-art 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: 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: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; 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: 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: macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Remove Background in the Contextual Task Bar, Properties › Quick Actions and the Control bar; previously minor: Ruler origin: the corner drag 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: Outline view: images and gradient meshes are picked on what Outline draws, so a click inside them reaches the path behind, #6437; previously minor: a middle-click on a document tab closes it, #6506; previously minor: Blob Brush: a round tip's preview is the outline of the area it adds, round at both ends, as the stroke it commits (#4343); scores and estimates unchanged; previously:; ruler double-click adds a guide at the pointer, #5239; G5: Inventory Icons built-in symbol library (four built-ins); previously minor: files that record no units open in Preferences › Units › General, #5820; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; numeric fields step on wheel hover without taking keyboard focus, #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; Selection QoL: marquee modes and visible feedback, #5313; #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; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Layers: Rename (`ui.rename`) opens the name field of the selected layer, group or object, #5324; Properties in Edit Artboards: Transform section above the Artboards section, #5219; scrubby labels: the Control bar's Stroke: and Opacity: links and the Properties panel's Stroke link scrub their fields, #4088; Properties: Quick Actions has Repeat Options for one selected repeat, #5181; Direct Selection: Shift-click picks several blend spine points, which drag together, #5285; Direct Selection: Cmd/Ctrl held lends the Selection tool and shows its bounding box, #3901; Join tool trims two crossing open paths and joins them at the crossing, #5844; Control bar: Paragraph: link and Align left/center/right while type is selected, #5372; shape tools: a press on the selection's centre point moves it and one in the rotate zone outside a box corner turns it, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; Units › East Asian Type acts, with Q and Ha units; scores unchanged) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (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: Graphic Styles panel: right-click item context menu for tiles and rows with Options, Duplicate, Delete, Redefine, Break Link; 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); Canvas context menu: a right-click on a path offers Simplify… next to Smooth…, opening the Simplify slider, or the Simplify dialog kept for next time, as Object › Path › Simplify… does, #8344; scores and estimates unchanged; previously: 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: : selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: Layersselected 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: 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: 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: 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); scores and estimates unchanged; previously: Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: 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: Layers panel: Alt over the list shows the copy cursor while rows or the selected-art 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: 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: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: Graphic Styles list fills a taller panel, #2992; 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: 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: macOS: the canvas cursor stays after the pointer moves, #6362; scores and estimates unchanged; previously minor: Remove Background in the Contextual Task Bar, Properties › Quick Actions and the Control bar; previously minor: Ruler origin: the corner drag 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: Outline view: images and gradient meshes are picked on what Outline draws, so a click inside them reaches the path behind, #6437; previously minor: a middle-click on a document tab closes it, #6506; previously minor: Blob Brush: a round tip's preview is the outline of the area it adds, round at both ends, as the stroke it commits (#4343); scores and estimates unchanged; previously:; ruler double-click adds a guide at the pointer, #5239; G5: Inventory Icons built-in symbol library (four built-ins); previously minor: files that record no units open in Preferences › Units › General, #5820; previously minor: interim macOS cursor delivery, #2292; native validation pending; scores and estimates unchanged; Control bar › Snapping includes the existing Snap to Glyph and Alignment Guides toggles (#6164); scores and estimates unchanged; floating tab groups collapse into the side icon rail and opened rail panels fold back into it, #5925 in part; numeric fields step on wheel hover without taking keyboard focus, #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; Selection QoL: marquee modes and visible feedback, #5313; #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; Drop Shadow and glow dialogs: spinner arrows, #5367, #5368; Stroke Weight Up and Down shortcuts, #5797; Layers: Rename (`ui.rename`) opens the name field of the selected layer, group or object, #5324; Properties in Edit Artboards: Transform section above the Artboards section, #5219; scrubby labels: the Control bar's Stroke: and Opacity: links and the Properties panel's Stroke link scrub their fields, #4088; Properties: Quick Actions has Repeat Options for one selected repeat, #5181; Direct Selection: Shift-click picks several blend spine points, which drag together, #5285; Direct Selection: Cmd/Ctrl held lends the Selection tool and shows its bounding box, #3901; Join tool trims two crossing open paths and joins them at the crossing, #5844; Control bar: Paragraph: link and Align left/center/right while type is selected, #5372; shape tools: a press on the selection's centre point moves it and one in the rotate zone outside a box corner turns it, #5477; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x; 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). > @@ -20,6 +20,8 @@ ## Feature submission evidence +**Scissors cut-point preview (#8655):** A native point marker shows the anchor or position on a curve that the current Scissors click targets, including the existing snapping rules. Hovering changes no artwork; an ineligible or stale hover has no marker. Existing cut and Alt Add Anchor behavior are retained. Focused tool and Session regressions live in `crates/tools/src/draw2/anchor/tests.rs` and `crates/engine/tests/scissors_snap.rs`. Scores and estimates are unchanged. + Draft enhancement #5804: Preferences › File Handling can select a raster editor through the native picker, with a private draft outside engine preferences and generic dialog fields. OK saves it, Cancel discards it, and Reset restores PhotoCraft. With Use System Defaults off, a missing chosen editor falls back to PhotoCraft, then the system default; validation and launch failures are reported. Control/MCP and synthetic input cannot choose an application or run external Edit Original. Web behavior, parity scores and estimates are unchanged; macOS/Linux smoke tests remain pending. **2026-11-09 revision:** draft implementation and regression coverage for #5804; no parity rescore. @@ -192,6 +194,7 @@ tools, never checked side by side) isn't captured row by row. | Node-editing cursors: Direct Selection's white arrow with a hollow or filled square over an anchor (path unselected or selected); the Reshape Segment cursor over a curved segment (Direct Selection, Anchor Point, the Pen with Alt); the Anchor Point caret for the Pen with Alt; Group Selection's plus (also Direct Selection with Alt); a filled arrow while dragging that turns hollow on a snap; a double arrowhead for an Alt-drag copy | partial | as the public manual describes them, drawn in code; no cue over handles (none documented) | | Anchor Point and Curvature tools' own cursors | done | the caret on the anchor it converts; the pen nib with a curve badge | | Scissors hover and cuts use the Pen's path, alignment, intersection and anchor snapping (#6470) | implemented | Existing Smart Guides, Snap to Point, pixel and grid options apply; Pixel Preview turns off Smart Guides. Alt still adds an anchor without cutting, and a cut still leaves one new endpoint selected. Headless regressions: `crates/tools/src/draw2/anchor/tests.rs` and `crates/engine/tests/scissors_snap.rs`. | +| Scissors cut-point preview (#8655) | implemented | Native marker at the actual anchor or curve target; current snapping, cut and Alt Add Anchor behavior retained. `crates/tools/src/draw2/anchor/tests.rs`, `crates/engine/tests/scissors_snap.rs`. | | Free Transform's Cmd/Ctrl side-shear cursor | done | two arrows passing along the side (ShearH, ShearV), instead of the resize arrow across it | | Live Paint Bucket cursors | partial | a filled bucket over a face a click fills, a brush over an edge it paints, an empty bucket where it paints nothing, following Paint Fills, Paint Strokes and Shift; the Eyedropper with Alt; the crosshair with Use Precise Cursors. No cursor swatch preview | | Cursors of their own for Lasso, Magic Wand, the freehand tools, Shaper, Measure, Print Tiling, the symbolism tools, vertical type, Scissors (over a segment and away), Mesh and Puppet Warp | partial | each tool returns its own cursor and Use Precise Cursors turns them into the crosshair; until they're drawn they borrow the crosshair, the I-beam, the Pen's add cursor or not-allowed | @@ -624,6 +627,7 @@ before release (#6373). [Paint faces and edges](https://helpx.adobe.com/illustra | Date | Change | Summary | |---|---|---| | 2026-11-19 | minor | View › 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 until it is off; the choices come back as they were and the rulers stay, though dragging or double-clicking them makes no guide meanwhile (#8363). Scores and estimates unchanged. | +| 2026-11-19 | minor | Scissors previews its actual anchor or curve cut point with a native point marker while hovering, retaining existing snapping, Alt Add Anchor and cut behavior (#8655). Scores and estimates unchanged. | | 2026-11-19 | minor | Artboard tool: Shift held once a move or an Alt-drag copy of an artboard is under way keeps it to the level, upright or 45° line from General › Constrain Angle, and snaps slide it along that line; a Shift-press still draws an artboard inside another or marquee-selects (#2497), #8580. Scores and estimates unchanged. | | 2026-11-19 | minor | Canvas context menu: a right-click on a path, a group of paths or a compound path offers Simplify… between Average… and Smooth…, in the Path menu's order, opening the Simplify slider at the Auto-Simplify level, or the Simplify dialog on its kept settings, as Object › Path › Simplify… does (#8344). Scores and estimates unchanged. | | 2026-11-19 | minor | G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s (part of #5930, `file.cancelPlace`); indeterminate moving bar, Cancel (Esc) leaves the document unmodified without undo steps; scores and estimates unchanged. |