From 2c7211090b57d1263e30cb2c9abff35887ac5e2a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 16:54:42 -0800 Subject: [PATCH 01/38] 3D: Extrude & Bevel takes custom bevel shapes drawn as open paths Custom bevels come from the bevels file, Bevels.vectorcraft next to the preferences. Each symbol whose art is one open path is one bevel, listed by name after the five built-in shapes in the Bevel Shape menus of Extrude & Bevel and Extrude & Bevel (Classic). Edit Bevels... under Bevel Shape in the 3D and Materials panel opens the file, creating it with an example bevel when it is missing, and saving it reloads the menus. A custom bevel takes the Width, Height, Repeat, Space, Bevel Inside and Bevel both sides settings, and the effect keeps a copy of its points so the document draws it without the file. - threeD.bevels.list, threeD.bevels.edit and threeD.bevels.reload - bevel {custom: name} in effect.apply and effect.setParams, stored as bevel custom with bevelName and bevelProfile (2 to 64 points) - Docs: docs/mcp.md, docs/three-d.md, docs/effects-parity.md --- apps/vectorcraft-cli/src/main.rs | 1 + apps/vectorcraft/src/main.rs | 2 + apps/vectorcraft/src/prefs_dir.rs | 8 + crates/effects/src/catalog.rs | 4 +- crates/effects/src/lib.rs | 11 +- crates/effects/src/solids.rs | 75 +++- crates/effects/src/solids/classic.rs | 21 +- crates/effects/src/solids/tests.rs | 52 +++ crates/engine/src/cmd.rs | 2 + crates/engine/src/cmd/arrowheads.rs | 7 +- crates/engine/src/cmd/bevels.rs | 334 ++++++++++++++++++ crates/engine/src/cmd/effectcmd.rs | 13 + crates/engine/src/cmd/fileio/save.rs | 4 +- crates/engine/src/lib.rs | 2 + crates/engine/src/session/documents.rs | 1 + crates/engine/src/tests.rs | 1 + crates/engine/src/tests/bevels.rs | 217 ++++++++++++ crates/three-d/src/lib.rs | 2 +- crates/three-d/src/solid.rs | 72 ++++ crates/three-d/src/solid/tests.rs | 34 ++ crates/ui-egui/src/dialogs/revolve.rs | 77 +++- crates/ui-egui/src/dialogs/three_d_classic.rs | 13 +- crates/ui-egui/src/i18n/bg.tsv | 4 + crates/ui-egui/src/i18n/bs.tsv | 4 + crates/ui-egui/src/i18n/ca.tsv | 4 + crates/ui-egui/src/i18n/cs.tsv | 4 + crates/ui-egui/src/i18n/da.tsv | 4 + crates/ui-egui/src/i18n/de.tsv | 4 + crates/ui-egui/src/i18n/el.tsv | 4 + crates/ui-egui/src/i18n/es.tsv | 4 + crates/ui-egui/src/i18n/fi.tsv | 4 + crates/ui-egui/src/i18n/fr.tsv | 4 + crates/ui-egui/src/i18n/hi.tsv | 4 + crates/ui-egui/src/i18n/hu.tsv | 4 + crates/ui-egui/src/i18n/id.tsv | 4 + crates/ui-egui/src/i18n/it.tsv | 4 + crates/ui-egui/src/i18n/ja.tsv | 4 + crates/ui-egui/src/i18n/ka.tsv | 4 + crates/ui-egui/src/i18n/ko.tsv | 4 + crates/ui-egui/src/i18n/nl.tsv | 4 + crates/ui-egui/src/i18n/pl.tsv | 4 + crates/ui-egui/src/i18n/pt-br.tsv | 4 + crates/ui-egui/src/i18n/ru.tsv | 4 + crates/ui-egui/src/i18n/sv.tsv | 4 + crates/ui-egui/src/i18n/tr.tsv | 4 + crates/ui-egui/src/i18n/uk.tsv | 4 + crates/ui-egui/src/i18n/vi.tsv | 4 + crates/ui-egui/src/i18n/zh-hans.tsv | 4 + crates/ui-egui/src/i18n/zh-hant.tsv | 4 + crates/ui-egui/src/panels/tests_three_d.rs | 35 ++ crates/ui-egui/src/panels/three_d.rs | 15 +- docs/effects-parity.md | 4 +- docs/mcp.md | 29 +- docs/three-d.md | 29 +- 54 files changed, 1119 insertions(+), 54 deletions(-) create mode 100644 crates/engine/src/cmd/bevels.rs create mode 100644 crates/engine/src/tests/bevels.rs diff --git a/apps/vectorcraft-cli/src/main.rs b/apps/vectorcraft-cli/src/main.rs index 0d4deca36f..c0726b3dc0 100644 --- a/apps/vectorcraft-cli/src/main.rs +++ b/apps/vectorcraft-cli/src/main.rs @@ -249,6 +249,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 c2b40e37e6..bd5749ba25 100644 --- a/apps/vectorcraft/src/main.rs +++ b/apps/vectorcraft/src/main.rs @@ -490,6 +490,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 11afcfe121..c6b6bb4c7e 100644 --- a/apps/vectorcraft/src/prefs_dir.rs +++ b/apps/vectorcraft/src/prefs_dir.rs @@ -97,6 +97,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 5b785bee14..fc0fe42c8c 100644 --- a/crates/effects/src/catalog.rs +++ b/crates/effects/src/catalog.rs @@ -189,7 +189,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), 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 hard-edged shadow, black at 50% times the art's opacity), 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)}. 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), 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 hard-edged shadow, black at 50% times the art's opacity), 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)}. 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}), ), g( @@ -210,7 +210,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 (black; the color the faces darken toward; none keeps the paint and adds only the highlight), shadingCustom: #rrggbb (#000000; the color shadingColor custom darkens toward), drawHiddenFaces: bool (false; also draws the faces turned away, behind the others)}. 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 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 and bevelProfile: [[x, y], …] (a custom bevel's name and 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 (black; the color the faces darken toward; none keeps the paint and adds only the highlight), shadingCustom: #rrggbb (#000000; the color shadingColor custom darkens toward), drawHiddenFaces: bool (false; also draws the faces turned away, behind the others)}. 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 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","drawHiddenFaces":false}), ), g( diff --git a/crates/effects/src/lib.rs b/crates/effects/src/lib.rs index d5f0af894a..3ea44d683f 100644 --- a/crates/effects/src/lib.rs +++ b/crates/effects/src/lib.rs @@ -87,15 +87,16 @@ 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, INFLATE, ROTATE, ROTATE_SURFACES, ROTATION_PRESETS, SHADING_COLORS, SOLIDS, SolidMesh, THREE_D_TYPES, - classic_extrude_options, classic_shading, extrude_options, has_solid, inflate_options, is_classic_three_d, is_three_d, solid_art, solid_art_in, - 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, + BEVEL_NAME, BEVEL_PROFILE, CLASSIC_EXTRUDE, CLASSIC_ROTATE, EXTRUDE, INFLATE, ROTATE, ROTATE_SURFACES, ROTATION_PRESETS, SHADING_COLORS, SOLIDS, + SolidMesh, THREE_D_TYPES, classic_extrude_options, classic_shading, extrude_options, has_solid, inflate_options, is_classic_three_d, is_three_d, + solid_art, solid_art_in, 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, }; 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::{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 4ddd453587..b538cf5c04 100644 --- a/crates/effects/src/solids.rs +++ b/crates/effects/src/solids.rs @@ -6,7 +6,7 @@ use serde_json::Value; use vectorcraft_doc::color::{BlendMode, Paint}; use vectorcraft_doc::{Appearance, AppearanceItem, Document, Effect, Node, NodeId, NodeKind, OpacityMask, StrokeLayer}; use vectorcraft_geom::{FillRule, PathData, Rect}; -use vectorcraft_three_d::{Bevel, BevelShape, Extrude, Facet, Inflate, Mesh, View}; +use vectorcraft_three_d::{Bevel, BevelProfile, BevelShape, Extrude, Facet, Inflate, Mesh, View}; #[cfg(test)] use vectorcraft_doc::color::Color; @@ -54,7 +54,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(); @@ -63,6 +65,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)) { @@ -125,14 +134,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), @@ -213,12 +274,12 @@ fn validate_solid_params(id: &str, p: &Value) -> Result<(), String> { crate::lighting::validate(p)?; shadow::validate(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 919de831ce..e0928f9452 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, StrokeLayer}; 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 crate::util::{flag, num, text}; @@ -43,13 +43,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, ..Extrude::default() } @@ -106,9 +100,16 @@ const FLAGS: [&str; 4] = ["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, and `surface`, `shadingColor` and -/// `shadingCustom` name a surface, a shading color and a #rrggbb color. +/// `shadingCustom` name a surface, a shading color and a #rrggbb color. 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) } /// Rotate (Classic)'s numeric parameters: (key, lowest, highest, whole numbers only). diff --git a/crates/effects/src/solids/tests.rs b/crates/effects/src/solids/tests.rs index 1efe826c75..2ff2e51b05 100644 --- a/crates/effects/src/solids/tests.rs +++ b/crates/effects/src/solids/tests.rs @@ -619,6 +619,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 66eb2104d1..171d1bf09a 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; @@ -312,6 +313,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 0aeda59731..eba26ad80e 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}")), diff --git a/crates/engine/src/cmd/bevels.rs b/crates/engine/src/cmd/bevels.rs new file mode 100644 index 0000000000..f36082862e --- /dev/null +++ b/crates/engine/src/cmd/bevels.rs @@ -0,0 +1,334 @@ +//! 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::{read, same_file}; +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; + +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 { + 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) { + 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). +fn points_of(n: &Node) -> 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 mut too_many = false; + let tolerance = path.bounds().map_or(1.0, |b| b.width().hypot(b.height()) / 2000.0).max(1e-9); + vectorcraft_geom::flatten(path.to_bezpath().elements().iter().copied(), tolerance, |el| match el { + PathEl::MoveTo(p) | PathEl::LineTo(p) if line.len() < MAX_LINE_POINTS => line.push(p), + PathEl::MoveTo(_) | PathEl::LineTo(_) => too_many = true, + _ => {} + }); + if too_many { + 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); + 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. +fn simplified(pts: &[(f64, f64)]) -> Vec<(f64, f64)> { + let mut eps = 1e-3; + loop { + let out = rdp(pts, eps); + if out.len() <= BevelProfile::MAX_POINTS || eps > 2.0 { + return out; + } + eps *= 2.0; + } +} + +/// The points of `pts` Ramer-Douglas-Peucker keeps at tolerance `eps`. +fn rdp(pts: &[(f64, f64)], eps: f64) -> Vec<(f64, f64)> { + if pts.len() < 3 { + return 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() { + 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)); + } + } + 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(); + } + } +} + +/// `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`. Other values are left +/// for the effect to check. +pub(crate) fn resolve_custom(s: &Session, 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 bevel = s.bevels.get(&name).ok_or_else(|| bad(cmd, format!("no custom bevel {name} (see threeD.bevels.list)")))?; + params["bevel"] = json!("custom"); + params[BEVEL_NAME] = json!(bevel.name); + params[BEVEL_PROFILE] = bevel.profile_json(); + 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(); + Ok(json!({"bevels": bevels, "file": s.bevels.path, "skipped": skipped(s), "error": s.bevels.error})) +} + +fn reload(s: &mut Session, _: &Value) -> Result { + const C: &str = "threeD.bevels.reload"; + 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"))?; + if let Some(dir) = std::path::Path::new(&path).parent() { + std::fs::create_dir_all(dir).map_err(|e| bad(C, format!("{}: {e}", dir.display())))?; + } + // 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 => { + crate::file_access::unconfined(|| 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 b570ce332a..be410f6d25 100644 --- a/crates/engine/src/cmd/effectcmd.rs +++ b/crates/engine/src/cmd/effectcmd.rs @@ -427,6 +427,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, &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"))?; @@ -718,6 +722,9 @@ 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, &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). @@ -798,6 +805,12 @@ 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 +} + // ---------- Load Texture ---------- /// Effect › Distort › Glass. diff --git a/crates/engine/src/cmd/fileio/save.rs b/crates/engine/src/cmd/fileio/save.rs index e1cbf68bf2..4e67063c9c 100644 --- a/crates/engine/src/cmd/fileio/save.rs +++ b/crates/engine/src/cmd/fileio/save.rs @@ -1032,7 +1032,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); @@ -1043,6 +1044,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/lib.rs b/crates/engine/src/lib.rs index a891fb9599..214d3279f8 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -153,6 +153,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 3e9ae56423..7b200af6bb 100644 --- a/crates/engine/src/session/documents.rs +++ b/crates/engine/src/session/documents.rs @@ -81,6 +81,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 18eadcdf80..d3d6046f89 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -14,6 +14,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..4540ae9654 --- /dev/null +++ b/crates/engine/src/tests/bevels.rs @@ -0,0 +1,217 @@ +//! 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); +} + +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); +} + +#[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 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); +} diff --git a/crates/three-d/src/lib.rs b/crates/three-d/src/lib.rs index 2d945c1439..10fd08ca00 100644 --- a/crates/three-d/src/lib.rs +++ b/crates/three-d/src/lib.rs @@ -8,7 +8,7 @@ mod solid; mod visibility; -pub use solid::{Bevel, BevelShape, Extrude, Facet, Inflate, View, extrude, inflate, inflate_together, plane}; +pub use solid::{Bevel, BevelProfile, BevelShape, Extrude, Facet, Inflate, View, extrude, inflate, inflate_together, plane}; pub use visibility::{VisibleFace, visible_faces}; mod shading; pub use shading::{ClassicShading, ClassicSurface, LightGradient, RgbGradient, ShadeGradient}; diff --git a/crates/three-d/src/solid.rs b/crates/three-d/src/solid.rs index 18c9959b19..30a65781d4 100644 --- a/crates/three-d/src/solid.rs +++ b/crates/three-d/src/solid.rs @@ -105,6 +105,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. @@ -118,11 +120,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", @@ -130,9 +194,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) } @@ -142,6 +208,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()), @@ -169,6 +236,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 be887180b2..fc6c2dd25e 100644 --- a/crates/three-d/src/solid/tests.rs +++ b/crates/three-d/src/solid/tests.rs @@ -198,6 +198,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/ui-egui/src/dialogs/revolve.rs b/crates/ui-egui/src/dialogs/revolve.rs index c7a306887e..8ecda502bd 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; @@ -178,11 +178,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)); @@ -197,8 +197,73 @@ fn solid_controls(app: &VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog, id: & } } +/// 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"; + // (shown label, value, the custom bevel's name and points). The built-in labels are + // translated; custom bevels show their names as they are. + type Choice = (String, Value, Option<(String, Value)>); + let mut options: Vec = super::effect::own_choices(effect, KEY, 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 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()); + // The effect's own custom bevel, unless the file lists it by name with the same points. + let own = custom && !options[builtin..].iter().any(|(_, _, c)| is(c)); + if own && let Some(p) = &points { + let shown = if name.is_empty() { tl!("Custom").to_string() } else { name.clone() }; + options.push((shown, json!("custom"), Some((name.clone(), p.clone())))); + } + 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; + if let Some(k) = widgets::dropdown_names(ui, ("three-d-choice", KEY), shown, &labels, width) + && 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); @@ -206,9 +271,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); heading(ui, c3("Bevel")); - 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 a3857c914a..5d9070e17c 100644 --- a/crates/ui-egui/src/dialogs/three_d_classic.rs +++ b/crates/ui-egui/src/dialogs/three_d_classic.rs @@ -11,15 +11,15 @@ use vectorcraft_effects::{CLASSIC_EXTRUDE, CLASSIC_REVOLVE, CLASSIC_ROTATE}; use super::revolve::{c3, choice, heading, label, light_list, light_record, number, reset_dot, selected_light, store_selected, toggle}; use crate::state::Dialog; -/// 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); @@ -78,11 +78,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 582a927f09..09041c162f 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -2811,6 +2811,10 @@ digits Malayalam Малаялам Edit Arrowheads Редактиране на върхове на стрелки Edit Arrowheads… Редактиране на върхове на стрелки… Reload Arrowheads Презареждане на върхове на стрелки + Bevels Фаски + Edit Bevels Редактиране на фаски + Edit Bevels… Редактиране на фаски… + Reload Bevels Презареждане на фаски Reset Rotate View Нулиране на изгледа на завъртане Rotate View to Selection Завъртане на изгледа спрямо селекцията Reset the rows to the artwork's colors Нулиране на редовете към цветовете на илюстрацията diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index d92da7ae40..27bcdb5898 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -3900,6 +3900,10 @@ 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… + Reload Bevels Ponovo učitaj zakošenja Stroke Options Opcije poteza Width Profiles Profili širine Apply Graphic Style Primijeni grafički stil diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 283dae1800..21ac37e77c 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -3593,6 +3593,10 @@ 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… + 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 diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 519963c4eb..f368ced92f 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -3956,6 +3956,10 @@ 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í… + Reload Bevels Znovu načíst zkosení Stroke Options Možnosti tahu Width Profiles Profily šířky Apply Graphic Style Použít grafický styl diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 3269755003..5df91a764d 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -3675,6 +3675,10 @@ 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… + Reload Bevels Genindlæs facetter Stroke Options Konturindstillinger Width Profiles Breddeprofiler Apply Graphic Style Anvend grafikstil diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index f3858abc1f..4b4656cd6e 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -2856,6 +2856,10 @@ 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… + Reload Bevels Abgeflachte Kanten neu laden Rotate View Ansicht drehen Reset Rotate View Ansichtsdrehung zurücksetzen Rotate View to Selection Ansicht nach Auswahl drehen diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 52a12276f7..6742463f69 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -3496,6 +3496,10 @@ digits Malayalam Μαλαγιάλαμ Edit Arrowheads Επεξεργασία αιχμών βελών Edit Arrowheads… Επεξεργασία αιχμών βελών… Reload Arrowheads Επαναφόρτωση αιχμών βελών + Bevels Λοξοτμήσεις + Edit Bevels Επεξεργασία λοξοτμήσεων + Edit Bevels… Επεξεργασία λοξοτμήσεων… + Reload Bevels Επαναφόρτωση λοξοτμήσεων Reset Rotate View Επαναφορά περιστροφής προβολής Rotate View to Selection Περιστροφή προβολής ως προς την επιλογή Reset the rows to the artwork's colors Επαναφορά γραμμών στα χρώματα του σχεδίου diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index e6f77cd908..dcc89cf724 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -2890,6 +2890,10 @@ 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… + 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 diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index dc0e432264..fb3975047f 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -3880,6 +3880,10 @@ 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ä… + Reload Bevels Lataa viisteet uudelleen Stroke Options Viivan asetukset Width Profiles Leveysprofiilit Apply Graphic Style Käytä grafiikkatyyliä diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 3c74586ef0..d9894d76c6 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -2882,6 +2882,10 @@ 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… + 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 diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 8e1ce7cc2a..6be73ec4a4 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -3921,6 +3921,10 @@ antiAlias Sharp शार्प Edit Arrowheads एरोहेड्स संपादित करें Edit Arrowheads… एरोहेड्स संपादित करें… Reload Arrowheads एरोहेड्स फिर से लोड करें + Bevels बेवल्स + Edit Bevels बेवल्स संपादित करें + Edit Bevels… बेवल्स संपादित करें… + Reload Bevels बेवल्स फिर से लोड करें Reset Rotate View व्यू घुमाएँ रीसेट करें Reset Ruler Origin शासकीय उत्पत्ति रीसेट करें Reset Symbol Instance सिंबल इंस्टेंस रीसेट करें diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 15ce573c11..ee8ee893a5 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3440,6 +3440,10 @@ 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… + 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 diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index f68fad0c1c..d1870c3c6e 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -3675,6 +3675,10 @@ 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… + Reload Bevels Muat ulang bentuk bevel Stroke Options Opsi goresan Width Profiles Profil lebar Apply Graphic Style Terapkan gaya grafis diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 480115859b..8548883c63 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -2932,6 +2932,10 @@ 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… + Reload Bevels Ricarica smussi Rotate View Ruota vista Reset Rotate View Reimposta rotazione vista Rotate View to Selection Ruota vista in base alla selezione diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index ba3105aec0..49cf283eee 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -2940,6 +2940,10 @@ mark-style Japanese 日本式 Edit Arrowheads 矢印を編集 Edit Arrowheads… 矢印を編集… Reload Arrowheads 矢印を再読み込み + Bevels ベベル一覧 + Edit Bevels ベベルを編集 + Edit Bevels… ベベルを編集… + Reload Bevels ベベルを再読み込み Reset the rows to the artwork's colors 行をアートワークのカラーにリセット Reset to Default 初期設定に戻す Reset to White, Black 白、黒にリセット diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 83fadf726a..7142235bc7 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -3518,6 +3518,10 @@ theme Appearance იერსახე Edit Arrowheads ისრის წვერების რედაქტირება Edit Arrowheads… ისრის წვერების რედაქტირება… Reload Arrowheads ისრის წვერების ხელახლა ჩატვირთვა + Bevels წაკვეთები + Edit Bevels წაკვეთების რედაქტირება + Edit Bevels… წაკვეთების რედაქტირება… + Reload Bevels წაკვეთების ხელახლა ჩატვირთვა Stroke Options კონტურის პარამეტრები Width Profiles სიგანის პროფილები Apply Graphic Style გრაფიკული სტილის გამოყენება diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index e6f7478bf3..342fa1bed7 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -2929,6 +2929,10 @@ mark-style Japanese 일본식 Edit Arrowheads 화살촉 편집 Edit Arrowheads… 화살촉 편집… Reload Arrowheads 화살촉 다시 불러오기 + Bevels 베벨 목록 + Edit Bevels 베벨 편집 + Edit Bevels… 베벨 편집… + Reload Bevels 베벨 다시 불러오기 Reset the rows to the artwork's colors 행을 아트웍 색상으로 재설정 Reset to Default 기본값으로 재설정 Reset to White, Black 흰색, 검정으로 재설정 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 26baaa8dc5..f36af51d6b 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -3689,6 +3689,10 @@ 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… + Reload Bevels Afschuiningen opnieuw laden Stroke Options Lijnopties Width Profiles Breedteprofielen Apply Graphic Style Grafische stijl toepassen diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 3637bb6f94..1358fc20f5 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -3819,6 +3819,10 @@ 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… + Reload Bevels Wczytaj ponownie fazy Stroke Options Opcje obrysu Width Profiles Profile szerokości Apply Graphic Style Zastosuj styl graficzny diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 15aa70e244..7ddbecebbb 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2427,6 +2427,10 @@ 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… + 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 diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 21f270a0fb..3d36e9ea08 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -2919,6 +2919,10 @@ digits Malayalam Малаялам Edit Arrowheads Редактировать стрелки Edit Arrowheads… Редактировать стрелки… Reload Arrowheads Перезагрузить стрелки + Bevels Фаски + Edit Bevels Редактировать фаски + Edit Bevels… Редактировать фаски… + Reload Bevels Перезагрузить фаски Rotate View Повернуть вид Reset Rotate View Сбросить поворот вида Rotate View to Selection Повернуть вид по выделению diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 7969960880..3efcee9a0e 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -2826,6 +2826,10 @@ 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… + 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 diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 639bf692a8..43b18b58fa 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -2695,6 +2695,10 @@ 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… + 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 diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 2889757941..26f6c4815c 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -2924,6 +2924,10 @@ digits Malayalam Малаялам Edit Arrowheads Редагувати стрілки Edit Arrowheads… Редагувати стрілки… Reload Arrowheads Перезавантажити стрілки + Bevels Фаски + Edit Bevels Редагувати фаски + Edit Bevels… Редагувати фаски… + Reload Bevels Перезавантажити фаски Rotate View Повернути вид Reset Rotate View Скинути поворот виду Rotate View to Selection Повернути вид за виділенням diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index ca39a2cd16..a7f09d2b6c 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3211,6 +3211,10 @@ 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… + 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 diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index d4fe4ce4f3..31f699343e 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -2790,6 +2790,10 @@ digits Malayalam 马拉雅拉姆数字 Edit Arrowheads 编辑箭头 Edit Arrowheads… 编辑箭头… Reload Arrowheads 重新载入箭头 + Bevels 斜角列表 + Edit Bevels 编辑斜角 + Edit Bevels… 编辑斜角… + Reload Bevels 重新载入斜角 Reset Rotate View 重置旋转视图 Rotate View to Selection 按所选对象旋转视图 Reset the rows to the artwork's colors 将各行重置为图稿的颜色 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 1a81d6d01c..30fa5ebb21 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -3901,6 +3901,10 @@ digits Malayalam 馬來亞拉姆數字 Edit Arrowheads 編輯箭頭 Edit Arrowheads… 編輯箭頭… Reload Arrowheads 重新載入箭頭 + Bevels 斜角清單 + Edit Bevels 編輯斜角 + Edit Bevels… 編輯斜角… + Reload Bevels 重新載入斜角 Rotate View 旋轉檢視 Reset Rotate View 重設旋轉檢視 Rotate View to Selection 依選取範圍旋轉檢視 diff --git a/crates/ui-egui/src/panels/tests_three_d.rs b/crates/ui-egui/src/panels/tests_three_d.rs index 29751dd5d7..def76a0197 100644 --- a/crates/ui-egui/src/panels/tests_three_d.rs +++ b/crates/ui-egui/src/panels/tests_three_d.rs @@ -211,6 +211,41 @@ 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)); +} + #[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 c9f2f2205e..92d0912e78 100644 --- a/crates/ui-egui/src/panels/three_d.rs +++ b/crates/ui-egui/src/panels/three_d.rs @@ -7,7 +7,7 @@ use egui::Ui; use serde_json::{Map, Value, json}; use vectorcraft_doc::{Effect, Node}; -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; @@ -150,9 +150,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()) @@ -232,6 +234,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { let mut d = Dialog { kind: ID.into(), fields }; let before = crate::dialogs::form::params(&d); crate::dialogs::revolve::controls(app, ui, &mut d); + let edit_bevels = d.fields.remove("__editBevels").is_some(); let state: Map = d .fields .iter() @@ -243,6 +246,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()); diff --git a/docs/effects-parity.md b/docs/effects-parity.md index e219ce5e1b..406907e1b4 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, smooth vector shading and round seam joins, SVG/PDF output, Expand Appearance ([revolve.md](revolve.md), #846) | -| Extrude & Bevel, Inflate, Rotate | initial: live, 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, 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, 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; hard-edged shadows behind or below the object from the first light ([three-d.md](three-d.md#shadows)); no materials, soft shadows or ray tracing | -| 3D (Classic): Extrude & Bevel, Revolve, Rotate | Extrude & Bevel (Classic) initial: live, 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 or no Shading Color, 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, 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, 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)); Map Art: none | +| 3D (Classic): Extrude & Bevel, Revolve, Rotate | Extrude & Bevel (Classic) initial: live, 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 or no Shading Color, 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, 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, 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)); Map Art: none | | Turntable (30.0 beta) | none | | Export 3D objects (OBJ, USDA, glTF) | initial: Asset Export's Export 3D Object collects 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`); no textures, map art or 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/mcp.md b/docs/mcp.md index 0a6d0cf4b9..d1100f8e34 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3466,7 +3466,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, @@ -3478,12 +3478,37 @@ 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, 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`. + +`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 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: diff --git a/docs/three-d.md b/docs/three-d.md index 820bc1e805..7f04b1787c 100644 --- a/docs/three-d.md +++ b/docs/three-d.md @@ -79,7 +79,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. | | 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). | @@ -88,6 +88,28 @@ object is where the art was. Holes stay holes, with walls of their own. Bevels move each corner along its bisector (mitres are limited to four times the width), so a bevel wider than a narrow part of the shape folds over itself. +### 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 @@ -297,7 +319,7 @@ Our reading: ## 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). @@ -314,7 +336,8 @@ out, perspective). No Adobe software, assets, presets or bevel shapes were used. and **ray-traced rendering** are not built: shading uses directional lights, in the paint of the fill or stroke the solid is built for ([Fills and strokes](#fills-and-strokes)), and the shadow is hard-edged ([Shadows](#shadows)). -- 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 From 0e74240620e4c178852b0ef0197306450440c153 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 17:37:57 -0800 Subject: [PATCH 02/38] 3D: plug-ins may not open the bevels file threeD.bevels.edit joins stroke.arrowheads.edit in the commands a plug-in may not call, and the merge with main is formatted. --- crates/effects/src/lib.rs | 6 +++--- crates/engine/src/cmd/plugin_call/reviewed.rs | 1 + crates/three-d/src/lib.rs | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/effects/src/lib.rs b/crates/effects/src/lib.rs index 3c6c1d03d7..0c980a0c43 100644 --- a/crates/effects/src/lib.rs +++ b/crates/effects/src/lib.rs @@ -87,9 +87,9 @@ 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::{ - BEVEL_NAME, BEVEL_PROFILE, CLASSIC_EXTRUDE, CLASSIC_ROTATE, EXTRUDE, GRAPHICS, GraphicFrame, INFLATE, MAX_GRAPHICS, MappedGraphic, 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, missing_symbol, + BEVEL_NAME, BEVEL_PROFILE, CLASSIC_EXTRUDE, CLASSIC_ROTATE, EXTRUDE, GRAPHICS, GraphicFrame, INFLATE, MAX_GRAPHICS, MappedGraphic, 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, missing_symbol, names_graphic_symbol, rename_graphic_symbol, rename_graphic_symbol_in, 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, diff --git a/crates/engine/src/cmd/plugin_call/reviewed.rs b/crates/engine/src/cmd/plugin_call/reviewed.rs index 0f5ada29fe..9a26b463f0 100644 --- a/crates/engine/src/cmd/plugin_call/reviewed.rs +++ b/crates/engine/src/cmd/plugin_call/reviewed.rs @@ -695,5 +695,6 @@ pub(super) const DENIED: &[&str] = &[ "object.liquify", "object.pathfinder.options", "stroke.arrowheads.edit", + "threeD.bevels.edit", "type.compositeFonts.set", ]; diff --git a/crates/three-d/src/lib.rs b/crates/three-d/src/lib.rs index 2ae07ba022..b2aaac253d 100644 --- a/crates/three-d/src/lib.rs +++ b/crates/three-d/src/lib.rs @@ -9,8 +9,8 @@ mod solid; mod visibility; pub use solid::{ - Bevel, BevelProfile, BevelShape, Extrude, FaceMap, Facet, Inflate, PlanarFace, View, extrude, extrude_face_map, inflate, inflate_together, - plane, plane_face_map, + Bevel, BevelProfile, BevelShape, Extrude, FaceMap, Facet, Inflate, PlanarFace, View, extrude, extrude_face_map, inflate, inflate_together, plane, + plane_face_map, }; pub use visibility::{VisibleFace, visible_faces}; mod shading; From dc956060f8ca68009166c7fca0546090a9fe236d Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 17:52:23 -0800 Subject: [PATCH 03/38] 3D: the bevels file stops cutting a path once it passes the point limit A bevel's path is cut into straight lines one segment at a time, and the reader stops at the segment that passes 8,192 points, so a detailed symbol is skipped without cutting the rest of its path. --- crates/engine/src/cmd/bevels.rs | 25 ++++++++++++++++++------- crates/engine/src/tests/bevels.rs | 22 ++++++++++++++++++++++ 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/crates/engine/src/cmd/bevels.rs b/crates/engine/src/cmd/bevels.rs index f36082862e..efe662b332 100644 --- a/crates/engine/src/cmd/bevels.rs +++ b/crates/engine/src/cmd/bevels.rs @@ -145,14 +145,25 @@ fn points_of(n: &Node) -> std::result::Result, &'static str> { return Err("its path has too many anchors for a bevel"); } let mut line: Vec = vec![]; - let mut too_many = false; let tolerance = path.bounds().map_or(1.0, |b| b.width().hypot(b.height()) / 2000.0).max(1e-9); - vectorcraft_geom::flatten(path.to_bezpath().elements().iter().copied(), tolerance, |el| match el { - PathEl::MoveTo(p) | PathEl::LineTo(p) if line.len() < MAX_LINE_POINTS => line.push(p), - PathEl::MoveTo(_) | PathEl::LineTo(_) => too_many = true, - _ => {} - }); - if too_many { + // 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") }; diff --git a/crates/engine/src/tests/bevels.rs b/crates/engine/src/tests/bevels.rs index 4540ae9654..5314ce5b00 100644 --- a/crates/engine/src/tests/bevels.rs +++ b/crates/engine/src/tests/bevels.rs @@ -102,6 +102,28 @@ fn curves_and_long_paths_fit_in_the_points_a_bevel_holds() { 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())]); +} + 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()) } From 4a212fdbd6ac1b042dae8b49916f3047dc3d78fc Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 19:25:30 -0800 Subject: [PATCH 04/38] 3D: a replay draws the custom bevel it recorded, and a mixed selection takes the whole bevel effect.apply and effect.setParams given bevel {custom: name} record the bevel's points in their journal entry as savedBevel, and savedBevel given with the name is used in place of the bevels file's points, so a replay draws the same bevel after the file changes or drops the name. The 3D and Materials panel sends a custom bevel's name and points with bevel whenever any of the three changes, so an Extrude & Bevel in a mixed selection that had no custom bevel takes the whole bevel. --- crates/engine/src/cmd/bevels.rs | 22 ++++++++---- crates/engine/src/cmd/effectcmd.rs | 8 ++--- crates/engine/src/tests/bevels.rs | 41 ++++++++++++++++++++++ crates/ui-egui/src/panels/tests_three_d.rs | 27 ++++++++++++++ crates/ui-egui/src/panels/three_d.rs | 14 +++++++- docs/mcp.md | 4 ++- 6 files changed, 104 insertions(+), 12 deletions(-) diff --git a/crates/engine/src/cmd/bevels.rs b/crates/engine/src/cmd/bevels.rs index efe662b332..cbc4dbb8f3 100644 --- a/crates/engine/src/cmd/bevels.rs +++ b/crates/engine/src/cmd/bevels.rs @@ -277,19 +277,29 @@ impl Session { } } +/// 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`. Other values are left -/// for the effect to check. -pub(crate) fn resolve_custom(s: &Session, params: &mut Value, cmd: &str) -> Result<()> { +/// 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 bevel = s.bevels.get(&name).ok_or_else(|| bad(cmd, format!("no custom bevel {name} (see 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!(bevel.name); - params[BEVEL_PROFILE] = bevel.profile_json(); + params[BEVEL_NAME] = json!(name); + params[BEVEL_PROFILE] = points; Ok(()) } diff --git a/crates/engine/src/cmd/effectcmd.rs b/crates/engine/src/cmd/effectcmd.rs index e391ef006d..73f447a6f0 100644 --- a/crates/engine/src/cmd/effectcmd.rs +++ b/crates/engine/src/cmd/effectcmd.rs @@ -49,7 +49,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)} 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) → {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), 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) → {ids, index, item, grouped?}", has_doc, apply ), @@ -76,7 +76,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), 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, 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)} → {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), 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, 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), savedBevel?: [[x, y]…] (as effect.apply)} → {ids}", has_doc, set_params ), @@ -436,7 +436,7 @@ pub(crate) fn apply(s: &mut Session, p: &Value) -> Result { } // A custom bevel by name takes a copy of its points from the bevels file. if bevel_effect(id) { - super::bevels::resolve_custom(s, &mut params, C)?; + 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 { @@ -733,7 +733,7 @@ fn set_params(s: &mut Session, p: &Value) -> Result { load_texture(&mut params, C)?; } if edited.iter().any(|e| bevel_effect(e)) || kind == Some(effects::EXTRUDE) { - super::bevels::resolve_custom(s, &mut params, C)?; + 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 diff --git a/crates/engine/src/tests/bevels.rs b/crates/engine/src/tests/bevels.rs index 5314ce5b00..1a77959394 100644 --- a/crates/engine/src/tests/bevels.rs +++ b/crates/engine/src/tests/bevels.rs @@ -190,6 +190,47 @@ fn the_bevels_file_is_made_opened_and_reloaded_when_saved() { 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(); diff --git a/crates/ui-egui/src/panels/tests_three_d.rs b/crates/ui-egui/src/panels/tests_three_d.rs index a97574f6ba..d272901fce 100644 --- a/crates/ui-egui/src/panels/tests_three_d.rs +++ b/crates/ui-egui/src/panels/tests_three_d.rs @@ -246,6 +246,33 @@ fn a_custom_bevel_sends_its_name_and_points() { 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}"); + } +} + #[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 54fb767bb5..c16963bb8b 100644 --- a/crates/ui-egui/src/panels/three_d.rs +++ b/crates/ui-egui/src/panels/three_d.rs @@ -491,9 +491,21 @@ pub(crate) fn mark_mixed(app: &VectorcraftApp, fields: &mut Map) } /// 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/docs/mcp.md b/docs/mcp.md index 70ebac3783..88f264be96 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3529,7 +3529,9 @@ returns each bevel's `name` and `points`, the `file` path, the `skipped` symbols 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 help page +`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. From e32a8d9822d727d157cf69d7e4e6a71f3d7904be Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 19:39:10 -0800 Subject: [PATCH 05/38] 3D: Bevel Shape lists the first object's custom bevel for a mixed selection When the selected Extrude & Bevels have custom bevels with different points, the panel unsets the shown points. Bevel Shape still lists the first selected effect's own custom bevel when the bevels file does not have it, so it can be picked for the whole selection. --- crates/ui-egui/src/dialogs/revolve.rs | 55 +++++++++++++++------- crates/ui-egui/src/panels/tests_three_d.rs | 38 +++++++++++++++ crates/ui-egui/src/panels/three_d.rs | 14 ++++++ 3 files changed, 90 insertions(+), 17 deletions(-) diff --git a/crates/ui-egui/src/dialogs/revolve.rs b/crates/ui-egui/src/dialogs/revolve.rs index 7d7b6fe3d1..1349146f59 100644 --- a/crates/ui-egui/src/dialogs/revolve.rs +++ b/crates/ui-egui/src/dialogs/revolve.rs @@ -238,17 +238,15 @@ fn solid_controls(app: &VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog, id: & } } -/// 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"; - // (shown label, value, the custom bevel's name and points). The built-in labels are - // translated; custom bevels show their names as they are. - type Choice = (String, Value, Option<(String, Value)>); - let mut options: Vec = super::effect::own_choices(effect, KEY, false) +/// 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. +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)) @@ -257,16 +255,39 @@ pub(super) fn bevel_choice(app: &VectorcraftApp, ui: &mut egui::Ui, d: &mut Dial 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 shown = if n.is_empty() { tl!("Custom").to_string() } else { n.clone() }; + 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()); - // The effect's own custom bevel, unless the file lists it by name with the same points. - let own = custom && !options[builtin..].iter().any(|(_, _, c)| is(c)); - if own && let Some(p) = &points { - let shown = if name.is_empty() { tl!("Custom").to_string() } else { name.clone() }; - options.push((shown, json!("custom"), Some((name.clone(), p.clone())))); - } 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()); diff --git a/crates/ui-egui/src/panels/tests_three_d.rs b/crates/ui-egui/src/panels/tests_three_d.rs index d272901fce..d2bca6e290 100644 --- a/crates/ui-egui/src/panels/tests_three_d.rs +++ b/crates/ui-egui/src/panels/tests_three_d.rs @@ -273,6 +273,44 @@ fn a_custom_bevel_picked_for_a_mixed_selection_reaches_every_effect() { } } +/// 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}"); + } +} + #[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 c16963bb8b..ddab3a0fb8 100644 --- a/crates/ui-egui/src/panels/three_d.rs +++ b/crates/ui-egui/src/panels/three_d.rs @@ -13,6 +13,7 @@ use vectorcraft_effects::{BEVEL_NAME, BEVEL_PROFILE, CLASSIC_EXTRUDE, CLASSIC_RE 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; @@ -235,13 +236,18 @@ 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 @@ -490,6 +496,14 @@ 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. From 17f1361ab55a2e5afdaeb7c5c572a3c91ade8683 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 12 Nov 2026 19:58:15 -0800 Subject: [PATCH 06/38] 3D: simplifying the bevels file's paths has a work limit Simplifying the paths of one bevels file measures at most 40,000,000 point-to-line distances. A symbol whose path needs more than are left is listed in skipped as too detailed, so a file of long jagged paths no longer stalls reading the bevels at startup or on reload. --- crates/engine/src/cmd/bevels.rs | 36 ++++++++++++++++++++----------- crates/engine/src/tests/bevels.rs | 15 +++++++++++++ docs/mcp.md | 3 ++- 3 files changed, 41 insertions(+), 13 deletions(-) diff --git a/crates/engine/src/cmd/bevels.rs b/crates/engine/src/cmd/bevels.rs index cbc4dbb8f3..cd68bd7f1b 100644 --- a/crates/engine/src/cmd/bevels.rs +++ b/crates/engine/src/cmd/bevels.rs @@ -27,6 +27,9 @@ pub const MAX_BEVELS: usize = 256; 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![ @@ -111,6 +114,11 @@ pub struct Read { /// 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 { @@ -121,7 +129,7 @@ pub fn bevels_of(doc: &Document) -> Read { out.skipped.push((sym.name.clone(), "another symbol has this name".into())); continue; } - match points_of(&sym.art) { + 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())), } @@ -138,8 +146,9 @@ fn open_path(n: &Node) -> Option<&PathData> { } } -/// The profile points of a bevel symbol's art `n` (see the module docs). -fn points_of(n: &Node) -> std::result::Result, &'static str> { +/// 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"); @@ -180,35 +189,38 @@ fn points_of(n: &Node) -> std::result::Result, &'static str> { // 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); + 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. -fn simplified(pts: &[(f64, f64)]) -> Vec<(f64, f64)> { +/// [`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); + let out = rdp(pts, eps, work)?; if out.len() <= BevelProfile::MAX_POINTS || eps > 2.0 { - return out; + return Some(out); } eps *= 2.0; } } -/// The points of `pts` Ramer-Douglas-Peucker keeps at tolerance `eps`. -fn rdp(pts: &[(f64, f64)], eps: f64) -> Vec<(f64, f64)> { +/// 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 pts.to_vec(); + 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); @@ -227,7 +239,7 @@ fn rdp(pts: &[(f64, f64)], eps: f64) -> Vec<(f64, f64)> { stack.push((i, b)); } } - pts.iter().zip(keep).filter_map(|(p, k)| k.then_some(*p)).collect() + 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. diff --git a/crates/engine/src/tests/bevels.rs b/crates/engine/src/tests/bevels.rs index 1a77959394..762086bb5f 100644 --- a/crates/engine/src/tests/bevels.rs +++ b/crates/engine/src/tests/bevels.rs @@ -124,6 +124,21 @@ fn a_path_cut_into_too_many_lines_is_skipped() { 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()) } diff --git a/docs/mcp.md b/docs/mcp.md index 88f264be96..c5e3df4083 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3521,7 +3521,8 @@ first anchor at the cap's edge to its last at the side wall, across the page acr 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, has ends that are not apart both across and down, or repeats an earlier name is +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`. From b30b317a8afe075c1d8604ab5c1d0e97d279bc25 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 13 Nov 2026 00:08:14 -0800 Subject: [PATCH 07/38] 3D: Extrude & Bevel (Classic) takes bevelProfile as a parameter The Classic params text named bevelName and bevelProfile in one entry, so the parameter check read only bevelName and refused a bevelProfile given to effect.apply or effect.setParams as an unknown parameter. Each key now has its own entry. The parameter-type test lists bevelName and bevelProfile of both extrude effects among the keys with checks of their own: validate_bevel refuses points that do not make a bevel and a name that is not a string. A new test applies a custom bevel to both effects and checks that a name that is not a string is refused with the document unchanged. --- crates/effects/src/catalog.rs | 2 +- crates/engine/src/cmd/params.rs | 4 ++-- crates/engine/src/tests/bevels.rs | 17 +++++++++++++++++ crates/engine/src/tests/params.rs | 3 ++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/crates/effects/src/catalog.rs b/crates/effects/src/catalog.rs index dff0bf6f8e..7171025676 100644 --- a/crates/effects/src/catalog.rs +++ b/crates/effects/src/catalog.rs @@ -210,7 +210,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; 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 and bevelProfile: [[x, y], …] (a custom bevel's name and 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 (black; the color the faces darken toward; none keeps the paint and adds only the highlight), shadingCustom: #rrggbb (#000000; the color shadingColor custom darkens toward), drawHiddenFaces: bool (false; also draws the faces turned away, behind the others)}. 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 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 (black; the color the faces darken toward; none keeps the paint and adds only the highlight), shadingCustom: #rrggbb (#000000; the color shadingColor custom darkens toward), drawHiddenFaces: bool (false; also draws the faces turned away, behind the others)}. 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 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","drawHiddenFaces":false}), ), g( diff --git a/crates/engine/src/cmd/params.rs b/crates/engine/src/cmd/params.rs index c38854ae76..1f8a047405 100644 --- a/crates/engine/src/cmd/params.rs +++ b/crates/engine/src/cmd/params.rs @@ -360,8 +360,8 @@ fn check_effect_types(id: &str, effect: &str, params: &Value) -> Result<()> { /// without a dialog default: the earlier 3D Perspective and light (`perspective`, `lightAzimuth`, /// `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 Glass or Texturizer `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. +/// 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/tests/bevels.rs b/crates/engine/src/tests/bevels.rs index 762086bb5f..662a026023 100644 --- a/crates/engine/src/tests/bevels.rs +++ b/crates/engine/src/tests/bevels.rs @@ -275,6 +275,23 @@ fn a_document_keeps_its_custom_bevels_without_the_bevels_file() { 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(); diff --git a/crates/engine/src/tests/params.rs b/crates/engine/src/tests/params.rs index e72f607030..ffce7b6db9 100644 --- a/crates/engine/src/tests/params.rs +++ b/crates/engine/src/tests/params.rs @@ -610,11 +610,12 @@ 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, 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, "version" => effect.starts_with("warp."), "style" => effect == "cropMarks", + "bevelName" | "bevelProfile" => matches!(effect, "threeD.extrude" | "threeD.classicExtrude"), _ => false, }; let mut unlisted = vec![]; From d1a3624ca517715315e0ce983f94436538d13089 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 13 Nov 2026 04:29:23 -0800 Subject: [PATCH 08/38] i18n: the custom bevel refusals are translated in the complete-message catalogs Extrude & Bevel refuses a bevel that is not none, a built-in shape or custom, a custom bevel without bevelProfile, points that do not make a bevel, and a bevelName that is not a string. These four messages had no @msg row, so they showed in English in every interface language, and three_d_refusals_are_translated_in_every_complete_catalog failed. Each of the 22 complete-message catalogs gets the four rows. The row for the bevel message is replaced, since the message now ends with the custom value. NAMED_KEYS lists the two messages that name bevel, none and custom without backticks, and three_d_refusals_translate_with_their_values shows each refusal translated with its parameter names and values as written. --- crates/ui-egui/src/i18n/ca.tsv | 5 ++++- crates/ui-egui/src/i18n/cs.tsv | 5 ++++- crates/ui-egui/src/i18n/de.tsv | 5 ++++- crates/ui-egui/src/i18n/el.tsv | 5 ++++- crates/ui-egui/src/i18n/es.tsv | 5 ++++- crates/ui-egui/src/i18n/fi.tsv | 5 ++++- crates/ui-egui/src/i18n/fr.tsv | 5 ++++- crates/ui-egui/src/i18n/hi.tsv | 5 ++++- crates/ui-egui/src/i18n/hu.tsv | 5 ++++- crates/ui-egui/src/i18n/it.tsv | 5 ++++- crates/ui-egui/src/i18n/ja.tsv | 5 ++++- crates/ui-egui/src/i18n/ka.tsv | 5 ++++- crates/ui-egui/src/i18n/ko.tsv | 5 ++++- crates/ui-egui/src/i18n/pl.tsv | 5 ++++- crates/ui-egui/src/i18n/pt-br.tsv | 5 ++++- crates/ui-egui/src/i18n/ru.tsv | 5 ++++- crates/ui-egui/src/i18n/sv.tsv | 5 ++++- crates/ui-egui/src/i18n/tests.rs | 19 ++++++++++++++++++- crates/ui-egui/src/i18n/tr.tsv | 5 ++++- crates/ui-egui/src/i18n/uk.tsv | 5 ++++- crates/ui-egui/src/i18n/vi.tsv | 5 ++++- crates/ui-egui/src/i18n/zh-hans.tsv | 5 ++++- crates/ui-egui/src/i18n/zh-hant.tsv | 5 ++++- 23 files changed, 106 insertions(+), 23 deletions(-) diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 07c2afa971..504c15da91 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -6070,7 +6070,10 @@ digits Malayalam Malaiàlam @msg The 3D object is too complex to export L’objecte 3D és massa complex per exportar-lo @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 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 8396445906..4f6c67e2c0 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -5913,7 +5913,10 @@ mark-style Japanese Japonské @msg The 3D object is too complex to export 3D objekt je pro export příliš složitý @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 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/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 5696072ba7..0ff0eafd4e 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -5488,7 +5488,10 @@ lighting Light Licht @msg The 3D object is too complex to export Das 3D-Objekt ist zu komplex für den Export @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 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 b7b1f81f59..fd3ee29069 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -5272,7 +5272,10 @@ digits Malayalam Μαλαγιάλαμ @msg The 3D object is too complex to export Το αντικείμενο 3D είναι πολύ σύνθετο για εξαγωγή @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) το αντικείμενο δεν έχει εφέ 3D (Εξώθηση και λοξότμηση, Περιστροφή γύρω από άξονα, Φούσκωμα ή Περιστροφή) @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 b355e9bf76..1dd915ddcd 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -5854,7 +5854,10 @@ mark-style Japanese Japonesas @msg The 3D object is too complex to export El objeto 3D es demasiado complejo para exportarlo @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 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 43d82f356a..5af4dca9df 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -5795,7 +5795,10 @@ mark-style Japanese Japanilainen @msg The 3D object is too complex to export 3D-objekti on liian monimutkainen vietäväksi @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 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 ac34af8029..996a0e3a3b 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -5483,7 +5483,10 @@ lighting Light Lumière @msg The 3D object is too complex to export L'objet 3D est trop complexe pour être exporté @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 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/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 47431f6610..c03c3a0c95 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -7896,7 +7896,10 @@ antiAlias Sharp शार्प @msg The 3D object is too complex to export 3D ऑब्जेक्ट एक्सपोर्ट करने के लिए बहुत जटिल है @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) ऑब्जेक्ट पर कोई 3D इफ़ेक्ट नहीं है (एक्सट्रूडेड और बेवेल, रिवॉल्व, फुलाएँ या घुमाव) @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 d8365ad8af..8832b5f6ad 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -5896,7 +5896,10 @@ imageTrace Outline Körvonal @msg The 3D object is too complex to export A 3D objektum túl összetett az exportáláshoz @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 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/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 7e9f51fd86..0f9ebc3d11 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -5530,7 +5530,10 @@ lighting Light Luce @msg The 3D object is too complex to export L'oggetto 3D è troppo complesso per essere esportato @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 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 2ea992ffa3..fc1d897439 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -5572,7 +5572,10 @@ lighting Light ライト @msg The 3D object is too complex to export 3D オブジェクトが複雑すぎるため書き出せません @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) オブジェクトに 3D 効果 (押し出しとベベル、回転体、膨張、回転) がありません @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 92f41cb979..cc45d1c9ac 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -5201,7 +5201,10 @@ font-technology Variable ცვლადი @msg The 3D object is too complex to export 3D ობიექტი ზედმეტად რთულია ექსპორტისთვის @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) ობიექტს არ აქვს 3D ეფექტი (ამოწევა და წაკვეთა, ბრუნვა, გაბერვა ან შემობრუნება) @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 cfc9501444..17283b3331 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -5491,7 +5491,10 @@ lighting Light 광원 @msg The 3D object is too complex to export 3D 개체가 너무 복잡하여 내보낼 수 없습니다 @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) 개체에 3D 효과(돌출 및 경사, 회전체, 부풀리기 또는 회전)가 없습니다 @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/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 222d94da1c..fd0f47f934 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -5743,7 +5743,10 @@ mark-style Japanese Japońskie @msg The 3D object is too complex to export Obiekt 3D jest zbyt złożony, aby go wyeksportować @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 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 tego rysunku: jego 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}”: rysunek symbolu jest niedostępny @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ą rysunek diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 9ec0405da1..64ac432868 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -5862,7 +5862,10 @@ mark-style Japanese Japonesas @msg The 3D object is too complex to export O objeto 3D é complexo demais para ser exportado @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 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 6bc6c821e7..30ad6d9d54 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -5516,7 +5516,10 @@ lighting Light Свет @msg The 3D object is too complex to export 3D-объект слишком сложен для экспорта @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) у объекта нет 3D-эффекта (Выдавливание и фаска, Вращение, Надувание или Повернуть) @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 3ac5bb0167..08e094aa48 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -5384,7 +5384,10 @@ lighting Light Ljus @msg The 3D object is too complex to export 3D-objektet är för komplext för att exporteras @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 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 66caa1c3a4..9f5f198548 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -2072,6 +2072,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}"); @@ -3473,7 +3489,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 bd5f48dbf6..6a99217906 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -5179,7 +5179,10 @@ lighting Light Işık @msg The 3D object is too complex to export 3 boyutlu nesne dışa aktarmak için çok karmaşık @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) nesnenin 3 boyutlu efekti yok (Ekstrüzyon ve Eğim, Döndür, Şişir veya Döndü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 a3315af982..8cd8dec590 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -5510,7 +5510,10 @@ lighting Light Світло @msg The 3D object is too complex to export 3D-об’єкт надто складний для експорту @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) об’єкт не має 3D-ефекту (Видавлювання та фаска, Обертання, Надування або Повернути) @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 de821105c5..ec48e28a02 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -5297,7 +5297,10 @@ theme Appearance Giao diện @msg The 3D object is too complex to export Đối tượng 3D quá phức tạp để xuất @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 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 b30a2c156e..6e29d61f60 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -5786,7 +5786,10 @@ lighting Light 光源 @msg The 3D object is too complex to export 3D 对象过于复杂,无法导出 @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) 该对象没有 3D 效果(突出与斜角、回转、膨胀或旋转) @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 c8ccb0e900..cbf85fdd24 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -5618,7 +5618,10 @@ lighting Light 光源 @msg The 3D object is too complex to export 3D 物件過於複雜,無法匯出 @msg the object has no 3D effect (Extrude & Bevel, Revolve, Inflate or Rotate) 此物件沒有 3D 效果 (突出與斜角、迴轉、膨脹或旋轉) @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}:剪裁路徑過於複雜,無法用來剪裁圖稿 From 12fc7e19a8134e3771bcfdb6700fa395ea0b9cd9 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 13 Nov 2026 07:58:04 -0800 Subject: [PATCH 09/38] i18n: Dutch rows for 3D custom bevel messages --- crates/ui-egui/src/i18n/nl.tsv | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 8f09c8b3f2..6c6d386de1 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -5861,7 +5861,10 @@ mark-style Japanese Japans @msg The 3D object is too complex to export Het 3D-object is te complex om te exporteren @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 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 From 4f4a39a756f5bd7bd5f5a8ed80ff61ccb2100064 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 13 Nov 2026 20:36:23 -0800 Subject: [PATCH 10/38] 3D: Bevel Shape labels an effect's own custom bevel apart from a file bevel of the same name When the bevels file lists a bevel with the name of the effect's own custom bevel but other points, the effect's entry is now shown as " (document)", and the menu marks the current entry by its position instead of its label, so two entries are no longer both shown as selected. --- crates/ui-egui/src/dialogs/revolve.rs | 20 +++++++++++++++++--- crates/ui-egui/src/i18n/bg.tsv | 1 + crates/ui-egui/src/i18n/bs.tsv | 1 + crates/ui-egui/src/i18n/ca.tsv | 1 + crates/ui-egui/src/i18n/cs.tsv | 1 + crates/ui-egui/src/i18n/da.tsv | 1 + crates/ui-egui/src/i18n/de.tsv | 1 + crates/ui-egui/src/i18n/el.tsv | 1 + crates/ui-egui/src/i18n/es.tsv | 1 + crates/ui-egui/src/i18n/fi.tsv | 1 + crates/ui-egui/src/i18n/fr.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 1 + crates/ui-egui/src/i18n/hu.tsv | 1 + crates/ui-egui/src/i18n/id.tsv | 1 + crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/ja.tsv | 1 + crates/ui-egui/src/i18n/ka.tsv | 1 + crates/ui-egui/src/i18n/ko.tsv | 1 + crates/ui-egui/src/i18n/nl.tsv | 1 + crates/ui-egui/src/i18n/pl.tsv | 1 + crates/ui-egui/src/i18n/pt-br.tsv | 1 + crates/ui-egui/src/i18n/ru.tsv | 1 + crates/ui-egui/src/i18n/sv.tsv | 1 + crates/ui-egui/src/i18n/tr.tsv | 1 + crates/ui-egui/src/i18n/uk.tsv | 1 + crates/ui-egui/src/i18n/vi.tsv | 1 + crates/ui-egui/src/i18n/zh-hans.tsv | 1 + crates/ui-egui/src/i18n/zh-hant.tsv | 1 + crates/ui-egui/src/panels/tests_three_d.rs | 22 ++++++++++++++++++++++ 29 files changed, 66 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/dialogs/revolve.rs b/crates/ui-egui/src/dialogs/revolve.rs index 1349146f59..67cd08fda2 100644 --- a/crates/ui-egui/src/dialogs/revolve.rs +++ b/crates/ui-egui/src/dialogs/revolve.rs @@ -244,7 +244,7 @@ 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. +/// 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() @@ -266,7 +266,11 @@ pub(crate) fn bevel_options(app: &VectorcraftApp, fields: &serde_json::Map = 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; - if let Some(k) = widgets::dropdown_names(ui, ("three-d-choice", KEY), shown, &labels, width) + // 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()); diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index f02f16bf8d..ae3b94d5bd 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -2863,6 +2863,7 @@ digits Malayalam Малаялам Bevels Фаски Edit Bevels Редактиране на фаски Edit Bevels… Редактиране на фаски… + {name} (document) {name} (документ) Reload Bevels Презареждане на фаски Reset Rotate View Нулиране на изгледа на завъртане Rotate View to Selection Завъртане на изгледа спрямо селекцията diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 67a7bda96b..951f200c97 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -3969,6 +3969,7 @@ theme Appearance Izgled 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 diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index f0fcf70843..1a5bd0db89 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -3653,6 +3653,7 @@ digits Malayalam Malaiàlam 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 diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 7551245ad4..7cd2f320d0 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4025,6 +4025,7 @@ theme Appearance Motiv 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 diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 647029e27b..4497c29285 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -3742,6 +3742,7 @@ theme Appearance Udseende 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 diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 0ee03555da..77bd9379c1 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -2908,6 +2908,7 @@ digits Malayalam Malayalam 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 diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 6c33aa87dd..d1accb5171 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -3645,6 +3645,7 @@ digits Malayalam Μαλαγιάλαμ Bevels Λοξοτμήσεις Edit Bevels Επεξεργασία λοξοτμήσεων Edit Bevels… Επεξεργασία λοξοτμήσεων… + {name} (document) {name} (έγγραφο) Reload Bevels Επαναφόρτωση λοξοτμήσεων Reset Rotate View Επαναφορά περιστροφής προβολής Rotate View to Selection Περιστροφή προβολής ως προς την επιλογή diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 15c12dcdcd..e8532b277f 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -2942,6 +2942,7 @@ digits Malayalam Malayálam 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 diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 9fd972ee9a..32d59f95c6 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -3949,6 +3949,7 @@ theme Appearance Ulkoasu 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 diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 06df1b4bd3..a7427096d7 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -2934,6 +2934,7 @@ digits Malayalam Malayalam 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 diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 22525881b4..d00f5c1fd1 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -4016,6 +4016,7 @@ antiAlias Sharp शार्प Bevels बेवल्स Edit Bevels बेवल्स संपादित करें Edit Bevels… बेवल्स संपादित करें… + {name} (document) {name} (दस्तावेज़) Reload Bevels बेवल्स फिर से लोड करें Reset Rotate View व्यू घुमाएँ रीसेट करें Reset Ruler Origin शासकीय उत्पत्ति रीसेट करें diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 5ec8045a85..e9545c5ba7 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3500,6 +3500,7 @@ mark-style Japanese Japán 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 diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 5042d4217b..d50bdaa3a2 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -3742,6 +3742,7 @@ theme Appearance Tampilan 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 diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index e6815869dc..64d173ee28 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -2984,6 +2984,7 @@ digits Malayalam Malayalam 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 diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 3c431b95be..3069ccbb6d 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -2992,6 +2992,7 @@ mark-style Japanese 日本式 Bevels ベベル一覧 Edit Bevels ベベルを編集 Edit Bevels… ベベルを編集… + {name} (document) {name} (ドキュメント) Reload Bevels ベベルを再読み込み Reset the rows to the artwork's colors 行をアートワークのカラーにリセット Color Theme Picker カラーテーマピッカー diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index adfdb887a7..a588c5d4fa 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -3585,6 +3585,7 @@ theme Appearance იერსახე Bevels წაკვეთები Edit Bevels წაკვეთების რედაქტირება Edit Bevels… წაკვეთების რედაქტირება… + {name} (document) {name} (დოკუმენტი) Reload Bevels წაკვეთების ხელახლა ჩატვირთვა Stroke Options კონტურის პარამეტრები Width Profiles სიგანის პროფილები diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index b46074af26..ea9e95c05e 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -2981,6 +2981,7 @@ mark-style Japanese 일본식 Bevels 베벨 목록 Edit Bevels 베벨 편집 Edit Bevels… 베벨 편집… + {name} (document) {name}(문서) Reload Bevels 베벨 다시 불러오기 Reset the rows to the artwork's colors 행을 아트웍 색상으로 재설정 Color Theme Picker 색상 테마 피커 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 7f598529c7..2642155c8f 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -4259,6 +4259,7 @@ theme Appearance Vormgeving 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 diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 8bbb4100c8..8e59033370 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -3888,6 +3888,7 @@ theme Appearance Wygląd 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 diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index f0a1110f02..71410dbff7 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2475,6 +2475,7 @@ digits Malayalam Malaiala 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 diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index dc2c2e54b9..957042a1c1 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -2971,6 +2971,7 @@ digits Malayalam Малаялам Bevels Фаски Edit Bevels Редактировать фаски Edit Bevels… Редактировать фаски… + {name} (document) {name} (документ) Reload Bevels Перезагрузить фаски Rotate View Повернуть вид Reset Rotate View Сбросить поворот вида diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 791dec357e..ef1cb74a6f 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -2878,6 +2878,7 @@ digits Malayalam Malayalam 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 diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index b1ae6df145..6a1b615d69 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -2721,6 +2721,7 @@ digits Malayalam Malayalam 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 diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 36ca63094b..a30e3df5c7 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -2976,6 +2976,7 @@ digits Malayalam Малаялам Bevels Фаски Edit Bevels Редагувати фаски Edit Bevels… Редагувати фаски… + {name} (document) {name} (документ) Reload Bevels Перезавантажити фаски Rotate View Повернути вид Reset Rotate View Скинути поворот виду diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 20f21181bc..fa5a3718d0 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3269,6 +3269,7 @@ mark-style Japanese Kiểu Nhật 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 diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 2b5732b80e..3a25db6cc2 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -2838,6 +2838,7 @@ digits Malayalam 马拉雅拉姆数字 Bevels 斜角列表 Edit Bevels 编辑斜角 Edit Bevels… 编辑斜角… + {name} (document) {name} (文档) Reload Bevels 重新载入斜角 Reset Rotate View 重置旋转视图 Rotate View to Selection 按所选对象旋转视图 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 2bb793d5e1..ea7b547462 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -4055,6 +4055,7 @@ digits Malayalam 馬來亞拉姆數字 Bevels 斜角清單 Edit Bevels 編輯斜角 Edit Bevels… 編輯斜角… + {name} (document) {name} (文件) Reload Bevels 重新載入斜角 Rotate View 旋轉檢視 Reset Rotate View 重設旋轉檢視 diff --git a/crates/ui-egui/src/panels/tests_three_d.rs b/crates/ui-egui/src/panels/tests_three_d.rs index 76e205745a..bb03045dea 100644 --- a/crates/ui-egui/src/panels/tests_three_d.rs +++ b/crates/ui-egui/src/panels/tests_three_d.rs @@ -311,6 +311,28 @@ fn a_mixed_selection_still_lists_the_first_effects_own_custom_bevel() { } } +/// 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(); From 118b27d3adc34ec34853d19a3af2d316ab429735 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 13 Nov 2026 21:17:27 -0800 Subject: [PATCH 11/38] 3D: keep agents to the bevels file inside their read roots Under automation read roots, threeD.bevels.list gives `file` as null for a bevels file outside them and names it by its file name in `error`. threeD.bevels.edit and threeD.bevels.reload refuse such a file with the root-check error, naming it by its file name: edit makes no folder or file and neither opens nor activates the file, and reload does not read it. Inside the roots, edit opens the file under the client's roots. The 3D and Materials panel's Edit Bevels... is not confined. --- crates/engine/src/cmd/arrowheads.rs | 4 +- crates/engine/src/cmd/bevels.rs | 19 +++++-- crates/engine/src/tests/bevels.rs | 82 +++++++++++++++++++++++++++++ docs/mcp.md | 7 +++ 4 files changed, 106 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/cmd/arrowheads.rs b/crates/engine/src/cmd/arrowheads.rs index d77724d8dc..cef54db187 100644 --- a/crates/engine/src/cmd/arrowheads.rs +++ b/crates/engine/src/cmd/arrowheads.rs @@ -413,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 index cd68bd7f1b..3fcaa1094c 100644 --- a/crates/engine/src/cmd/bevels.rs +++ b/crates/engine/src/cmd/bevels.rs @@ -16,7 +16,7 @@ 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::{read, same_file}; +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. @@ -325,11 +325,18 @@ fn skipped(s: &Session) -> Vec { 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(); - Ok(json!({"bevels": bevels, "file": s.bevels.path, "skipped": skipped(s), "error": s.bevels.error})) + // 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())); @@ -340,8 +347,11 @@ fn reload(s: &mut Session, _: &Value) -> Result { 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() { - std::fs::create_dir_all(dir).map_err(|e| bad(C, format!("{}: {e}", dir.display())))?; + 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()); @@ -360,7 +370,8 @@ fn edit(s: &mut Session, _: &Value) -> Result { s.set_active(i); } None => { - crate::file_access::unconfined(|| s.execute("document.open", &json!({ "path": path })))?; + // 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/tests/bevels.rs b/crates/engine/src/tests/bevels.rs index 662a026023..301ed61905 100644 --- a/crates/engine/src/tests/bevels.rs +++ b/crates/engine/src/tests/bevels.rs @@ -310,3 +310,85 @@ fn without_a_bevels_file_editing_is_refused_and_none_are_listed() { 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/docs/mcp.md b/docs/mcp.md index 7c9514ea17..d3bac3d8b9 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3892,6 +3892,13 @@ the file may take, has ends that are not apart both across and down, or repeats 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 From 804f844fcf6ea139df32c39e90f4695b8d59dc1a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 14 Nov 2026 07:24:54 -0800 Subject: [PATCH 12/38] Part of #978: the Color Wheel panel can gray out colors the CMYK space cannot print The panel menu gains Show Out-of-Gamut Colors. While it is on, the wheel's square and the box's color field draw gray over the cells of a 16 by 16 grid whose colors fail the out-of-gamut warning's test (`Cms::out_of_gamut` on the color a pick there would store). The grid is kept in panel state per channel, strip value, color settings and loaded profiles, so it is computed again only when one of them changes, including when a profile is loaded again under the same name. `ui.colorWheel {gamut?}` sets it, and the setting is kept with the preferences. --- crates/mcp/src/ui_catalog.rs | 2 +- crates/ui-egui/src/i18n/bg.tsv | 1 + crates/ui-egui/src/i18n/bs.tsv | 1 + crates/ui-egui/src/i18n/ca.tsv | 1 + crates/ui-egui/src/i18n/cs.tsv | 1 + crates/ui-egui/src/i18n/da.tsv | 1 + crates/ui-egui/src/i18n/de.tsv | 1 + crates/ui-egui/src/i18n/el.tsv | 1 + crates/ui-egui/src/i18n/es.tsv | 1 + crates/ui-egui/src/i18n/fi.tsv | 1 + crates/ui-egui/src/i18n/fr.tsv | 1 + crates/ui-egui/src/i18n/gu.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 1 + crates/ui-egui/src/i18n/hu.tsv | 1 + crates/ui-egui/src/i18n/id.tsv | 1 + crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/ja.tsv | 1 + crates/ui-egui/src/i18n/ka.tsv | 1 + crates/ui-egui/src/i18n/ko.tsv | 1 + crates/ui-egui/src/i18n/nl.tsv | 1 + crates/ui-egui/src/i18n/pl.tsv | 1 + crates/ui-egui/src/i18n/pt-br.tsv | 1 + crates/ui-egui/src/i18n/ru.tsv | 1 + crates/ui-egui/src/i18n/sv.tsv | 1 + crates/ui-egui/src/i18n/tr.tsv | 1 + crates/ui-egui/src/i18n/uk.tsv | 1 + crates/ui-egui/src/i18n/vi.tsv | 1 + crates/ui-egui/src/i18n/zh-hans.tsv | 1 + crates/ui-egui/src/i18n/zh-hant.tsv | 1 + crates/ui-egui/src/menus/ui_commands.rs | 2 +- crates/ui-egui/src/panels.rs | 2 + crates/ui-egui/src/panels/color_wheel.rs | 115 +++++++++- .../src/panels/tests_color_wheel_box.rs | 23 +- .../src/panels/tests_color_wheel_gamut.rs | 216 ++++++++++++++++++ crates/ui-egui/src/state.rs | 2 +- crates/ui-egui/src/widgets.rs | 6 +- crates/ui-egui/src/widgets/color.rs | 67 +++++- docs/control-protocol.md | 6 +- docs/mcp.md | 8 +- docs/target-app-parity.md | 2 +- 40 files changed, 443 insertions(+), 36 deletions(-) create mode 100644 crates/ui-egui/src/panels/tests_color_wheel_gamut.rs diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 943faa4782..b75851677b 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1324,7 +1324,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.colorWheel", "Color Wheel Options", "", - "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, and pick the box's channel, as Box Channel does: 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); keys left out keep their values, params that are not an object, another key or a value off the list are an error and change nothing, both 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}", + "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, gamut?: bool} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, and pick the box's channel, as Box Channel does: 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); 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; keys left out keep their values, params that are not an object, another key or a value off the list are an error and change nothing, all three 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, gamut}", ), ( "ui.savePdfDialog", diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 348ac7b881..c3c5c14d79 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -2373,6 +2373,7 @@ font-technology Variable Променливи The Scripts folder cannot be read Папката Scripts не може да бъде прочетена Other Script… Друг скрипт… Out of Gamut Warning Предупреждение за излизане извън цветовата гама + Show Out-of-Gamut Colors Показване на цветовете извън цветовата гама Out of Web Color Warning Предупреждение за цвят извън уеб палитрата Out Tangent Handles Външни тангентни дръжки Outer Glow… Външно разсейване… diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 3b1a9e001c..f63d89b0ad 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -1649,6 +1649,7 @@ digits Malayalam Malajalam Create New Swatch… Kreiraj novi uzorak boje… Name 40% Naziv 40% Out of Gamut Warning Upozorenje o izlasku iz gamuta + Show Out-of-Gamut Colors Prikaži boje izvan gamuta Out of Web Color Warning Upozorenje o boji izvan weba Web Safe RGB Sigurni web RGB {warning}: click to correct to the closest color ({hex}) {warning}: kliknite za ispravku na najbližu boju ({hex}) diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 488b46c4f5..d0f028a97b 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -3010,6 +3010,7 @@ digits Malayalam Malaiàlam Other Library… Una altra biblioteca… Other Script… Un altre script… Out of Gamut Warning Avís fora de gama + Show Out-of-Gamut Colors Mostra els colors fora de gama Out of Web Color Warning Avís fora dels colors web Out Tangent Handles Nanses tangents de sortida Outer Corner Tile Mosaic de cantonada exterior diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 6a57e90e37..7ee7411790 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -1678,6 +1678,7 @@ digits Malayalam Malajálamské Create New Swatch… Vytvořit novou položku vzorníku… Name 40% Název 40 % Out of Gamut Warning Upozornění na barvu mimo gamut + Show Out-of-Gamut Colors Zobrazit barvy mimo gamut Out of Web Color Warning Upozornění na barvu mimo webovou paletu Web Safe RGB Webově bezpečné RGB {warning}: click to correct to the closest color ({hex}) {warning}: kliknutím opravíte na nejbližší barvu ({hex}) diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 54a79e38e5..bc38e95000 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -1584,6 +1584,7 @@ digits Malayalam Malayalam Create New Swatch… Opret ny farveprøve… Name 40% Navn 40% Out of Gamut Warning Advarsel: uden for gamut + Show Out-of-Gamut Colors Vis farver uden for gamut Out of Web Color Warning Advarsel: ikke-websikker farve Web Safe RGB Websikker RGB {warning}: click to correct to the closest color ({hex}) {warning}: klik for at rette til den nærmeste farve ({hex}) diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index ab77cb0dd7..6802775e29 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -2411,6 +2411,7 @@ file-filter Templates Vorlagen Other Library… Andere Bibliothek… Other Script… Anderes Skript… Out of Gamut Warning Warnung: außerhalb des Farbumfangs + Show Out-of-Gamut Colors Farben außerhalb des Farbumfangs einblenden Out of Web Color Warning Warnung: keine Webfarbe Out Tangent Handles Ausgehende Tangentengriffe Outer Glow… Schein nach außen… diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index a1a203a257..9a9b9bcbef 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -3273,6 +3273,7 @@ theme Appearance Εμφάνιση Other Library… Άλλη βιβλιοθήκη… Other Script… Άλλο σενάριο… Out of Gamut Warning Προειδοποίηση εκτός χρωματικής γκάμας + Show Out-of-Gamut Colors Εμφάνιση χρωμάτων εκτός χρωματικής γκάμας Out of Web Color Warning Προειδοποίηση εκτός χρωμάτων ιστού Out Tangent Handles Λαβές εξερχόμενης εφαπτομένης Outline Others Περιγράμματα άλλων diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 45fd0d8235..2580f20479 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -2449,6 +2449,7 @@ font-technology Variable Variables Other Library… Otra biblioteca… Other Script… Otro script… Out of Gamut Warning Aviso de fuera de gama + Show Out-of-Gamut Colors Mostrar colores fuera de gama Out of Web Color Warning Aviso de color no apto para web Out Tangent Handles Manejadores de tangente de salida Outer Glow… Resplandor exterior… diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index f6db5b8ee1..403ae26e7d 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -1651,6 +1651,7 @@ digits Malayalam Malajalam Create New Swatch… Luo uusi värimalli… Name 40% Nimi 40% Out of Gamut Warning Väriavaruuden ulkopuolella -varoitus + Show Out-of-Gamut Colors Näytä väriavaruuden ulkopuoliset värit Out of Web Color Warning Verkkovärien ulkopuolella -varoitus Web Safe RGB Verkkoturvallinen RGB {warning}: click to correct to the closest color ({hex}) {warning}: korjaa lähimpään väriin ({hex}) napsauttamalla diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index ae0bf3b436..9051184455 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -2441,6 +2441,7 @@ font-technology Variable Variables Other Library… Autre bibliothèque… Other Script… Autre script… Out of Gamut Warning Avertissement hors gamme + Show Out-of-Gamut Colors Afficher les couleurs hors gamme Out of Web Color Warning Avertissement de couleur non Web Out Tangent Handles Poignées de tangente sortantes Outer Glow… Lueur externe… diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index f38612601c..091ee4b820 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -4229,6 +4229,7 @@ Box Channel બૉક્સ ચેનલ Color box રંગ બૉક્સ Color Wheel Options રંગ વ્હીલ વિકલ્પો + Show Out-of-Gamut Colors ગેમટ બહારના રંગો બતાવો {name} (spot) {name} (સ્પૉટ) {pages} in all, {count} per copy કુલ {pages}, પ્રતિ નકલ {count} {page} of {count} {count} માંથી {page} diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 624671acca..9aa23621d7 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -3287,6 +3287,7 @@ antiAlias Sharp शार्प Other Library… अन्य लाइब्रेरी… Other Script… अन्य स्क्रिप्ट… Out of Gamut Warning गैमट से बाहर होने की चेतावनी + Show Out-of-Gamut Colors गैमट से बाहर के रंग दिखाएँ Out of Web Color Warning वेब कलर चेतावनी से बाहर Out Tangent Handles आउट टैंगेंट हैंडल Out: आउटपुट: diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 3e8a200697..c7a29fd383 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -2923,6 +2923,7 @@ file-filter Templates Sablonok Other Library… Másik könyvtár… Other Script… Másik szkript… Out of Gamut Warning Színtartományon kívüli szín figyelmeztetés + Show Out-of-Gamut Colors Színtartományon kívüli színek megjelenítése Out of Web Color Warning Nem webbiztos szín figyelmeztetés Out Tangent Handles Kimenő érintőfogantyúk Outer Corner Tile Külső sarokcsempe diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 2107a23bf0..f5ae5ba704 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -1584,6 +1584,7 @@ digits Malayalam Malayalam Create New Swatch… Buat swatch baru… Name 40% Nama 40% Out of Gamut Warning Peringatan di luar gamut + Show Out-of-Gamut Colors Tampilkan warna di luar gamut Out of Web Color Warning Peringatan di luar warna web Web Safe RGB RGB aman web {warning}: click to correct to the closest color ({hex}) {warning}: klik untuk mengoreksi ke warna terdekat ({hex}) diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index f75dc629db..e29bc3b9a8 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -2487,6 +2487,7 @@ file-filter Templates Modelli Other Library… Altra libreria… Other Script… Altro script… Out of Gamut Warning Avviso fuori gamma + Show Out-of-Gamut Colors Mostra colori fuori gamma Out of Web Color Warning Avviso colore non web Out Tangent Handles Maniglie tangente in uscita Outer Glow… Bagliore esterno… diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 67072cc8b3..04a6995169 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -3946,6 +3946,7 @@ file-filter Templates テンプレート Offset X X 軸オフセット Other Libraries その他のライブラリ Out of Gamut Warning 色域外警告 + Show Out-of-Gamut Colors 色域外のカラーを表示 Out of Web Color Warning Web カラー外警告 Output 出力 Output Black 出力ブラック diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index c8513b84c3..04833fad62 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -1522,6 +1522,7 @@ digits Malayalam მალაიალამური Create New Swatch… ახალი ფერის ნიმუშის შექმნა… Name 40% სახელი 40% Out of Gamut Warning ფერთა გამიდან გასვლის გაფრთხილება + Show Out-of-Gamut Colors ფერთა გამის გარეთ მყოფი ფერების ჩვენება Out of Web Color Warning გაფრთხილება: ფერი ვებფერი არ არის Web Safe RGB ვებისთვის უსაფრთხო RGB {warning}: click to correct to the closest color ({hex}) {warning}: დაწკაპეთ უახლოეს ფერზე ჩასასწორებლად ({hex}) diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 8aa0bc41ca..3ed5f27dc1 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3934,6 +3934,7 @@ file-filter Templates 템플릿 Offset X X 오프셋 Other Libraries 기타 라이브러리 Out of Gamut Warning 색상 범위 초과 경고 + Show Out-of-Gamut Colors 색상 범위를 벗어난 색상 표시 Out of Web Color Warning 웹 색상 초과 경고 Output 출력 Output Black 출력 검정 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index de5b7a3cf6..5fa7387727 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -2102,6 +2102,7 @@ digits Malayalam Malayalam Create New Swatch… Nieuw staal maken… Name 40% Naam 40% Out of Gamut Warning Waarschuwing buiten gamut + Show Out-of-Gamut Colors Kleuren buiten gamut tonen Out of Web Color Warning Waarschuwing buiten webkleur Web Safe RGB Websafe RGB {warning}: click to correct to the closest color ({hex}) {warning}: klik om te corrigeren naar de dichtstbijzijnde kleur ({hex}) diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index f9bdc664f1..e688a7e247 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -1590,6 +1590,7 @@ digits Malayalam Malajalam Create New Swatch… Utwórz nową próbkę… Name 40% Nazwa 40% Out of Gamut Warning Ostrzeżenie: poza gamutem + Show Out-of-Gamut Colors Pokaż kolory poza gamutem Out of Web Color Warning Ostrzeżenie: poza kolorami WWW Web Safe RGB RGB bezpieczne dla WWW {warning}: click to correct to the closest color ({hex}) {warning}: kliknij, aby poprawić na najbliższy kolor ({hex}) diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 07cd9c6fd6..bbc1037db2 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -5110,6 +5110,7 @@ axis Both Ambos Opacity: Default Opacidade: Padrão Other Libraries Outras Bibliotecas Out of Gamut Warning Aviso de Fora do Gamut + Show Out-of-Gamut Colors Mostrar Cores Fora do Gamut Out of Web Color Warning Aviso de Cor Fora da Web Output Saída Output Black Preto de Saída diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index fcf44192cd..bc60fa7dd8 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -2474,6 +2474,7 @@ file-filter Templates Шаблоны Other Library… Другая библиотека… Other Script… Другая письменность… Out of Gamut Warning Предупреждение о выходе из цветового охвата + Show Out-of-Gamut Colors Показать цвета вне цветового охвата Out of Web Color Warning Предупреждение о цвете, не поддерживаемом web Out Tangent Handles Маркеры исходящей касательной Outer Glow… Внешнее свечение… diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index d68878734e..32542260bf 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -2388,6 +2388,7 @@ font-technology Variable Variabla Other Library… Annat bibliotek… Other Script… Annat skript… Out of Gamut Warning Färgomfångsvarning + Show Out-of-Gamut Colors Visa färger utanför färgomfånget Out of Web Color Warning Varning för färg utanför webbfärger Out Tangent Handles Utgående tangenthandtag Outer Glow… Yttre glöd… diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index b3c88cc563..5f30f03efa 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -2234,6 +2234,7 @@ shape Open Açık Other Library… Diğer Kütüphane… Other Script… Diğer Komut Dosyası… Out of Gamut Warning Gamut Dışı Uyarısı + Show Out-of-Gamut Colors Gamut Dışı Renkleri Göster Out of Web Color Warning Web Dışı Renk Uyarısı Out Tangent Handles Dışarıya Teğet Tutamaçlar Outer Glow… Dış Parıltı… diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 0ab6257df4..7b4d5b908b 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -2479,6 +2479,7 @@ file-filter Templates Шаблони Other Library… Інша бібліотека… Other Script… Інша писемність… Out of Gamut Warning Попередження про вихід із колірного охоплення + Show Out-of-Gamut Colors Показати кольори поза колірним охопленням Out of Web Color Warning Попередження про колір, що не підтримується web Out Tangent Handles Маркери вихідної дотичної Outer Glow… Зовнішнє свічення… diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 80cc4951cf..c37fd34328 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -2743,6 +2743,7 @@ digits Hindi Hindi Other Library… Thư viện khác… Other Script… Script khác… Out of Gamut Warning Cảnh báo ngoài dải màu + Show Out-of-Gamut Colors Hiện màu ngoài dải màu Out of Web Color Warning Cảnh báo ngoài màu web Out Tangent Handles Tay nắm tiếp tuyến ra Outer Corner Tile Ô góc ngoài diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 9561a51baf..875aabc8d4 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -2342,6 +2342,7 @@ file-filter Templates 模板 Other Library… 其他库… Other Script… 其他脚本… Out of Gamut Warning 超出色域警告 + Show Out-of-Gamut Colors 显示超出色域的颜色 Out of Web Color Warning 非网页安全色警告 Out Tangent Handles 外切线控制手柄 Outer Glow… 外光晕… diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 7489e3d4d9..b53aa1eb91 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -3558,6 +3558,7 @@ file-filter Templates 範本 Other Library… 其他資料庫… Other Script… 其他指令碼… Out of Gamut Warning 超出色域警告 + Show Out-of-Gamut Colors 顯示超出色域的顏色 Out of Web Color Warning 非網頁安全色警告 Out Tangent Handles 外切線控制把手 Outer Glow… 外光暈… diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index d36ecae60f..86cc9281fc 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -1325,7 +1325,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.colorWheel", "Color Wheel Options", "", - "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, and pick the box's channel, as Box Channel does: 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); keys left out keep their values, params that are not an object, another key or a value off the list are an error and change nothing, both 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}", + "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, gamut?: bool} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, and pick the box's channel, as Box Channel does: 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); 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; keys left out keep their values, params that are not an object, another key or a value off the list are an error and change nothing, all three 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, gamut}", ), ( "ui.savePdfDialog", diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index d12c89d2af..ba9e187b11 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -698,6 +698,8 @@ mod tests_color_wheel; #[cfg(test)] mod tests_color_wheel_box; #[cfg(test)] +mod tests_color_wheel_gamut; +#[cfg(test)] mod tests_constrain; #[cfg(test)] mod tests_css_properties; diff --git a/crates/ui-egui/src/panels/color_wheel.rs b/crates/ui-egui/src/panels/color_wheel.rs index 31522578e5..80b4dd76f0 100644 --- a/crates/ui-egui/src/panels/color_wheel.rs +++ b/crates/ui-egui/src/panels/color_wheel.rs @@ -11,11 +11,16 @@ //! channel strip at its right, for the channel picked under Box Channel (Hue, Saturation, //! Brightness, Red, Green or Blue). The field shows the other two components on the Color //! Picker's axes. The view and the channel are kept with the preferences (`ui.colorWheel`). +//! +//! 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. use egui::{Ui, UiBuilder, vec2}; use serde::{Deserialize, Serialize}; use serde_json::{Value, json}; -use vectorcraft_color::cms::{self, Cms}; +use vectorcraft_color::cms::{self, Cms, ColorSettings}; use vectorcraft_color::{Color, Paint, hsb_to_rgb, rgb_to_hsb}; use vectorcraft_doc::{ColorMode, NodeId}; @@ -67,6 +72,14 @@ pub struct Settings { pub view: View, #[serde(serialize_with = "serialize_channel", deserialize_with = "deserialize_channel")] pub channel: Channel, + /// Show Out-of-Gamut Colors: gray out the colors the CMYK space cannot print. + #[serde(deserialize_with = "deserialize_flag")] + pub gamut: bool, +} + +fn deserialize_flag<'de, D: serde::Deserializer<'de>>(d: D) -> Result { + let v = ::deserialize(d)?; + Ok(v.as_bool().unwrap_or_default()) } fn deserialize_view<'de, D: serde::Deserializer<'de>>(d: D) -> Result { @@ -90,11 +103,11 @@ pub fn deserialize_settings<'de, D: serde::Deserializer<'de>>(d: D) -> Result Result { - const KEYS: [&str; 2] = ["view", "channel"]; + const KEYS: [&str; 3] = ["view", "channel", "gamut"]; match p { Value::Null => {} Value::Object(o) => { @@ -113,11 +126,19 @@ pub(crate) fn command(app: &mut VectorcraftApp, p: &Value) -> Result {} Some(v) => set.channel = v.as_str().and_then(Channel::parse).ok_or("`channel` must be hue, saturation, brightness, red, green or blue")?, } + match p.get("gamut") { + None | Some(Value::Null) => {} + Some(v) => { + let key = "gamut"; + set.gamut = v.as_bool().ok_or_else(|| format!("`{key}` must be true or false"))?; + } + } app.ui.color_wheel = set; Ok(json!(app.ui.color_wheel)) } -/// The panel menu: Wheel View and Box View, and Box Channel while the box shows. +/// The panel menu: Wheel View and Box View, Box Channel while the box shows, and Show +/// Out-of-Gamut Colors. 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)] { @@ -134,6 +155,68 @@ 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(); + } +} + +/// 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 color a pick +/// there stores in the working RGB space. 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, @@ -180,16 +263,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. @@ -310,6 +396,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| { @@ -318,7 +405,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); @@ -328,7 +415,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)); if let Some((h, phase)) = ring.hue { pick = Some(([h, hsb[1], hsb[2]], phase)); } 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 d3866fd5d9..4e3ce95d2d 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel_box.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel_box.rs @@ -167,16 +167,16 @@ 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()); - assert_eq!(app.run("ui.colorWheel", json!({})).unwrap(), json!({"view": "wheel", "channel": "hue"})); - assert_eq!(app.run("ui.colorWheel", json!({"view": "box"})).unwrap(), json!({"view": "box", "channel": "hue"})); - assert_eq!(app.run("ui.colorWheel", json!({"channel": "green"})).unwrap(), json!({"view": "box", "channel": "green"})); + assert_eq!(app.run("ui.colorWheel", json!({})).unwrap(), json!({"view": "wheel", "channel": "hue", "gamut": false})); + assert_eq!(app.run("ui.colorWheel", json!({"view": "box"})).unwrap(), json!({"view": "box", "channel": "hue", "gamut": false})); + assert_eq!(app.run("ui.colorWheel", json!({"channel": "green"})).unwrap(), json!({"view": "box", "channel": "green", "gamut": false})); let e = app.run("ui.colorWheel", json!({"view": "triangle"})).unwrap_err(); assert_eq!(e, "`view` must be wheel or box"); let e = app.run("ui.colorWheel", json!({"view": "wheel", "channel": 7})).unwrap_err(); assert_eq!(e, "`channel` must be hue, saturation, brightness, red, green or blue"); - assert_eq!(app.ui.color_wheel, Settings { view: View::Box, channel: Channel::Green }, "an error changes nothing"); + assert_eq!(app.ui.color_wheel, Settings { view: View::Box, channel: Channel::Green, ..Default::default() }, "an error changes nothing"); let ui = crate::control::inspect(&app, &egui::Context::default()); - assert_eq!(ui["ui"]["color_wheel"], json!({"view": "box", "channel": "green"})); + assert_eq!(ui["ui"]["color_wheel"], json!({"view": "box", "channel": "green", "gamut": false})); } /// The command's errors are translated in the catalogs that translate status and error messages, @@ -211,10 +211,10 @@ 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"); + assert_eq!(e, "unknown parameter `veiw`; the command takes: view, channel, gamut"); let e = app.run("ui.colorWheel", json!({"view": "wheel", "chanel": "blue"})).unwrap_err(); - assert_eq!(e, "unknown parameter `chanel`; the command takes: view, channel"); - assert_eq!(app.ui.color_wheel, Settings { view: View::Box, channel: Channel::Red }, "an error changes nothing"); + assert_eq!(e, "unknown parameter `chanel`; the command takes: view, channel, gamut"); + assert_eq!(app.ui.color_wheel, Settings { view: View::Box, channel: Channel::Red, ..Default::default() }, "an error changes nothing"); } /// With None there is no color to edit: the strip reads 0 to screen readers, as the hue ring does, @@ -249,7 +249,8 @@ fn ui_color_wheel_answers_junk_params_without_a_panic() { /// not know reads as the key's default without losing the other preferences. #[test] fn the_settings_are_kept_and_read_leniently() { - let ui = crate::UiState { color_wheel: Settings { view: View::Box, channel: Channel::Blue }, color_rgb_percent: true, ..Default::default() }; + let color_wheel = Settings { view: View::Box, channel: Channel::Blue, ..Default::default() }; + let ui = crate::UiState { color_wheel, color_rgb_percent: true, ..Default::default() }; let saved = serde_json::to_value(&ui).unwrap(); let back: crate::UiState = serde_json::from_value(saved.clone()).unwrap(); assert_eq!(back.color_wheel, ui.color_wheel); @@ -262,11 +263,11 @@ fn the_settings_are_kept_and_read_leniently() { let mut odd = saved.clone(); odd["color_wheel"] = json!({"view": "box", "channel": 7}); let back: crate::UiState = serde_json::from_value(odd).unwrap(); - assert_eq!(back.color_wheel, Settings { view: View::Box, channel: Channel::default() }); + assert_eq!(back.color_wheel, Settings { view: View::Box, ..Default::default() }); let mut odd = saved.clone(); odd["color_wheel"] = json!({"view": "triangle", "channel": "blue"}); let back: crate::UiState = serde_json::from_value(odd).unwrap(); - assert_eq!(back.color_wheel, Settings { view: View::Wheel, channel: Channel::Blue }); + assert_eq!(back.color_wheel, Settings { view: View::Wheel, channel: Channel::Blue, ..Default::default() }); let mut odd = saved; odd["color_wheel"] = json!("box"); let back: crate::UiState = serde_json::from_value(odd).unwrap(); 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..0573b5a37f --- /dev/null +++ b/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs @@ -0,0 +1,216 @@ +//! 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") }; + let name = "Color Wheel Gamut Reload CMYK"; + let bytes = cms::icc_bytes(cms::GENERIC_CMYK).unwrap(); + cms::register_icc(&bytes, Some(name.into())).unwrap(); + h.run_steps(2); + cms::unregister_icc(name); + 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 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()); + app.run("ui.colorWheel", json!({"view": "box"})).unwrap(); + assert_eq!(app.run("ui.colorWheel", json!({"gamut": true})).unwrap(), 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"); + assert_eq!(app.run("ui.colorWheel", json!({"gamut": false})).unwrap()["gamut"], json!(false)); + 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 }); +} + +/// 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()); +} diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index d1722e8b72..278ae0282e 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -734,7 +734,7 @@ 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, and the box's channel (`ui.colorWheel`, + /// Color Wheel panel: the wheel or the box, the box's channel and the out-of-gamut shading (`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, diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index 2ace2c7a67..1c36c9fc1a 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -34,10 +34,12 @@ pub(crate) use buttons::{button_width, icon_button_info, primary_button_width, s #[cfg(test)] 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}; +#[cfg(test)] +pub(crate) use color::shade_edges; pub use color::{ FieldAxis, Live, RingResponse, SliderValue, 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, region_texture, ring_square, segment_color, segmented_wheel, stepped_area, + 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, region_texture, ring_square, segment_color, segmented_wheel, stepped_area, }; pub(crate) use color::{HEX_FIELD_CHARS, hex_text, pointer_phase}; pub use drag::{ diff --git a/crates/ui-egui/src/widgets/color.rs b/crates/ui-egui/src/widgets/color.rs index f7c1d9365b..21ddb3fb85 100644 --- a/crates/ui-egui/src/widgets/color.rs +++ b/crates/ui-egui/src/widgets/color.rs @@ -383,11 +383,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()); @@ -396,6 +411,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; @@ -446,6 +462,55 @@ pub fn color_field( (None, Live::Idle) } +/// The gray over a shaded cell of a [`color_field_shaded`]. +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. +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 bb13e0d5f5..de4288cd23 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -265,9 +265,9 @@ 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?}` shows the wheel or the box (a -color field with a channel strip at its right) and picks the box's channel; it returns the settings, and `ui.inspect` -reports them as `ui.color_wheel`. +point (the first stop or point when none is selected). `ui.colorWheel {view?, channel?, gamut?}` shows the wheel or +the box (a color field with a channel strip at its right), picks the box's channel, and with `gamut` grays out the +colors the CMYK space cannot print; it returns the settings, and `ui.inspect` reports them as `ui.color_wheel`. Edit Colors dialogs: `ui.colorBalanceDialog` opens Adjust Colors (`colorBalance`: fields `mode` `gray`/`rgb`/`cmyk`/ `global`, the channels `r` `g` `b` / `c` `m` `y` `k` / `gray` / `tint` (global mode) from −100 to 100, `convert`, `fill`, `stroke`, diff --git a/docs/mcp.md b/docs/mcp.md index 12c1f38184..68e99c7232 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -622,9 +622,11 @@ RGB fields in percent, as a double-click right of an RGB field does, and `false` 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. 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}`, and both settings are kept with -the preferences. +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. 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, gamut}`, and the settings are kept with the preferences. In remote desktop mode, `invoke_menu` with `{"command":"ui.sampleScreenColor","params":{}}` shows the system's screen color sampler and returns `null` before a color is picked: the system's sampler on macOS, the XDG desktop diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index e34f814534..fe0563ea9e 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1502,7 +1502,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Colorized images (#1466):** a fill color applied to a selected grayscale or 1-bit image (`paint.setFill`) colorizes it with black, white, a process color or a spot color, and refuses a process color when the image has an alpha channel ([Convert color modes](https://web.archive.org/web/20251220223850/https://helpx.adobe.com/illustrator/desktop/manage-colors/select-and-adjust-colors/convert-color-modes.html), "Colorize Grayscale or 1-bit images"); black and white are accepted there too. The canvas draws each pixel in the color as far as the pixel is dark, with white pixels transparent; PDF export writes the image in the color (a spot color as its ink, Registration in every ink) with the image as its soft mask; Separations Preview and printed separations show it on its color's plates; native files keep the color. EPS and SVG write the image's own pixels. - **Missing library files:** a persistent swatch or graphic style library panel whose file is gone at startup reopens and stays in the preferences, showing the file's path with Locate Library… (`ui.libraryPanel.locate`), which reads the file from where it is now into the same panel. - **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. - - **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. 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}`). 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}`). Plain Comma and Period, and also Shift+Comma and Shift+Period, apply the last solid color and the last gradient to the active Fill or Stroke proxy in VectorCraft ([Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html), "Select color fill mode" and "Select gradient fill mode"). Recent Colors keeps the last 30 solid colors applied, newest first and each once, and the list stays the same when another document is opened or made active; a 31st color drops the oldest ([Select colors using the Color panel](https://helpx.adobe.com/illustrator/desktop/manage-colors/select-and-adjust-colors/select-colors-using-the-color-panel.html)). The list lasts for the session. In the Color and Swatches panels the chips wrap onto further rows when the panel is too narrow for one row (`paint.recent`). Tests: `recent_colors_keep_thirty_colors_across_documents` in `crates/engine/src/tests/paintproxy.rs`, `all_thirty_recent_colors_wrap_into_a_narrow_panel` in `crates/ui-egui/src/panels/color/tests.rs`. From 5589f629d4478215c70992f8ea0098e544429bc4 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 14 Nov 2026 08:57:06 -0800 Subject: [PATCH 13/38] Color Wheel: catalog row with the panel's rows, and test cleanup - The "Show Out-of-Gamut Colors" row moves next to the other Color Wheel rows in each catalog, out of the alphabetical block it had split. - The `gamut_grid` doc comment says the cells are tested on the working-RGB color of a pick, before it is converted to CMYK or Lab. - The profile test unregisters its ICC profile in a drop guard, so a failed assertion does not leave it registered for other tests. - The `color_wheel` field's doc comment in `state.rs` is rewrapped. --- crates/ui-egui/src/i18n/bg.tsv | 2 +- crates/ui-egui/src/i18n/bs.tsv | 2 +- crates/ui-egui/src/i18n/ca.tsv | 2 +- crates/ui-egui/src/i18n/cs.tsv | 2 +- crates/ui-egui/src/i18n/da.tsv | 2 +- crates/ui-egui/src/i18n/de.tsv | 2 +- crates/ui-egui/src/i18n/el.tsv | 2 +- crates/ui-egui/src/i18n/es.tsv | 2 +- crates/ui-egui/src/i18n/fi.tsv | 2 +- crates/ui-egui/src/i18n/fr.tsv | 2 +- crates/ui-egui/src/i18n/hi.tsv | 2 +- crates/ui-egui/src/i18n/hu.tsv | 2 +- crates/ui-egui/src/i18n/id.tsv | 2 +- crates/ui-egui/src/i18n/it.tsv | 2 +- crates/ui-egui/src/i18n/ja.tsv | 2 +- crates/ui-egui/src/i18n/ka.tsv | 2 +- crates/ui-egui/src/i18n/ko.tsv | 2 +- crates/ui-egui/src/i18n/nl.tsv | 2 +- crates/ui-egui/src/i18n/pl.tsv | 2 +- crates/ui-egui/src/i18n/pt-br.tsv | 2 +- crates/ui-egui/src/i18n/ru.tsv | 2 +- crates/ui-egui/src/i18n/sv.tsv | 2 +- crates/ui-egui/src/i18n/tr.tsv | 2 +- crates/ui-egui/src/i18n/uk.tsv | 2 +- crates/ui-egui/src/i18n/vi.tsv | 2 +- crates/ui-egui/src/i18n/zh-hans.tsv | 2 +- crates/ui-egui/src/i18n/zh-hant.tsv | 2 +- crates/ui-egui/src/panels/color_wheel.rs | 6 +++--- crates/ui-egui/src/panels/tests_color_wheel_gamut.rs | 9 ++++++++- crates/ui-egui/src/state.rs | 4 ++-- 30 files changed, 40 insertions(+), 33 deletions(-) diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index c3c5c14d79..36488e4c37 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -562,6 +562,7 @@ font-technology Variable Променливи Box Channel Канал на квадрата Color box Цветови квадрат Color Wheel Options Опции на цветното колело + Show Out-of-Gamut Colors Показване на цветовете извън цветовата гама Color Type: Цветен тип: Color: Цвят: Colorize Оцветяване @@ -2373,7 +2374,6 @@ font-technology Variable Променливи The Scripts folder cannot be read Папката Scripts не може да бъде прочетена Other Script… Друг скрипт… Out of Gamut Warning Предупреждение за излизане извън цветовата гама - Show Out-of-Gamut Colors Показване на цветовете извън цветовата гама Out of Web Color Warning Предупреждение за цвят извън уеб палитрата Out Tangent Handles Външни тангентни дръжки Outer Glow… Външно разсейване… diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index f63d89b0ad..eee2cb2b4d 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -740,6 +740,7 @@ Box Channel Kanal kvadrata Color box Kvadrat boje Color Wheel Options Opcije kotača boja + Show Out-of-Gamut Colors Prikaži boje izvan gamuta CSS Properties CSS svojstva Document Info Informacije o dokumentu Flattener Preview Pregled spljoštavanja @@ -1649,7 +1650,6 @@ digits Malayalam Malajalam Create New Swatch… Kreiraj novi uzorak boje… Name 40% Naziv 40% Out of Gamut Warning Upozorenje o izlasku iz gamuta - Show Out-of-Gamut Colors Prikaži boje izvan gamuta Out of Web Color Warning Upozorenje o boji izvan weba Web Safe RGB Sigurni web RGB {warning}: click to correct to the closest color ({hex}) {warning}: kliknite za ispravku na najbližu boju ({hex}) diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index d0f028a97b..6f7a5b84fa 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -824,6 +824,7 @@ antiAlias Sharp Nítid Box Channel Canal del quadre Color box Quadre de color Color Wheel Options Opcions de la roda de colors + Show Out-of-Gamut Colors Mostra els colors fora de gama Color Type: Tipus de color: Color wheel Roda de color Color: Color: @@ -3010,7 +3011,6 @@ digits Malayalam Malaiàlam Other Library… Una altra biblioteca… Other Script… Un altre script… Out of Gamut Warning Avís fora de gama - Show Out-of-Gamut Colors Mostra els colors fora de gama Out of Web Color Warning Avís fora dels colors web Out Tangent Handles Nanses tangents de sortida Outer Corner Tile Mosaic de cantonada exterior diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 7ee7411790..aec29f9ab7 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -753,6 +753,7 @@ Box Channel Kanál čtverce Color box Barevný čtverec Color Wheel Options Možnosti barevného kola + Show Out-of-Gamut Colors Zobrazit barvy mimo gamut CSS Properties Vlastnosti CSS Document Info Informace o dokumentu Flattener Preview Náhled sloučení @@ -1678,7 +1679,6 @@ digits Malayalam Malajálamské Create New Swatch… Vytvořit novou položku vzorníku… Name 40% Název 40 % Out of Gamut Warning Upozornění na barvu mimo gamut - Show Out-of-Gamut Colors Zobrazit barvy mimo gamut Out of Web Color Warning Upozornění na barvu mimo webovou paletu Web Safe RGB Webově bezpečné RGB {warning}: click to correct to the closest color ({hex}) {warning}: kliknutím opravíte na nejbližší barvu ({hex}) diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index bc38e95000..ca095adf83 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -698,6 +698,7 @@ Box Channel Kvadratets kanal Color box Farvekvadrat Color Wheel Options Indstillinger for farvehjul + Show Out-of-Gamut Colors Vis farver uden for gamut CSS Properties CSS-egenskaber Document Info Dokumentoplysninger Flattener Preview Udjævningsforhåndsvisning @@ -1584,7 +1585,6 @@ digits Malayalam Malayalam Create New Swatch… Opret ny farveprøve… Name 40% Navn 40% Out of Gamut Warning Advarsel: uden for gamut - Show Out-of-Gamut Colors Vis farver uden for gamut Out of Web Color Warning Advarsel: ikke-websikker farve Web Safe RGB Websikker RGB {warning}: click to correct to the closest color ({hex}) {warning}: klik for at rette til den nærmeste farve ({hex}) diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 6802775e29..2ce633fe27 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -555,6 +555,7 @@ font-technology Variable Variabel Box Channel Kanal des Quadrats Color box Farbquadrat Color Wheel Options Optionen für den Farbkreis + Show Out-of-Gamut Colors Farben außerhalb des Farbumfangs einblenden Color Type: Farbart: Color: Farbe: Colorize Einfärben @@ -2411,7 +2412,6 @@ file-filter Templates Vorlagen Other Library… Andere Bibliothek… Other Script… Anderes Skript… Out of Gamut Warning Warnung: außerhalb des Farbumfangs - Show Out-of-Gamut Colors Farben außerhalb des Farbumfangs einblenden Out of Web Color Warning Warnung: keine Webfarbe Out Tangent Handles Ausgehende Tangentengriffe Outer Glow… Schein nach außen… diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 9a9b9bcbef..e69fb91d61 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -537,6 +537,7 @@ font-technology Variable Μεταβλητές Box Channel Κανάλι τετραγώνου Color box Τετράγωνο χρώματος Color Wheel Options Επιλογές χρωματικού τροχού + Show Out-of-Gamut Colors Εμφάνιση χρωμάτων εκτός χρωματικής γκάμας Color Type: Τύπος χρώματος: Color: Χρώμα: Colorize Χρωματισμός @@ -3273,7 +3274,6 @@ theme Appearance Εμφάνιση Other Library… Άλλη βιβλιοθήκη… Other Script… Άλλο σενάριο… Out of Gamut Warning Προειδοποίηση εκτός χρωματικής γκάμας - Show Out-of-Gamut Colors Εμφάνιση χρωμάτων εκτός χρωματικής γκάμας Out of Web Color Warning Προειδοποίηση εκτός χρωμάτων ιστού Out Tangent Handles Λαβές εξερχόμενης εφαπτομένης Outline Others Περιγράμματα άλλων diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 2580f20479..2e3db2a871 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -577,6 +577,7 @@ font-technology Variable Variables Box Channel Canal del cuadro Color box Cuadro de color Color Wheel Options Opciones de la rueda de color + Show Out-of-Gamut Colors Mostrar colores fuera de gama Color Type: Tipo de color: Color: Color: Colorize Colorear @@ -2449,7 +2450,6 @@ font-technology Variable Variables Other Library… Otra biblioteca… Other Script… Otro script… Out of Gamut Warning Aviso de fuera de gama - Show Out-of-Gamut Colors Mostrar colores fuera de gama Out of Web Color Warning Aviso de color no apto para web Out Tangent Handles Manejadores de tangente de salida Outer Glow… Resplandor exterior… diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 403ae26e7d..b94e5bef08 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -744,6 +744,7 @@ Box Channel Ruudun kanava Color box Väriruutu Color Wheel Options Väriympyrän asetukset + Show Out-of-Gamut Colors Näytä väriavaruuden ulkopuoliset värit CSS Properties CSS-ominaisuudet Document Info Asiakirjan tiedot Flattener Preview Litistyksen esikatselu @@ -1651,7 +1652,6 @@ digits Malayalam Malajalam Create New Swatch… Luo uusi värimalli… Name 40% Nimi 40% Out of Gamut Warning Väriavaruuden ulkopuolella -varoitus - Show Out-of-Gamut Colors Näytä väriavaruuden ulkopuoliset värit Out of Web Color Warning Verkkovärien ulkopuolella -varoitus Web Safe RGB Verkkoturvallinen RGB {warning}: click to correct to the closest color ({hex}) {warning}: korjaa lähimpään väriin ({hex}) napsauttamalla diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 9051184455..98451403b1 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -578,6 +578,7 @@ font-technology Variable Variables Box Channel Couche du carré Color box Carré de couleur Color Wheel Options Options de la roue chromatique + Show Out-of-Gamut Colors Afficher les couleurs hors gamme Color Type: Type de couleur : Color: Couleur : Colorize Coloriser @@ -2441,7 +2442,6 @@ font-technology Variable Variables Other Library… Autre bibliothèque… Other Script… Autre script… Out of Gamut Warning Avertissement hors gamme - Show Out-of-Gamut Colors Afficher les couleurs hors gamme Out of Web Color Warning Avertissement de couleur non Web Out Tangent Handles Poignées de tangente sortantes Outer Glow… Lueur externe… diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 9aa23621d7..008c4026dd 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -948,6 +948,7 @@ antiAlias Sharp शार्प Box Channel बॉक्स चैनल Color box कलर बॉक्स Color Wheel Options कलर व्हील ऑप्शन्स + Show Out-of-Gamut Colors गैमट से बाहर के रंग दिखाएँ Color Type: रंग का प्रकार: Color wheel कलर व्हील Color: रंग: @@ -3287,7 +3288,6 @@ antiAlias Sharp शार्प Other Library… अन्य लाइब्रेरी… Other Script… अन्य स्क्रिप्ट… Out of Gamut Warning गैमट से बाहर होने की चेतावनी - Show Out-of-Gamut Colors गैमट से बाहर के रंग दिखाएँ Out of Web Color Warning वेब कलर चेतावनी से बाहर Out Tangent Handles आउट टैंगेंट हैंडल Out: आउटपुट: diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index c7a29fd383..5dba6b02aa 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -753,6 +753,7 @@ font-technology Variable Változó Box Channel Négyzet csatornája Color box Színnégyzet Color Wheel Options Színkör beállításai + Show Out-of-Gamut Colors Színtartományon kívüli színek megjelenítése Color Type: Színtípus: Color: Szín: Colorization Színezés @@ -2923,7 +2924,6 @@ file-filter Templates Sablonok Other Library… Másik könyvtár… Other Script… Másik szkript… Out of Gamut Warning Színtartományon kívüli szín figyelmeztetés - Show Out-of-Gamut Colors Színtartományon kívüli színek megjelenítése Out of Web Color Warning Nem webbiztos szín figyelmeztetés Out Tangent Handles Kimenő érintőfogantyúk Outer Corner Tile Külső sarokcsempe diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index f5ae5ba704..e91af7ace4 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -698,6 +698,7 @@ Box Channel Saluran kotak Color box Kotak warna Color Wheel Options Opsi roda warna + Show Out-of-Gamut Colors Tampilkan warna di luar gamut CSS Properties Properti CSS Document Info Info dokumen Flattener Preview Pratinjau perata @@ -1584,7 +1585,6 @@ digits Malayalam Malayalam Create New Swatch… Buat swatch baru… Name 40% Nama 40% Out of Gamut Warning Peringatan di luar gamut - Show Out-of-Gamut Colors Tampilkan warna di luar gamut Out of Web Color Warning Peringatan di luar warna web Web Safe RGB RGB aman web {warning}: click to correct to the closest color ({hex}) {warning}: klik untuk mengoreksi ke warna terdekat ({hex}) diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index e29bc3b9a8..27c45f98e5 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -577,6 +577,7 @@ font-technology Variable Variabili Box Channel Canale del riquadro Color box Riquadro colore Color Wheel Options Opzioni ruota dei colori + Show Out-of-Gamut Colors Mostra colori fuori gamma Color Type: Tipo di colore: Color: Colore: Colorize Colora @@ -2487,7 +2488,6 @@ file-filter Templates Modelli Other Library… Altra libreria… Other Script… Altro script… Out of Gamut Warning Avviso fuori gamma - Show Out-of-Gamut Colors Mostra colori fuori gamma Out of Web Color Warning Avviso colore non web Out Tangent Handles Maniglie tangente in uscita Outer Glow… Bagliore esterno… diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 04a6995169..ab10f2a379 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -768,6 +768,7 @@ digits Malayalam マラヤーラム数字 Box Channel ボックスのチャンネル Color box カラーボックス Color Wheel Options カラーホイールオプション + Show Out-of-Gamut Colors 色域外のカラーを表示 CSS Properties CSS プロパティ Document Info ドキュメント情報 Flattener Preview 分割・統合プレビュー @@ -3946,7 +3947,6 @@ file-filter Templates テンプレート Offset X X 軸オフセット Other Libraries その他のライブラリ Out of Gamut Warning 色域外警告 - Show Out-of-Gamut Colors 色域外のカラーを表示 Out of Web Color Warning Web カラー外警告 Output 出力 Output Black 出力ブラック diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 04833fad62..6a9a3019a3 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -664,6 +664,7 @@ Box Channel კვადრატის არხი Color box ფერის კვადრატი Color Wheel Options ფერთა წრის პარამეტრები + Show Out-of-Gamut Colors ფერთა გამის გარეთ მყოფი ფერების ჩვენება CSS Properties CSS თვისებები Document Info დოკუმენტის ინფორმაცია Flattener Preview გაბრტყელების წინასწარი ნახვა @@ -1522,7 +1523,6 @@ digits Malayalam მალაიალამური Create New Swatch… ახალი ფერის ნიმუშის შექმნა… Name 40% სახელი 40% Out of Gamut Warning ფერთა გამიდან გასვლის გაფრთხილება - Show Out-of-Gamut Colors ფერთა გამის გარეთ მყოფი ფერების ჩვენება Out of Web Color Warning გაფრთხილება: ფერი ვებფერი არ არის Web Safe RGB ვებისთვის უსაფრთხო RGB {warning}: click to correct to the closest color ({hex}) {warning}: დაწკაპეთ უახლოეს ფერზე ჩასასწორებლად ({hex}) diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 3ed5f27dc1..097412b714 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -761,6 +761,7 @@ digits Malayalam 말라얄람어 Box Channel 상자 채널 Color box 색상 상자 Color Wheel Options 색상환 옵션 + Show Out-of-Gamut Colors 색상 범위를 벗어난 색상 표시 CSS Properties CSS 속성 Document Info 문서 정보 Flattener Preview 병합 미리 보기 @@ -3934,7 +3935,6 @@ file-filter Templates 템플릿 Offset X X 오프셋 Other Libraries 기타 라이브러리 Out of Gamut Warning 색상 범위 초과 경고 - Show Out-of-Gamut Colors 색상 범위를 벗어난 색상 표시 Out of Web Color Warning 웹 색상 초과 경고 Output 출력 Output Black 출력 검정 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 5fa7387727..0161a073f8 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -1216,6 +1216,7 @@ Box Channel Kanaal van het vak Color box Kleurvak Color Wheel Options Opties voor kleurenwiel + Show Out-of-Gamut Colors Kleuren buiten gamut tonen CSS Properties CSS-eigenschappen Document Info Documentinfo Flattener Preview Afvlakvoorbeeld @@ -2102,7 +2103,6 @@ digits Malayalam Malayalam Create New Swatch… Nieuw staal maken… Name 40% Naam 40% Out of Gamut Warning Waarschuwing buiten gamut - Show Out-of-Gamut Colors Kleuren buiten gamut tonen Out of Web Color Warning Waarschuwing buiten webkleur Web Safe RGB Websafe RGB {warning}: click to correct to the closest color ({hex}) {warning}: klik om te corrigeren naar de dichtstbijzijnde kleur ({hex}) diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index e688a7e247..f2aa40a565 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -702,6 +702,7 @@ Box Channel Kanał kwadratu Color box Kwadrat koloru Color Wheel Options Opcje koła kolorów + Show Out-of-Gamut Colors Pokaż kolory poza gamutem CSS Properties Właściwości CSS Document Info Informacje o dokumencie Flattener Preview Podgląd spłaszczania @@ -1590,7 +1591,6 @@ digits Malayalam Malajalam Create New Swatch… Utwórz nową próbkę… Name 40% Nazwa 40% Out of Gamut Warning Ostrzeżenie: poza gamutem - Show Out-of-Gamut Colors Pokaż kolory poza gamutem Out of Web Color Warning Ostrzeżenie: poza kolorami WWW Web Safe RGB RGB bezpieczne dla WWW {warning}: click to correct to the closest color ({hex}) {warning}: kliknij, aby poprawić na najbliższy kolor ({hex}) diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index bbc1037db2..c08a266e9f 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -522,6 +522,7 @@ antiAlias Sharp Nítido Box Channel Canal da Caixa Color box Caixa de cor Color Wheel Options Opções da Roda de Cores + Show Out-of-Gamut Colors Mostrar Cores Fora do Gamut Color Type: Tipo de Cor: Color blindness – Deuteranopia-type Daltonismo – tipo deuteranopia Color blindness – Protanopia-type Daltonismo – tipo protanopia @@ -5110,7 +5111,6 @@ axis Both Ambos Opacity: Default Opacidade: Padrão Other Libraries Outras Bibliotecas Out of Gamut Warning Aviso de Fora do Gamut - Show Out-of-Gamut Colors Mostrar Cores Fora do Gamut Out of Web Color Warning Aviso de Cor Fora da Web Output Saída Output Black Preto de Saída diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index bc60fa7dd8..3bd0a834c1 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -575,6 +575,7 @@ font-technology Variable Вариативные Box Channel Канал квадрата Color box Цветовой квадрат Color Wheel Options Параметры цветового круга + Show Out-of-Gamut Colors Показать цвета вне цветового охвата Color Type: Тип цвета: Color: Цвет: Colorize Тонировать @@ -2474,7 +2475,6 @@ file-filter Templates Шаблоны Other Library… Другая библиотека… Other Script… Другая письменность… Out of Gamut Warning Предупреждение о выходе из цветового охвата - Show Out-of-Gamut Colors Показать цвета вне цветового охвата Out of Web Color Warning Предупреждение о цвете, не поддерживаемом web Out Tangent Handles Маркеры исходящей касательной Outer Glow… Внешнее свечение… diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 32542260bf..8e7fbfe533 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -564,6 +564,7 @@ font-technology Variable Variabla Box Channel Rutans kanal Color box Färgruta Color Wheel Options Alternativ för färghjulet + Show Out-of-Gamut Colors Visa färger utanför färgomfånget Color Type: Färgtyp: Color: Färg: Colorize Färglägg @@ -2388,7 +2389,6 @@ font-technology Variable Variabla Other Library… Annat bibliotek… Other Script… Annat skript… Out of Gamut Warning Färgomfångsvarning - Show Out-of-Gamut Colors Visa färger utanför färgomfånget Out of Web Color Warning Varning för färg utanför webbfärger Out Tangent Handles Utgående tangenthandtag Outer Glow… Yttre glöd… diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 5f30f03efa..eafcee0d19 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -558,6 +558,7 @@ font-technology Variable Değişken Box Channel Kutu Kanalı Color box Renk kutusu Color Wheel Options Renk Tekerleği Seçenekleri + Show Out-of-Gamut Colors Gamut Dışı Renkleri Göster Color Type: Renk Türü: Color: Renk: Colorize Renklendir @@ -2234,7 +2235,6 @@ shape Open Açık Other Library… Diğer Kütüphane… Other Script… Diğer Komut Dosyası… Out of Gamut Warning Gamut Dışı Uyarısı - Show Out-of-Gamut Colors Gamut Dışı Renkleri Göster Out of Web Color Warning Web Dışı Renk Uyarısı Out Tangent Handles Dışarıya Teğet Tutamaçlar Outer Glow… Dış Parıltı… diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 7b4d5b908b..760b927ada 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -571,6 +571,7 @@ font-technology Variable Варіативні Box Channel Канал квадрата Color box Колірний квадрат Color Wheel Options Параметри колірного кола + Show Out-of-Gamut Colors Показати кольори поза колірним охопленням Color Type: Тип кольору: Color: Колір: Colorize Тонувати @@ -2479,7 +2480,6 @@ file-filter Templates Шаблони Other Library… Інша бібліотека… Other Script… Інша писемність… Out of Gamut Warning Попередження про вихід із колірного охоплення - Show Out-of-Gamut Colors Показати кольори поза колірним охопленням Out of Web Color Warning Попередження про колір, що не підтримується web Out Tangent Handles Маркери вихідної дотичної Outer Glow… Зовнішнє свічення… diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index c37fd34328..bb25880b0a 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -664,6 +664,7 @@ font-technology Variable Biến thiên 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 + Show Out-of-Gamut Colors Hiện màu ngoài dải màu Color Type: Loại màu: Color: Màu: Colorization Tô màu @@ -2743,7 +2744,6 @@ digits Hindi Hindi Other Library… Thư viện khác… Other Script… Script khác… Out of Gamut Warning Cảnh báo ngoài dải màu - Show Out-of-Gamut Colors Hiện màu ngoài dải màu Out of Web Color Warning Cảnh báo ngoài màu web Out Tangent Handles Tay nắm tiếp tuyến ra Outer Corner Tile Ô góc ngoài diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 875aabc8d4..305599550d 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -523,6 +523,7 @@ antiAlias Sharp 锐利 Box Channel 方块色版 Color box 颜色方块 Color Wheel Options 色轮选项 + Show Out-of-Gamut Colors 显示超出色域的颜色 Color Type: 颜色类型: Color: 颜色: Colorize 上色 @@ -2342,7 +2343,6 @@ file-filter Templates 模板 Other Library… 其他库… Other Script… 其他脚本… Out of Gamut Warning 超出色域警告 - Show Out-of-Gamut Colors 显示超出色域的颜色 Out of Web Color Warning 非网页安全色警告 Out Tangent Handles 外切线控制手柄 Outer Glow… 外光晕… diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index b53aa1eb91..3144392377 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -540,6 +540,7 @@ font-technology Variable 可變 Box Channel 方塊色版 Color box 顏色方塊 Color Wheel Options 色輪選項 + Show Out-of-Gamut Colors 顯示超出色域的顏色 Color Type: 顏色類型: Color: 顏色: Colorize 上色 @@ -3558,7 +3559,6 @@ file-filter Templates 範本 Other Library… 其他資料庫… Other Script… 其他指令碼… Out of Gamut Warning 超出色域警告 - Show Out-of-Gamut Colors 顯示超出色域的顏色 Out of Web Color Warning 非網頁安全色警告 Out Tangent Handles 外切線控制把手 Outer Glow… 外光暈… diff --git a/crates/ui-egui/src/panels/color_wheel.rs b/crates/ui-egui/src/panels/color_wheel.rs index 80b4dd76f0..14cc4ebab1 100644 --- a/crates/ui-egui/src/panels/color_wheel.rs +++ b/crates/ui-egui/src/panels/color_wheel.rs @@ -169,9 +169,9 @@ pub(crate) const GAMUT_CELLS: usize = 16; 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 color a pick -/// there stores in the working RGB space. The wheel's square is the box of [`Channel::Hue`] at the -/// ring's hue. +/// 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 [`stored`] converts it to CMYK or Lab. 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]; diff --git a/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs b/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs index 0573b5a37f..fa1bde439d 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs @@ -107,11 +107,18 @@ fn the_cache_computes_once_per_key() { 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(); + let _unregister = Unregister(name); cms::register_icc(&bytes, Some(name.into())).unwrap(); h.run_steps(2); - cms::unregister_icc(name); 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); diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 278ae0282e..da1bffd97b 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -734,8 +734,8 @@ 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 and the out-of-gamut shading (`ui.colorWheel`, - /// [`crate::panels::color_wheel::deserialize_settings`]). + /// Color Wheel panel: the wheel or the box, the box's channel and the out-of-gamut shading + /// (`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 From ca54bdf9fc384c1ece30c87eb035b36e70f8fc97 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 14 Nov 2026 09:35:54 -0800 Subject: [PATCH 14/38] Color Wheel: a test for the gray over out-of-gamut cells - A new test paints a two-by-two grid and checks that the gray covers the marked cells only and that each edge is drawn dark, then light. - The "Show Out-of-Gamut Colors" catalog row moves to right after "Box View", next to the panel's other menu items, in every catalog. - The gamut_grid doc comment says that a pick's color is tested before any conversion to CMYK or Lab, which happens only for some targets. - The test profile's guard is created after the profile registers. --- crates/ui-egui/src/i18n/bg.tsv | 2 +- crates/ui-egui/src/i18n/bs.tsv | 2 +- crates/ui-egui/src/i18n/ca.tsv | 2 +- crates/ui-egui/src/i18n/cs.tsv | 2 +- crates/ui-egui/src/i18n/da.tsv | 2 +- crates/ui-egui/src/i18n/de.tsv | 2 +- crates/ui-egui/src/i18n/el.tsv | 2 +- crates/ui-egui/src/i18n/es.tsv | 2 +- crates/ui-egui/src/i18n/fi.tsv | 2 +- crates/ui-egui/src/i18n/fr.tsv | 2 +- crates/ui-egui/src/i18n/gu.tsv | 2 +- crates/ui-egui/src/i18n/hi.tsv | 2 +- crates/ui-egui/src/i18n/hu.tsv | 2 +- crates/ui-egui/src/i18n/id.tsv | 2 +- crates/ui-egui/src/i18n/it.tsv | 2 +- crates/ui-egui/src/i18n/ja.tsv | 2 +- crates/ui-egui/src/i18n/ka.tsv | 2 +- crates/ui-egui/src/i18n/ko.tsv | 2 +- crates/ui-egui/src/i18n/nl.tsv | 2 +- crates/ui-egui/src/i18n/pl.tsv | 2 +- crates/ui-egui/src/i18n/pt-br.tsv | 2 +- crates/ui-egui/src/i18n/ru.tsv | 2 +- crates/ui-egui/src/i18n/sv.tsv | 2 +- crates/ui-egui/src/i18n/tr.tsv | 2 +- crates/ui-egui/src/i18n/uk.tsv | 2 +- crates/ui-egui/src/i18n/vi.tsv | 2 +- crates/ui-egui/src/i18n/zh-hans.tsv | 2 +- crates/ui-egui/src/i18n/zh-hant.tsv | 2 +- crates/ui-egui/src/panels/color_wheel.rs | 6 ++-- .../src/panels/tests_color_wheel_gamut.rs | 33 ++++++++++++++++++- crates/ui-egui/src/widgets.rs | 4 +-- crates/ui-egui/src/widgets/color.rs | 4 +-- 32 files changed, 67 insertions(+), 36 deletions(-) diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 36488e4c37..127187a417 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -559,10 +559,10 @@ 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 Опции на цветното колело - Show Out-of-Gamut Colors Показване на цветовете извън цветовата гама Color Type: Цветен тип: Color: Цвят: Colorize Оцветяване diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index eee2cb2b4d..e5c68dc192 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -737,10 +737,10 @@ {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 - Show Out-of-Gamut Colors Prikaži boje izvan gamuta CSS Properties CSS svojstva Document Info Informacije o dokumentu Flattener Preview Pregled spljoštavanja diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 6f7a5b84fa..319406b2d2 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -821,10 +821,10 @@ antiAlias Sharp Nítid {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 - Show Out-of-Gamut Colors Mostra els colors fora de gama Color Type: Tipus de color: Color wheel Roda de color Color: Color: diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index aec29f9ab7..755dae9cba 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -750,10 +750,10 @@ {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 - Show Out-of-Gamut Colors Zobrazit barvy mimo gamut CSS Properties Vlastnosti CSS Document Info Informace o dokumentu Flattener Preview Náhled sloučení diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index ca095adf83..1508d851ff 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -695,10 +695,10 @@ {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 - Show Out-of-Gamut Colors Vis farver uden for gamut CSS Properties CSS-egenskaber Document Info Dokumentoplysninger Flattener Preview Udjævningsforhåndsvisning diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 2ce633fe27..5e76cccc62 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -552,10 +552,10 @@ 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 - Show Out-of-Gamut Colors Farben außerhalb des Farbumfangs einblenden Color Type: Farbart: Color: Farbe: Colorize Einfärben diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index e69fb91d61..54b59e3528 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -534,10 +534,10 @@ 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 Επιλογές χρωματικού τροχού - Show Out-of-Gamut Colors Εμφάνιση χρωμάτων εκτός χρωματικής γκάμας Color Type: Τύπος χρώματος: Color: Χρώμα: Colorize Χρωματισμός diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 2e3db2a871..b0802db4fd 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -574,10 +574,10 @@ 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 - Show Out-of-Gamut Colors Mostrar colores fuera de gama Color Type: Tipo de color: Color: Color: Colorize Colorear diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index b94e5bef08..ba2f7738bb 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -741,10 +741,10 @@ {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 - Show Out-of-Gamut Colors Näytä väriavaruuden ulkopuoliset värit CSS Properties CSS-ominaisuudet Document Info Asiakirjan tiedot Flattener Preview Litistyksen esikatselu diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 98451403b1..e5b16e9840 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -575,10 +575,10 @@ 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 - Show Out-of-Gamut Colors Afficher les couleurs hors gamme Color Type: Type de couleur : Color: Couleur : Colorize Coloriser diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 091ee4b820..f80447ab98 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -4226,10 +4226,10 @@ {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View વ્હીલ વ્યૂ Box View બૉક્સ વ્યૂ + Show Out-of-Gamut Colors ગેમટ બહારના રંગો બતાવો Box Channel બૉક્સ ચેનલ Color box રંગ બૉક્સ Color Wheel Options રંગ વ્હીલ વિકલ્પો - Show Out-of-Gamut Colors ગેમટ બહારના રંગો બતાવો {name} (spot) {name} (સ્પૉટ) {pages} in all, {count} per copy કુલ {pages}, પ્રતિ નકલ {count} {page} of {count} {count} માંથી {page} diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 008c4026dd..06fc045228 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -945,10 +945,10 @@ 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 कलर व्हील ऑप्शन्स - Show Out-of-Gamut Colors गैमट से बाहर के रंग दिखाएँ Color Type: रंग का प्रकार: Color wheel कलर व्हील Color: रंग: diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 5dba6b02aa..25eea00278 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -750,10 +750,10 @@ font-technology Variable Változó {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 - Show Out-of-Gamut Colors Színtartományon kívüli színek megjelenítése Color Type: Színtípus: Color: Szín: Colorization Színezés diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index e91af7ace4..1ddef096bc 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -695,10 +695,10 @@ {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 - Show Out-of-Gamut Colors Tampilkan warna di luar gamut CSS Properties Properti CSS Document Info Info dokumen Flattener Preview Pratinjau perata diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 27c45f98e5..71a9e7669a 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -574,10 +574,10 @@ 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 - Show Out-of-Gamut Colors Mostra colori fuori gamma Color Type: Tipo di colore: Color: Colore: Colorize Colora diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index ab10f2a379..70bc0e1c57 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -765,10 +765,10 @@ 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 カラーホイールオプション - Show Out-of-Gamut Colors 色域外のカラーを表示 CSS Properties CSS プロパティ Document Info ドキュメント情報 Flattener Preview 分割・統合プレビュー diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 6a9a3019a3..5221b80bfe 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -661,10 +661,10 @@ {name1} {value1}, {name2} {value2} {name1} {value1}, {name2} {value2} Wheel View წრის ხედი Box View კვადრატის ხედი + Show Out-of-Gamut Colors ფერთა გამის გარეთ მყოფი ფერების ჩვენება Box Channel კვადრატის არხი Color box ფერის კვადრატი Color Wheel Options ფერთა წრის პარამეტრები - Show Out-of-Gamut Colors ფერთა გამის გარეთ მყოფი ფერების ჩვენება CSS Properties CSS თვისებები Document Info დოკუმენტის ინფორმაცია Flattener Preview გაბრტყელების წინასწარი ნახვა diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 097412b714..95a99412a2 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -758,10 +758,10 @@ 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 색상환 옵션 - Show Out-of-Gamut Colors 색상 범위를 벗어난 색상 표시 CSS Properties CSS 속성 Document Info 문서 정보 Flattener Preview 병합 미리 보기 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 0161a073f8..87b7fe0928 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -1213,10 +1213,10 @@ {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 - Show Out-of-Gamut Colors Kleuren buiten gamut tonen CSS Properties CSS-eigenschappen Document Info Documentinfo Flattener Preview Afvlakvoorbeeld diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index f2aa40a565..752fff4f16 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -699,10 +699,10 @@ {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 - Show Out-of-Gamut Colors Pokaż kolory poza gamutem CSS Properties Właściwości CSS Document Info Informacje o dokumencie Flattener Preview Podgląd spłaszczania diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index c08a266e9f..0765eb04b0 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -519,10 +519,10 @@ 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 - Show Out-of-Gamut Colors Mostrar Cores Fora do Gamut Color Type: Tipo de Cor: Color blindness – Deuteranopia-type Daltonismo – tipo deuteranopia Color blindness – Protanopia-type Daltonismo – tipo protanopia diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 3bd0a834c1..7f5b8bd375 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -572,10 +572,10 @@ 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 Параметры цветового круга - Show Out-of-Gamut Colors Показать цвета вне цветового охвата Color Type: Тип цвета: Color: Цвет: Colorize Тонировать diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 8e7fbfe533..26b5f6be86 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -561,10 +561,10 @@ 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 - Show Out-of-Gamut Colors Visa färger utanför färgomfånget Color Type: Färgtyp: Color: Färg: Colorize Färglägg diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index eafcee0d19..0f6ffc23df 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -555,10 +555,10 @@ 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 - Show Out-of-Gamut Colors Gamut Dışı Renkleri Göster Color Type: Renk Türü: Color: Renk: Colorize Renklendir diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 760b927ada..a2048a6dc5 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -568,10 +568,10 @@ 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 Параметри колірного кола - Show Out-of-Gamut Colors Показати кольори поза колірним охопленням Color Type: Тип кольору: Color: Колір: Colorize Тонувати diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index bb25880b0a..665a1b3e37 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -661,10 +661,10 @@ 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 - Show Out-of-Gamut Colors Hiện màu ngoài dải màu Color Type: Loại màu: Color: Màu: Colorization Tô màu diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 305599550d..dff948e79b 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -520,10 +520,10 @@ 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 色轮选项 - Show Out-of-Gamut Colors 显示超出色域的颜色 Color Type: 颜色类型: Color: 颜色: Colorize 上色 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 3144392377..99e651243c 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -537,10 +537,10 @@ 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 色輪選項 - Show Out-of-Gamut Colors 顯示超出色域的顏色 Color Type: 顏色類型: Color: 顏色: Colorize 上色 diff --git a/crates/ui-egui/src/panels/color_wheel.rs b/crates/ui-egui/src/panels/color_wheel.rs index 14cc4ebab1..64c75fa5aa 100644 --- a/crates/ui-egui/src/panels/color_wheel.rs +++ b/crates/ui-egui/src/panels/color_wheel.rs @@ -169,9 +169,9 @@ pub(crate) const GAMUT_CELLS: usize = 16; 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 [`stored`] converts it to CMYK or Lab. The wheel's square is the box of -/// [`Channel::Hue`] at the ring's hue. +/// 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]; diff --git a/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs b/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs index fa1bde439d..f24329b69d 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs @@ -116,8 +116,8 @@ fn the_grid_is_computed_again_after_a_profile_is_loaded() { } let name = "Color Wheel Gamut Reload CMYK"; let bytes = cms::icc_bytes(cms::GENERIC_CMYK).unwrap(); - let _unregister = Unregister(name); 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)); @@ -221,3 +221,34 @@ fn the_edge_runs_between_marked_and_unmarked_cells() { 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/widgets.rs b/crates/ui-egui/src/widgets.rs index 1c36c9fc1a..9625774112 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -34,14 +34,14 @@ pub(crate) use buttons::{button_width, icon_button_info, primary_button_width, s #[cfg(test)] 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}; -#[cfg(test)] -pub(crate) use color::shade_edges; pub use color::{ FieldAxis, Live, RingResponse, SliderValue, WheelResponse, channel_slider, channel_slider_named, 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, region_texture, ring_square, segment_color, segmented_wheel, stepped_area, }; pub(crate) use color::{HEX_FIELD_CHARS, 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_drop, doc_preview, 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 21ddb3fb85..d2c1ce311d 100644 --- a/crates/ui-egui/src/widgets/color.rs +++ b/crates/ui-egui/src/widgets/color.rs @@ -463,7 +463,7 @@ pub fn color_field_shaded( } /// The gray over a shaded cell of a [`color_field_shaded`]. -const SHADE: Color32 = Color32::from_rgba_premultiplied(96, 96, 96, 192); +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 { @@ -491,7 +491,7 @@ pub(crate) fn shade_edges(shade: &[u16]) -> Vec<[(usize, usize); 2]> { /// Gray out the cells `shade` marks over `rect`, and draw the lines between them and the others /// dark under light. -fn shade_cells(painter: &egui::Painter, rect: Rect, shade: &[u16]) { +pub(crate) fn shade_cells(painter: &egui::Painter, rect: Rect, shade: &[u16]) { let n = shade.len().min(16); if n == 0 { return; From 8a7f0a2c392ca7b796c1709f96676ad4faf18d82 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 14 Nov 2026 14:58:17 -0800 Subject: [PATCH 15/38] i18n: Danish rows for custom bevel messages --- crates/ui-egui/src/i18n/da.tsv | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 0770ce4d1d..d0af6ffe96 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -292,7 +292,10 @@ @msg The 3D object is too complex to export 3D-objektet er for komplekst til at blive eksporteret @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 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 From e407e7e0346d28a2264718c37e62724667e34eac Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 10:11:59 -0800 Subject: [PATCH 16/38] Command Palette: Clear Recent Commands empties the recent list Clear Recent Commands (help.clearRecentCommands) empties the picks that an empty search and the Recent Commands list show, and the saved ids with them. A pick of it in the search is not kept as a recent pick. command_list reports it as not enabled while no ids are saved. - The label has a row in every catalog that translates the Recent Commands strings. - crates/mcp/src/ui_catalog.rs is regenerated with cargo xtask ui-commands. - Docs: a Recent commands section in docs/mcp.md and a line in docs/target-app-parity.md. - Test: clear_recent_commands_empties_the_recent_picks. --- crates/mcp/src/ui_catalog.rs | 6 +++++ crates/ui-egui/src/i18n/bg.tsv | 1 + crates/ui-egui/src/i18n/bs.tsv | 1 + crates/ui-egui/src/i18n/ca.tsv | 1 + crates/ui-egui/src/i18n/cs.tsv | 1 + crates/ui-egui/src/i18n/da.tsv | 1 + crates/ui-egui/src/i18n/de.tsv | 1 + crates/ui-egui/src/i18n/el.tsv | 1 + crates/ui-egui/src/i18n/es.tsv | 1 + crates/ui-egui/src/i18n/fi.tsv | 1 + crates/ui-egui/src/i18n/fr.tsv | 1 + crates/ui-egui/src/i18n/gu.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 1 + crates/ui-egui/src/i18n/hu.tsv | 1 + crates/ui-egui/src/i18n/id.tsv | 1 + crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/ja.tsv | 1 + crates/ui-egui/src/i18n/ka.tsv | 1 + crates/ui-egui/src/i18n/ko.tsv | 1 + crates/ui-egui/src/i18n/nl.tsv | 1 + crates/ui-egui/src/i18n/pl.tsv | 1 + crates/ui-egui/src/i18n/pt-br.tsv | 1 + crates/ui-egui/src/i18n/ru.tsv | 1 + crates/ui-egui/src/i18n/sv.tsv | 1 + crates/ui-egui/src/i18n/tr.tsv | 1 + crates/ui-egui/src/i18n/uk.tsv | 1 + crates/ui-egui/src/i18n/vi.tsv | 1 + crates/ui-egui/src/i18n/zh-hans.tsv | 1 + crates/ui-egui/src/i18n/zh-hant.tsv | 1 + crates/ui-egui/src/menus/run.rs | 5 ++++ crates/ui-egui/src/menus/state.rs | 1 + crates/ui-egui/src/menus/ui_commands.rs | 6 +++++ crates/ui-egui/src/palette.rs | 35 +++++++++++++++++++++++++ docs/mcp.md | 9 +++++++ docs/target-app-parity.md | 1 + 35 files changed, 91 insertions(+) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 3066e8e835..45feefdb82 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -872,6 +872,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) and the saved list; a pick of it is not kept as a recent pick. Not enabled while no picks are saved", + ), ( "help.safeMode", "Safe Mode…", diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 851f9691e1..97b5f09757 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -3182,6 +3182,7 @@ digits Malayalam Малаялам @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} от {n} резултат. Продължете да пишете, за да ги стесните.|{shown} от {n} резултата. Продължете да пишете, за да ги стесните. Recent Commands Последни команди No recent commands Няма последни команди + Clear Recent Commands Изчистване на последните команди Search Commands… Търсене на команди… Secondary Вторичен Section Symbol Символ за раздел diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 187d50ccd4..2f6c44a627 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -4376,6 +4376,7 @@ font-technology Variable Varijabilni @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} od {n} rezultata. Nastavite kucati da ih suzite.|{shown} od {n} rezultata. Nastavite kucati da ih suzite.|{shown} od {n} rezultata. Nastavite kucati da ih suzite. Recent Commands Nedavne naredbe No recent commands Nema nedavnih naredbi + 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 73b3f70001..3f0c85eaa2 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -4109,6 +4109,7 @@ digits Malayalam Malaiàlam @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} de {n} resultat. Continueu escrivint per reduir-los.|{shown} de {n} resultats. Continueu escrivint per reduir-los. Recent Commands Ordres recents No recent commands No hi ha ordres recents + Clear Recent Commands Esborra les ordres recents Search Commands… Cerca ordres… Search Fonts Folder Cerca a la carpeta de tipus de lletra Searching… Cercant… diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index ec22e49cb8..91fe2ec315 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4481,6 +4481,7 @@ font-technology Variable Variabilní @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} z {n} výsledku. Pište dál a výsledky se zúží.|{shown} z {n} výsledků. Pište dál a výsledky se zúží.|{shown} z {n} výsledků. Pište dál a výsledky se zúží. Recent Commands Nedávné příkazy No recent commands Žádné nedávné příkazy + Clear Recent Commands Vymazat seznam nedávných příkazů Dashed Line Čárkovaná čára Panel menu Nabídka panelu Unembed… Zrušit vložení… diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 5dbf175b99..4826d111a8 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -6853,6 +6853,7 @@ font-technology Variable Variable @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} af {n} resultat. Skriv videre for at indsnævre dem.|{shown} af {n} resultater. Skriv videre for at indsnævre dem. Recent Commands Seneste kommandoer No recent commands Ingen seneste kommandoer + 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 969840f177..6fe46bf76a 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -3246,6 +3246,7 @@ digits Malayalam Malayalam @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} von {n} Ergebnis. Tippen Sie weiter, um sie einzugrenzen.|{shown} von {n} Ergebnissen. Tippen Sie weiter, um sie einzugrenzen. Recent Commands Zuletzt verwendete Befehle No recent commands Keine zuletzt verwendeten Befehle + Clear Recent Commands Liste der zuletzt verwendeten Befehle leeren Search Commands… Befehle suchen… Secondary Sekundär Section Symbol Paragrafenzeichen diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 6d45c60ea2..bda4c0153b 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -3947,6 +3947,7 @@ digits Malayalam Μαλαγιάλαμ @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} από {n} αποτέλεσμα. Συνεχίστε να πληκτρολογείτε για να τα περιορίσετε.|{shown} από {n} αποτελέσματα. Συνεχίστε να πληκτρολογείτε για να τα περιορίσετε. Recent Commands Πρόσφατες εντολές No recent commands Δεν υπάρχουν πρόσφατες εντολές + Clear Recent Commands Εκκαθάριση πρόσφατων εντολών Search Commands… Αναζήτηση εντολών… Secondary Δευτερεύον Section Symbol Σύμβολο ενότητας diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 4cd374d26a..5a962f2a13 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -3280,6 +3280,7 @@ digits Malayalam Malayálam @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} de {n} resultado. Sigue escribiendo para acotarlos.|{shown} de {n} resultados. Sigue escribiendo para acotarlos. Recent Commands Comandos recientes No recent commands No hay comandos recientes + Clear Recent Commands Borrar comandos recientes Search Commands… Buscar comandos… Secondary Secundario Section Symbol Símbolo de sección diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 14e3983e0d..4ede1bdbce 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4400,6 +4400,7 @@ font-technology Variable Muuttuvat @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown}/{n} tulosta. Kirjoita lisää rajataksesi tuloksia.|{shown}/{n} tulosta. Kirjoita lisää rajataksesi tuloksia. Recent Commands Viimeisimmät komennot No recent commands Ei viimeisimpiä komentoja + Clear Recent Commands Tyhjennä viimeisimmät komennot Dashed Line Katkoviiva Panel menu Paneelivalikko Unembed… Poista upotus… diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index c1cb1bdc10..c11644b4ef 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -3272,6 +3272,7 @@ digits Malayalam Malayalam @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} sur {n} résultat. Continuez à taper pour les affiner.|{shown} sur {n} résultats. Continuez à taper pour les affiner. Recent Commands Commandes récentes No recent commands Aucune commande récente + Clear Recent Commands Effacer les commandes récentes Search Commands… Rechercher des commandes… Secondary Secondaire Section Symbol Symbole de section diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index beffa5a79d..01889a0c6e 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -3371,6 +3371,7 @@ @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} માંથી {shown} પરિણામ. તેમને સંકુચિત કરવા લખતા રહો.|{n} માંથી {shown} પરિણામો. તેમને સંકુચિત કરવા લખતા રહો. Recent Commands તાજેતરના આદેશો No recent commands કોઈ તાજેતરના આદેશો નથી + Clear Recent Commands તાજેતરના આદેશો સાફ કરો Search images છબીઓ શોધો Searching… શોધી રહ્યા છીએ… Secondary ગૌણ diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 0f3ae23348..550e6d9388 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -4461,6 +4461,7 @@ antiAlias Sharp शार्प @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} में से {shown} परिणाम। इन्हें सीमित करने के लिए लिखते रहें।|{n} में से {shown} परिणाम। इन्हें सीमित करने के लिए लिखते रहें। Recent Commands हाल के आदेश No recent commands कोई हाल का आदेश नहीं + Clear Recent Commands हाल के आदेश साफ़ करें Search Commands… कमांड खोजें… Search Fonts Folder खोज फ़ॉन्ट फ़ोल्डर Search images इमेज खोजना diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index a7d31f9532..669b5e8cf6 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3900,6 +3900,7 @@ mark-style Japanese Japán @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} találatból {shown} látható. Gépeljen tovább a szűkítéshez. Recent Commands Legutóbbi parancsok No recent commands Nincsenek legutóbbi parancsok + Clear Recent Commands Legutóbbi parancsok listájának törlése Search Commands… Parancsok keresése… Search Fonts Folder Keresés betűtípusmappában Searching… Keresés… diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 2d8a08c1a8..b8ec96504b 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -4132,6 +4132,7 @@ font-technology Variable Variabel @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} dari {n} hasil. Terus ketik untuk mempersempitnya. Recent Commands Perintah terbaru No recent commands Tidak ada perintah terbaru + 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 f704097324..02d35ee9bb 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -3323,6 +3323,7 @@ digits Malayalam Malayalam @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} di {n} risultato. Continua a digitare per restringerli.|{shown} di {n} risultati. Continua a digitare per restringerli. Recent Commands Comandi recenti No recent commands Nessun comando recente + Clear Recent Commands Cancella comandi recenti Search Commands… Cerca comandi… Secondary Secondario Section Symbol Simbolo di sezione diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 8a93f04936..158a276eb1 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -3201,6 +3201,7 @@ mark-style Japanese 日本式 @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} 件中 {shown} 件。続けて入力すると絞り込めます。 Recent Commands 最近使ったコマンド No recent commands 最近使ったコマンドはありません + Clear Recent Commands 最近使ったコマンドを消去 Secondary セカンダリ Select All Art on Layer レイヤー上のすべてのアートを選択 Select All Assets すべてのアセットを選択 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index d57efa8e1f..cdfb90ed6c 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6084,6 +6084,7 @@ font-technology Variable ცვლადი @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} შედეგიდან {shown}. გააგრძელეთ აკრეფა მათ შესამცირებლად. Recent Commands ბოლო ბრძანებები No recent commands ბოლო ბრძანებები არ არის + Clear Recent Commands ბოლო ბრძანებების სიის გასუფთავება Dashed Line ტირეებიანი ხაზი Panel menu პანელის მენიუ Unembed… ჩაშენების მოხსნა… diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index d08f8919e1..6ae6f01a23 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3190,6 +3190,7 @@ mark-style Japanese 일본식 @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. 결과 {n}개 중 {shown}개. 계속 입력하여 범위를 좁히세요. Recent Commands 최근 명령 No recent commands 최근 명령 없음 + Clear Recent Commands 최근 명령 목록 지우기 Secondary 보조 Select All Art on Layer 레이어의 모든 아트웍 선택 Select All Assets 모든 에셋 선택 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 916f70a9b3..14d5b80688 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -4747,6 +4747,7 @@ font-technology Variable Variabel @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} van {n} resultaat. Typ verder om ze te beperken.|{shown} van {n} resultaten. Typ verder om ze te beperken. Recent Commands Recente opdrachten No recent commands Geen recente opdrachten + Clear Recent Commands Recente opdrachten wissen Dashed Line Streepjeslijn Panel menu Paneelmenu Unembed… Insluiten ongedaan maken… diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index c8815c637e..c939a823f7 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4322,6 +4322,7 @@ font-technology Variable Zmienne @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} z {n} wyniku. Pisz dalej, aby je zawęzić.|{shown} z {n} wyników. Pisz dalej, aby je zawęzić.|{shown} z {n} wyników. Pisz dalej, aby je zawęzić. Recent Commands Ostatnie polecenia No recent commands Brak ostatnich poleceń + Clear Recent Commands Wyczyść listę ostatnich poleceń Dashed Line Linia przerywana Panel menu Menu panelu Unembed… Wyodrębnij… diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index eceda253e3..f77b39a00b 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2739,6 +2739,7 @@ digits Malayalam Malaiala @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} de {n} resultado. Continue digitando para filtrá-los.|{shown} de {n} resultados. Continue digitando para filtrá-los. Recent Commands Comandos recentes No recent commands Nenhum comando recente + Clear Recent Commands Limpar Comandos Recentes Secondary Secundária Section Symbol Símbolo de Seção Select Selecionar diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 1157c3324e..67bcf11052 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -3312,6 +3312,7 @@ digits Malayalam Малаялам @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} из {n} результата. Продолжайте вводить, чтобы сузить их.|{shown} из {n} результатов. Продолжайте вводить, чтобы сузить их.|{shown} из {n} результатов. Продолжайте вводить, чтобы сузить их. Recent Commands Недавние команды No recent commands Нет недавних команд + Clear Recent Commands Очистить список недавних команд Search Commands… Поиск команд… Secondary Вторичный Section Symbol Символ параграфа diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index a541de505b..7b956a8664 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -3202,6 +3202,7 @@ digits Malayalam Malayalam @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} av {n} resultat. Fortsätt skriva för att begränsa dem.|{shown} av {n} resultat. Fortsätt skriva för att begränsa dem. Recent Commands Senaste kommandon No recent commands Inga senaste kommandon + Clear Recent Commands Rensa senaste kommandon Search Commands… Sök kommandon… Secondary Sekundär Section Symbol Paragraftecken diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 4693bcc373..cab47afbc6 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -3073,6 +3073,7 @@ digits Malayalam Malayalam @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} sonuçtan {shown} tanesi. Daraltmak için yazmaya devam edin. Recent Commands Son komutlar No recent commands Son komut yok + Clear Recent Commands Son Komutları Temizle Search Commands… Arama Komutları… Secondary İkincil Section Symbol Bölüm Sembolü diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 6720cd5152..15a3f98e19 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -3315,6 +3315,7 @@ digits Malayalam Малаялам @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} з {n} результату. Продовжуйте вводити, щоб звузити їх.|{shown} з {n} результатів. Продовжуйте вводити, щоб звузити їх.|{shown} з {n} результатів. Продовжуйте вводити, щоб звузити їх. Recent Commands Нещодавні команди No recent commands Немає нещодавніх команд + Clear Recent Commands Очистити список нещодавніх команд Search Commands… Пошук команд… Secondary Вторинний Section Symbol Символ параграфа diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index c98a7543c5..c225cbe866 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3657,6 +3657,7 @@ mark-style Japanese Kiểu Nhật @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} trên {n} kết quả. Tiếp tục gõ để thu hẹp. Recent Commands Lệnh gần đây No recent commands Không có lệnh gần đây + Clear Recent Commands Xóa lệnh gần đây Search Commands… Tìm kiếm lệnh… Search Fonts Folder Tìm kiếm thư mục phông chữ Searching… Đang tìm kiếm… diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index ea94e537ca..2aa86f820b 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -3142,6 +3142,7 @@ digits Malayalam 马拉雅拉姆数字 @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. 共 {n} 个结果,显示 {shown} 个。继续输入以缩小范围。 Recent Commands 最近使用的命令 No recent commands 没有最近使用的命令 + Clear Recent Commands 清除最近使用的命令 Search Commands… 搜索命令… Secondary 次要 Section Symbol 章节符号 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index e72dd522cb..a2e00e5efb 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -4447,6 +4447,7 @@ digits Malayalam 馬來亞拉姆數字 @plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. 共 {n} 個結果,顯示 {shown} 個。繼續輸入以縮小範圍。 Recent Commands 最近使用的指令 No recent commands 沒有最近使用的指令 + Clear Recent Commands 清除最近使用的指令 Search Commands… 搜尋指令… Secondary 次要 Section Symbol 章節符號 diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 495e606d6c..91b455314f 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -733,6 +733,11 @@ fn run_ui_part7(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option { + app.ui.recent_commands.clear(); + Ok(Value::Null) + } // Closing asks Save / Don't Save / Cancel for modified documents first (`unsaved`). // Without an `index`, the current window closes: one of several views of a document closes // without closing the document (Window › New Window). diff --git a/crates/ui-egui/src/menus/state.rs b/crates/ui-egui/src/menus/state.rs index d4dda4698b..bd4417aea9 100644 --- a/crates/ui-egui/src/menus/state.rs +++ b/crates/ui-egui/src/menus/state.rs @@ -249,6 +249,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(), 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 e4806b0457..4485b00a20 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -873,6 +873,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) and the saved list; a pick of it is not kept as a recent pick. Not enabled while no picks are saved", + ), ( "help.safeMode", "Safe Mode…", diff --git a/crates/ui-egui/src/palette.rs b/crates/ui-egui/src/palette.rs index 6b01518575..fef34624eb 100644 --- a/crates/ui-egui/src/palette.rs +++ b/crates/ui-egui/src/palette.rs @@ -1483,6 +1483,41 @@ 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 there are none, 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!("No recent commands")), "{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()); + } + /// 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() { diff --git a/docs/mcp.md b/docs/mcp.md index 29b57dc20f..bc099a4f2f 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3072,6 +3072,15 @@ 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. `help.clearRecentCommands {}` (Clear Recent Commands) empties the list and the saved ids, and +returns `null`. A pick of it in the search is not kept as a recent pick. It is a UI command, so it needs the desktop +app (`--connect`); `command_list` gives it `enabled: false` while no ids 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. + ## Navigator panel options The Navigator panel menu's Panel Options… opens the `navigatorPanelOptions` dialog (fields `color`, `solidDashes`), diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 2f125432b3..3fd58b3b38 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1008,6 +1008,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Perspective Distort and Free Distort (`object.distort`) turn each warped object's bounding box as the warp turns the object at its own center, the objects inside groups, compound paths and clip groups and the art of linked opacity masks included, so the next Selection or Free Transform drag uses the tilted box; Object › Transform › Reset Bounding Box squares it again, and corners left where they are add no undo step (VectorCraft's own rule; `bboxrotate::distort_turns_an_upright_box_with_the_warp_at_its_center`, `distort_turns_each_member_and_linked_mask_by_its_own_warp`, `mirrored_and_collapsing_distorts_keep_valid_angles`, `distort_angles_undo_redo_and_reopen_together`, `xform::unchanged_distort_records_no_history`). - The Free Transform widget's Constrain works in Free Distort as well as in Free Transform ([the help page](https://helpx.adobe.com/illustrator/using/tool-techniques/free-transform-tool.html)). With Constrain on, or Shift held, a corner dragged in Free Distort moves only along the line through the opposite corner, in the box's own proportions, and the other three corners stay in place; on a turned box the line runs through the box's own corners. The line is VectorCraft's own rule. Cmd/Ctrl+Alt+Shift on a corner still drags in Perspective Distort, where Constrain stays unavailable (tools `xform::free::tests::free_distort_corner_keeps_to_its_diagonal_with_shift_or_constrain`, `shift_pressed_during_a_free_distort_drag_constrains_it`, `a_turned_box_is_constrained_along_its_own_diagonal`, `along_diagonal_of_a_degenerate_box`; engine `xform::free_transform_constrained_distort_keeps_the_corner_on_its_diagonal`; ui-egui `free_transform::tests::the_widget_sets_the_mode_and_a_corner_drag_then_distorts`). - 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). + - Clear Recent Commands (`help.clearRecentCommands`), found through Help › Search Commands…, empties the Recent Commands list, the list an empty search shows and the saved list. A pick of it is not kept as a recent pick. This is VectorCraft's own behavior (`palette` test `clear_recent_commands_empties_the_recent_picks`). - A Recent Commands button beside the Help › Search Commands field lists the last five commands and tools picked from the palette, most recent first, with a command picked again moved to the top. 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 Command Palette lists the picks of the Recent Commands list under a Recent Commands heading, most recent first, with the first highlighted and no result count, so opening the palette and pressing Enter runs the last pick again. With no picks yet it lists no results and shows a dimmed No recent commands line. 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_there_are_none`, `enter_on_an_empty_search_runs_the_last_pick_again`, `the_palette_opens_again_with_its_first_row_highlighted`). - The Learn panel (Window › Learn, or Explore tutorials beside the search icon on the app bar) has a For you tab with a Get started section and a Quick skill guide card, and a Skills tab that lists VectorCraft's own skills with their progress rings and counts of tutorials finished; a skill lists its tutorials, a tutorial shows its numbered steps, and Back goes up a level; `learn.list`, `learn.tab {tab}`, `learn.skill {skill}`, `learn.show {tutorial}` and `learn.back` script it, and the tab buttons, the rows and Back run them ([the help page](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/learn-skills-quick-skill-guide.html); `panels::learn::tests`). From 423537497ea2a5f4c21e3fc108fde8a5d7a4c6bd Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 17:37:51 -0800 Subject: [PATCH 17/38] Command Palette: Clear Recent Commands also empties the pick counts Clear Recent Commands (help.clearRecentCommands) now empties the pick counts that rank the results, with the recent list and the saved ids. command_list reports it as enabled while a pick or a count is saved. - A pick from the search is counted when Recent Commands records it, before it runs, so a pick of Clear Recent Commands is cleared with the rest and is not counted afterward. A refused pick puts the counts back as it puts the list back. - The command's params text, docs/mcp.md and the two lines in docs/target-app-parity.md say so; crates/mcp/src/ui_catalog.rs carries the same params text. - Test: clear_recent_commands_also_clears_the_pick_counts. --- crates/mcp/src/ui_catalog.rs | 2 +- crates/ui-egui/src/menus/run.rs | 1 + crates/ui-egui/src/menus/state.rs | 2 +- crates/ui-egui/src/menus/ui_commands.rs | 2 +- crates/ui-egui/src/palette.rs | 53 ++++++++++++++++++++----- docs/mcp.md | 9 +++-- docs/target-app-parity.md | 4 +- 7 files changed, 55 insertions(+), 18 deletions(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 3d7a3334f5..861febd552 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -876,7 +876,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "help.clearRecentCommands", "Clear Recent Commands", "", - "{} empty the recent picks of Help › Search Commands (the list an empty search shows and the Recent Commands list) and the saved list; a pick of it is not kept as a recent pick. Not enabled while no picks are saved", + "{} 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.safeMode", diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 53527601bb..b40b3da596 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -736,6 +736,7 @@ fn run_ui_part7(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option { 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 bd4417aea9..cfe6cf9852 100644 --- a/crates/ui-egui/src/menus/state.rs +++ b/crates/ui-egui/src/menus/state.rs @@ -249,7 +249,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(), + "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 44f333cf41..fad73b83f5 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -877,7 +877,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "help.clearRecentCommands", "Clear Recent Commands", "", - "{} empty the recent picks of Help › Search Commands (the list an empty search shows and the Recent Commands list) and the saved list; a pick of it is not kept as a recent pick. Not enabled while no picks are saved", + "{} 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.safeMode", diff --git a/crates/ui-egui/src/palette.rs b/crates/ui-egui/src/palette.rs index b0b56cb09d..d57e612a9a 100644 --- a/crates/ui-egui/src/palette.rs +++ b/crates/ui-egui/src/palette.rs @@ -685,6 +685,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 { @@ -1021,18 +1026,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; @@ -1946,6 +1951,36 @@ mod tests { 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() { diff --git a/docs/mcp.md b/docs/mcp.md index b20661a3e9..61f8351f6f 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3140,10 +3140,11 @@ dropped. 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. `help.clearRecentCommands {}` (Clear Recent Commands) empties the list and the saved ids, and -returns `null`. A pick of it in the search is not kept as a recent pick. It is a UI command, so it needs the desktop -app (`--connect`); `command_list` gives it `enabled: false` while no ids 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. +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. ## Navigator panel options diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index faf5b575fd..32ca49b7ff 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1026,7 +1026,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Perspective Distort and Free Distort (`object.distort`) turn each warped object's bounding box as the warp turns the object at its own center, the objects inside groups, compound paths and clip groups and the art of linked opacity masks included, so the next Selection or Free Transform drag uses the tilted box; Object › Transform › Reset Bounding Box squares it again, and corners left where they are add no undo step (VectorCraft's own rule; `bboxrotate::distort_turns_an_upright_box_with_the_warp_at_its_center`, `distort_turns_each_member_and_linked_mask_by_its_own_warp`, `mirrored_and_collapsing_distorts_keep_valid_angles`, `distort_angles_undo_redo_and_reopen_together`, `xform::unchanged_distort_records_no_history`). - The Free Transform widget's Constrain works in Free Distort as well as in Free Transform ([the help page](https://helpx.adobe.com/illustrator/using/tool-techniques/free-transform-tool.html)). With Constrain on, or Shift held, a corner dragged in Free Distort moves only along the line through the opposite corner, in the box's own proportions, and the other three corners stay in place; on a turned box the line runs through the box's own corners. The line is VectorCraft's own rule. Cmd/Ctrl+Alt+Shift on a corner still drags in Perspective Distort, where Constrain stays unavailable (tools `xform::free::tests::free_distort_corner_keeps_to_its_diagonal_with_shift_or_constrain`, `shift_pressed_during_a_free_distort_drag_constrains_it`, `a_turned_box_is_constrained_along_its_own_diagonal`, `along_diagonal_of_a_degenerate_box`; engine `xform::free_transform_constrained_distort_keeps_the_corner_on_its_diagonal`; ui-egui `free_transform::tests::the_widget_sets_the_mode_and_a_corner_drag_then_distorts`). - 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). - - Clear Recent Commands (`help.clearRecentCommands`), found through Help › Search Commands…, empties the Recent Commands list, the list an empty search shows and the saved list. A pick of it is not kept as a recent pick. This is VectorCraft's own behavior (`palette` test `clear_recent_commands_empties_the_recent_picks`). + - 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 and tools 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; 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`). - The Learn panel (Window › Learn, or Explore tutorials beside the search icon on the app bar) has a For you tab with a Get started section and a Quick skill guide card, and a Skills tab that lists VectorCraft's own skills with their progress rings and counts of tutorials finished; a skill lists its tutorials, a tutorial shows its numbered steps, and Back goes up a level; `learn.list`, `learn.tab {tab}`, `learn.skill {skill}`, `learn.show {tutorial}` and `learn.back` script it, and the tab buttons, the rows and Back run them ([the help page](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/learn-skills-quick-skill-guide.html); `panels::learn::tests`). @@ -1338,7 +1338,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur A Command Palette query word with a typo still finds the result: "gruop" lists Object › Group first, and "eyedroper", "rectange" and "elipse" list the same first results as the words spelled right, the Eyedropper, Rectangle and Ellipse tools among them. When a query word of 4 or more letters is not a word, a base word or the start of a word of any result's name, menu path or id, the search compares it with the words of result names and menu paths, and a word 1 edit away (2 for a query word of 8 or more letters) matches; a letter added, left out or changed, or two letters next to each other swapped, is one edit. A query word meets at most the 32 nearest such words. Results matched through a typo come after every result the query matches without one, and among them the query is read with the misspelled word replaced by the word it meets, so they come in the order the word spelled right gives; then a result whose label holds the word comes before one whose menu path holds it. Ids, and query words and result words with Chinese, Japanese or Korean letters, are not compared this way, and results without typos keep their order (`palette::search` tests `edits_are_counted_up_to_a_bound`, `a_word_with_a_typo_finds_the_result`, `a_typo_meets_at_most_32_words`, `misspelled_words_find_the_command`). A Command Palette query word also finds a result whose name or menu path holds a word with the same meaning: "remove bg" lists Remove Background… first, "outline text" lists Type › Create Outlines first, and "flip", "combine", "vectorize" and "colour" list Reflect…, Unite, an Image Trace command and the Color panel among the first 3 results. The words come from VectorCraft's own table of 21 groups of English words (`palette/words.rs`, at most 60 groups of at most 6 words); a word that is the whole label of another command, such as Merge or Mirror, is in no group, and neither is Insert. A word or its English base word that is in a group meets the other words of its group in labels and menu paths, and their base words, but not ids or word starts. A result whose label holds the word itself ranks above one whose label holds a word with the same meaning, which ranks above one whose menu path holds the word, so "type" now lists Scale Text Attributes above Type › Orientation › Vertical. A catalog may add a group's words in its language with a row in the `search` context (the group's English words joined by ", ", then that language's words), used while that language is the UI language; no catalog has to have these rows (`palette::search` tests `a_word_with_the_same_meaning_finds_the_result`, `a_catalog_row_adds_words_to_a_group`, `words_with_the_same_meaning_find_the_command`; `palette::words` tests; `i18n` test `search_rows_name_a_group_and_add_single_words`). The Command Palette ranks the commands listed in Recent Commands first among the results that match a query as well as they do, the most recent first, and below every result that matches it better: after a pick of Effect › Convert to Shape › Rectangle…, "rect" lists it above the Rectangle Tool, so Enter runs it again. A recent pick ranks after the whole-query match, the word grades and the matches through a typo, a description or a word with the same meaning, and before the kind of result and the name's length. The ranking uses the list Recent Commands shows. This is VectorCraft's own behavior (`palette::search` test `a_recent_pick_ranks_first_within_its_grades`; `palette` tests `a_recent_pick_ranks_first_among_results_that_match_as_well`, `the_kept_ranking_follows_the_recent_picks`). - The Command Palette also counts how many times each command is picked and ranks the commands picked most often first among the results that match a query as well as they do, also after they leave Recent Commands, and below every result that matches it better. A pick is counted only when Recent Commands records it, so a refused pick and a pick of Search Commands… are not counted. Counts are compared in grades that double: grade 1 starts at 1 pick, grade 2 at 3, grade 3 at 7, and so on up to grade 9, and a command picked once ranks above the commands never picked. The grade ranks after the word grades and the typo, description and same-meaning matches, and before the place among the recent picks. The count is kept for at most 200 commands: a new command then removes, of the half of the commands picked longest ago, the one with the fewest picks, of those the one picked longest ago. When a count reaches 1,000, every count is halved and commands left at 0 are dropped. The counts are saved with the other interface settings (`command_uses` in `ui.json`); a count above 999 loads as 999 and an unreadable entry is dropped. The web build keeps them for the session. This is VectorCraft's own behavior (`palette::search` test `a_command_picked_often_ranks_first_within_its_grades`; `palette` tests `a_command_picked_often_ranks_first_among_results_that_match_as_well`, `the_kept_ranking_follows_the_pick_counts`, `a_count_does_not_pass_a_better_match`, `pick_counts_rank_in_grades_that_double`, `the_201st_command_removes_the_least_used_and_keeps_itself`, `new_commands_build_up_counts_when_every_counted_one_has_more_picks`, `counts_are_halved_at_one_thousand`, `saved_pick_counts_load_what_is_readable`, `only_a_pick_recorded_in_recent_commands_is_counted`). + The Command Palette also counts how many times each command is picked and ranks the commands picked most often first among the results that match a query as well as they do, also after they leave Recent Commands, and below every result that matches it better. A pick is counted only when Recent Commands records it, so a refused pick and a pick of Search Commands… are not counted. Clear Recent Commands empties the counts with the list, and a pick of it is not counted. Counts are compared in grades that double: grade 1 starts at 1 pick, grade 2 at 3, grade 3 at 7, and so on up to grade 9, and a command picked once ranks above the commands never picked. The grade ranks after the word grades and the typo, description and same-meaning matches, and before the place among the recent picks. The count is kept for at most 200 commands: a new command then removes, of the half of the commands picked longest ago, the one with the fewest picks, of those the one picked longest ago. When a count reaches 1,000, every count is halved and commands left at 0 are dropped. The counts are saved with the other interface settings (`command_uses` in `ui.json`); a count above 999 loads as 999 and an unreadable entry is dropped. The web build keeps them for the session. This is VectorCraft's own behavior (`palette::search` test `a_command_picked_often_ranks_first_within_its_grades`; `palette` tests `a_command_picked_often_ranks_first_among_results_that_match_as_well`, `the_kept_ranking_follows_the_pick_counts`, `a_count_does_not_pass_a_better_match`, `pick_counts_rank_in_grades_that_double`, `the_201st_command_removes_the_least_used_and_keeps_itself`, `new_commands_build_up_counts_when_every_counted_one_has_more_picks`, `counts_are_halved_at_one_thousand`, `saved_pick_counts_load_what_is_readable`, `only_a_pick_recorded_in_recent_commands_is_counted`, `clear_recent_commands_also_clears_the_pick_counts`). A Command Palette query word also finds a command by what the command's description says: "transparent background" lists Remove Background… among the first 3 results, and "png" lists it after every result with "png" in its name or menu path. The description is the command's params text (an engine or plug-in command's, a UI command's, or an effect's) without each `{…}` group that is not inside a `{`, `[` or `(` group, without each such `[…]` or `(…)` group just after a `→`, and without the `→` before a removed group, cut to its first 300 characters at the end of a word. The words of a schema ("corners" for Remove Background…) and of a result written as a group do not find the command; a result written as words after a `→` stays in the description. Words of 2 characters or fewer, words with no letter, and "the", "and", "ids", "true", "false" and "null" are left out. A query word that is a word of a description, shares an English base word with one, starts one or has the same meaning as one finds the result, and such a result ranks below every result that the query matches in its name, menu path or id, as text inside a word or through a typo. Descriptions are English only, and a typo does not match them. Tools, panels and filter plug-ins have no description (`palette::search` tests `a_description_leaves_out_the_schema_and_the_result`, `a_word_of_the_description_finds_the_result`, `a_description_match_ranks_below_a_typo`, `words_of_a_description_find_the_command`). `object.setProps` with `visible: false` or `locked: true` deselects every selected object that is then hidden or locked, the key object included, as the eye and lock columns do. Ctrl/Cmd+Alt-clicking an eye switches the other layers to Outline and the row's layer to Preview, or switches all layers back to Preview when the others are in Outline (`layer.outlineOthers`, `layer.previewAll`). From bb8804acb5c8b2af7bdb24c1bb9296c7ada3bc71 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 18:23:05 -0800 Subject: [PATCH 18/38] Command Palette: test that a refused pick keeps the earlier counts A refused pick now restores the pick counts as well as the recent list. The new test starts with saved picks and counts, makes a pick that is refused, and checks that both are unchanged. The comment on Clear Recent Commands says that its own pick is counted before it is cleared. --- crates/ui-egui/src/menus/run.rs | 2 +- crates/ui-egui/src/palette.rs | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index b40b3da596..1fea924819 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -733,7 +733,7 @@ fn run_ui_part7(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option { app.ui.recent_commands.clear(); app.ui.command_uses = Default::default(); diff --git a/crates/ui-egui/src/palette.rs b/crates/ui-egui/src/palette.rs index 15670e26ba..c6dee0a1ca 100644 --- a/crates/ui-egui/src/palette.rs +++ b/crates/ui-egui/src/palette.rs @@ -1854,6 +1854,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() { From c45e63039a0c6233c3a3a7d6f3a5d579dc429357 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 21:09:23 -0800 Subject: [PATCH 19/38] Command Palette: a saved palette toggle takes no Recent Commands place A Search Commands entry saved in Recent Commands before its picks were left out is now removed on the next pick, so the list keeps eight other picks. The Enter test now checks that Swap Fill and Stroke ran, and the typo ranking line states that description matches come after typo matches. --- crates/ui-egui/src/palette.rs | 9 +++++++-- crates/ui-egui/src/shortcuts/tests.rs | 3 +++ docs/target-app-parity.md | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/palette.rs b/crates/ui-egui/src/palette.rs index 0a8fe0f218..9a513d03db 100644 --- a/crates/ui-egui/src/palette.rs +++ b/crates/ui-egui/src/palette.rs @@ -594,9 +594,10 @@ const MAX_SAVED_RECENT_COMMANDS: usize = 20; /// Puts `id` first in the Recent Commands ids `list`, removing its earlier place, and keeps the /// newest [`MAX_RECENT_COMMANDS`] ids that are `known`. An id that is not `known` now (a plug-in /// that is disabled or not loaded yet) keeps its place among them, so it shows again when its -/// command comes back. The list never holds more than [`MAX_SAVED_RECENT_COMMANDS`] ids. +/// command comes back. The palette's own toggle, saved before its picks were left out, is removed, +/// so it takes none of those places. The list never holds more than [`MAX_SAVED_RECENT_COMMANDS`] ids. fn remember(list: &mut Vec, id: &str, known: impl Fn(&str) -> bool) { - list.retain(|c| c != id); + list.retain(|c| c != id && c != PALETTE_TOGGLE); list.insert(0, id.to_string()); let mut kept = 0; let end = list.iter().position(|c| { @@ -1280,6 +1281,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); diff --git a/crates/ui-egui/src/shortcuts/tests.rs b/crates/ui-egui/src/shortcuts/tests.rs index dd7eb93456..75c10c764a 100644 --- a/crates/ui-egui/src/shortcuts/tests.rs +++ b/crates/ui-egui/src/shortcuts/tests.rs @@ -1896,13 +1896,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/docs/target-app-parity.md b/docs/target-app-parity.md index aae949af1b..7028348e63 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1360,7 +1360,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur A press of any pointer button outside the Command Palette closes it: a click, a right-click or the start of a drag. While the palette is open, the canvas, the toolbars, the docked panels and the app bar under it do not respond to the pointer, so the press that closes the palette does not press a tool button or another control there. A window drawn above them, such as a progress window, still gets its click, and that click also closes the palette (`palette` tests `a_click_on_the_canvas_closes_the_palette`, `a_click_on_another_control_closes_the_palette_without_pressing_it`, `a_right_click_or_a_drag_outside_closes_the_palette`, `a_click_on_a_window_above_closes_the_palette_and_reaches_it`, `the_click_that_opens_the_palette_does_not_close_it`). The Command Palette ranks its results by how well they match. A query that is a result's id lists that result first (`view.goto1` lists Saved View 1 above Saved View 10); then come results whose name is the query, results whose name without its menu path starts with it, and results whose initials it is ("ea" finds Export As…). Within each of those, a result where every word of the query is a whole word of its name ranks above one where a word only starts a word of the name, then one where it is a word of the menu that holds it, then of its id, then text inside a word, so a query that is a menu's title ("object") lists results named with that word above the items of that menu. A tool ranks above a menu command, panel, effect or filter plug-in that matches as well, so "rect" lists the Rectangle Tool above Effect › Convert to Shape › Rectangle…, and of two results of the same kind the shorter name comes first. Words of the menu bar item that runs a result also find it, the item's own label included ("exit" finds Quit VectorCraft, which File › Exit runs); with the native macOS menu bar, the items that bar moves into its application menu are found under it (Preferences… under Settings). Every result the earlier search found is still found, and the highlight stays on its result when a plug-in is installed, a shortcut changes or the language changes while the palette is open (`palette::search` tests `a_better_word_grade_ranks_first`, `a_better_whole_query_tier_ranks_first`, `kind_and_length_never_lift_a_worse_grade`, `a_menu_title_does_not_lift_its_items`, `common_queries_list_the_command_near_the_top`, `every_result_is_found_first_by_its_name_and_its_id`, `every_result_found_before_is_still_found_and_shown`, `results_know_their_place_in_the_menu_bar`, `native_homes_follow_the_native_application_menu`; `palette` test `the_highlight_stays_on_its_result_when_the_results_change`). A Command Palette query word in an English plural or verb form finds a result whose English name or menu path holds the base word: "rounded corners" lists Effect › Stylize › Round Corners… first, and "scaling" finds Object › Transform › Scale…. The search drops `'s`; `es` after `s`, `x`, `z`, `ch` or `sh` (also trying the word with only its `s` dropped, so "rasterizes" finds Rasterize…); a final `s` in words of more than 3 letters, except after `ss`, `us` or `is`; `ing` in words of more than 5 letters and `ed` in words of more than 4. After `ing` or `ed`, a doubled `b`, `d`, `g`, `m`, `n`, `p`, `r` or `t` is tried both single and doubled, the single letter only when at least 3 letters are left ("cutting" meets Cut, "added" meets Add); otherwise the word is also tried with an `e` ("scaling" meets Scale…). It turns `ies` into `y` or `ie` in words of more than 5 letters and `sses` into `ss`, and leaves `series` and `species` as they are. Among results that the whole query matches the same way (as an id, as a label, at the start of a label, as initials, or none of these), a result whose name holds the base word of a query word ranks below one that holds the query word whole and above one where the query word only starts a word of the name, so "scale zz" lists a name with "Zz Scaling" above one with "Zz Scalers". "scale" alone still lists "Scalers" above "Scaling", because "Scalers" starts with the query. A partly typed word that is not itself a word of any result ("scal") does not meet a base word. Names shown in other languages and ids are not changed this way, and every result found before is still found (`palette::search` tests `plurals_and_verb_forms_meet_their_base_word`, `a_plural_or_verb_form_finds_the_result`, `a_better_word_grade_ranks_first`, `a_partly_typed_word_does_not_lift_a_verb_form`, `a_whole_query_tier_comes_before_a_stem_form`, `results_matched_without_a_stem_keep_their_order`). - A Command Palette query word with a typo still finds the result: "gruop" lists Object › Group first, and "eyedroper", "rectange" and "elipse" list the same first results as the words spelled right, the Eyedropper, Rectangle and Ellipse tools among them. When a query word of 4 or more letters is not a word, a base word or the start of a word of any result's name, menu path or id, the search compares it with the words of result names and menu paths, and a word 1 edit away (2 for a query word of 8 or more letters) matches; a letter added, left out or changed, or two letters next to each other swapped, is one edit. A query word meets at most the 32 nearest such words. Results matched through a typo come after every result the query matches without one, and among them the query is read with the misspelled word replaced by the word it meets, so they come in the order the word spelled right gives; then a result whose label holds the word comes before one whose menu path holds it. Ids, and query words and result words with Chinese, Japanese or Korean letters, are not compared this way, and results without typos keep their order (`palette::search` tests `edits_are_counted_up_to_a_bound`, `a_word_with_a_typo_finds_the_result`, `a_typo_meets_at_most_32_words`, `misspelled_words_find_the_command`). + A Command Palette query word with a typo still finds the result: "gruop" lists Object › Group first, and "eyedroper", "rectange" and "elipse" list the same first results as the words spelled right, the Eyedropper, Rectangle and Ellipse tools among them. When a query word of 4 or more letters is not a word, a base word or the start of a word of any result's name, menu path or id, the search compares it with the words of result names and menu paths, and a word 1 edit away (2 for a query word of 8 or more letters) matches; a letter added, left out or changed, or two letters next to each other swapped, is one edit. A query word meets at most the 32 nearest such words. Results matched through a typo come after every other result the query matches in a name, menu path or id, and before the results found through a command's description. Among them, the query is read with the misspelled word replaced by the word it meets, so they come in the order the word spelled right gives; then a result whose label holds the word comes before one whose menu path holds it. Ids, and query words and result words with Chinese, Japanese or Korean letters, are not compared this way, and results without typos keep their order (`palette::search` tests `edits_are_counted_up_to_a_bound`, `a_word_with_a_typo_finds_the_result`, `a_typo_meets_at_most_32_words`, `misspelled_words_find_the_command`). A Command Palette query word also finds a result whose name or menu path holds a word with the same meaning: "remove bg" lists Remove Background… first, "outline text" lists Type › Create Outlines first, and "flip", "combine", "vectorize" and "colour" list Reflect…, Unite, an Image Trace command and the Color panel among the first 3 results. The words come from VectorCraft's own table of 21 groups of English words (`palette/words.rs`, at most 60 groups of at most 6 words); a word that is the whole label of another command, such as Merge or Mirror, is in no group, and neither is Insert. A word or its English base word that is in a group meets the other words of its group in labels and menu paths, and their base words, but not ids or word starts. A result whose label holds the word itself ranks above one whose label holds a word with the same meaning, which ranks above one whose menu path holds the word, so "type" now lists Scale Text Attributes above Type › Orientation › Vertical. A catalog may add a group's words in its language with a row in the `search` context (the group's English words joined by ", ", then that language's words), used while that language is the UI language; no catalog has to have these rows (`palette::search` tests `a_word_with_the_same_meaning_finds_the_result`, `a_catalog_row_adds_words_to_a_group`, `words_with_the_same_meaning_find_the_command`; `palette::words` tests; `i18n` test `search_rows_name_a_group_and_add_single_words`). A Command Palette query word also finds a command by what the command's description says: "transparent background" lists Remove Background… among the first 3 results, and "png" lists it after every result with "png" in its name or menu path. The description is the command's params text (an engine or plug-in command's, a UI command's, or an effect's) without each `{…}` group that is not inside a `{`, `[` or `(` group, without each such `[…]` or `(…)` group just after a `→`, and without the `→` before a removed group, cut to its first 300 characters at the end of a word. The words of a schema ("corners" for Remove Background…) and of a result written as a group do not find the command; a result written as words after a `→` stays in the description. Words of 2 characters or fewer, words with no letter, and "the", "and", "ids", "true", "false" and "null" are left out. A query word that is a word of a description, shares an English base word with one, starts one or has the same meaning as one finds the result, and such a result ranks below every result that the query matches in its name, menu path or id, as text inside a word or through a typo. Descriptions are English only, and a typo does not match them. Tools, panels and filter plug-ins have no description (`palette::search` tests `a_description_leaves_out_the_schema_and_the_result`, `a_word_of_the_description_finds_the_result`, `a_description_match_ranks_below_a_typo`, `words_of_a_description_find_the_command`). `object.setProps` with `visible: false` or `locked: true` deselects every selected object that is then hidden or locked, the key object included, as the eye and lock columns do. From 47fb647d9ed6f8b35fdedfa4cc78ac17283c8374 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 21:09:25 -0800 Subject: [PATCH 20/38] Docs: state the typo and recent-pick ranking order of the Command Palette Typo matches rank above description matches, and recency orders recent picks only among results in the same pick-count grade. --- docs/target-app-parity.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 3a248d0e20..66e7189dfc 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1361,9 +1361,9 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur A press of any pointer button outside the Command Palette closes it: a click, a right-click or the start of a drag. While the palette is open, the canvas, the toolbars, the docked panels and the app bar under it do not respond to the pointer, so the press that closes the palette does not press a tool button or another control there. A window drawn above them, such as a progress window, still gets its click, and that click also closes the palette (`palette` tests `a_click_on_the_canvas_closes_the_palette`, `a_click_on_another_control_closes_the_palette_without_pressing_it`, `a_right_click_or_a_drag_outside_closes_the_palette`, `a_click_on_a_window_above_closes_the_palette_and_reaches_it`, `the_click_that_opens_the_palette_does_not_close_it`). The Command Palette ranks its results by how well they match. A query that is a result's id lists that result first (`view.goto1` lists Saved View 1 above Saved View 10); then come results whose name is the query, results whose name without its menu path starts with it, and results whose initials it is ("ea" finds Export As…). Within each of those, a result where every word of the query is a whole word of its name ranks above one where a word only starts a word of the name, then one where it is a word of the menu that holds it, then of its id, then text inside a word, so a query that is a menu's title ("object") lists results named with that word above the items of that menu. A tool ranks above a menu command, panel, effect or filter plug-in that matches as well, so "rect" lists the Rectangle Tool above Effect › Convert to Shape › Rectangle…, and of two results of the same kind the shorter name comes first. Words of the menu bar item that runs a result also find it, the item's own label included ("exit" finds Quit VectorCraft, which File › Exit runs); with the native macOS menu bar, the items that bar moves into its application menu are found under it (Preferences… under Settings). Every result the earlier search found is still found, and the highlight stays on its result when a plug-in is installed, a shortcut changes or the language changes while the palette is open (`palette::search` tests `a_better_word_grade_ranks_first`, `a_better_whole_query_tier_ranks_first`, `kind_and_length_never_lift_a_worse_grade`, `a_menu_title_does_not_lift_its_items`, `common_queries_list_the_command_near_the_top`, `every_result_is_found_first_by_its_name_and_its_id`, `every_result_found_before_is_still_found_and_shown`, `results_know_their_place_in_the_menu_bar`, `native_homes_follow_the_native_application_menu`; `palette` test `the_highlight_stays_on_its_result_when_the_results_change`). A Command Palette query word in an English plural or verb form finds a result whose English name or menu path holds the base word: "rounded corners" lists Effect › Stylize › Round Corners… first, and "scaling" finds Object › Transform › Scale…. The search drops `'s`; `es` after `s`, `x`, `z`, `ch` or `sh` (also trying the word with only its `s` dropped, so "rasterizes" finds Rasterize…); a final `s` in words of more than 3 letters, except after `ss`, `us` or `is`; `ing` in words of more than 5 letters and `ed` in words of more than 4. After `ing` or `ed`, a doubled `b`, `d`, `g`, `m`, `n`, `p`, `r` or `t` is tried both single and doubled, the single letter only when at least 3 letters are left ("cutting" meets Cut, "added" meets Add); otherwise the word is also tried with an `e` ("scaling" meets Scale…). It turns `ies` into `y` or `ie` in words of more than 5 letters and `sses` into `ss`, and leaves `series` and `species` as they are. Among results that the whole query matches the same way (as an id, as a label, at the start of a label, as initials, or none of these), a result whose name holds the base word of a query word ranks below one that holds the query word whole and above one where the query word only starts a word of the name, so "scale zz" lists a name with "Zz Scaling" above one with "Zz Scalers". "scale" alone still lists "Scalers" above "Scaling", because "Scalers" starts with the query. A partly typed word that is not itself a word of any result ("scal") does not meet a base word. Names shown in other languages and ids are not changed this way, and every result found before is still found (`palette::search` tests `plurals_and_verb_forms_meet_their_base_word`, `a_plural_or_verb_form_finds_the_result`, `a_better_word_grade_ranks_first`, `a_partly_typed_word_does_not_lift_a_verb_form`, `a_whole_query_tier_comes_before_a_stem_form`, `results_matched_without_a_stem_keep_their_order`). - A Command Palette query word with a typo still finds the result: "gruop" lists Object › Group first, and "eyedroper", "rectange" and "elipse" list the same first results as the words spelled right, the Eyedropper, Rectangle and Ellipse tools among them. When a query word of 4 or more letters is not a word, a base word or the start of a word of any result's name, menu path or id, the search compares it with the words of result names and menu paths, and a word 1 edit away (2 for a query word of 8 or more letters) matches; a letter added, left out or changed, or two letters next to each other swapped, is one edit. A query word meets at most the 32 nearest such words. Results matched through a typo come after every result the query matches without one, and among them the query is read with the misspelled word replaced by the word it meets, so they come in the order the word spelled right gives; then a result whose label holds the word comes before one whose menu path holds it. Ids, and query words and result words with Chinese, Japanese or Korean letters, are not compared this way, and results without typos keep their order (`palette::search` tests `edits_are_counted_up_to_a_bound`, `a_word_with_a_typo_finds_the_result`, `a_typo_meets_at_most_32_words`, `misspelled_words_find_the_command`). + A Command Palette query word with a typo still finds the result: "gruop" lists Object › Group first, and "eyedroper", "rectange" and "elipse" list the same first results as the words spelled right, the Eyedropper, Rectangle and Ellipse tools among them. When a query word of 4 or more letters is not a word, a base word or the start of a word of any result's name, menu path or id, the search compares it with the words of result names and menu paths, and a word 1 edit away (2 for a query word of 8 or more letters) matches; a letter added, left out or changed, or two letters next to each other swapped, is one edit. A query word meets at most the 32 nearest such words. Results matched through a typo come after every other result the query matches in a name, menu path or id, and before the results found through a command's description. Among them, the query is read with the misspelled word replaced by the word it meets, so they come in the order the word spelled right gives; then a result whose label holds the word comes before one whose menu path holds it. Ids, and query words and result words with Chinese, Japanese or Korean letters, are not compared this way, and results without typos keep their order (`palette::search` tests `edits_are_counted_up_to_a_bound`, `a_word_with_a_typo_finds_the_result`, `a_typo_meets_at_most_32_words`, `misspelled_words_find_the_command`). A Command Palette query word also finds a result whose name or menu path holds a word with the same meaning: "remove bg" lists Remove Background… first, "outline text" lists Type › Create Outlines first, and "flip", "combine", "vectorize" and "colour" list Reflect…, Unite, an Image Trace command and the Color panel among the first 3 results. The words come from VectorCraft's own table of 21 groups of English words (`palette/words.rs`, at most 60 groups of at most 6 words); a word that is the whole label of another command, such as Merge or Mirror, is in no group, and neither is Insert. A word or its English base word that is in a group meets the other words of its group in labels and menu paths, and their base words, but not ids or word starts. A result whose label holds the word itself ranks above one whose label holds a word with the same meaning, which ranks above one whose menu path holds the word, so "type" now lists Scale Text Attributes above Type › Orientation › Vertical. A catalog may add a group's words in its language with a row in the `search` context (the group's English words joined by ", ", then that language's words), used while that language is the UI language; no catalog has to have these rows (`palette::search` tests `a_word_with_the_same_meaning_finds_the_result`, `a_catalog_row_adds_words_to_a_group`, `words_with_the_same_meaning_find_the_command`; `palette::words` tests; `i18n` test `search_rows_name_a_group_and_add_single_words`). - The Command Palette ranks the commands listed in Recent Commands first among the results that match a query as well as they do, the most recent first, and below every result that matches it better: after a pick of Effect › Convert to Shape › Rectangle…, "rect" lists it above the Rectangle Tool, so Enter runs it again. A recent pick ranks after the whole-query match, the word grades and the matches through a typo, a description or a word with the same meaning, and before the kind of result and the name's length. The ranking uses the list Recent Commands shows. This is VectorCraft's own behavior (`palette::search` test `a_recent_pick_ranks_first_within_its_grades`; `palette` tests `a_recent_pick_ranks_first_among_results_that_match_as_well`, `the_kept_ranking_follows_the_recent_picks`). + The Command Palette ranks the commands listed in Recent Commands first among the results that match a query as well as they do and were picked as often, the most recent first, and below every result that matches it better: after a pick of Effect › Convert to Shape › Rectangle…, "rect" lists it above the Rectangle Tool, so Enter runs it again. A recent pick ranks after the whole-query match, the word grades, the matches through a typo, a description or a word with the same meaning, and the grade of how often it was picked, and before the kind of result and the name's length. The ranking uses the list Recent Commands shows. This is VectorCraft's own behavior (`palette::search` test `a_recent_pick_ranks_first_within_its_grades`; `palette` tests `a_recent_pick_ranks_first_among_results_that_match_as_well`, `the_kept_ranking_follows_the_recent_picks`). The Command Palette also counts how many times each command is picked and ranks the commands picked most often first among the results that match a query as well as they do, also after they leave Recent Commands, and below every result that matches it better. A pick is counted only when Recent Commands records it, so a refused pick and a pick of Search Commands… are not counted. Clear Recent Commands empties the counts with the list, and a pick of it is not counted. Counts are compared in grades that double: grade 1 starts at 1 pick, grade 2 at 3, grade 3 at 7, and so on up to grade 9, and a command picked once ranks above the commands never picked. The grade ranks after the word grades and the typo, description and same-meaning matches, and before the place among the recent picks. The count is kept for at most 200 commands: a new command then removes, of the half of the commands picked longest ago, the one with the fewest picks, of those the one picked longest ago. When a count reaches 1,000, every count is halved and commands left at 0 are dropped. The counts are saved with the other interface settings (`command_uses` in `ui.json`); a count above 999 loads as 999 and an unreadable entry is dropped. The web build keeps them for the session. This is VectorCraft's own behavior (`palette::search` test `a_command_picked_often_ranks_first_within_its_grades`; `palette` tests `a_command_picked_often_ranks_first_among_results_that_match_as_well`, `the_kept_ranking_follows_the_pick_counts`, `a_count_does_not_pass_a_better_match`, `pick_counts_rank_in_grades_that_double`, `the_201st_command_removes_the_least_used_and_keeps_itself`, `new_commands_build_up_counts_when_every_counted_one_has_more_picks`, `counts_are_halved_at_one_thousand`, `saved_pick_counts_load_what_is_readable`, `only_a_pick_recorded_in_recent_commands_is_counted`, `clear_recent_commands_also_clears_the_pick_counts`). A Command Palette query word also finds a command by what the command's description says: "transparent background" lists Remove Background… among the first 3 results, and "png" lists it after every result with "png" in its name or menu path. The description is the command's params text (an engine or plug-in command's, a UI command's, or an effect's) without each `{…}` group that is not inside a `{`, `[` or `(` group, without each such `[…]` or `(…)` group just after a `→`, and without the `→` before a removed group, cut to its first 300 characters at the end of a word. The words of a schema ("corners" for Remove Background…) and of a result written as a group do not find the command; a result written as words after a `→` stays in the description. Words of 2 characters or fewer, words with no letter, and "the", "and", "ids", "true", "false" and "null" are left out. A query word that is a word of a description, shares an English base word with one, starts one or has the same meaning as one finds the result, and such a result ranks below every result that the query matches in its name, menu path or id, as text inside a word or through a typo. Descriptions are English only, and a typo does not match them. Tools, panels and filter plug-ins have no description (`palette::search` tests `a_description_leaves_out_the_schema_and_the_result`, `a_word_of_the_description_finds_the_result`, `a_description_match_ranks_below_a_typo`, `words_of_a_description_find_the_command`). `object.setProps` with `visible: false` or `locked: true` deselects every selected object that is then hidden or locked, the key object included, as the eye and lock columns do. From 8950883c015d08eed7ecdd8b1bdf33ad77de2800 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 06:30:21 -0800 Subject: [PATCH 21/38] Docs: a recent pick ranks first among results with the same pick-count grade --- docs/target-app-parity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index aada554ba2..12a99848d1 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1366,7 +1366,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur A Command Palette query word in an English plural or verb form finds a result whose English name or menu path holds the base word: "rounded corners" lists Effect › Stylize › Round Corners… first, and "scaling" finds Object › Transform › Scale…. The search drops `'s`; `es` after `s`, `x`, `z`, `ch` or `sh` (also trying the word with only its `s` dropped, so "rasterizes" finds Rasterize…); a final `s` in words of more than 3 letters, except after `ss`, `us` or `is`; `ing` in words of more than 5 letters and `ed` in words of more than 4. After `ing` or `ed`, a doubled `b`, `d`, `g`, `m`, `n`, `p`, `r` or `t` is tried both single and doubled, the single letter only when at least 3 letters are left ("cutting" meets Cut, "added" meets Add); otherwise the word is also tried with an `e` ("scaling" meets Scale…). It turns `ies` into `y` or `ie` in words of more than 5 letters and `sses` into `ss`, and leaves `series` and `species` as they are. Among results that the whole query matches the same way (as an id, as a label, at the start of a label, as initials, or none of these), a result whose name holds the base word of a query word ranks below one that holds the query word whole and above one where the query word only starts a word of the name, so "scale zz" lists a name with "Zz Scaling" above one with "Zz Scalers". "scale" alone still lists "Scalers" above "Scaling", because "Scalers" starts with the query. A partly typed word that is not itself a word of any result ("scal") does not meet a base word. Names shown in other languages and ids are not changed this way, and every result found before is still found (`palette::search` tests `plurals_and_verb_forms_meet_their_base_word`, `a_plural_or_verb_form_finds_the_result`, `a_better_word_grade_ranks_first`, `a_partly_typed_word_does_not_lift_a_verb_form`, `a_whole_query_tier_comes_before_a_stem_form`, `results_matched_without_a_stem_keep_their_order`). A Command Palette query word with a typo still finds the result: "gruop" lists Object › Group first, and "eyedroper", "rectange" and "elipse" list the same first results as the words spelled right, the Eyedropper, Rectangle and Ellipse tools among them. When a query word of 4 or more letters is not a word, a base word or the start of a word of any result's name, menu path or id, the search compares it with the words of result names and menu paths, and a word 1 edit away (2 for a query word of 8 or more letters) matches; a letter added, left out or changed, or two letters next to each other swapped, is one edit. A query word meets at most the 32 nearest such words. Results matched through a typo come after every other result the query matches in a name, menu path or id, and before the results found through a command's description. Among them, the query is read with the misspelled word replaced by the word it meets, so they come in the order the word spelled right gives; then a result whose label holds the word comes before one whose menu path holds it. Ids, and query words and result words with Chinese, Japanese or Korean letters, are not compared this way, and results without typos keep their order (`palette::search` tests `edits_are_counted_up_to_a_bound`, `a_word_with_a_typo_finds_the_result`, `a_typo_meets_at_most_32_words`, `misspelled_words_find_the_command`). A Command Palette query word also finds a result whose name or menu path holds a word with the same meaning: "remove bg" lists Remove Background… first, "outline text" lists Type › Create Outlines first, and "flip", "combine", "vectorize" and "colour" list Reflect…, Unite, an Image Trace command and the Color panel among the first 3 results. The words come from VectorCraft's own table of 21 groups of English words (`palette/words.rs`, at most 60 groups of at most 6 words); a word that is the whole label of another command, such as Merge or Mirror, is in no group, and neither is Insert. A word or its English base word that is in a group meets the other words of its group in labels and menu paths, and their base words, but not ids or word starts. A result whose label holds the word itself ranks above one whose label holds a word with the same meaning, which ranks above one whose menu path holds the word, so "type" now lists Scale Text Attributes above Type › Orientation › Vertical. A catalog may add a group's words in its language with a row in the `search` context (the group's English words joined by ", ", then that language's words), used while that language is the UI language; no catalog has to have these rows (`palette::search` tests `a_word_with_the_same_meaning_finds_the_result`, `a_catalog_row_adds_words_to_a_group`, `words_with_the_same_meaning_find_the_command`; `palette::words` tests; `i18n` test `search_rows_name_a_group_and_add_single_words`). - The Command Palette ranks the commands listed in Recent Commands first among the results that match a query as well as they do and were picked as often, the most recent first, and below every result that matches it better: after a pick of Effect › Convert to Shape › Rectangle…, "rect" lists it above the Rectangle Tool, so Enter runs it again. A recent pick ranks after the whole-query match, the word grades, the matches through a typo, a description or a word with the same meaning, and the grade of how often it was picked, and before the kind of result and the name's length. The ranking uses the list Recent Commands shows. This is VectorCraft's own behavior (`palette::search` test `a_recent_pick_ranks_first_within_its_grades`; `palette` tests `a_recent_pick_ranks_first_among_results_that_match_as_well`, `the_kept_ranking_follows_the_recent_picks`). + The Command Palette ranks the commands listed in Recent Commands first among the results that match a query as well as they do and have the same pick-count grade, the most recent first, and below every result that matches it better: after a pick of Effect › Convert to Shape › Rectangle…, "rect" lists it above the Rectangle Tool, so Enter runs it again. A recent pick ranks after the whole-query match, the word grades, the matches through a typo, a description or a word with the same meaning, and the grade of how often it was picked, and before the kind of result and the name's length. The ranking uses the list Recent Commands shows. This is VectorCraft's own behavior (`palette::search` test `a_recent_pick_ranks_first_within_its_grades`; `palette` tests `a_recent_pick_ranks_first_among_results_that_match_as_well`, `the_kept_ranking_follows_the_recent_picks`). The Command Palette also counts how many times each command is picked and ranks the commands picked most often first among the results that match a query as well as they do, also after they leave Recent Commands, and below every result that matches it better. A pick is counted only when Recent Commands records it, so a refused pick and a pick of Search Commands… are not counted. Clear Recent Commands empties the counts with the list, and a pick of it is not counted. Counts are compared in grades that double: grade 1 starts at 1 pick, grade 2 at 3, grade 3 at 7, and so on up to grade 9, and a command picked once ranks above the commands never picked. The grade ranks after the word grades and the typo, description and same-meaning matches, and before the place among the recent picks. The count is kept for at most 200 commands: a new command then removes, of the half of the commands picked longest ago, the one with the fewest picks, of those the one picked longest ago. When a count reaches 1,000, every count is halved and commands left at 0 are dropped. The counts are saved with the other interface settings (`command_uses` in `ui.json`); a count above 999 loads as 999 and an unreadable entry is dropped. The web build keeps them for the session. This is VectorCraft's own behavior (`palette::search` test `a_command_picked_often_ranks_first_within_its_grades`; `palette` tests `a_command_picked_often_ranks_first_among_results_that_match_as_well`, `the_kept_ranking_follows_the_pick_counts`, `a_count_does_not_pass_a_better_match`, `pick_counts_rank_in_grades_that_double`, `the_201st_command_removes_the_least_used_and_keeps_itself`, `new_commands_build_up_counts_when_every_counted_one_has_more_picks`, `counts_are_halved_at_one_thousand`, `saved_pick_counts_load_what_is_readable`, `only_a_pick_recorded_in_recent_commands_is_counted`, `clear_recent_commands_also_clears_the_pick_counts`). A Command Palette query word also finds a command by what the command's description says: "transparent background" lists Remove Background… among the first 3 results, and "png" lists it after every result with "png" in its name or menu path. The description is the command's params text (an engine or plug-in command's, a UI command's, or an effect's) without each `{…}` group that is not inside a `{`, `[` or `(` group, without each such `[…]` or `(…)` group just after a `→`, and without the `→` before a removed group, cut to its first 300 characters at the end of a word. The words of a schema ("corners" for Remove Background…) and of a result written as a group do not find the command; a result written as words after a `→` stays in the description. Words of 2 characters or fewer, words with no letter, and "the", "and", "ids", "true", "false" and "null" are left out. A query word that is a word of a description, shares an English base word with one, starts one or has the same meaning as one finds the result, and such a result ranks below every result that the query matches in its name, menu path or id, as text inside a word or through a typo. Descriptions are English only, and a typo does not match them. Tools, panels and filter plug-ins have no description (`palette::search` tests `a_description_leaves_out_the_schema_and_the_result`, `a_word_of_the_description_finds_the_result`, `a_description_match_ranks_below_a_typo`, `words_of_a_description_find_the_command`). `object.setProps` with `visible: false` or `locked: true` deselects every selected object that is then hidden or locked, the key object included, as the eye and lock columns do. From 7ccbb2ec1f215c0a9ce09dc678aa11585265d064 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 06:41:13 -0800 Subject: [PATCH 22/38] Command Palette: a palette toggled closed and open before it is drawn starts at its first row The palette's command, its shortcut and the search icon now go through one toggle that marks the palette as toggled, and the palette forgets its highlight the next time it is drawn. Two runs of the command in one step (closed, then open again before a frame drew it closed) kept the old row, and Enter on an empty search ran that row instead of the last pick. --- crates/ui-egui/src/chrome.rs | 3 +-- crates/ui-egui/src/menus/run.rs | 3 +-- crates/ui-egui/src/palette.rs | 36 +++++++++++++++++++++++++++++++++ crates/ui-egui/src/state.rs | 6 ++++++ 4 files changed, 44 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/chrome.rs b/crates/ui-egui/src/chrome.rs index dc9f9fa848..cb97e43170 100644 --- a/crates/ui-egui/src/chrome.rs +++ b/crates/ui-egui/src/chrome.rs @@ -151,8 +151,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/menus/run.rs b/crates/ui-egui/src/menus/run.rs index b4e1c668ac..5e31c39b2e 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -729,8 +729,7 @@ 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) } // Closing asks Save / Don't Save / Cancel for modified documents first (`unsaved`). diff --git a/crates/ui-egui/src/palette.rs b/crates/ui-egui/src/palette.rs index 52e42dcc28..f834d66196 100644 --- a/crates/ui-egui/src/palette.rs +++ b/crates/ui-egui/src/palette.rs @@ -635,6 +635,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 pick opened a dialog, which focuses its own first field, or the press that @@ -642,6 +649,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)); + } if !app.ui.palette_open { // The palette opens again with its first row highlighted and its list scrolled to the top // (a list height of 0 scrolls it to the highlighted row). @@ -1624,6 +1636,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/state.rs b/crates/ui-egui/src/state.rs index d3698aaeef..b6bf1793d5 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -594,6 +594,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). @@ -1205,6 +1210,7 @@ impl Default for UiState { status_notes: None, palette_open: false, palette_query: String::new(), + palette_toggled: false, screen_mode: 0, tiled: false, floating: Vec::new(), From 0cf595d539113da6f22d1fcae1983bf1cd941342 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 16:31:14 -0800 Subject: [PATCH 23/38] Rerun CI From 5dcc0008ee4e4f9471d6fa937a19899f5fece882 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 19:27:20 -0800 Subject: [PATCH 24/38] Transform: Rectangle Properties has a Corner menu for the corner type A live rectangle's Rectangle Properties (Transform panel, the Properties panel's Transform section and the Contextual Task Bar's Shape Properties) now 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 live rectangle, corners with no radius included, and leaves the radii as they are. It is blank when the shown rectangle's corners have different kinds. - With Corner Radius unlinked, each corner's row has its own menu beside its radius field, or under it when the panel is too narrow for both. - The menus and the unlinked radius fields change only the selected live rectangles; other selected paths and polygons are left as they are. Before, a radius typed into an unlinked corner field also rounded that anchor index on every other selected path. - A pick is one undo step, and picking the kind the corners already have adds none. --- crates/engine/src/tests/livecorners.rs | 22 +++ crates/ui-egui/src/panels.rs | 84 +++++++++-- crates/ui-egui/src/panels/transform/tests.rs | 31 +++++ crates/ui-egui/src/tests/taskbar.rs | 138 +++++++++++++++++++ docs/target-app-parity.md | 1 + 5 files changed, 268 insertions(+), 8 deletions(-) diff --git a/crates/engine/src/tests/livecorners.rs b/crates/engine/src/tests/livecorners.rs index b9e3793913..9881f30e88 100644 --- a/crates/engine/src/tests/livecorners.rs +++ b/crates/engine/src/tests/livecorners.rs @@ -59,6 +59,28 @@ 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); +} + /// #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/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index aa07b13a90..50db13e13b 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -54,7 +54,7 @@ pub mod variables; use egui::{Rect, Sense, Ui, vec2}; use serde_json::{Value, json}; use vectorcraft_color::{BlendMode, Color, Paint}; -use vectorcraft_doc::{LiveCorners, Node, NodeId, NodeKind, StrokeLayer}; +use vectorcraft_doc::{LiveCorners, LiveShape, Node, NodeId, NodeKind, StrokeLayer}; use vectorcraft_engine::inspect::StrokeMixed; use vectorcraft_geom::shapes::CornerKind; @@ -89,8 +89,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; @@ -104,27 +105,94 @@ 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) { + let corners = corner.map_or(json!([0, 1, 2, 3]), |k| json!([k])); + match app.session.active() { + // The command refuses the selection, with its message, while part of a symbol's art is + // selected. + Some(st) if st.selection.symbol_part.is_some() => p["corners"] = corners, + Some(st) => { + let is_rectangle = |n: &Node| matches!(&n.kind, NodeKind::Path { live: Some(l), .. } if matches!(**l, LiveShape::Rectangle { .. })); + let rectangle = |id: &&NodeId| st.doc.node(**id).is_some_and(is_rectangle); + let items: Vec = st.selection.objects.iter().filter(rectangle).map(|id| json!({"id": id.0, "corners": corners})).collect(); + p["items"] = json!(items); + } + None => return, + } + 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(); } diff --git a/crates/ui-egui/src/panels/transform/tests.rs b/crates/ui-egui/src/panels/transform/tests.rs index 3dff8e6a4b..a25a2db37d 100644 --- a/crates/ui-egui/src/panels/transform/tests.rs +++ b/crates/ui-egui/src/panels/transform/tests.rs @@ -107,6 +107,37 @@ 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:?}"); + } +} + /// #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/tests/taskbar.rs b/crates/ui-egui/src/tests/taskbar.rs index 8230969c97..25999c1148 100644 --- a/crates/ui-egui/src/tests/taskbar.rs +++ b/crates/ui-egui/src/tests/taskbar.rs @@ -565,6 +565,144 @@ 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")); + click(&mut app, entry(&texts, "Chamfer")); + 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/docs/target-app-parity.md b/docs/target-app-parity.md index ef83de54ad..d2a5785c39 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1301,6 +1301,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, items}`). 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`, `rectangle_kind_menu_targets_all_or_one_corner_and_skips_noop_undo`). - **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). - **Blend spine points by marquee:** with Direct Selection, a marquee picks the spine points inside it on a selected blend, the topmost one when several are selected, and the picked points drag together as Shift-clicked ones do; Shift-marquee adds points or takes picked ones away, a plain marquee around none of them drops the picks, and Escape during the marquee keeps them. Unselected, locked and hidden blends are skipped. The spine's points are anchor points edited with Direct Selection ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/modify-spine-of-blended-objects.html)), and a boundary drag with the tool selects anchor points ([the help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/select-anchor-points-in-paths.html)); the rules for selected, topmost and Shift are VectorCraft's own (`crates/tools/src/direct/tests.rs`, `marquee_picks_selected_blend_spine_points_which_drag_together`, `shift_marquee_toggles_selected_blend_spine_points`, `marquee_skips_unselected_locked_and_hidden_blend_spines`, `escape_cancels_a_marquee_and_keeps_the_picked_spine_points`). - **Blend steps of brushed strokes:** the steps interpolate the pen pressure, tilt, bearing and rotation recorded with the Paintbrush, so a Calligraphic, Scatter or Art brush that varies with the pen changes gradually from one key to the next. A key without a recording counts as half pressure, half tilt and 0°, as brushes read it, and angles turn the shorter way round. When the blend starts a key's path at another anchor (an open path run from its end, a closed one turned to another start), the key's recordings, width profile, arrowheads, dashes and a gradient along or across the stroke turn with the path. Different brushes still switch halfway (VectorCraft's own rule; strokes blend their options, as [Blended objects overview](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/blended-objects-overview.html) describes; `crates/doc/src/blend.rs`, `pen_pressure_tilt_and_angles_interpolate_for_brushes`, `stroke_profiles_turn_with_a_key_path_started_elsewhere`, `stroke_gradients_and_dashes_turn_with_a_key_path_started_elsewhere`). From db6e491c56b9ea0d4a6e5afbfd8a88ecaf10368e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 20:23:57 -0800 Subject: [PATCH 25/38] Transform: Rectangle Properties corner edits send the rectangles as one ids list The Corner menus and the unlinked Corner Radius fields sent one object.setLiveShape item per selected live rectangle, each with the same corners, and the command looks each id up in that list, so an edit took time quadratic in the number of selected rectangles. They now send the rectangles as ids with one shared corners list. With no live rectangle selected the edit leaves the document and its undo history as they are. The Properties panel test for a Direct-Selected rectangle corner now expects the Rectangle Properties Corner menu once. --- crates/ui-egui/src/panels.rs | 9 +++++---- crates/ui-egui/src/panels/properties/tests.rs | 4 ++-- crates/ui-egui/src/panels/transform/tests.rs | 17 +++++++++++++++++ docs/target-app-parity.md | 2 +- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index e96c374021..635e87a094 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -140,16 +140,17 @@ fn set_rectangle_kinds(app: &mut VectorcraftApp, kind: CornerKind, corner: Optio /// 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) { - let corners = corner.map_or(json!([0, 1, 2, 3]), |k| json!([k])); + p["corners"] = corner.map_or(json!([0, 1, 2, 3]), |k| json!([k])); match app.session.active() { // The command refuses the selection, with its message, while part of a symbol's art is // selected. - Some(st) if st.selection.symbol_part.is_some() => p["corners"] = corners, + Some(st) if st.selection.symbol_part.is_some() => {} + // The selected live rectangles as `ids`, all sharing `corners`. Some(st) => { let is_rectangle = |n: &Node| matches!(&n.kind, NodeKind::Path { live: Some(l), .. } if matches!(**l, LiveShape::Rectangle { .. })); let rectangle = |id: &&NodeId| st.doc.node(**id).is_some_and(is_rectangle); - let items: Vec = st.selection.objects.iter().filter(rectangle).map(|id| json!({"id": id.0, "corners": corners})).collect(); - p["items"] = json!(items); + let ids: Vec = st.selection.objects.iter().filter(rectangle).map(|id| id.0).collect(); + p["ids"] = json!(ids); } None => return, } diff --git a/crates/ui-egui/src/panels/properties/tests.rs b/crates/ui-egui/src/panels/properties/tests.rs index c91d01a2bf..f1fc6eb540 100644 --- a/crates/ui-egui/src/panels/properties/tests.rs +++ b/crates/ui-egui/src/panels/properties/tests.rs @@ -1555,11 +1555,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/transform/tests.rs b/crates/ui-egui/src/panels/transform/tests.rs index 7260c7d3fa..7bfe802561 100644 --- a/crates/ui-egui/src/panels/transform/tests.rs +++ b/crates/ui-egui/src/panels/transform/tests.rs @@ -167,6 +167,23 @@ fn a_rectangle_shows_linked_and_unlinked_corner_types() { } } +/// 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); +} + /// #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/docs/target-app-parity.md b/docs/target-app-parity.md index 88d2d57f3e..06faf2ee49 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1322,7 +1322,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, items}`). 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`, `rectangle_kind_menu_targets_all_or_one_corner_and_skips_noop_undo`). + - **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, ids, corners}`). 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`). - **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). - **Blend spine points by marquee:** with Direct Selection, a marquee picks the spine points inside it on a selected blend, the topmost one when several are selected, and the picked points drag together as Shift-clicked ones do; Shift-marquee adds points or takes picked ones away, a plain marquee around none of them drops the picks, and Escape during the marquee keeps them. Unselected, locked and hidden blends are skipped. The spine's points are anchor points edited with Direct Selection ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/modify-spine-of-blended-objects.html)), and a boundary drag with the tool selects anchor points ([the help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/select-anchor-points-in-paths.html)); the rules for selected, topmost and Shift are VectorCraft's own (`crates/tools/src/direct/tests.rs`, `marquee_picks_selected_blend_spine_points_which_drag_together`, `shift_marquee_toggles_selected_blend_spine_points`, `marquee_skips_unselected_locked_and_hidden_blend_spines`, `escape_cancels_a_marquee_and_keeps_the_picked_spine_points`). - **Blend steps of brushed strokes:** the steps interpolate the pen pressure, tilt, bearing and rotation recorded with the Paintbrush, so a Calligraphic, Scatter or Art brush that varies with the pen changes gradually from one key to the next. A key without a recording counts as half pressure, half tilt and 0°, as brushes read it, and angles turn the shorter way round. When the blend starts a key's path at another anchor (an open path run from its end, a closed one turned to another start), the key's recordings, width profile, arrowheads, dashes and a gradient along or across the stroke turn with the path. Different brushes still switch halfway (VectorCraft's own rule; strokes blend their options, as [Blended objects overview](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/blended-objects-overview.html) describes; `crates/doc/src/blend.rs`, `pen_pressure_tilt_and_angles_interpolate_for_brushes`, `stroke_profiles_turn_with_a_key_path_started_elsewhere`, `stroke_gradients_and_dashes_turn_with_a_key_path_started_elsewhere`). From 70885f54668ca71bd8dd4781bfe674e405b1a22e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 22:57:51 -0800 Subject: [PATCH 26/38] Color Wheel: document null params and the sampled gamut shading ui.colorWheel's params text and docs/mcp.md now say that a key set to null keeps its value while the other keys apply, and that the out-of-gamut shading is approximate: each cell of the 16 by 16 grid is grayed out or not by the color at its center. A test checks that null keeps view and channel while another key applies. --- crates/mcp/src/ui_catalog.rs | 2 +- crates/ui-egui/src/menus/ui_commands.rs | 2 +- crates/ui-egui/src/panels/color_wheel.rs | 5 +++-- crates/ui-egui/src/panels/tests_color_wheel_gamut.rs | 8 ++++++-- docs/mcp.md | 7 +++++-- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index aa8a0f8cbf..dc8fbefef8 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1418,7 +1418,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.colorWheel", "Color Wheel Options", "", - "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, gamut?: bool} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, and pick the box's channel, as Box Channel does: 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); 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; keys left out keep their values, params that are not an object, another key or a value off the list are an error and change nothing, all three 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, gamut}", + "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, gamut?: bool} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, and pick the box's channel, as Box Channel does: 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); 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; keys left out or set to null keep their values while the other keys apply, params that are not an object, another key or a value off the list are an error and change nothing, all three 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, gamut}", ), ( "ui.savePdfDialog", diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index 1b9165108c..9648962555 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -1419,7 +1419,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.colorWheel", "Color Wheel Options", "", - "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, gamut?: bool} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, and pick the box's channel, as Box Channel does: 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); 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; keys left out keep their values, params that are not an object, another key or a value off the list are an error and change nothing, all three 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, gamut}", + "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, gamut?: bool} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, and pick the box's channel, as Box Channel does: 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); 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; keys left out or set to null keep their values while the other keys apply, params that are not an object, another key or a value off the list are an error and change nothing, all three 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, gamut}", ), ( "ui.savePdfDialog", diff --git a/crates/ui-egui/src/panels/color_wheel.rs b/crates/ui-egui/src/panels/color_wheel.rs index 64c75fa5aa..6009ba5963 100644 --- a/crates/ui-egui/src/panels/color_wheel.rs +++ b/crates/ui-egui/src/panels/color_wheel.rs @@ -104,8 +104,9 @@ pub fn deserialize_settings<'de, D: serde::Deserializer<'de>>(d: D) -> Result Result { const KEYS: [&str; 3] = ["view", "channel", "gamut"]; match p { diff --git a/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs b/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs index f24329b69d..b124ab492b 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs @@ -150,8 +150,9 @@ fn with_the_setting_off_no_grid_is_computed() { assert_eq!(drawn(&h), None); } -/// `ui.colorWheel {gamut}` sets the setting and keeps the others; a value that is not true or -/// false is an error that changes nothing, translated where messages are. +/// `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()); @@ -161,6 +162,9 @@ fn ui_color_wheel_sets_gamut() { 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, json!({"view": "wheel", "channel": "red", "gamut": true}), "null keeps a value while the other keys apply"); assert_eq!(app.run("ui.colorWheel", json!({"gamut": false})).unwrap()["gamut"], json!(false)); for code in ["de", "fr", "ja", "zh-hans"] { let lang = crate::i18n::Lang::from_code(code).expect("registered"); diff --git a/docs/mcp.md b/docs/mcp.md index 1f11853929..2af8195eee 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -674,8 +674,11 @@ and answers true when the fields show in percent. 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. `"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. 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 +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. Keys left out or set to `null` keep their values, and the other keys still apply. 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, gamut}`, and the settings are kept with the preferences. In remote desktop mode, `invoke_menu` with `{"command":"ui.sampleScreenColor","params":{}}` shows the system's From 993ad1cd55d1df398465efa7a373bdce76baa499 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 01:26:22 -0800 Subject: [PATCH 27/38] Color Wheel: test that a null view keeps the view ui_color_wheel_sets_gamut now also runs ui.colorWheel with view set to null and gamut set to false, and checks that the view stays as it was while gamut applies. --- crates/ui-egui/src/panels/tests_color_wheel_gamut.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs b/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs index b124ab492b..47a68fad76 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel_gamut.rs @@ -165,7 +165,8 @@ fn ui_color_wheel_sets_gamut() { 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, json!({"view": "wheel", "channel": "red", "gamut": true}), "null keeps a value while the other keys apply"); - assert_eq!(app.run("ui.colorWheel", json!({"gamut": false})).unwrap()["gamut"], json!(false)); + let got = app.run("ui.colorWheel", json!({"view": null, "gamut": false})).unwrap(); + assert_eq!(got, 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); From e4776713d709d518a31533d0c1d56e0cd777013a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 06:27:06 -0800 Subject: [PATCH 28/38] Transform: a corner kind the rectangle already has leaves it unchanged A kind-only object.setLiveShape call now leaves each rectangle whose corners already have the kind as it is, even when its transform keeps a scale, and changes only the other targets. The Corner menu applies a pending tool edit before it reads the selected rectangles. The popup test checks that the list opened before it picks the Chamfer row. --- crates/engine/src/cmd/object/shape.rs | 11 +++-- crates/engine/src/tests/livecorners.rs | 32 +++++++++++++ crates/ui-egui/src/panels.rs | 4 ++ crates/ui-egui/src/panels/transform/tests.rs | 47 ++++++++++++++++++++ crates/ui-egui/src/tests/taskbar.rs | 6 ++- 5 files changed, 95 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/cmd/object/shape.rs b/crates/engine/src/cmd/object/shape.rs index 02edf6193b..661a9331ef 100644 --- a/crates/engine/src/cmd/object/shape.rs +++ b/crates/engine/src/cmd/object/shape.rs @@ -265,18 +265,21 @@ 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) && 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 unchanged: BTreeSet = ids.iter().copied().filter(has_values).collect(); + if ids.iter().all(|id| unchanged.contains(id)) { return ok(); } + let ids: Vec = ids.into_iter().filter(|id| !unchanged.contains(id)).collect(); s.edit("Live Shape", |d, sel| { for id in &ids { let Some(NodeKind::Path { path, live, .. }) = d.node_mut(*id).map(|n| &mut n.kind) else { continue }; diff --git a/crates/engine/src/tests/livecorners.rs b/crates/engine/src/tests/livecorners.rs index d91f120831..6d9d806c3e 100644 --- a/crates/engine/src/tests/livecorners.rs +++ b/crates/engine/src/tests/livecorners.rs @@ -81,6 +81,38 @@ fn rectangle_kind_menu_targets_all_or_one_corner_and_skips_noop_undo() { 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); +} + /// #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/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index 49f99de7f7..9e30fd609d 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -142,6 +142,10 @@ fn set_rectangle_kinds(app: &mut VectorcraftApp, kind: CornerKind, corner: Optio /// 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. + let r = app.session.finish_tool_edit(); + crate::canvas::apply_requests(app, r); match app.session.active() { // The command refuses the selection, with its message, while part of a symbol's art is // selected. diff --git a/crates/ui-egui/src/panels/transform/tests.rs b/crates/ui-egui/src/panels/transform/tests.rs index 2a57359a22..564693132c 100644 --- a/crates/ui-egui/src/panels/transform/tests.rs +++ b/crates/ui-egui/src/panels/transform/tests.rs @@ -184,6 +184,53 @@ fn a_rectangle_corner_kind_without_a_selected_rectangle_changes_nothing() { 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/tests/taskbar.rs b/crates/ui-egui/src/tests/taskbar.rs index ff9f58f05c..ca0f4874e6 100644 --- a/crates/ui-egui/src/tests/taskbar.rs +++ b/crates/ui-egui/src/tests/taskbar.rs @@ -774,7 +774,11 @@ fn the_shape_properties_popup_changes_a_rectangle_corner_type() { 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")); - click(&mut app, entry(&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(); From 3bcd4057817823d7debe9150848c7614f691529b Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 16:39:55 -0800 Subject: [PATCH 29/38] Preferences: Plug-in Instruction Budget and Low-Latency Drawing show a sentence Both settings came in with main and had no sentence, so the one-sentence test for the categories up to Appearance of Black failed. Each now has an English sentence and a row in the 28 complete catalogs, and the hover and keyboard tests for Plug-ins & Scratch Disks and Performance cover them. The hover tests for User Interface, Performance and File Handling scroll until the row's label lies wholly inside the field list before they move the pointer to it. The Polish rows for art and artwork in these sentences say kompozycja, as main's Polish vocabulary test requires. --- crates/ui-egui/src/i18n/bg.tsv | 2 + crates/ui-egui/src/i18n/bs.tsv | 2 + crates/ui-egui/src/i18n/ca.tsv | 2 + crates/ui-egui/src/i18n/cs.tsv | 2 + crates/ui-egui/src/i18n/da.tsv | 2 + crates/ui-egui/src/i18n/de.tsv | 2 + crates/ui-egui/src/i18n/el.tsv | 2 + crates/ui-egui/src/i18n/es.tsv | 2 + crates/ui-egui/src/i18n/fi.tsv | 2 + crates/ui-egui/src/i18n/fr.tsv | 2 + crates/ui-egui/src/i18n/gu.tsv | 2 + crates/ui-egui/src/i18n/hi.tsv | 2 + crates/ui-egui/src/i18n/hu.tsv | 2 + crates/ui-egui/src/i18n/id.tsv | 2 + crates/ui-egui/src/i18n/it.tsv | 2 + crates/ui-egui/src/i18n/ja.tsv | 2 + crates/ui-egui/src/i18n/ka.tsv | 2 + crates/ui-egui/src/i18n/ko.tsv | 2 + crates/ui-egui/src/i18n/nl.tsv | 2 + crates/ui-egui/src/i18n/pl.tsv | 14 ++- crates/ui-egui/src/i18n/pt-br.tsv | 2 + crates/ui-egui/src/i18n/ru.tsv | 2 + crates/ui-egui/src/i18n/sv.tsv | 2 + crates/ui-egui/src/i18n/tr.tsv | 2 + crates/ui-egui/src/i18n/uk.tsv | 2 + crates/ui-egui/src/i18n/vi.tsv | 2 + crates/ui-egui/src/i18n/zh-hans.tsv | 2 + crates/ui-egui/src/i18n/zh-hant.tsv | 2 + .../ui-egui/src/prefs_dialog/descriptions.rs | 8 ++ crates/ui-egui/src/prefs_dialog/tests.rs | 116 ++++++++---------- 30 files changed, 124 insertions(+), 68 deletions(-) diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index fae7168300..2feec9f4e6 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -3179,6 +3179,7 @@ digits Malayalam Малаялам New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Новият текст получава този език, докато езикът в Настройка на документ е Английски: САЩ; текстът, който вече е в документа, запазва своя език. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. В абзаците с включено Пренасяне на думи изброената дума се пренася само при въведените в нея тирета или никъде, ако няма такива, независимо от езика и регистъра ѝ. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. В настолната версия .wasm приставките в тази папка се зареждат при стартиране и когато щракнете върху ОК с нова папка тук, освен в Безопасен режим; уеб версията не ги зарежда. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. „Голям“ позволява на филтър или команда на приставка да изпълни поне 250 милиона инструкции, плюс още за всеки байт входни данни; „Нормално“ запазва собствения лимит на приставката. Ограничението по време остава същото. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Първият избор на временен диск: Startup, None или път до папка; VectorCraft го запазва, но все още не използва временни дискове. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Вторият избор на временен диск: Startup, None или път до папка; VectorCraft го запазва, но все още не използва временни дискове. How light or dark the interface is. Колко светъл или тъмен е интерфейсът. @@ -3197,6 +3198,7 @@ digits Malayalam Малаялам Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. „Анимирано мащабиране“ работи само докато това е включено; изключено, „Анимирано мащабиране“ е затъмнено и мащабирането не е анимирано. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. Мащабирането с колелцето се плъзга плавно, а инструментът „Мащаб“ мащабира, докато плъзгате настрани или го задържите; изключено, той мащабира до областта, през която плъзнете. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. От следващото стартиране настолната версия рисува с този вид графичен процесор; „Автоматично“ предпочита този, който управлява дисплея. Уеб версията не го използва. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. От следващото стартиране прозорецът показва кадрите, без да чака опресняването на дисплея, най-много 240 в секунда, освен ако --present-mode или VECTORCRAFT_PRESENT_MODE задава режима. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. Най-многото стъпки за отмяна, които всеки документ пази; по-малко число премахва най-старите стъпки, когато щракнете върху ОК. Стъпки може да отпаднат и по-рано, ако заемат твърде много памет. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Показва как рисунката се променя, докато плъзгате; изключено, контурите следват плъзгането, а рисунката се променя, когато отпуснете. Помощна линия от линийката винаги се движи, докато плъзгате. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Колко работни нишки рисуват рисунката; -1 използва с една по-малко от ядрата, които VectorCraft може да ползва, най-много 8, а 0 не използва нито една. Уеб версията никога не използва. diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 96633fc866..ba51feb871 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -4646,6 +4646,7 @@ font-technology Variable Varijabilni New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Novi tekst dobija ovaj jezik dok je jezik u Postavkama dokumenta Engleski: SAD; tekst koji je već u dokumentu zadržava svoj jezik. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. U pasusima s uključenom opcijom Rastavljaj riječi navedena riječ se rastavlja samo na crticama upisanim u nju, ili nigdje ako ih nema, bez obzira na jezik i velika ili mala slova. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. U desktop verziji .wasm dodaci iz ove mape učitavaju se pri pokretanju i kada kliknete U redu s novom mapom ovdje, osim u sigurnom načinu rada; web verzija ih ne učitava. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. Veliko omogućava filteru ili naredbi dodatka da izvrši najmanje 250 miliona instrukcija, plus još za svaki bajt ulaza; Normalno zadržava vlastito ograničenje dodatka. Vremensko ograničenje ostaje isto. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Prvi izbor radnog diska: Startup, None ili putanja do mape; VectorCraft ga sprema, ali još ne koristi radne diskove. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Drugi izbor radnog diska: Startup, None ili putanja do mape; VectorCraft ga sprema, ali još ne koristi radne diskove. How light or dark the interface is. Koliko je interfejs svijetao ili taman. @@ -4664,6 +4665,7 @@ font-technology Variable Varijabilni Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. Animirano zumiranje radi samo dok je ovo uključeno; isključeno, Animirano zumiranje je zatamnjeno i zumiranje nije animirano. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. Zumiranje točkićem glatko klizi, a Alat za zumiranje zumira dok vučete ustranu ili ga držite; isključeno, Alat za zumiranje zumira na područje preko kojeg prevučete. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Od sljedećeg pokretanja desktop verzija crta ovom vrstom grafičkog procesora; Automatski daje prednost onom koji pokreće ekran. Web verzija ga ne koristi. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. Od sljedećeg pokretanja prozor prikazuje kadrove bez čekanja na osvježavanje ekrana, najviše 240 u sekundi, osim ako --present-mode ili VECTORCRAFT_PRESENT_MODE postavlja način. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. Najveći broj koraka poništavanja koje svaki dokument čuva; manji broj uklanja najstarije korake kada kliknete U redu. Koraci mogu nestati i ranije kada zauzimaju previše memorije. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Prikazuje kako se crtež mijenja dok vučete; isključeno, obrisi prate povlačenje, a crtež se mijenja kada pustite. Vodilja s ravnala se uvijek pomiče dok vučete. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Koliko radnih niti crta crtež; -1 koristi jednu manje od jezgri koje VectorCraft smije koristiti, najviše 8, a 0 nijednu. Web verzija nikad ne koristi nijednu. diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 3b39fba282..072eac3bc3 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -4030,6 +4030,7 @@ digits Malayalam Malaiàlam New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. El text nou pren aquest idioma mentre l’idioma de Configuració del document sigui Anglès: EUA; el text que ja és en un document conserva el seu idioma. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. En els paràgrafs amb Particiona activat, una paraula de la llista es parteix només als guionets que s’hi han escrit, o enlloc si no en té, sigui quin sigui el seu idioma o l’ús de majúscules. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. A la versió d’escriptori, els complements .wasm d’aquesta carpeta es carreguen en iniciar i quan feu clic a D’acord amb una carpeta nova aquí, excepte en Mode segur; la versió web no els carrega. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. Gran permet que un filtre o una ordre d’un complement executi almenys 250 milions d’instruccions, més d’altres per cada byte d’entrada; Normal manté el límit propi del complement. El límit de temps no canvia. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. La primera opció de disc d’intercanvi: Startup, None o el camí d’una carpeta; VectorCraft la desa, però encara no fa servir discs d’intercanvi. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. La segona opció de disc d’intercanvi: Startup, None o el camí d’una carpeta; VectorCraft la desa, però encara no fa servir discs d’intercanvi. How light or dark the interface is. Com de clara o fosca és la interfície. @@ -4048,6 +4049,7 @@ digits Malayalam Malaiàlam Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. El Zoom animat només funciona mentre això està activat; desactivat, el Zoom animat apareix atenuat i el zoom no s’anima. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. El zoom amb la roda llisca suaument, i l’Eina de zoom fa zoom mentre arrossegueu de costat o la manteniu premuda; desactivat, l’Eina de zoom fa zoom a l’àrea que arrossegueu. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. A partir del pròxim inici, la versió d’escriptori dibuixa amb aquest tipus de processador gràfic; Automàtic prefereix el que controla la pantalla. La versió web no l’utilitza. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. A partir del pròxim inici, la finestra mostra els fotogrames sense esperar que la pantalla es refresqui, com a màxim 240 per segon, tret que --present-mode o VECTORCRAFT_PRESENT_MODE estableixi el mode. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. El màxim de passos de desfer que conserva cada document; un nombre més baix elimina els passos més antics quan feu clic a D’acord. Els passos també poden desaparèixer abans si ocupen massa memòria. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Mostra com canvia l’art mentre arrossegueu; desactivat, els contorns segueixen l’arrossegament i l’art canvia quan deixeu anar. Una guia de regle sempre es mou mentre arrossegueu. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Quants fils de treball dibuixen l’art; -1 en fa servir un menys que els nuclis que VectorCraft pot usar, com a màxim 8, i 0 cap. La versió web no en fa servir mai cap. diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 424cc86607..81f8a7bbeb 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4757,6 +4757,7 @@ font-technology Variable Variabilní New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Nový text dostane tento jazyk, dokud je jazyk v Nastavení dokumentu Angličtina: USA; text, který už v dokumentu je, si ponechá svůj jazyk. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. V odstavcích se zapnutou volbou Dělit slova se uvedené slovo dělí jen u spojovníků, které v něm napíšete, nebo nikde, pokud žádné nemá, bez ohledu na jazyk a velikost písmen. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. V desktopové verzi se zásuvné moduly .wasm z této složky načtou při spuštění a po klepnutí na OK s novou složkou zde, kromě nouzového režimu; webová verze je nenačítá. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. Velké dovolí filtru nebo příkazu zásuvného modulu provést nejméně 250 milionů instrukcí a další za každý bajt vstupu; Normální ponechá vlastní limit zásuvného modulu. Časový limit zůstává stejný. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. První volba odkládacího disku: Startup, None nebo cesta ke složce; VectorCraft ji uloží, ale odkládací disky zatím nepoužívá. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Druhá volba odkládacího disku: Startup, None nebo cesta ke složce; VectorCraft ji uloží, ale odkládací disky zatím nepoužívá. How light or dark the interface is. Jak světlé nebo tmavé je rozhraní. @@ -4775,6 +4776,7 @@ font-technology Variable Variabilní Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. Animované zvětšení funguje, jen když je toto zapnuto; při vypnutí je Animované zvětšení zašedlé a zvětšování není animované. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. Zvětšení kolečkem plynule dojede a Nástroj Lupa zvětšuje, když táhnete do strany nebo ho podržíte; při vypnutí Nástroj Lupa zvětší oblast, přes kterou táhnete. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Od příštího spuštění kreslí desktopová verze tímto druhem grafického procesoru; Automaticky dává přednost tomu, který řídí displej. Webová verze ho nepoužívá. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. Od příštího spuštění okno zobrazuje snímky bez čekání na obnovení displeje, nejvýše 240 za sekundu, pokud režim nenastaví --present-mode nebo VECTORCRAFT_PRESENT_MODE. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. Nejvyšší počet kroků zpět, které si každý dokument ponechá; nižší číslo po klepnutí na OK odstraní nejstarší kroky. Kroky mohou zmizet i dříve, když zabírají příliš paměti. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Ukazuje, jak se kresba mění, zatímco táhnete; při vypnutí sledují tažení obrysy a kresba se změní, až pustíte. Vodítko z pravítka se při tažení pohybuje vždy. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Kolik pracovních vláken kreslí kresbu; -1 použije o jedno méně, než je jader, která VectorCraft smí použít, nejvýše 8, a 0 žádné. Webová verze nepoužívá žádné. diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 8ca718e8d8..d6d146a763 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7178,6 +7178,7 @@ font-technology Variable Variable New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Ny tekst får dette sprog, så længe sproget i Dokumentopsætning er Engelsk: USA; tekst, der allerede er i et dokument, beholder sit eget sprog. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. I afsnit med Orddeling slået til deles et ord på listen kun ved de bindestreger, der er skrevet i det, eller slet ikke uden nogen, uanset sprog og store eller små bogstaver. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. I desktopversionen indlæses .wasm-plug-ins i denne mappe ved start, og når du klikker på OK med en ny mappe her, undtagen i sikker tilstand; webversionen indlæser dem ikke. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. Stor lader et plug-in-filter eller en plug-in-kommando køre mindst 250 millioner instruktioner plus flere for hver byte input; Normal beholder plug-in'ets egen grænse. Tidsgrænsen er den samme. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Det første valg af midlertidig disk: Startup, None eller en mappesti; VectorCraft gemmer det, men bruger endnu ikke midlertidige diske. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Det andet valg af midlertidig disk: Startup, None eller en mappesti; VectorCraft gemmer det, men bruger endnu ikke midlertidige diske. How light or dark the interface is. Hvor lys eller mørk brugergrænsefladen er. @@ -7196,6 +7197,7 @@ font-technology Variable Variable Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. Animeret zoom virker kun, mens dette er slået til; slået fra er Animeret zoom nedtonet, og zoom animeres ikke. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. Zoom med hjulet glider blødt ind, og Zoomværktøjet zoomer, mens du trækker til siden eller holder det nede; slået fra zoomer Zoomværktøjet til det område, du trækker hen over. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Fra næste start tegner desktopversionen med denne type grafikprocessor; Automatisk foretrækker den, der styrer skærmen. Webversionen bruger den ikke. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. Fra næste start viser vinduet billeder uden at vente på, at skærmen opdateres, højst 240 i sekundet, medmindre --present-mode eller VECTORCRAFT_PRESENT_MODE angiver tilstanden. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. Det største antal fortryd-trin, hvert dokument beholder; et lavere tal fjerner de ældste trin, når du klikker på OK. Trin kan også forsvinde tidligere, når de bruger for meget hukommelse. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Viser grafikken ændre sig, mens du trækker; slået fra følger konturer trækket, og grafikken ændres, når du slipper. En hjælpelinje fra linealen flytter sig altid, mens du trækker. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Hvor mange arbejdstråde der tegner grafikken; -1 bruger én færre end de kerner, VectorCraft må bruge, højst 8, og 0 ingen. Webversionen bruger aldrig nogen. diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index be5ac3f25c..f275409413 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -3251,6 +3251,7 @@ digits Malayalam Malayalam New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Neuer Text erhält diese Sprache, solange die Sprache unter „Dokument einrichten“ Englisch: USA ist; Text, der bereits in einem Dokument steht, behält seine Sprache. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. In Absätzen mit eingeschalteter Silbentrennung wird ein aufgeführtes Wort nur an den darin eingegebenen Bindestrichen getrennt oder gar nicht, wenn es keine hat, unabhängig von Sprache und Groß- und Kleinschreibung. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. In der Desktop-Version werden die .wasm-Plug-ins in diesem Ordner beim Start geladen und wenn Sie hier mit einem neuen Ordner auf OK klicken, außer im abgesicherten Modus; die Webversion lädt sie nicht. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. „Groß“ lässt einen Plug-in-Filter oder -Befehl mindestens 250 Millionen Anweisungen ausführen, dazu weitere für jedes Byte der Eingabe; „Normal“ behält das eigene Limit des Plug-ins. Das Zeitlimit bleibt gleich. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Die erste Wahl für das Arbeitsvolume: Startup, None oder ein Ordnerpfad; VectorCraft speichert sie, verwendet aber noch keine Arbeitsvolumes. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Die zweite Wahl für das Arbeitsvolume: Startup, None oder ein Ordnerpfad; VectorCraft speichert sie, verwendet aber noch keine Arbeitsvolumes. How light or dark the interface is. Wie hell oder dunkel die Benutzeroberfläche ist. @@ -3269,6 +3270,7 @@ digits Malayalam Malayalam Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. „Animierter Zoom“ funktioniert nur, solange dies eingeschaltet ist; ausgeschaltet ist „Animierter Zoom“ abgeblendet und das Zoomen wird nicht animiert. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. Der Zoom mit dem Mausrad gleitet weich, und das Zoom-Werkzeug zoomt, während Sie seitwärts ziehen oder es gedrückt halten; ausgeschaltet zoomt es auf den Bereich, über den Sie ziehen. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Ab dem nächsten Start zeichnet die Desktop-Version mit dieser Art von Grafikprozessor; „Automatisch“ bevorzugt den, der den Bildschirm ansteuert. Die Webversion verwendet sie nicht. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. Ab dem nächsten Start zeigt das Fenster Bilder an, ohne auf die Aktualisierung des Bildschirms zu warten, höchstens 240 pro Sekunde, außer --present-mode oder VECTORCRAFT_PRESENT_MODE legt den Modus fest. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. Die Höchstzahl der Rückgängig-Schritte, die jedes Dokument behält; eine kleinere Zahl entfernt beim Klick auf OK die ältesten Schritte. Schritte können auch früher entfallen, wenn sie zu viel Speicher belegen. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Zeigt beim Ziehen, wie sich das Bildmaterial ändert; ausgeschaltet folgen Umrisse dem Ziehen, und das Bildmaterial ändert sich beim Loslassen. Eine Hilfslinie aus dem Lineal bewegt sich beim Ziehen immer mit. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Wie viele Worker-Threads das Bildmaterial zeichnen; -1 verwendet einen weniger als die Kerne, die VectorCraft nutzen darf, höchstens 8, und 0 keinen. Die Webversion verwendet nie einen. diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index aec2d300ab..95aa88d025 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -4102,6 +4102,7 @@ digits Malayalam Μαλαγιάλαμ New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Το νέο κείμενο παίρνει αυτήν τη γλώσσα όσο η γλώσσα στη Ρύθμιση εγγράφου είναι Αγγλικά: ΗΠΑ· το κείμενο που υπάρχει ήδη σε ένα έγγραφο κρατά τη δική του γλώσσα. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. Σε παραγράφους με ενεργό τον Συλλαβισμό, μια λέξη της λίστας χωρίζεται μόνο στα ενωτικά που έχουν πληκτρολογηθεί σε αυτήν ή πουθενά αν δεν έχει, ανεξάρτητα από τη γλώσσα ή τα πεζά-κεφαλαία της. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. Στην έκδοση για υπολογιστή, τα πρόσθετα .wasm αυτού του φακέλου φορτώνονται κατά την εκκίνηση και όταν κάνετε κλικ στο Εντάξει με νέο φάκελο εδώ, εκτός από την Ασφαλή λειτουργία· η έκδοση web δεν τα φορτώνει. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. Το Μεγάλο επιτρέπει σε ένα φίλτρο ή μια εντολή πρόσθετου να εκτελέσει τουλάχιστον 250 εκατομμύρια οδηγίες, συν περισσότερες για κάθε byte εισόδου· η Κανονική διατηρεί το δικό όριο του πρόσθετου. Το χρονικό όριο μένει ίδιο. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Η πρώτη επιλογή δίσκου προσωρινής αποθήκευσης: Startup, None ή διαδρομή φακέλου· το VectorCraft την αποθηκεύει, αλλά δεν χρησιμοποιεί ακόμη δίσκους προσωρινής αποθήκευσης. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Η δεύτερη επιλογή δίσκου προσωρινής αποθήκευσης: Startup, None ή διαδρομή φακέλου· το VectorCraft την αποθηκεύει, αλλά δεν χρησιμοποιεί ακόμη δίσκους προσωρινής αποθήκευσης. How light or dark the interface is. Πόσο φωτεινό ή σκοτεινό είναι το περιβάλλον χρήστη. @@ -4120,6 +4121,7 @@ digits Malayalam Μαλαγιάλαμ Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. Η Κινούμενη μεγέθυνση λειτουργεί μόνο όσο αυτό είναι ενεργό· όταν είναι ανενεργό, η Κινούμενη μεγέθυνση είναι αχνή και η μεγέθυνση δεν κινείται. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. Η μεγέθυνση με τον τροχό γλιστρά ομαλά, και το εργαλείο Μεγέθυνση μεγεθύνει καθώς σύρετε στο πλάι ή το κρατάτε πατημένο· όταν είναι ανενεργό, μεγεθύνει στην περιοχή που σύρετε. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Από την επόμενη εκκίνηση, η έκδοση για υπολογιστή σχεδιάζει με αυτό το είδος επεξεργαστή γραφικών· το Αυτόματο προτιμά αυτόν που οδηγεί την οθόνη. Η έκδοση web δεν το χρησιμοποιεί. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. Από την επόμενη εκκίνηση, το παράθυρο εμφανίζει καρέ χωρίς να περιμένει την ανανέωση της οθόνης, έως 240 το δευτερόλεπτο, εκτός αν το --present-mode ή το VECTORCRAFT_PRESENT_MODE ορίζει τη λειτουργία. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. Τα περισσότερα βήματα αναίρεσης που κρατά κάθε έγγραφο· μικρότερος αριθμός αφαιρεί τα παλαιότερα βήματα όταν κάνετε κλικ στο Εντάξει. Βήματα μπορεί να φύγουν και νωρίτερα αν πιάνουν πολλή μνήμη. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Δείχνει το έργο να αλλάζει όσο σύρετε· όταν είναι ανενεργό, περιγράμματα ακολουθούν τη μεταφορά και το έργο αλλάζει όταν αφήσετε. Ένας οδηγός χάρακα κινείται πάντα όσο σύρετε. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Πόσα νήματα εργασίας σχεδιάζουν το έργο· το -1 χρησιμοποιεί ένα λιγότερο από τους πυρήνες που επιτρέπονται στο VectorCraft, έως 8, και το 0 κανένα. Η έκδοση web δεν χρησιμοποιεί ποτέ. diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index f6b2870237..5840932577 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -3288,6 +3288,7 @@ digits Malayalam Malayálam New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. El texto nuevo toma este idioma mientras el idioma de Ajustar documento sea Inglés: Estados Unidos; el texto que ya está en un documento conserva su idioma. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. En los párrafos con Separar con guiones activado, una palabra de la lista se divide solo en los guiones escritos en ella, o en ningún punto si no tiene, sea cual sea su idioma o uso de mayúsculas. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. En la versión de escritorio, los plugins .wasm de esta carpeta se cargan al iniciar y al hacer clic en Aceptar con una carpeta nueva aquí, salvo en Modo seguro; la versión web no los carga. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. Grande permite que un filtro o un comando de un plugin ejecute al menos 250 millones de instrucciones, más otras por cada byte de entrada; Normal mantiene el límite propio del plugin. El límite de tiempo no cambia. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. La primera opción de disco de memoria virtual: Startup, None o la ruta de una carpeta; VectorCraft la guarda, pero aún no usa discos de memoria virtual. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. La segunda opción de disco de memoria virtual: Startup, None o la ruta de una carpeta; VectorCraft la guarda, pero aún no usa discos de memoria virtual. How light or dark the interface is. Lo clara u oscura que es la interfaz. @@ -3306,6 +3307,7 @@ digits Malayalam Malayálam Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. El Zoom animado solo funciona mientras esto está activado; desactivado, el Zoom animado aparece atenuado y el zoom no se anima. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. El zoom con la rueda se desliza suavemente, y la Herramienta Zoom amplía mientras arrastra de lado o la mantiene pulsada; desactivado, la Herramienta Zoom amplía el área que arrastra. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. A partir del próximo inicio, la versión de escritorio dibuja con este tipo de procesador gráfico; Automático prefiere el que controla la pantalla. La versión web no lo usa. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. A partir del próximo inicio, la ventana muestra los fotogramas sin esperar a que la pantalla se actualice, como máximo 240 por segundo, salvo que --present-mode o VECTORCRAFT_PRESENT_MODE establezca el modo. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. El máximo de pasos de deshacer que conserva cada documento; un número menor quita los pasos más antiguos al hacer clic en Aceptar. Los pasos también pueden irse antes si ocupan demasiada memoria. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Muestra cómo cambia el arte mientras arrastra; desactivado, los contornos siguen el arrastre y el arte cambia al soltar. Una guía de regla siempre se mueve mientras arrastra. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Cuántos hilos de trabajo dibujan el arte; -1 usa uno menos que los núcleos que VectorCraft puede usar, como máximo 8, y 0 ninguno. La versión web nunca usa ninguno. diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 8cce2c5459..f41e9da7ee 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4667,6 +4667,7 @@ font-technology Variable Muuttuvat New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Uusi teksti saa tämän kielen, kun Asiakirjan asetusten kieli on Englanti: USA; asiakirjassa jo oleva teksti säilyttää oman kielensä. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. Kappaleissa, joissa Tavuta on käytössä, luettelon sana tavutetaan vain siihen kirjoitettujen yhdysmerkkien kohdalta tai ei lainkaan, jos niitä ei ole, kielestä ja kirjainkoosta riippumatta. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. Työpöytäversiossa tämän kansion .wasm-laajennukset ladataan käynnistettäessä ja kun napsautat OK uuden kansion kanssa tässä, paitsi vikasietotilassa; verkkoversio ei lataa niitä. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. Suuri antaa laajennuksen suodattimen tai komennon suorittaa vähintään 250 miljoonaa käskyä sekä lisää jokaista syötteen tavua kohden; Normaali säilyttää laajennuksen oman rajan. Aikaraja pysyy samana. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Ensimmäinen työlevyvalinta: Startup, None tai kansiopolku; VectorCraft tallentaa sen, mutta ei vielä käytä työlevyjä. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Toinen työlevyvalinta: Startup, None tai kansiopolku; VectorCraft tallentaa sen, mutta ei vielä käytä työlevyjä. How light or dark the interface is. Kuinka vaalea tai tumma käyttöliittymä on. @@ -4685,6 +4686,7 @@ font-technology Variable Muuttuvat Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. Animoitu zoomaus toimii vain, kun tämä on päällä; pois päältä Animoitu zoomaus on himmennetty eikä zoomausta animoida. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. Rullalla zoomaus liukuu pehmeästi, ja Zoomaustyökalu zoomaa, kun vedät sivulle tai pidät sitä painettuna; pois päältä Zoomaustyökalu zoomaa alueeseen, jonka yli vedät. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Seuraavasta käynnistyksestä alkaen työpöytäversio piirtää tämän tyyppisellä grafiikkasuorittimella; Automaattinen suosii näyttöä ohjaavaa. Verkkoversio ei käytä sitä. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. Seuraavasta käynnistyksestä alkaen ikkuna näyttää kehykset odottamatta näytön virkistystä, enintään 240 sekunnissa, ellei --present-mode tai VECTORCRAFT_PRESENT_MODE aseta tilaa. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. Kumoamisvaiheiden enimmäismäärä, jonka kukin asiakirja säilyttää; pienempi luku poistaa vanhimmat vaiheet, kun napsautat OK. Vaiheita voi poistua aiemmin, jos ne vievät liikaa muistia. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Näyttää kuvituksen muuttuvan vetäessäsi; pois päältä ääriviivat seuraavat vetoa ja kuvitus muuttuu, kun vapautat. Viivaimen apuviiva liikkuu aina vetäessäsi. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Montako työsäiettä piirtää kuvituksen; -1 käyttää yhden vähemmän kuin VectorCraftin käytettävissä olevia ytimiä, enintään 8, ja 0 ei yhtään. Verkkoversio ei käytä koskaan yhtään. diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 0b585ab3ff..5332066ab9 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -3276,6 +3276,7 @@ digits Malayalam Malayalam New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Le nouveau texte prend cette langue tant que la langue de Format de document est l’anglais des États-Unis. Le texte déjà présent dans un document garde sa langue. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. Dans les paragraphes où Césure est activée, un mot de la liste n’est coupé qu’aux traits d’union saisis dedans, ou nulle part s’il n’en a pas, quelles que soient sa langue et sa casse. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. Dans la version de bureau, les modules externes .wasm de ce dossier se chargent au démarrage et lorsque vous cliquez sur OK avec un nouveau dossier ici, sauf en mode sans échec. La version web ne les charge pas. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. Grand permet à un filtre ou une commande de module externe d’exécuter au moins 250 millions d’instructions, plus d’autres pour chaque octet d’entrée. Normal conserve la limite propre du module. La limite de temps reste la même. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Premier disque de travail (Startup, None ou le chemin d’un dossier). VectorCraft l’enregistre, mais n’utilise pas encore de disques de travail. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Second disque de travail (Startup, None ou le chemin d’un dossier). VectorCraft l’enregistre, mais n’utilise pas encore de disques de travail. How light or dark the interface is. Le degré de clarté de l’interface, du plus sombre au plus clair. @@ -3294,6 +3295,7 @@ digits Malayalam Malayalam Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. Le Zoom animé ne fonctionne que si cette option est activée. Désactivée, le Zoom animé est grisé et le zoom n’est pas animé. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. Le zoom à la molette glisse en douceur, et l’Outil Zoom zoome quand vous faites glisser de côté ou le maintenez enfoncé. Désactivée, l’Outil Zoom zoome sur la zone que vous parcourez. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. À partir du prochain démarrage, la version de bureau dessine avec ce type de processeur graphique. Automatique préfère celui qui pilote l’écran. La version web ne l’utilise pas. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. À partir du prochain démarrage, la fenêtre affiche les images sans attendre le rafraîchissement de l’écran, 240 par seconde au plus, sauf si --present-mode ou VECTORCRAFT_PRESENT_MODE définit le mode. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. Le nombre maximal d’étapes d’annulation que chaque document conserve. Un nombre plus bas supprime les plus anciennes quand vous cliquez sur OK. Des étapes peuvent aussi partir plus tôt si elles occupent trop de mémoire. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Montre l’illustration qui change pendant que vous faites glisser. Désactivée, des contours suivent le glissement et l’illustration change quand vous relâchez. Un repère de règle suit toujours le glissement. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Le nombre de threads de travail qui dessinent l’illustration. Avec -1, VectorCraft en utilise un de moins que les cœurs qu’il peut utiliser, 8 au plus, et avec 0 aucun. La version web n’en utilise jamais. diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index c75fb4867b..2847e27f55 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -3337,6 +3337,7 @@ New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. દસ્તાવેજ સેટઅપની ભાષા અંગ્રેજી: USA હોય ત્યાં સુધી નવા ટેક્સ્ટને આ ભાષા મળે છે; દસ્તાવેજમાં પહેલેથી રહેલું ટેક્સ્ટ પોતાની ભાષા રાખે છે. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. હાઇફનેટ કરો ચાલુ હોય તેવા ફકરાઓમાં, સૂચિમાંનો શબ્દ ફક્ત તેમાં લખેલા હાઇફન પર જ તૂટે છે, અથવા કોઈ ન હોય તો ક્યાંય નહીં, તેની ભાષા કે કેસ ગમે તે હોય. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. ડેસ્કટોપ સંસ્કરણમાં, આ ફોલ્ડરના .wasm પ્લગ-ઇન્સ શરૂઆતમાં અને અહીં નવા ફોલ્ડર સાથે ઠીક પર ક્લિક કરો ત્યારે લોડ થાય છે, સેફ મોડ સિવાય; વેબ સંસ્કરણ તેમને લોડ કરતું નથી. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. મોટું પ્લગ-ઇન ફિલ્ટર અથવા આદેશને ઓછામાં ઓછા 250 મિલિયન સૂચનાઓ ચલાવવા દે છે, ઉપરાંત ઇનપુટના દરેક બાઇટ માટે વધુ; સામાન્ય પ્લગ-ઇનની પોતાની મર્યાદા રાખે છે. સમય મર્યાદા એ જ રહે છે. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. પ્રથમ સ્ક્રેચ ડિસ્ક પસંદગી: Startup, None અથવા ફોલ્ડરનો પાથ; VectorCraft તેને સાચવે છે, પરંતુ હજી સ્ક્રેચ ડિસ્કનો ઉપયોગ કરતું નથી. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. બીજી સ્ક્રેચ ડિસ્ક પસંદગી: Startup, None અથવા ફોલ્ડરનો પાથ; VectorCraft તેને સાચવે છે, પરંતુ હજી સ્ક્રેચ ડિસ્કનો ઉપયોગ કરતું નથી. How light or dark the interface is. ઇન્ટરફેસ કેટલું આછું કે ઘેરું છે. @@ -3355,6 +3356,7 @@ Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. ઍનિમેટેડ ઝૂમ ફક્ત આ ચાલુ હોય ત્યારે જ કામ કરે છે; બંધ હોય ત્યારે, ઍનિમેટેડ ઝૂમ ઝાંખું થાય છે અને ઝૂમ ઍનિમેટ થતું નથી. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. વ્હીલથી ઝૂમ સરળતાથી સરકે છે, અને ઝૂમ ટૂલ તમે બાજુમાં ખેંચો અથવા દબાવી રાખો ત્યારે ઝૂમ કરે છે; બંધ હોય ત્યારે, ઝૂમ ટૂલ તમે ખેંચો તે વિસ્તાર પર ઝૂમ કરે છે. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. આગલી શરૂઆતથી, ડેસ્કટોપ સંસ્કરણ આ પ્રકારના ગ્રાફિક્સ પ્રોસેસરથી દોરે છે; સ્વચાલિત ડિસ્પ્લે ચલાવતા પ્રોસેસરને પસંદ કરે છે. વેબ સંસ્કરણ તેનો ઉપયોગ કરતું નથી. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. આગલી શરૂઆતથી, વિન્ડો ડિસ્પ્લે રિફ્રેશ થવાની રાહ જોયા વિના ફ્રેમ બતાવે છે, સેકન્ડમાં વધુમાં વધુ 240, સિવાય કે --present-mode અથવા VECTORCRAFT_PRESENT_MODE મોડ સેટ કરે. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. દરેક દસ્તાવેજ રાખે તે પૂર્વવત્ પગલાંની મહત્તમ સંખ્યા; ઓછી સંખ્યા ઠીક પર ક્લિક કરો ત્યારે સૌથી જૂનાં પગલાં દૂર કરે છે. પગલાં વધુ મેમરી લે ત્યારે વહેલાં પણ દૂર થઈ શકે છે. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. તમે ખેંચો ત્યારે આર્ટ બદલાતી બતાવે છે; બંધ હોય ત્યારે, રૂપરેખાઓ ખેંચાણને અનુસરે છે અને તમે છોડો ત્યારે આર્ટ બદલાય છે. રૂલરની માર્ગદર્શિકા ખેંચતી વખતે હંમેશા ખસે છે. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. કેટલા વર્કર થ્રેડ આર્ટ દોરે છે; -1 VectorCraft વાપરી શકે તે કોરથી એક ઓછો વાપરે છે, વધુમાં વધુ 8, અને 0 એક પણ નહીં. વેબ સંસ્કરણ ક્યારેય કોઈ વાપરતું નથી. diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index bcb9d223fc..51e24790ab 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -4655,6 +4655,7 @@ antiAlias Sharp शार्प New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. जब तक डॉक्यूमेंट सेटअप की भाषा अंग्रेज़ी: USA है, नए टेक्स्ट को यह भाषा मिलती है; डॉक्यूमेंट में पहले से मौजूद टेक्स्ट अपनी भाषा रखता है। In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. जिन पैराग्राफ़ में हाइफ़नेशन चालू है, उनमें सूची का शब्द केवल उसमें टाइप किए गए हाइफ़न पर टूटता है, या कोई न हो तो कहीं नहीं, उसकी भाषा या केस चाहे जो हो। On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. डेस्कटॉप संस्करण में, इस फ़ोल्डर के .wasm प्लग-इन शुरू होने पर और यहाँ नया फ़ोल्डर देकर ठीक है पर क्लिक करने पर लोड होते हैं, सुरक्षित मोड को छोड़कर; वेब संस्करण उन्हें लोड नहीं करता। + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. बड़ा किसी प्लग-इन फ़िल्टर या कमांड को कम से कम 25 करोड़ निर्देश चलाने देता है, साथ ही इनपुट के हर बाइट के लिए और; सामान्य प्लग-इन की अपनी सीमा रखता है। समय सीमा वही रहती है। The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. पहला स्क्रैच डिस्क विकल्प: Startup, None या फ़ोल्डर पाथ; VectorCraft इसे सहेजता है, पर अभी स्क्रैच डिस्क का उपयोग नहीं करता। The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. दूसरा स्क्रैच डिस्क विकल्प: Startup, None या फ़ोल्डर पाथ; VectorCraft इसे सहेजता है, पर अभी स्क्रैच डिस्क का उपयोग नहीं करता। How light or dark the interface is. इंटरफ़ेस कितना हल्का या गहरा है। @@ -4673,6 +4674,7 @@ antiAlias Sharp शार्प Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. एनिमेटेड ज़ूम केवल तभी काम करता है जब यह चालू हो; बंद होने पर, एनिमेटेड ज़ूम धुंधला हो जाता है और ज़ूम एनिमेट नहीं होता। The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. व्हील से ज़ूम सहजता से सरकता है, और ज़ूम टूल बगल में खींचने या दबाए रखने पर ज़ूम करता है; बंद होने पर, ज़ूम टूल उस क्षेत्र पर ज़ूम करता है जिस पर आप खींचते हैं। From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. अगली शुरुआत से, डेस्कटॉप संस्करण इस प्रकार के ग्राफ़िक्स प्रोसेसर से बनाता है; स्वचालित उस प्रोसेसर को प्राथमिकता देता है जो डिस्प्ले चलाता है। वेब संस्करण इसका उपयोग नहीं करता। + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. अगली शुरुआत से, विंडो डिस्प्ले के रीफ़्रेश होने का इंतज़ार किए बिना फ़्रेम दिखाती है, एक सेकंड में अधिकतम 240, जब तक --present-mode या VECTORCRAFT_PRESENT_MODE मोड तय न करे। The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. हर दस्तावेज़ अधिकतम जितने पूर्ववत चरण रखता है; कम संख्या ठीक है पर क्लिक करने पर सबसे पुराने चरण हटा देती है। ज़्यादा मेमोरी लेने पर चरण पहले भी हट सकते हैं। Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. खींचते समय आर्टवर्क को बदलते हुए दिखाता है; बंद होने पर, रूपरेखाएँ खींचने के साथ चलती हैं और छोड़ने पर आर्टवर्क बदलता है। रूलर गाइड खींचते समय हमेशा चलती है। How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. कितने वर्कर थ्रेड आर्टवर्क बनाते हैं; -1 उन कोर से एक कम उपयोग करता है जिन्हें VectorCraft उपयोग कर सकता है, अधिकतम 8, और 0 एक भी नहीं। वेब संस्करण कभी कोई उपयोग नहीं करता। diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index a2ea9a4694..b1a72b62db 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3869,6 +3869,7 @@ mark-style Japanese Japán New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Az új szöveg ezt a nyelvet kapja, amíg a Dokumentumbeállítás nyelve Angol: amerikai; a dokumentumban már meglévő szöveg megtartja a saját nyelvét. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. Azokban a bekezdésekben, ahol az Elválasztás be van kapcsolva, a felsorolt szó csak a beleírt kötőjeleknél válik el, vagy sehol, ha nincs benne, nyelvétől és kis- vagy nagybetűitől függetlenül. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. Az asztali változatban a mappa .wasm bővítményei indításkor töltődnek be, és amikor itt új mappával az OK gombra kattint, kivéve csökkentett módban; a webes változat nem tölti be őket. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. A Nagy lehetővé teszi, hogy egy bővítményszűrő vagy -parancs legalább 250 millió utasítást futtasson, és a bemenet minden bájtjáért továbbiakat; a Normál megtartja a bővítmény saját korlátját. Az időkorlát változatlan marad. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Az első munkalemez-választás: Startup, None vagy egy mappa elérési útja; a VectorCraft tárolja, de munkalemezeket még nem használ. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. A második munkalemez-választás: Startup, None vagy egy mappa elérési útja; a VectorCraft tárolja, de munkalemezeket még nem használ. How light or dark the interface is. Milyen világos vagy sötét a felület. @@ -3887,6 +3888,7 @@ mark-style Japanese Japán Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. Az Animált nagyítás csak akkor működik, ha ez be van kapcsolva; kikapcsolva az Animált nagyítás halvány, és a nagyítás nem animált. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. A görgős nagyítás simán úszik be, a Nagyító pedig akkor nagyít, amikor oldalra húz vagy lenyomva tartja; kikapcsolva a Nagyító arra a területre nagyít, amelyen áthúz. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. A következő indítástól az asztali változat ilyen típusú grafikus processzorral rajzol; az Automatikus a kijelzőt meghajtót részesíti előnyben. A webes változat nem használja. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. A következő indítástól az ablak a kijelző frissítésére várás nélkül jeleníti meg a képkockákat, másodpercenként legfeljebb 240-et, hacsak a --present-mode vagy a VECTORCRAFT_PRESENT_MODE meg nem adja a módot. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. A dokumentumonként megőrzött visszavonási lépések legnagyobb száma; kisebb szám az OK gombra kattintáskor törli a legrégebbi lépéseket. A lépések korábban is törlődhetnek, ha túl sok memóriát foglalnak. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Húzás közben mutatja a grafika változását; kikapcsolva körvonalak követik a húzást, és a grafika elengedéskor változik. A vonalzó segédvonala húzás közben mindig mozog. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Hány munkaszál rajzolja a grafikát; a -1 eggyel kevesebbet használ, mint ahány magot a VectorCraft használhat, legfeljebb 8-at, a 0 egyet sem. A webes változat soha nem használ egyet sem. diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 52f88ff13e..f9d241ab35 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -4389,6 +4389,7 @@ font-technology Variable Variabel New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Teks baru mendapat bahasa ini selama bahasa di Pengaturan dokumen adalah Inggris: USA; teks yang sudah ada di dokumen mempertahankan bahasanya sendiri. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. Di paragraf dengan Pemenggalan kata aktif, kata dalam daftar hanya dipenggal pada tanda hubung yang diketik di dalamnya, atau tidak di mana pun jika tidak ada, apa pun bahasa atau huruf besar-kecilnya. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. Di versi desktop, plug-in .wasm di folder ini dimuat saat memulai dan saat Anda mengeklik OK dengan folder baru di sini, kecuali dalam Mode aman; versi web tidak memuatnya. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. Besar memungkinkan filter atau perintah plug-in menjalankan setidaknya 250 juta instruksi, ditambah lagi untuk setiap byte input; Normal mempertahankan batas plug-in itu sendiri. Batas waktunya tetap sama. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Pilihan disk scratch pertama: Startup, None, atau jalur folder; VectorCraft menyimpannya, tetapi belum menggunakan disk scratch. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Pilihan disk scratch kedua: Startup, None, atau jalur folder; VectorCraft menyimpannya, tetapi belum menggunakan disk scratch. How light or dark the interface is. Seberapa terang atau gelap antarmuka. @@ -4407,6 +4408,7 @@ font-technology Variable Variabel Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. Zoom animasi hanya berfungsi selama ini aktif; jika nonaktif, Zoom animasi diredupkan dan zoom tidak dianimasikan. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. Zoom dengan roda meluncur halus, dan Alat zoom memperbesar saat Anda menyeret ke samping atau menahannya; jika nonaktif, Alat zoom memperbesar ke area yang Anda seret. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Mulai dari peluncuran berikutnya, versi desktop menggambar dengan jenis prosesor grafis ini; Otomatis mengutamakan yang menjalankan layar. Versi web tidak menggunakannya. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. Mulai dari peluncuran berikutnya, jendela menampilkan bingkai tanpa menunggu layar menyegarkan, paling banyak 240 per detik, kecuali --present-mode atau VECTORCRAFT_PRESENT_MODE menetapkan modenya. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. Jumlah maksimum langkah urungkan yang disimpan setiap dokumen; angka yang lebih kecil menghapus langkah terlama saat Anda mengeklik OK. Langkah juga dapat hilang lebih awal jika memakai terlalu banyak memori. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Menampilkan gambar yang berubah saat Anda menyeret; jika nonaktif, garis luar mengikuti seretan dan gambar berubah saat Anda melepas. Panduan penggaris selalu bergerak saat Anda menyeret. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Berapa banyak thread pekerja yang menggambar; -1 memakai satu lebih sedikit dari inti yang boleh dipakai VectorCraft, paling banyak 8, dan 0 tidak memakai sama sekali. Versi web tidak pernah memakainya. diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 3c5381ed43..75fe408f43 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -3336,6 +3336,7 @@ digits Malayalam Malayalam New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Il nuovo testo prende questa lingua finché la lingua di Imposta documento è Inglese: Stati Uniti; il testo già presente in un documento mantiene la propria lingua. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. Nei paragrafi con Sillaba attivo, una parola dell'elenco va a capo solo ai trattini digitati al suo interno, o in nessun punto se non ne ha, qualunque sia la sua lingua o l'uso delle maiuscole. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. Nella versione desktop, i plug-in .wasm di questa cartella vengono caricati all'avvio e quando fai clic su OK con una nuova cartella qui, tranne in modalità provvisoria; la versione web non li carica. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. Grande consente a un filtro o comando di un plug-in di eseguire almeno 250 milioni di istruzioni, più altre per ogni byte di input; Normale mantiene il limite proprio del plug-in. Il limite di tempo resta lo stesso. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. La prima scelta del disco di memoria virtuale: Startup, None o il percorso di una cartella; VectorCraft la memorizza, ma non usa ancora dischi di memoria virtuale. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. La seconda scelta del disco di memoria virtuale: Startup, None o il percorso di una cartella; VectorCraft la memorizza, ma non usa ancora dischi di memoria virtuale. How light or dark the interface is. Quanto è chiara o scura l'interfaccia. @@ -3354,6 +3355,7 @@ digits Malayalam Malayalam Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. Lo Zoom animato funziona solo mentre questa opzione è attiva; se disattivata, lo Zoom animato è attenuato e lo zoom non è animato. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. Lo zoom con la rotellina scorre in modo fluido, e lo Strumento Zoom ingrandisce mentre trascini di lato o lo tieni premuto; se disattivata, lo Strumento Zoom ingrandisce l'area che trascini. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Dal prossimo avvio, la versione desktop disegna con questo tipo di processore grafico; Automatico preferisce quello che gestisce lo schermo. La versione web non lo usa. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. Dal prossimo avvio, la finestra mostra i fotogrammi senza attendere l'aggiornamento dello schermo, al massimo 240 al secondo, a meno che --present-mode o VECTORCRAFT_PRESENT_MODE imposti la modalità. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. Il numero massimo di passaggi di annullamento che ogni documento conserva; un numero più basso rimuove i passaggi più vecchi quando fai clic su OK. I passaggi possono sparire anche prima se occupano troppa memoria. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Mostra la grafica che cambia mentre trascini; se disattivata, i contorni seguono il trascinamento e la grafica cambia quando rilasci. Una guida del righello si muove sempre mentre trascini. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Quanti thread di lavoro disegnano la grafica; -1 ne usa uno in meno dei core che VectorCraft può usare, al massimo 8, e 0 nessuno. La versione web non ne usa mai. diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index e93e10b281..ba5dfa19ee 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -3320,6 +3320,7 @@ mark-style Japanese 日本式 New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. ドキュメント設定の言語が英語 (米国) の間は、新しいテキストにこの言語が設定されます。ドキュメント内の既存のテキストは自身の言語を保ちます。 In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. ハイフネーションがオンの段落では、リストの単語は入力したハイフンの位置でのみ分割され、ハイフンがなければ分割されません。言語や大文字小文字は問いません。 On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. デスクトップ版では、このフォルダーの .wasm プラグインが起動時と、ここに新しいフォルダーを指定して OK をクリックしたときに読み込まれます (セーフモードを除く)。Web 版では読み込まれません。 + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. 大では、プラグインのフィルターやコマンドが少なくとも 2 億 5,000 万命令を実行でき、入力の 1 バイトごとにさらに追加されます。通常ではプラグイン自身の上限が使われます。時間の上限は変わりません。 The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. 1 つ目の仮想記憶ディスクの選択です。Startup、None またはフォルダーのパスを指定します。VectorCraft は保存しますが、仮想記憶ディスクはまだ使用しません。 The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. 2 つ目の仮想記憶ディスクの選択です。Startup、None またはフォルダーのパスを指定します。VectorCraft は保存しますが、仮想記憶ディスクはまだ使用しません。 How light or dark the interface is. インターフェイスをどの程度明るく、または暗く表示するかです。 @@ -3338,6 +3339,7 @@ mark-style Japanese 日本式 Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. アニメーションズームは、これがオンのときだけ働きます。オフの場合、アニメーションズームは淡色表示になり、ズームはアニメーションしません。 The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. ホイールによるズームはなめらかに動き、ズームツールは横にドラッグするか押したままにするとズームします。オフの場合、ズームツールはドラッグした範囲にズームします。 From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. 次回の起動から、デスクトップ版はこの種類のグラフィックプロセッサーで描画します。自動ではディスプレイを駆動しているものが優先されます。Web 版では使われません。 + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. 次回の起動から、ウィンドウはディスプレイの更新を待たずにフレームを表示します (1 秒あたり最大 240)。ただし --present-mode または VECTORCRAFT_PRESENT_MODE でモードを指定した場合はそれに従います。 The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. 各ドキュメントが保持する取り消しステップの最大数です。値を下げると、OK をクリックしたときに古いステップから削除されます。メモリを使いすぎる場合は、さらに早く削除されることがあります。 Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. ドラッグ中にアートワークが変わる様子を表示します。オフの場合、ドラッグ中はアウトラインが動き、ボタンを離すとアートワークが変わります。定規ガイドはドラッグ中も常に動きます。 How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. アートワークを描画するワーカースレッドの数です。-1 は VectorCraft が使えるコア数より 1 つ少なく (最大 8)、0 はワーカーを使いません。Web 版では常に使いません。 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index cfb73edcc8..501c4c58b4 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6464,6 +6464,7 @@ font-technology Variable ცვლადი New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. ახალი ტექსტი იღებს ამ ენას, სანამ დოკუმენტის პარამეტრების ენაა ინგლისური: აშშ; დოკუმენტში უკვე არსებული ტექსტი ინარჩუნებს თავის ენას. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. აბზაცებში, სადაც სიტყვების გადატანა ჩართულია, სიაში მოცემული სიტყვა მხოლოდ მასში აკრეფილ დეფისებთან გადაიტანება, ან არსად, თუ ისინი არ აქვს, მიუხედავად ენისა და რეგისტრისა. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. დესკტოპის ვერსიაში ამ საქაღალდის .wasm პლაგინები იტვირთება გაშვებისას და როცა აქ ახალი საქაღალდით OK-ს დააწკაპუნებთ, გარდა უსაფრთხო რეჟიმისა; ვებ-ვერსია მათ არ ტვირთავს. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. დიდი პლაგინის ფილტრს ან ბრძანებას აძლევს საშუალებას, შეასრულოს მინიმუმ 250 მილიონი ინსტრუქცია, დამატებით შეყვანის ყოველ ბაიტზე; ჩვეულებრივი ინარჩუნებს პლაგინის საკუთარ ლიმიტს. დროის ლიმიტი იგივე რჩება. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. სამუშაო დისკის პირველი არჩევანი: Startup, None ან საქაღალდის მისამართი; VectorCraft მას ინახავს, მაგრამ სამუშაო დისკებს ჯერ არ იყენებს. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. სამუშაო დისკის მეორე არჩევანი: Startup, None ან საქაღალდის მისამართი; VectorCraft მას ინახავს, მაგრამ სამუშაო დისკებს ჯერ არ იყენებს. How light or dark the interface is. რამდენად ღია ან მუქია ინტერფეისი. @@ -6482,6 +6483,7 @@ font-technology Variable ცვლადი Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. ანიმირებული მასშტაბირება მუშაობს მხოლოდ მაშინ, როცა ეს ჩართულია; გამორთულისას ანიმირებული მასშტაბირება მკრთალია და მასშტაბირება არ ანიმირდება. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. ბორბლით მასშტაბირება რბილად სრიალებს, მასშტაბის ხელსაწყო კი ადიდებს, როცა გვერდზე გადაათრევთ ან დაჭერილს გაჩერებთ; გამორთულისას ის ადიდებს არეს, რომელზეც გადაათრევთ. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. შემდეგი გაშვებიდან დესკტოპის ვერსია ხატავს ამ ტიპის გრაფიკული პროცესორით; ავტომატური უპირატესობას ანიჭებს ეკრანის მმართველს. ვებ-ვერსია მას არ იყენებს. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. შემდეგი გაშვებიდან ფანჯარა კადრებს აჩვენებს ეკრანის განახლების მოლოდინის გარეშე, წამში მაქსიმუმ 240-ს, თუ რეჟიმს --present-mode ან VECTORCRAFT_PRESENT_MODE არ აყენებს. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. გაუქმების ნაბიჯების მაქსიმალური რაოდენობა თითო დოკუმენტში; მცირე რიცხვი OK-ზე დაწკაპუნებისას შლის უძველეს ნაბიჯებს. ნაბიჯები შეიძლება ადრეც წაიშალოს, თუ ბევრ მეხსიერებას იკავებს. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. აჩვენებს, როგორ იცვლება ნახატი გადათრევისას; გამორთულისას კონტურები მისდევს გადათრევას, ნახატი კი ხელის აშვებისას იცვლება. სახაზავის დამხმარე ხაზი გადათრევისას ყოველთვის მოძრაობს. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. რამდენი სამუშაო ნაკადი ხატავს ნახატს; -1 იყენებს ერთით ნაკლებს VectorCraft-ისთვის ხელმისაწვდომ ბირთვებზე, მაქსიმუმ 8-ს, 0 კი არცერთს. ვებ-ვერსია არასდროს იყენებს. diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index bdedf81a4c..b42c8ed208 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3309,6 +3309,7 @@ mark-style Japanese 일본식 New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. 문서 설정의 언어가 영어: 미국인 동안 새 텍스트는 이 언어를 받습니다. 문서에 이미 있는 텍스트는 자체 언어를 유지합니다. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. 하이픈 넣기가 켜진 단락에서는 목록의 단어가 입력한 하이픈 위치에서만 나뉘며, 하이픈이 없으면 나뉘지 않습니다. 언어나 대소문자는 상관없습니다. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. 데스크톱 버전에서는 이 폴더의 .wasm 플러그인이 시작할 때와 여기에 새 폴더를 지정하고 확인을 클릭할 때 로드됩니다(안전 모드 제외). 웹 버전은 로드하지 않습니다. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. 크게는 플러그인 필터나 명령이 최소 2억 5천만 개의 명령어를 실행하고 입력 1바이트마다 더 실행할 수 있게 합니다. 표준은 플러그인 자체의 한도를 유지합니다. 시간 한도는 그대로입니다. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. 첫 번째 스크래치 디스크 선택: Startup, None 또는 폴더 경로. VectorCraft는 이 값을 저장하지만 아직 스크래치 디스크를 사용하지 않습니다. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. 두 번째 스크래치 디스크 선택: Startup, None 또는 폴더 경로. VectorCraft는 이 값을 저장하지만 아직 스크래치 디스크를 사용하지 않습니다. How light or dark the interface is. 인터페이스를 얼마나 밝게 또는 어둡게 표시할지입니다. @@ -3327,6 +3328,7 @@ mark-style Japanese 일본식 Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. 애니메이션 확대/축소는 이 옵션이 켜져 있을 때만 작동합니다. 끄면 애니메이션 확대/축소가 흐리게 표시되고 확대/축소에 애니메이션이 없습니다. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. 휠로 확대/축소하면 부드럽게 움직이고, 확대/축소 도구는 옆으로 드래그하거나 누르고 있으면 확대/축소합니다. 끄면 확대/축소 도구는 드래그한 영역으로 확대합니다. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. 다음 시작부터 데스크톱 버전은 이 종류의 그래픽 프로세서로 그립니다. 자동은 디스플레이를 구동하는 프로세서를 우선합니다. 웹 버전은 사용하지 않습니다. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. 다음 시작부터 창은 디스플레이 새로 고침을 기다리지 않고 프레임을 표시하며 초당 최대 240개입니다. 단, --present-mode 또는 VECTORCRAFT_PRESENT_MODE로 모드를 지정하면 그 모드를 따릅니다. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. 각 문서가 보관하는 실행 취소 단계의 최대 수입니다. 낮추면 확인을 클릭할 때 가장 오래된 단계가 삭제됩니다. 메모리를 너무 많이 쓰면 단계가 더 일찍 삭제될 수도 있습니다. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. 드래그하는 동안 아트가 바뀌는 모습을 보여 줍니다. 끄면 윤곽선이 드래그를 따라가고 놓을 때 아트가 바뀝니다. 눈금자 안내선은 드래그하는 동안 항상 움직입니다. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. 아트를 그리는 작업자 스레드 수입니다. -1은 VectorCraft가 쓸 수 있는 코어보다 하나 적게(최대 8개) 쓰고, 0은 하나도 쓰지 않습니다. 웹 버전은 항상 쓰지 않습니다. diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 26fdd1d21e..c48281c6cd 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -5049,6 +5049,7 @@ font-technology Variable Variabel New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Nieuwe tekst krijgt deze taal zolang de taal in Documentinstellingen Engels: VS is; tekst die al in een document staat, behoudt zijn eigen taal. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. In alinea's met Afbreken aan wordt een opgesomd woord alleen afgebroken bij de koppeltekens die erin getypt zijn, of nergens als het er geen heeft, ongeacht taal of hoofdletters. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. In de desktopversie worden de .wasm-plug-ins in deze map geladen bij het starten en wanneer u hier met een nieuwe map op OK klikt, behalve in de veilige modus; de webversie laadt ze niet. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. Groot laat een plug-infilter of -opdracht minstens 250 miljoen instructies uitvoeren, plus meer voor elke byte invoer; Normaal houdt de eigen limiet van de plug-in aan. De tijdslimiet blijft gelijk. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. De eerste keuze voor de scratchschijf: Startup, None of een mappad; VectorCraft slaat deze op, maar gebruikt nog geen scratchschijven. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. De tweede keuze voor de scratchschijf: Startup, None of een mappad; VectorCraft slaat deze op, maar gebruikt nog geen scratchschijven. How light or dark the interface is. Hoe licht of donker de gebruikersinterface is. @@ -5067,6 +5068,7 @@ font-technology Variable Variabel Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. Geanimeerd zoomen werkt alleen zolang dit aan staat; uit is Geanimeerd zoomen gedimd en wordt zoomen niet geanimeerd. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. Zoomen met het wieltje glijdt soepel, en het Zoom-gereedschap zoomt terwijl u opzij sleept of het ingedrukt houdt; uit zoomt het Zoom-gereedschap in op het gebied waarover u sleept. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Vanaf de volgende start tekent de desktopversie met dit soort grafische processor; Automatisch kiest bij voorkeur de processor die het beeldscherm aanstuurt. De webversie gebruikt het niet. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. Vanaf de volgende start toont het venster beelden zonder te wachten tot het beeldscherm ververst, hoogstens 240 per seconde, tenzij --present-mode of VECTORCRAFT_PRESENT_MODE de modus instelt. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. Het grootste aantal ongedaanmaakstappen dat elk document bewaart; een lager getal verwijdert de oudste stappen wanneer u op OK klikt. Stappen kunnen ook eerder verdwijnen als ze te veel geheugen gebruiken. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Toont tijdens het slepen hoe de illustratie verandert; uit volgen contouren het slepen en verandert de illustratie wanneer u loslaat. Een hulplijn van de liniaal beweegt altijd mee tijdens het slepen. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Hoeveel werkthreads de illustratie tekenen; -1 gebruikt er één minder dan de kernen die VectorCraft mag gebruiken, hoogstens 8, en 0 geen. De webversie gebruikt er nooit een. diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 09aa273195..0ce2a8b3ca 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4600,6 +4600,7 @@ font-technology Variable Zmienne New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Nowy tekst otrzymuje ten język, dopóki językiem w Ustawieniach dokumentu jest Angielski: USA; tekst, który już jest w dokumencie, zachowuje swój język. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. W akapitach z włączoną opcją Dziel wyrazy wyraz z listy jest dzielony tylko w miejscach wpisanych w nim łączników albo wcale, jeśli ich nie ma, bez względu na język i wielkość liter. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. W wersji na komputer wtyczki .wasm z tego folderu są wczytywane przy uruchomieniu i po kliknięciu OK z nowym folderem tutaj, z wyjątkiem trybu awaryjnego; wersja internetowa ich nie wczytuje. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. Duże pozwala filtrowi lub poleceniu wtyczki wykonać co najmniej 250 milionów instrukcji, plus kolejne za każdy bajt danych wejściowych; Normalny zachowuje własny limit wtyczki. Limit czasu pozostaje ten sam. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Pierwszy wybór dysku roboczego: Startup, None lub ścieżka folderu; VectorCraft go zapisuje, ale jeszcze nie używa dysków roboczych. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Drugi wybór dysku roboczego: Startup, None lub ścieżka folderu; VectorCraft go zapisuje, ale jeszcze nie używa dysków roboczych. How light or dark the interface is. Jak jasny lub ciemny jest interfejs. @@ -4612,17 +4613,18 @@ font-technology Variable Zmienne Makes the document tabs taller and their names larger. Sprawia, że karty dokumentów są wyższe, a ich nazwy większe. From the next start, the system draws the window's title bar where VectorCraft would otherwise draw its own. Od następnego uruchomienia system rysuje pasek tytułu okna tam, gdzie VectorCraft w przeciwnym razie rysowałby własny. From the next start, VectorCraft draws the window's title bar even where the desktop would draw it, unless System Title Bar is on. Od następnego uruchomienia VectorCraft rysuje pasek tytułu okna nawet tam, gdzie narysowałoby go środowisko pulpitu, chyba że Systemowy pasek tytułu jest włączony. - Makes the interface larger or smaller; art on the canvas keeps its size at the same zoom. Powiększa lub pomniejsza interfejs; grafika na płótnie zachowuje rozmiar przy tym samym powiększeniu. + Makes the interface larger or smaller; art on the canvas keeps its size at the same zoom. Powiększa lub pomniejsza interfejs; kompozycja na płótnie zachowuje rozmiar przy tym samym powiększeniu. The tool pointers VectorCraft draws grow and shrink with UI Scaling; off, they keep their size. Wskaźniki narzędzi rysowane przez VectorCraft rosną i maleją wraz ze Skalowaniem interfejsu; po wyłączeniu zachowują swój rozmiar. The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. Język interfejsu; Auto używa języka systemu. Okno dialogowe zmienia język, gdy tylko go wybierzesz. Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. Animowane powiększanie działa tylko wtedy, gdy to jest włączone; po wyłączeniu Animowane powiększanie jest wyszarzone, a powiększanie nie jest animowane. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. Powiększanie kółkiem przebiega płynnie, a Narzędzie Lupka powiększa, gdy przeciągasz w bok lub je przytrzymujesz; po wyłączeniu Narzędzie Lupka powiększa obszar, przez który przeciągniesz. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Od następnego uruchomienia wersja na komputer rysuje tym rodzajem procesora graficznego; Automatycznie wybiera najpierw ten, który obsługuje ekran. Wersja internetowa go nie używa. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. Od następnego uruchomienia okno wyświetla klatki bez czekania na odświeżenie ekranu, najwyżej 240 na sekundę, chyba że tryb ustawia --present-mode lub VECTORCRAFT_PRESENT_MODE. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. Największa liczba kroków cofania, które zachowuje każdy dokument; mniejsza liczba usuwa najstarsze kroki po kliknięciu OK. Kroki mogą też zniknąć wcześniej, gdy zajmują zbyt dużo pamięci. - Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Pokazuje zmiany grafiki podczas przeciągania; po wyłączeniu kontury podążają za przeciąganiem, a grafika zmienia się po puszczeniu. Linia pomocnicza z linijki zawsze porusza się podczas przeciągania. - How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Ile wątków roboczych rysuje grafikę; -1 używa o jeden mniej niż rdzeni, których VectorCraft może używać, najwyżej 8, a 0 żadnego. Wersja internetowa nigdy żadnego nie używa. + Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Pokazuje zmiany kompozycji podczas przeciągania; po wyłączeniu kontury podążają za przeciąganiem, a kompozycja zmienia się po puszczeniu. Linia pomocnicza z linijki zawsze porusza się podczas przeciągania. + How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Ile wątków roboczych rysuje kompozycję; -1 używa o jeden mniej niż rdzeni, których VectorCraft może używać, najwyżej 8, a 0 żadnego. Wersja internetowa nigdy żadnego nie używa. From the next start on a Wayland desktop, X11 (XWayland) opens the window through XWayland; the other choices do so only when a pen is attached. Od następnego uruchomienia na pulpicie Wayland X11 (XWayland) otwiera okno przez XWayland; inne wybory robią to tylko wtedy, gdy podłączone jest pióro. - Converts the artwork and artboards on the canvas to the display's color profile where the system does not already do so; off, the canvas is drawn in sRGB. Konwertuje grafikę i obszary kompozycji na płótnie do profilu kolorów ekranu tam, gdzie system tego jeszcze nie robi; po wyłączeniu płótno jest rysowane w sRGB. + Converts the artwork and artboards on the canvas to the display's color profile where the system does not already do so; off, the canvas is drawn in sRGB. Konwertuje kompozycję i obszary kompozycji na płótnie do profilu kolorów ekranu tam, gdzie system tego jeszcze nie robi; po wyłączeniu płótno jest rysowane w sRGB. On the desktop, a save to a file is written in the background while you keep editing; off, you wait until it is written. W wersji na komputer zapis do pliku odbywa się w tle, gdy dalej edytujesz; po wyłączeniu czekasz, aż zostanie zapisany. On the desktop, exports to files and packages are written in the background while you keep editing, except 3D exports; off, you wait for them. W wersji na komputer eksporty do plików i pakiety są zapisywane w tle, gdy dalej edytujesz, z wyjątkiem eksportów 3D; po wyłączeniu na nie czekasz. Every few minutes, keeps a recovery copy of each document with unsaved changes made since its last copy; off, no timed copies are made. Co kilka minut zachowuje kopię odzyskiwania każdego dokumentu z niezapisanymi zmianami od jego ostatniej kopii; po wyłączeniu kopie okresowe nie powstają. @@ -4637,8 +4639,8 @@ font-technology Variable Zmienne Edit Original opens a linked file in the system's default app for its type; off, a linked raster image opens in PhotoCraft where it is installed. Edytuj oryginał otwiera połączony plik w domyślnej aplikacji systemu dla jego typu; po wyłączeniu połączony obraz rastrowy otwiera się w PhotoCraft, jeśli jest zainstalowany. A file saved by an older VectorCraft version opens with [Converted] after its name, and Save asks where to save it; off, Save replaces the file. Plik zapisany starszą wersją VectorCraft otwiera się z [Converted] po nazwie, a Zapisz pyta, gdzie go zapisać; po wyłączeniu Zapisz zastępuje plik. VectorCraft files and templates are saved compressed, so they are smaller, unless a save says otherwise; saves for versions that cannot open compressed files stay uncompressed. Pliki i szablony VectorCraft są zapisywane skompresowane, więc są mniejsze, chyba że zapis stanowi inaczej; zapisy dla wersji, które nie otwierają skompresowanych plików, pozostają nieskompresowane. - Copy and Cut also give other apps SVG code of the art; on the desktop, the code is not copied as text when the art embeds more than 1 MiB of images. Kopiuj i Wytnij przekazują innym aplikacjom także kod SVG grafiki; na komputerze kod nie jest kopiowany jako tekst, gdy grafika osadza ponad 1 MiB obrazów. - On Windows, Copy and Cut also give other apps a PDF of the art; the other platforms do not copy a PDF yet. W systemie Windows Kopiuj i Wytnij przekazują innym aplikacjom także PDF grafiki; inne platformy jeszcze nie kopiują PDF. + Copy and Cut also give other apps SVG code of the art; on the desktop, the code is not copied as text when the art embeds more than 1 MiB of images. Kopiuj i Wytnij przekazują innym aplikacjom także kod SVG kompozycji; na komputerze kod nie jest kopiowany jako tekst, gdy kompozycja osadza ponad 1 MiB obrazów. + On Windows, Copy and Cut also give other apps a PDF of the art; the other platforms do not copy a PDF yet. W systemie Windows Kopiuj i Wytnij przekazują innym aplikacjom także PDF kompozycji; inne platformy jeszcze nie kopiują PDF. VectorCraft stores this choice, but Copy and Cut do not use a legacy vector clipboard format yet. VectorCraft zapisuje ten wybór, ale Kopiuj i Wytnij nie używają jeszcze formatu starszego schowka wektorowego. Preserve Paths or Preserve Appearance and Overprints for the legacy vector clipboard; VectorCraft stores the choice but does not use it yet. Zachowaj ścieżki lub Zachowaj wygląd i nadruki dla starszego schowka wektorowego; VectorCraft zapisuje wybór, ale jeszcze go nie używa. Keep Formatting keeps the styles of text copied from VectorCraft type when it is pasted into type; Keep Plain Text gives it the style where it lands. Zachowaj formatowanie zachowuje style tekstu skopiowanego z obiektu tekstowego VectorCraft po wklejeniu do obiektu tekstowego; Zachowaj zwykły tekst nadaje mu styl miejsca, w które trafia. diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index e09dbc05f2..9ef5573e7c 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2773,6 +2773,7 @@ digits Malayalam Malaiala New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. O texto novo recebe este idioma enquanto o idioma da Configuração do Documento for Inglês: EUA; o texto que já está em um documento mantém o próprio idioma. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. Em parágrafos com Hifenizar ativado, uma palavra da lista é dividida apenas nos hifens digitados nela, ou em nenhum ponto se não tiver nenhum, qualquer que seja o idioma ou o uso de maiúsculas. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. Na versão para desktop, os plug-ins .wasm desta pasta são carregados ao iniciar e quando você clica em OK com uma nova pasta aqui, exceto no Modo de Segurança; a versão web não os carrega. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. Grande permite que um filtro ou comando de plug-in execute pelo menos 250 milhões de instruções, mais outras para cada byte de entrada; Normal mantém o limite próprio do plug-in. O limite de tempo continua o mesmo. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. A primeira opção de disco de cópia: Startup, None ou o caminho de uma pasta; o VectorCraft a armazena, mas ainda não usa discos de cópia. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. A segunda opção de disco de cópia: Startup, None ou o caminho de uma pasta; o VectorCraft a armazena, mas ainda não usa discos de cópia. How light or dark the interface is. O quanto a interface é clara ou escura. @@ -2791,6 +2792,7 @@ digits Malayalam Malaiala Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. O Zoom Animado só funciona enquanto isto está ativado; desativado, o Zoom Animado fica esmaecido e o zoom não é animado. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. O zoom com a roda desliza suavemente, e a Ferramenta Zoom amplia enquanto você arrasta para o lado ou a mantém pressionada; desativado, a Ferramenta Zoom amplia a área que você arrasta. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. A partir da próxima inicialização, a versão para desktop desenha com este tipo de processador gráfico; Automático prefere o que controla a tela. A versão web não o usa. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. A partir da próxima inicialização, a janela mostra os quadros sem esperar a atualização da tela, no máximo 240 por segundo, a menos que --present-mode ou VECTORCRAFT_PRESENT_MODE defina o modo. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. O número máximo de etapas de desfazer que cada documento guarda; um número menor remove as etapas mais antigas quando você clica em OK. Etapas também podem sair antes quando usam memória demais. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Mostra a arte mudando enquanto você arrasta; desativado, contornos seguem o arraste e a arte muda quando você solta. Uma guia de régua sempre se move enquanto você arrasta. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Quantas threads de trabalho desenham a arte; -1 usa uma a menos que os núcleos que o VectorCraft pode usar, no máximo 8, e 0 nenhuma. A versão web nunca usa nenhuma. diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 6219102b6c..6c7d53b031 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -3318,6 +3318,7 @@ digits Malayalam Малаялам New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Новый текст получает этот язык, пока в «Параметрах документа» выбран язык Английский: США; текст, который уже есть в документе, сохраняет свой язык. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. В абзацах с включённым параметром «Расставлять переносы» слово из списка переносится только по введённым в нём дефисам или нигде, если их нет, независимо от языка и регистра. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. В настольной версии модули .wasm из этой папки загружаются при запуске и при нажатии ОК с новой папкой здесь, кроме безопасного режима; веб-версия их не загружает. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. «Большой» позволяет фильтру или команде модуля выполнить не менее 250 миллионов инструкций, плюс ещё за каждый байт входных данных; «Обычный» сохраняет собственный лимит модуля. Ограничение по времени остаётся прежним. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Первый выбор рабочего диска: Startup, None или путь к папке; VectorCraft сохраняет его, но пока не использует рабочие диски. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Второй выбор рабочего диска: Startup, None или путь к папке; VectorCraft сохраняет его, но пока не использует рабочие диски. How light or dark the interface is. Насколько светлый или тёмный интерфейс. @@ -3336,6 +3337,7 @@ digits Malayalam Малаялам Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. Анимированное масштабирование работает, только пока это включено; если выключено, Анимированное масштабирование затенено и масштабирование не анимируется. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. Масштабирование колесом идёт плавно, а Инструмент «Масштаб» масштабирует, пока вы тянете вбок или удерживаете его; если выключено, он масштабирует до области, по которой вы протянули. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Со следующего запуска настольная версия рисует этим типом графического процессора; «Автоматически» предпочитает тот, что управляет дисплеем. Веб-версия его не использует. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. Со следующего запуска окно показывает кадры, не дожидаясь обновления дисплея, не более 240 в секунду, если режим не задан через --present-mode или VECTORCRAFT_PRESENT_MODE. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. Наибольшее число шагов отмены, которое хранит каждый документ; меньшее число удаляет самые старые шаги при нажатии ОК. Шаги могут уйти и раньше, если занимают слишком много памяти. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Показывает, как меняется графика, пока вы тянете; если выключено, за перетаскиванием следуют контуры, а графика меняется, когда вы отпускаете. Направляющая с линейки всегда движется при перетаскивании. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Сколько рабочих потоков рисуют графику; -1 использует на один меньше, чем ядер, доступных VectorCraft, не более 8, а 0 ни одного. Веб-версия не использует их никогда. diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index e422125282..4916a0a26e 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -3207,6 +3207,7 @@ digits Malayalam Malayalam New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Ny text får det här språket så länge språket i Dokumentinställningar är Engelska: USA; text som redan finns i ett dokument behåller sitt eget språk. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. I stycken med Avstava på avstavas ett listat ord bara vid bindestrecken som skrivits in i det, eller inte alls om det saknar sådana, oavsett språk och skiftläge. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. I skrivbordsversionen läses .wasm-plugins i den här mappen in vid start och när du klickar på OK med en ny mapp här, utom i felsäkert läge; webbversionen läser inte in dem. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. Stor låter ett plugin-filter eller ett plugin-kommando köra minst 250 miljoner instruktioner, plus fler för varje byte indata; Normal behåller pluginets egen gräns. Tidsgränsen är densamma. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Det första valet av arbetsdisk: Startup, None eller en mappsökväg; VectorCraft sparar det men använder ännu inte arbetsdiskar. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Det andra valet av arbetsdisk: Startup, None eller en mappsökväg; VectorCraft sparar det men använder ännu inte arbetsdiskar. How light or dark the interface is. Hur ljust eller mörkt gränssnittet är. @@ -3225,6 +3226,7 @@ digits Malayalam Malayalam Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. Animerad zoom fungerar bara medan detta är på; avstängt är Animerad zoom nedtonad och zoomningen animeras inte. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. Zoom med hjulet glider in mjukt, och Zoomverktyget zoomar medan du drar åt sidan eller håller det nedtryckt; avstängt zoomar Zoomverktyget till området du drar över. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Från nästa start ritar skrivbordsversionen med den här typen av grafikprocessor; Automatisk föredrar den som driver skärmen. Webbversionen använder den inte. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. Från nästa start visar fönstret bildrutor utan att vänta på att skärmen uppdateras, högst 240 per sekund, om inte --present-mode eller VECTORCRAFT_PRESENT_MODE anger läget. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. Det högsta antalet ångra-steg som varje dokument behåller; ett lägre tal tar bort de äldsta stegen när du klickar på OK. Steg kan också försvinna tidigare när de använder för mycket minne. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Visar hur bilden ändras medan du drar; avstängt följer konturer dragningen och bilden ändras när du släpper. En stödlinje från linjalen flyttas alltid medan du drar. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Hur många arbetstrådar som ritar bilden; -1 använder en färre än de kärnor VectorCraft får använda, högst 8, och 0 ingen. Webbversionen använder aldrig någon. diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index a01eb39c0e..508da9939d 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -3055,6 +3055,7 @@ digits Malayalam Malayalam New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Belge Kurulumu'nun dili İngilizce: ABD olduğu sürece yeni metin bu dili alır; bir belgede zaten bulunan metin kendi dilini korur. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. Tireleme açık paragraflarda listedeki bir sözcük yalnızca içine yazılan tirelerden bölünür, tire yoksa hiç bölünmez; dili ve büyük/küçük harf durumu fark etmez. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. Masaüstü sürümünde bu klasördeki .wasm eklentileri başlangıçta ve burada yeni bir klasörle Tamam'a tıkladığınızda yüklenir, Güvenli Mod hariç; web sürümü bunları yüklemez. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. Büyük, bir eklenti filtresinin veya komutunun en az 250 milyon talimat, ayrıca girdinin her baytı için daha fazlasını çalıştırmasına izin verir; Normal, eklentinin kendi sınırını korur. Süre sınırı aynı kalır. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. İlk geçici disk seçimi: Startup, None veya bir klasör yolu; VectorCraft bunu saklar ancak henüz geçici disk kullanmaz. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. İkinci geçici disk seçimi: Startup, None veya bir klasör yolu; VectorCraft bunu saklar ancak henüz geçici disk kullanmaz. How light or dark the interface is. Arayüzün ne kadar açık veya koyu olduğu. @@ -3073,6 +3074,7 @@ digits Malayalam Malayalam Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. Animasyonlu Yakınlaştırma yalnızca bu açıkken çalışır; kapalıyken Animasyonlu Yakınlaştırma soluk görünür ve yakınlaştırma animasyonlu olmaz. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. Tekerlekle yakınlaştırma yumuşakça kayar, Yakınlaştırma Aracı ise yana sürüklerken veya basılı tutarken yakınlaştırır; kapalıyken Yakınlaştırma Aracı sürüklediğiniz alana yakınlaştırır. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Bir sonraki başlatmadan itibaren masaüstü sürümü bu tür grafik işlemciyle çizer; Otomatik, ekranı süren işlemciyi tercih eder. Web sürümü bunu kullanmaz. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. Bir sonraki başlatmadan itibaren pencere, ekranın yenilenmesini beklemeden kareleri saniyede en fazla 240 olarak gösterir; --present-mode veya VECTORCRAFT_PRESENT_MODE modu belirlerse o geçerlidir. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. Her belgenin sakladığı en fazla geri alma adımı sayısı; daha düşük bir sayı, Tamam'a tıkladığınızda en eski adımları kaldırır. Adımlar çok fazla bellek kullanırsa daha erken de gidebilir. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Sürüklerken çizimin değişmesini gösterir; kapalıyken sürüklemeyi ana hatlar izler ve çizim bıraktığınızda değişir. Cetvel kılavuzu sürüklerken her zaman hareket eder. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Çizimi kaç çalışan iş parçacığının çizdiği; -1, VectorCraft'ın kullanabileceği çekirdeklerden bir eksiğini, en fazla 8'i kullanır, 0 ise hiçbirini. Web sürümü hiçbir zaman kullanmaz. diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 4861149d1c..6f469e7027 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -3328,6 +3328,7 @@ digits Malayalam Малаялам New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Новий текст отримує цю мову, доки в «Параметрах документа» вибрано мову Англійська: США; текст, який уже є в документі, зберігає свою мову. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. В абзацах з увімкненим параметром «Розставляти переноси» слово зі списку переноситься лише за введеними в ньому дефісами або ніде, якщо їх немає, незалежно від мови й регістру. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. У настільній версії модулі .wasm з цієї папки завантажуються під час запуску і коли ви натискаєте ОК з новою папкою тут, крім безпечного режиму; веб-версія їх не завантажує. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. «Великий» дає фільтру або команді модуля виконати щонайменше 250 мільйонів інструкцій, плюс ще за кожен байт вхідних даних; «Звичайний» зберігає власне обмеження модуля. Обмеження за часом лишається тим самим. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Перший вибір робочого диска: Startup, None або шлях до папки; VectorCraft зберігає його, але поки не використовує робочі диски. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Другий вибір робочого диска: Startup, None або шлях до папки; VectorCraft зберігає його, але поки не використовує робочі диски. How light or dark the interface is. Наскільки світлим чи темним є інтерфейс. @@ -3346,6 +3347,7 @@ digits Malayalam Малаялам Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. Анімоване масштабування працює, лише поки це увімкнено; якщо вимкнено, Анімоване масштабування затінене і масштабування не анімується. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. Масштабування коліщатком іде плавно, а Інструмент «Масштаб» масштабує, поки ви тягнете вбік або утримуєте його; якщо вимкнено, він масштабує до області, яку ви протягнули. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. З наступного запуску настільна версія малює цим типом графічного процесора; «Автоматично» надає перевагу тому, що керує дисплеєм. Веб-версія його не використовує. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. З наступного запуску вікно показує кадри, не чекаючи оновлення дисплея, не більше 240 за секунду, якщо режим не задано через --present-mode або VECTORCRAFT_PRESENT_MODE. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. Найбільша кількість кроків скасування, яку зберігає кожен документ; менше число видаляє найстаріші кроки, коли ви натискаєте ОК. Кроки можуть зникнути й раніше, якщо займають надто багато пам’яті. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Показує, як змінюється графіка, поки ви тягнете; якщо вимкнено, за перетягуванням стежать контури, а графіка змінюється, коли ви відпускаєте. Напрямна з лінійки завжди рухається під час перетягування. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Скільки робочих потоків малюють графіку; -1 використовує на один менше, ніж ядер, доступних VectorCraft, не більше 8, а 0 жодного. Веб-версія не використовує їх ніколи. diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 214f837e63..cb7b241b09 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3644,6 +3644,7 @@ mark-style Japanese Kiểu Nhật New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Văn bản mới nhận ngôn ngữ này khi ngôn ngữ trong Thiết lập tài liệu là Tiếng Anh: Mỹ; văn bản đã có trong tài liệu giữ ngôn ngữ của nó. In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. Trong các đoạn bật Gạch nối, một từ trong danh sách chỉ được ngắt tại các dấu gạch nối đã gõ trong từ, hoặc không ngắt ở đâu nếu không có, bất kể ngôn ngữ hay chữ hoa thường. On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. Trong phiên bản máy tính, các plug-in .wasm trong thư mục này được tải khi khởi động và khi bạn bấm OK với một thư mục mới ở đây, trừ trong Chế độ an toàn; phiên bản web không tải chúng. + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. Lớn cho phép bộ lọc hoặc lệnh của plug-in chạy ít nhất 250 triệu lệnh máy, cộng thêm cho mỗi byte đầu vào; Thường giữ giới hạn riêng của plug-in. Giới hạn thời gian vẫn như cũ. The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Lựa chọn đĩa tạm thứ nhất: Startup, None hoặc đường dẫn thư mục; VectorCraft lưu lựa chọn này nhưng chưa dùng đĩa tạm. The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. Lựa chọn đĩa tạm thứ hai: Startup, None hoặc đường dẫn thư mục; VectorCraft lưu lựa chọn này nhưng chưa dùng đĩa tạm. How light or dark the interface is. Mức sáng hoặc tối của giao diện. @@ -3662,6 +3663,7 @@ mark-style Japanese Kiểu Nhật Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. Thu phóng có hiệu ứng chỉ hoạt động khi mục này bật; khi tắt, Thu phóng có hiệu ứng bị làm mờ và việc thu phóng không có hiệu ứng. The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. Thu phóng bằng con lăn trượt mượt mà, và Công cụ thu phóng phóng to khi bạn kéo sang ngang hoặc giữ nó; khi tắt, Công cụ thu phóng phóng to vùng bạn kéo qua. From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Từ lần khởi động tới, phiên bản máy tính vẽ bằng loại bộ xử lý đồ họa này; Tự động ưu tiên bộ xử lý điều khiển màn hình. Phiên bản web không dùng nó. + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. Từ lần khởi động tới, cửa sổ hiển thị khung hình mà không chờ màn hình làm mới, tối đa 240 khung mỗi giây, trừ khi --present-mode hoặc VECTORCRAFT_PRESENT_MODE đặt chế độ. The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. Số bước hoàn tác tối đa mà mỗi tài liệu giữ; số nhỏ hơn sẽ xóa các bước cũ nhất khi bạn bấm OK. Các bước cũng có thể bị xóa sớm hơn khi chúng dùng quá nhiều bộ nhớ. Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. Hiển thị hình vẽ thay đổi khi bạn kéo; khi tắt, đường viền đi theo thao tác kéo và hình vẽ thay đổi khi bạn thả ra. Đường gióng của thước luôn di chuyển khi bạn kéo. How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. Số luồng làm việc vẽ hình vẽ; -1 dùng ít hơn một luồng so với số lõi VectorCraft được dùng, tối đa 8, và 0 không dùng luồng nào. Phiên bản web không bao giờ dùng luồng nào. diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 18d11afce7..09e9aed4d8 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -3187,6 +3187,7 @@ digits Malayalam 马拉雅拉姆数字 New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. 当文档设置的语言为英语:美国时,新文字使用此语言;文档中已有的文字保留自己的语言。 In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. 在启用自动断字的段落中,列表中的单词只在其中键入的连字符处断开,没有连字符则不断开,与语言和大小写无关。 On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. 在桌面版中,此文件夹中的 .wasm 增效工具会在启动时以及在此处指定新文件夹并单击“确定”时载入,安全模式除外;Web 版不会载入它们。 + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. “大”允许增效工具的滤镜或命令至少执行 2.5 亿条指令,并按输入的每个字节另加指令;“正常”保留增效工具自身的限制。时间限制不变。 The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. 第一个暂存盘选择:Startup、None 或文件夹路径;VectorCraft 会存储它,但尚未使用暂存盘。 The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. 第二个暂存盘选择:Startup、None 或文件夹路径;VectorCraft 会存储它,但尚未使用暂存盘。 How light or dark the interface is. 界面的明暗程度。 @@ -3205,6 +3206,7 @@ digits Malayalam 马拉雅拉姆数字 Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. 只有开启此项时,动画缩放才会起作用;关闭此项后,动画缩放显示为灰色,缩放不带动画。 The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. 用滚轮缩放时会平滑过渡,缩放工具在你向侧面拖动或按住不放时进行缩放;关闭此项后,缩放工具缩放到你拖过的区域。 From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. 从下次启动起,桌面版使用这类图形处理器绘制;“自动”优先使用驱动显示器的图形处理器。Web 版不使用此项。 + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. 从下次启动起,窗口不等待显示器刷新即显示帧,每秒最多 240 帧,除非 --present-mode 或 VECTORCRAFT_PRESENT_MODE 指定了模式。 The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. 每个文档保留的最大撤销步骤数;调低后,单击“确定”时会删除最早的步骤。步骤占用过多内存时也可能更早被删除。 Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. 拖动时显示图稿的变化;关闭此项后,由轮廓跟随拖动,松开后图稿才改变。标尺参考线在拖动时总是跟着移动。 How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. 绘制图稿的工作线程数;-1 使用比 VectorCraft 可用核心数少一个的线程,最多 8 个,0 则不使用。Web 版始终不使用。 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index af0222569f..325e2d4ec4 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -4540,6 +4540,7 @@ digits Malayalam 馬來亞拉姆數字 New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. 當文件設定的語言為英文:美國時,新文字使用此語言;文件中已有的文字保留自己的語言。 In paragraphs with Hyphenate on, a listed word breaks only at the hyphens typed in it, or nowhere when it has none, whatever its language or case. 在開啟使用連字號的段落中,清單中的單字只在其中輸入的連字號處斷開,沒有連字號則不斷開,與語言和大小寫無關。 On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them. 在桌面版中,此資料夾中的 .wasm 增效模組會在啟動時以及在此指定新資料夾並按一下「確定」時載入,安全模式除外;網頁版不會載入它們。 + Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same. 「大」允許增效模組的濾鏡或命令至少執行 2.5 億條指令,並依輸入的每個位元組另加指令;「正常」保留增效模組本身的限制。時間限制不變。 The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. 第一個暫存磁碟選擇:Startup、None 或資料夾路徑;VectorCraft 會儲存它,但尚未使用暫存磁碟。 The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet. 第二個暫存磁碟選擇:Startup、None 或資料夾路徑;VectorCraft 會儲存它,但尚未使用暫存磁碟。 How light or dark the interface is. 介面的明暗程度。 @@ -4558,6 +4559,7 @@ digits Malayalam 馬來亞拉姆數字 Animated Zoom works only while this is on; off, Animated Zoom is dimmed and zooming does not animate. 只有開啟此選項時,動畫縮放才會起作用;關閉此選項時,動畫縮放會顯示為灰色,縮放不帶動畫。 The wheel's zoom glides in, and the Zoom tool zooms as you drag sideways or hold it down; off, the Zoom tool zooms to the area you drag across. 用滾輪縮放時會平滑過渡,縮放工具在你向側邊拖曳或按住不放時進行縮放;關閉此選項時,縮放工具會縮放到你拖曳過的區域。 From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. 從下次啟動起,桌面版使用這類圖形處理器繪製;「自動」優先使用驅動顯示器的圖形處理器。網頁版不使用此選項。 + From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode. 從下次啟動起,視窗不等待顯示器重新整理即顯示影格,每秒最多 240 格,除非 --present-mode 或 VECTORCRAFT_PRESENT_MODE 指定了模式。 The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory. 每份文件保留的最大復原步驟數;調低後,按一下「確定」時會刪除最早的步驟。步驟佔用過多記憶體時也可能更早被刪除。 Shows the artwork changing while you drag; off, outlines follow the drag and the artwork changes when you release. A ruler guide always moves as you drag. 拖曳時顯示圖稿的變化;關閉此選項時,由外框跟隨拖曳,放開後圖稿才改變。尺標參考線在拖曳時總是跟著移動。 How many worker threads draw the artwork; -1 uses one fewer than the cores VectorCraft may use, at most 8, and 0 uses none. The web version always uses none. 繪製圖稿的工作執行緒數;-1 使用比 VectorCraft 可用核心數少一個的執行緒,最多 8 個,0 則不使用。網頁版始終不使用。 diff --git a/crates/ui-egui/src/prefs_dialog/descriptions.rs b/crates/ui-egui/src/prefs_dialog/descriptions.rs index 7981915a59..da2da58cef 100644 --- a/crates/ui-egui/src/prefs_dialog/descriptions.rs +++ b/crates/ui-egui/src/prefs_dialog/descriptions.rs @@ -237,6 +237,10 @@ pub(crate) const DESCRIPTIONS: &[(&str, &str)] = &[ "pluginsFolder", "On the desktop, the .wasm plug-ins in this folder load at startup and when you click OK with a new folder here, except in Safe Mode; the web version does not load them.", ), + ( + "pluginInstructionBudget", + "Large lets a plug-in filter or command run at least 250 million instructions, plus more for each byte of input; Normal keeps the plug-in's own limit. The time limit stays the same.", + ), ("scratchPrimary", "The first scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet."), ("scratchSecondary", "The second scratch disk choice: Startup, None or a folder path; VectorCraft stores it but does not use scratch disks yet."), // User Interface @@ -275,6 +279,10 @@ pub(crate) const DESCRIPTIONS: &[(&str, &str)] = &[ "gpuPreference", "From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it.", ), + ( + "lowLatencyDrawing", + "From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second, unless --present-mode or VECTORCRAFT_PRESENT_MODE sets the mode.", + ), ( "historyStates", "The most undo steps each document keeps; lowering it drops the oldest steps when you click OK. Steps can also go sooner when they use too much memory.", diff --git a/crates/ui-egui/src/prefs_dialog/tests.rs b/crates/ui-egui/src/prefs_dialog/tests.rs index 36e5fb39b6..5342b3c5b9 100644 --- a/crates/ui-egui/src/prefs_dialog/tests.rs +++ b/crates/ui-egui/src/prefs_dialog/tests.rs @@ -1873,6 +1873,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] @@ -2326,8 +2357,8 @@ fn keyboard_focus_on_a_hyphenation_row_shows_its_description() { assert!(described.iter().any(|d| d == exceptions), "the focused field carries the sentence: {described:?}"); } -/// The pointer over each row of Plug-ins & Scratch Disks, Additional Plug-ins Folder, Primary and -/// Secondary, shows that row's sentence and neither of the others. +/// The pointer over each row of Plug-ins & Scratch Disks, Additional Plug-ins Folder, Plug-in +/// Instruction Budget, Primary and Secondary, shows that row's sentence and none of the others. #[test] fn hovering_a_plugins_and_scratch_disks_row_shows_its_description() { let mut a = app(); @@ -2339,7 +2370,12 @@ fn hovering_a_plugins_and_scratch_disks_row_shows_its_description() { let row = |texts: &[(String, egui::Rect)], label: &str| { texts.iter().find(|(t, _)| t.starts_with(label)).map(|(_, r)| r.center()).unwrap_or_else(|| panic!("no `{label}` in {texts:?}")) }; - let rows = [("Additional Plug-ins Folder:", "pluginsFolder"), ("Primary:", "scratchPrimary"), ("Secondary:", "scratchSecondary")]; + let rows = [ + ("Additional Plug-ins Folder:", "pluginsFolder"), + ("Plug-in Instruction", "pluginInstructionBudget"), + ("Primary:", "scratchPrimary"), + ("Secondary:", "scratchSecondary"), + ]; let sentences: Vec<_> = rows.iter().map(|(_, key)| descriptions::description(key).unwrap_or_else(|| panic!("`{key}` has a sentence"))).collect(); for (i, (label, _)) in rows.iter().enumerate() { description_frame(&mut a, &ctx, vec![egui::Event::PointerMoved(row(&texts, label))]); @@ -2350,9 +2386,9 @@ fn hovering_a_plugins_and_scratch_disks_row_shows_its_description() { } } -/// Tab from the search field reaches the Additional Plug-ins Folder field, then Primary, then -/// Secondary: the line shows each one's sentence in turn, and a screen reader gets it as the focused -/// field's description. +/// Tab from the search field reaches the Additional Plug-ins Folder field, then the Plug-in +/// Instruction Budget menu, Primary and Secondary: the line shows each one's sentence in turn, and a +/// screen reader gets it as the focused control's description. #[test] fn keyboard_focus_on_a_plugins_and_scratch_disks_row_shows_its_description() { let mut a = app(); @@ -2371,10 +2407,10 @@ fn keyboard_focus_on_a_plugins_and_scratch_disks_row_shows_its_description() { } None }; - for key in ["pluginsFolder", "scratchPrimary", "scratchSecondary"] { + for key in ["pluginsFolder", "pluginInstructionBudget", "scratchPrimary", "scratchSecondary"] { let sentence = descriptions::description(key).unwrap_or_else(|| panic!("`{key}` has a sentence")); - let described = tab_to(sentence).unwrap_or_else(|| panic!("Tab reaches the `{key}` field and its sentence shows")); - assert!(described.iter().any(|d| d == sentence), "the focused `{key}` field carries the sentence: {described:?}"); + let described = tab_to(sentence).unwrap_or_else(|| panic!("Tab reaches the `{key}` control and its sentence shows")); + assert!(described.iter().any(|d| d == sentence), "the focused `{key}` control carries the sentence: {described:?}"); } } @@ -2416,21 +2452,9 @@ fn hovering_a_user_interface_row_shows_its_description() { ]; 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 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; - } + 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() { @@ -2491,14 +2515,15 @@ fn hovering_a_performance_row_shows_its_description() { let row = |texts: &[(String, egui::Rect)], label: &str| { texts.iter().rev().find(|(t, _)| t == label).map(|(_, r)| r.center()).unwrap_or_else(|| panic!("no `{label}` in {texts:?}")) }; - let mut rows = vec![ - ("GPU Performance", "gpuPerformance"), - ("Animated Zoom", "animatedZoom"), - ("Graphics Processor:", "gpuPreference"), + let mut rows = vec![("GPU Performance", "gpuPerformance"), ("Animated Zoom", "animatedZoom"), ("Graphics Processor:", "gpuPreference")]; + if !cfg!(target_arch = "wasm32") { + rows.push(("Low-Latency Drawing", "lowLatencyDrawing")); + } + rows.extend([ ("History States:", "historyStates"), ("Real-time Drawing and Editing", "realTimeDrawing"), ("Render Threads (-1 = Automatic):", "renderThreads"), - ]; + ]); if cfg!(target_os = "linux") { rows.push(("Linux Display Server:", "linuxDisplayServer")); } @@ -2507,21 +2532,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; - } + 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() { @@ -2589,30 +2602,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() { From 27646e8164d0ce8b9fe962b7f2208380980be77f Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 17:23:11 -0800 Subject: [PATCH 30/38] Transform: corner fields and menus play back on the selected rectangles The Rectangle Properties corner fields and menus now send `rectanglesOnly` with the selection instead of the selected rectangles' ids. An action that records them then sets the rectangles selected when it plays. `object.setLiveShape {rectanglesOnly}` sets the live rectangles among its targets and leaves the other objects as they are. A radius is compared with the radius a corner stores, so a corner that stores a larger radius than it draws takes the new one, alone or beside other targets. Radii stored as fractions are still compared as drawn. --- crates/engine/src/cmd/object/commands.rs | 2 +- crates/engine/src/cmd/object/shape.rs | 21 ++++++++--- crates/engine/src/tests/livecorners.rs | 47 ++++++++++++++++++++++++ crates/ui-egui/src/panels.rs | 19 +++------- docs/mcp.md | 6 ++- docs/target-app-parity.md | 2 +- 6 files changed, 75 insertions(+), 22 deletions(-) diff --git a/crates/engine/src/cmd/object/commands.rs b/crates/engine/src/cmd/object/commands.rs index 4be83d7da6..753f5f9f6f 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)} (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)} (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 661a9331ef..94cf575de1 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()) { @@ -225,6 +225,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(); @@ -270,16 +277,20 @@ pub(super) fn set_live_shape(s: &mut Session, p: &Value) -> Result { (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) }) }; // The objects every value given already matches stay as they are, beside others that change. - let unchanged: BTreeSet = ids.iter().copied().filter(has_values).collect(); - if ids.iter().all(|id| unchanged.contains(id)) { + let ids: Vec = ids.into_iter().filter(|id| !has_values(id)).collect(); + if ids.is_empty() { return ok(); } - let ids: Vec = ids.into_iter().filter(|id| !unchanged.contains(id)).collect(); s.edit("Live Shape", |d, sel| { for id in &ids { let Some(NodeKind::Path { path, live, .. }) = d.node_mut(*id).map(|n| &mut n.kind) else { continue }; diff --git a/crates/engine/src/tests/livecorners.rs b/crates/engine/src/tests/livecorners.rs index 6d9d806c3e..0e67c72c33 100644 --- a/crates/engine/src/tests/livecorners.rs +++ b/crates/engine/src/tests/livecorners.rs @@ -113,6 +113,53 @@ fn a_kind_the_corners_have_leaves_a_stretched_rectangle() { 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/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index 9e30fd609d..2d7037c5a0 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -57,7 +57,7 @@ use std::sync::Arc; use egui::{Rect, Sense, Ui, vec2}; use serde_json::{Value, json}; use vectorcraft_color::{BlendMode, Color, Paint}; -use vectorcraft_doc::{LiveCorners, LiveShape, Node, NodeId, NodeKind, StrokeLayer}; +use vectorcraft_doc::{LiveCorners, Node, NodeId, NodeKind, StrokeLayer}; use vectorcraft_engine::inspect::StrokeMixed; use vectorcraft_geom::shapes::CornerKind; @@ -146,19 +146,12 @@ fn set_rectangle_corners(app: &mut VectorcraftApp, mut p: Value, corner: Option< // selected after it. let r = app.session.finish_tool_edit(); crate::canvas::apply_requests(app, r); - match app.session.active() { - // The command refuses the selection, with its message, while part of a symbol's art is - // selected. - Some(st) if st.selection.symbol_part.is_some() => {} - // The selected live rectangles as `ids`, all sharing `corners`. - Some(st) => { - let is_rectangle = |n: &Node| matches!(&n.kind, NodeKind::Path { live: Some(l), .. } if matches!(**l, LiveShape::Rectangle { .. })); - let rectangle = |id: &&NodeId| st.doc.node(**id).is_some_and(is_rectangle); - let ids: Vec = st.selection.objects.iter().filter(rectangle).map(|id| id.0).collect(); - p["ids"] = json!(ids); - } - None => 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); } diff --git a/docs/mcp.md b/docs/mcp.md index 655efa1b4c..eb6764b99a 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -6889,7 +6889,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` @@ -6908,7 +6908,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`). diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index d6c8cf348d..18c5721197 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1362,7 +1362,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, ids, corners}`). 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`). + - **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`). - **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). - **Blend spine points by marquee:** with Direct Selection, a marquee picks the spine points inside it on a selected blend, the topmost one when several are selected, and the picked points drag together as Shift-clicked ones do; Shift-marquee adds points or takes picked ones away, a plain marquee around none of them drops the picks, and Escape during the marquee keeps them. Unselected, locked and hidden blends are skipped. The spine's points are anchor points edited with Direct Selection ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/modify-spine-of-blended-objects.html)), and a boundary drag with the tool selects anchor points ([the help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/select-anchor-points-in-paths.html)); the rules for selected, topmost and Shift are VectorCraft's own (`crates/tools/src/direct/tests.rs`, `marquee_picks_selected_blend_spine_points_which_drag_together`, `shift_marquee_toggles_selected_blend_spine_points`, `marquee_skips_unselected_locked_and_hidden_blend_spines`, `escape_cancels_a_marquee_and_keeps_the_picked_spine_points`). When no selected object is a blend, the selected-spine checks of Direct Selection's hover, press and marquee, the Anchor Point tool and the Pen return at once instead of building every blend's spine first; on 20,000 paths and 200 blends with one path selected, 500 checks took 24 µs instead of 336 ms, and the results are the same (`the_selected_spine_check_builds_no_spine_without_a_selected_blend`, `the_selected_spine_check_matches_a_filter_of_every_spine`; `selected_spine_check_timing` times it). From 0393a9780411f93ed0db43914c1e042731f111a9 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 06:36:42 -0800 Subject: [PATCH 31/38] i18n: Indonesian rows for custom bevel messages --- crates/ui-egui/src/i18n/id.tsv | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 97214bded6..12c3babb7e 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 From 45c6fb40cbf1ea01f99ac1878f080c85108ba0b1 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 06:01:39 -0800 Subject: [PATCH 32/38] Retype: evenly spaced glyphs keep their spacing as tracking Part of #4934. type.retype set a line spaced by tracking as one point type object per glyph, since untracked type does not draw the glyphs where the outlines are. - A line of three or more glyphs that most gaps space evenly apart now takes that spacing as its tracking (1/1000 em, tried rounded to a whole number within 0.05, then as measured). The font's advances and pair kerning are left out of the measure, and word spaces are counted after the tracking. When untracked type also draws the line, 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". Negative tracking is set only on opaque, Normal lines with a solid fill or none and no stroke. - Where a line splits, the glyphs after the split take the tracking their own gaps give, and a tracked line whose type misplaces its first glyphs is set again without tracking. The measure has a layout budget, so long or widely spaced lines are bounded. - The result's fonts entries add tracking. These rules are VectorCraft's own. Docs: docs/mcp.md (Retype tracking), docs/type-parity.md (Retype row), docs/target-app-parity.md, docs/roadmap.md (M7 row). --- crates/engine/src/cmd/retype.rs | 355 ++++++++++++++++++++++++-- crates/engine/src/cmd/retype_tests.rs | 355 +++++++++++++++++++++++++- docs/mcp.md | 21 ++ docs/roadmap.md | 2 +- docs/target-app-parity.md | 4 + docs/type-parity.md | 2 +- 6 files changed, 712 insertions(+), 27 deletions(-) diff --git a/crates/engine/src/cmd/retype.rs b/crates/engine/src/cmd/retype.rs index cb548bd46e..6066e47f33 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,31 @@ 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 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 +241,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 +303,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 +313,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 +333,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 +360,208 @@ 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. 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 seven 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 mut tries = vec![]; + for seed in [median(extra.clone(), false), median(extra, true)].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 +570,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(264))).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 +596,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 +710,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 +732,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(), @@ -533,6 +838,13 @@ fn retype(s: &mut Session, p: &Value) -> Result { // 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(); + // Each line's tracking is measured with seven layouts at most: the line as read (its + // characters), its glyphs without and with one space between them (three times its + // glyphs) and four tracked readings of at most 64 spaces in each gap (260 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(263))).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 +923,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..b89d8e0d78 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(); @@ -537,3 +537,348 @@ fn a_long_tracked_line_is_checked_in_time() { assert_eq!(r["unmatched"], json!([])); eprintln!("450 tracked glyphs: {:?}, {} objects", t0.elapsed(), texts.len()); } + +/// 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. + for text in ["MMMM", "MMMM MM", "M MM", "MM M"] { + 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 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/docs/mcp.md b/docs/mcp.md index 966175ccc2..f0f035a261 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -12156,6 +12156,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 45df43932f..488755ffef 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -181,7 +181,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | 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; 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 | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 48b66331f3..f94e56c853 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -3017,6 +3017,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). 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. | From 3ab753a4420a138709a14e30628303ace5605711 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 11:17:37 -0800 Subject: [PATCH 33/38] Retype: tight joins keep lone glyphs out, and a space in tight gaps seeds the tracking A glyph that joined a line only through the tight-tracking test counts as alone when the line has fewer than three glyphs, so two overlapping one-contour glyphs beside other art stay outlines after the layout check splits them. A line most of whose gaps hold a word space also tries the tracking implied by the lower median extra less one space, so "M M MM" at -300 stays one object. --- crates/engine/src/cmd/retype.rs | 46 +++++++++++++++++++++------ crates/engine/src/cmd/retype_tests.rs | 21 ++++++++++-- 2 files changed, 56 insertions(+), 11 deletions(-) diff --git a/crates/engine/src/cmd/retype.rs b/crates/engine/src/cmd/retype.rs index 6066e47f33..7f3d65bee7 100644 --- a/crates/engine/src/cmd/retype.rs +++ b/crates/engine/src/cmd/retype.rs @@ -218,6 +218,28 @@ impl Line { 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 @@ -368,14 +390,15 @@ impl Line { /// 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. A tracking within + /// 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 seven layouts at most takes + /// 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 { @@ -474,8 +497,14 @@ impl Line { }; // 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). + let spaced_seed = lower.map(|e| (e - space) / 2.0); let mut tries = vec![]; - for seed in [median(extra.clone(), false), median(extra, true)].into_iter().flatten() { + 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) { @@ -578,7 +607,7 @@ fn verified(lines: Vec, system_layout: bool, unmatched: &mut Vec) // 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(264))).fold(budget, usize::saturating_add); + 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() { @@ -836,14 +865,13 @@ 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(); - // Each line's tracking is measured with seven layouts at most: the line as read (its + 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 four tracked readings of at most 64 spaces in each gap (260 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(263))).fold(256usize, usize::saturating_add); + 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 { diff --git a/crates/engine/src/cmd/retype_tests.rs b/crates/engine/src/cmd/retype_tests.rs index b89d8e0d78..6512d8a334 100644 --- a/crates/engine/src/cmd/retype_tests.rs +++ b/crates/engine/src/cmd/retype_tests.rs @@ -533,11 +533,26 @@ 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); @@ -773,7 +788,9 @@ fn glyphs_type_cannot_draw_do_not_use_up_the_tracking_measure() { 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. - for text in ["MMMM", "MMMM MM", "M MM", "MM M"] { + // 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}"); From f4fb0d187c50c952f2a460331d4ed86e37b15b34 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 11:39:56 -0800 Subject: [PATCH 34/38] Transform: the corner command stops when the pending edit fails to settle set_rectangle_corners reported an error from finish_tool_edit and still ran object.setLiveShape on the selection. It now returns after reporting the error. --- crates/ui-egui/src/panels.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index 48e3aa5005..e73a83e9e1 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -146,8 +146,13 @@ 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. - let r = app.session.finish_tool_edit(); - crate::canvas::apply_requests(app, r); + 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; } From 9ae87b1af652ae45be2a14af5e0ab0d55e0053f9 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 11:52:06 -0800 Subject: [PATCH 35/38] Retype: untracked words are not read as spaced letters in tight tracking The space-aware tracking seed is tried only when untracked type does not already draw the whole line. --- crates/engine/src/cmd/retype.rs | 4 +++- crates/engine/src/cmd/retype_tests.rs | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/retype.rs b/crates/engine/src/cmd/retype.rs index 7f3d65bee7..8f4bcb4b35 100644 --- a/crates/engine/src/cmd/retype.rs +++ b/crates/engine/src/cmd/retype.rs @@ -502,7 +502,9 @@ impl Line { // (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). - let spaced_seed = lower.map(|e| (e - space) / 2.0); + // 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 }; diff --git a/crates/engine/src/cmd/retype_tests.rs b/crates/engine/src/cmd/retype_tests.rs index 6512d8a334..3d9dc5e3fe 100644 --- a/crates/engine/src/cmd/retype_tests.rs +++ b/crates/engine/src/cmd/retype_tests.rs @@ -859,6 +859,16 @@ fn a_word_space_between_kerned_letters_is_read_as_a_space() { 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(); From 36bde202eb87d19ae87ff95ce232516b0150a513 Mon Sep 17 00:00:00 2001 From: yoriswind Date: Thu, 19 Nov 2026 20:00:59 +0000 Subject: [PATCH 36/38] Scissors: preview the actual cut point Show the native point marker at the existing cut target, respecting consumer endpoint eligibility/canonicalization and current snapping/selection. Keep cut commands unchanged. Closes #8655. --- crates/engine/tests/scissors_snap.rs | 176 ++++++++++++++++++ crates/tools/src/draw2/anchor.rs | 90 ++++++++-- crates/tools/src/draw2/anchor/tests.rs | 236 +++++++++++++++++++++++++ docs/gaps.md | 5 +- docs/roadmap.md | 7 +- docs/target-app-parity.md | 7 +- docs/ui-parity.md | 6 +- 7 files changed, 505 insertions(+), 22 deletions(-) diff --git a/crates/engine/tests/scissors_snap.rs b/crates/engine/tests/scissors_snap.rs index f44b0e6f66..a02cac77da 100644 --- a/crates/engine/tests/scissors_snap.rs +++ b/crates/engine/tests/scissors_snap.rs @@ -154,3 +154,179 @@ 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 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); + vec![(interior_markers, actual_interior), (canonical_markers, canonical)] +} 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/docs/gaps.md b/docs/gaps.md index 9bee6df9d8..a314f4ddc5 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/roadmap.md b/docs/roadmap.md index 8104582d7a..8c42266779 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 (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-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: 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,7 +179,7 @@ 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 | @@ -233,6 +235,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours | 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 | 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 0a643f124b..39e5bd8387 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-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: 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-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: 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 (fourteen generated libraries including Tech Circuit, 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) | @@ -3119,6 +3121,7 @@ Edit › Copy and Cut put the selected ruler guides on the clipboard, with the s | 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 | 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/ui-parity.md b/docs/ui-parity.md index a67ebfa855..b282b639e5 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-19 · **Change:** minor (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-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: 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 | @@ -622,6 +625,7 @@ before release (#6373). [Paint faces and edges](https://helpx.adobe.com/illustra | 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 | 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. | From 3aa1e34294d19cc55062c38be0fddb73cc217a37 Mon Sep 17 00:00:00 2001 From: yoriswind Date: Thu, 19 Nov 2026 20:21:09 +0000 Subject: [PATCH 37/38] Tests: split scissors endpoint control helper Preserve the endpoint, interior, and canonicalization checks while keeping each helper below strict Clippy complexity limits. --- crates/engine/tests/scissors_snap.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/engine/tests/scissors_snap.rs b/crates/engine/tests/scissors_snap.rs index a02cac77da..6d12bd6457 100644 --- a/crates/engine/tests/scissors_snap.rs +++ b/crates/engine/tests/scissors_snap.rs @@ -286,6 +286,11 @@ fn review_8655_session_endpoint_controls() -> Vec<(Vec, Point)> { 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( @@ -328,5 +333,5 @@ fn review_8655_session_endpoint_controls() -> Vec<(Vec, Point)> { assert_eq!(path(&session, closed), original_closed); session.execute("edit.redo", &json!({})).unwrap(); assert_eq!(path(&session, closed), opened); - vec![(interior_markers, actual_interior), (canonical_markers, canonical)] + (canonical_markers, canonical) } From 2fb48bd77d0ebd8caccf242630d2b1fd70661cf3 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Fri, 20 Nov 2026 04:00:20 +0700 Subject: [PATCH 38/38] Tests: the inline refresh test holds the fonts lock, so a font another test adds can't change one pass's type --- crates/engine/src/tests/inline.rs | 3 +++ 1 file changed, 3 insertions(+) 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);