From f763b86fdc49fd5da6df4ecc6aa5e7a4b113f9b9 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 14 Nov 2026 08:06:25 -0800 Subject: [PATCH 01/55] Color Wheel: OKLCH Sliders edit a color by lightness, chroma and hue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Color Wheel panel's menu gets OKLCH Sliders: L, C and H rows under the wheel or the box that edit the color by the OKLCH lightness (0 to 100 %), chroma (0 to 100 % of 0.4) and hue of its display sRGB, as CSS Color 4 defines them. Each track dims the colors outside sRGB, and a tick on the C track marks the largest chroma that fits; a color outside sRGB keeps L and H and takes that chroma. The rows are gray, and the menu item and ui.colorWheel {sliders: "oklch"} are refused, while the working RGB space is not sRGB. The choice is kept with the preferences. - vectorcraft-color: oklab.rs with OKLCH conversions and max_chroma. - color.convert {to: "oklch"} answers [L %, C, H°]. - ui.colorWheel takes sliders next to view and channel. Docs: docs/mcp.md, docs/control-protocol.md, docs/target-app-parity.md. --- crates/color/src/lib.rs | 1 + crates/color/src/oklab.rs | 138 +++++++++ crates/engine/src/cmd/colormgmt.rs | 14 +- crates/engine/src/tests/colormgmt.rs | 24 ++ crates/mcp/src/ui_catalog.rs | 2 +- crates/ui-egui/src/i18n/bg.tsv | 6 + crates/ui-egui/src/i18n/bs.tsv | 6 + crates/ui-egui/src/i18n/ca.tsv | 6 + crates/ui-egui/src/i18n/cs.tsv | 6 + crates/ui-egui/src/i18n/da.tsv | 6 + crates/ui-egui/src/i18n/de.tsv | 6 + crates/ui-egui/src/i18n/el.tsv | 6 + crates/ui-egui/src/i18n/es.tsv | 6 + crates/ui-egui/src/i18n/fi.tsv | 6 + crates/ui-egui/src/i18n/fr.tsv | 6 + crates/ui-egui/src/i18n/gu.tsv | 5 + crates/ui-egui/src/i18n/hi.tsv | 6 + crates/ui-egui/src/i18n/hu.tsv | 6 + crates/ui-egui/src/i18n/id.tsv | 6 + crates/ui-egui/src/i18n/it.tsv | 6 + crates/ui-egui/src/i18n/ja.tsv | 6 + crates/ui-egui/src/i18n/ka.tsv | 6 + crates/ui-egui/src/i18n/ko.tsv | 6 + crates/ui-egui/src/i18n/nl.tsv | 6 + crates/ui-egui/src/i18n/pl.tsv | 6 + crates/ui-egui/src/i18n/pt-br.tsv | 6 + crates/ui-egui/src/i18n/ru.tsv | 6 + crates/ui-egui/src/i18n/sv.tsv | 6 + crates/ui-egui/src/i18n/tr.tsv | 6 + crates/ui-egui/src/i18n/uk.tsv | 6 + crates/ui-egui/src/i18n/vi.tsv | 6 + crates/ui-egui/src/i18n/zh-hans.tsv | 6 + crates/ui-egui/src/i18n/zh-hant.tsv | 6 + crates/ui-egui/src/menus/ui_commands.rs | 2 +- crates/ui-egui/src/panels/color_wheel.rs | 211 +++++++++++++- .../ui-egui/src/panels/tests_color_wheel.rs | 261 +++++++++++++++++- .../src/panels/tests_color_wheel_box.rs | 26 +- crates/ui-egui/src/state.rs | 2 +- crates/ui-egui/src/widgets.rs | 4 +- crates/ui-egui/src/widgets/buttons.rs | 12 +- docs/control-protocol.md | 5 +- docs/mcp.md | 8 +- docs/target-app-parity.md | 1 + 43 files changed, 840 insertions(+), 38 deletions(-) create mode 100644 crates/color/src/oklab.rs diff --git a/crates/color/src/lib.rs b/crates/color/src/lib.rs index 3afca8063c..b3d97d7efd 100644 --- a/crates/color/src/lib.rs +++ b/crates/color/src/lib.rs @@ -10,6 +10,7 @@ pub mod freeform; pub mod gradient; pub mod harmony; pub mod libraries; +pub mod oklab; pub mod palette_io; pub mod recolor; pub mod swatch; diff --git a/crates/color/src/oklab.rs b/crates/color/src/oklab.rs new file mode 100644 index 0000000000..90467fc6c3 --- /dev/null +++ b/crates/color/src/oklab.rs @@ -0,0 +1,138 @@ +//! OKLCH, the polar form of Oklab, as CSS Color 4 defines it +//! (): lightness L from 0 to 1, chroma +//! C (CSS reads 100% as 0.4) and hue H in degrees from the positive `a` axis. The conversions take +//! and give gamma-encoded sRGB through the Oklab matrices of [`crate::libraries`]. + +use crate::libraries::{oklab_to_srgb, srgb_to_oklab}; + +/// The chroma CSS reads as 100%. +pub const CHROMA_FULL: f64 = 0.4; + +/// Chroma at or below which the hue is powerless (CSS Color 4's ε); [`to_oklch`] gives hue 0 there. +pub const POWERLESS_CHROMA: f64 = 0.000_004; + +/// How far outside 0..=1 an sRGB component may be and still count as inside the gamut. +const GAMUT_SLACK: f64 = 1e-4; + +/// OKLCH `[l, c, h°]` of sRGB `rgb` (gamma encoded). Values outside 0..=1 are converted as they +/// are. The hue is in 0..360, and 0 while the chroma is powerless. +pub fn to_oklch(rgb: [f32; 3]) -> [f64; 3] { + let [l, a, b] = srgb_to_oklab(rgb); + let c = a.hypot(b); + if c <= POWERLESS_CHROMA { + return [l, 0.0, 0.0]; + } + [l, c, b.atan2(a).to_degrees().rem_euclid(360.0)] +} + +/// sRGB (gamma encoded) of OKLCH `(l, c, h°)`, unclamped. +pub fn oklch_to_srgb(l: f64, c: f64, h: f64) -> [f64; 3] { + let (sin, cos) = h.to_radians().sin_cos(); + oklab_to_srgb(l, c * cos, c * sin) +} + +/// Whether sRGB `rgb` lies inside the sRGB gamut. +pub fn in_srgb(rgb: [f64; 3]) -> bool { + rgb.iter().all(|v| (-GAMUT_SLACK..=1.0 + GAMUT_SLACK).contains(v)) +} + +/// The largest chroma sRGB holds at lightness `l` and hue `h°`: 0 at or outside black and white. +pub fn max_chroma(l: f64, h: f64) -> f64 { + if !(l > 0.0 && l < 1.0) || !h.is_finite() { + return 0.0; + } + // sRGB holds every chroma from 0 up to its edge along a hue at a given lightness. + let (mut lo, mut hi) = (0.0, 0.5); + for _ in 0..40 { + let mid = (lo + hi) / 2.0; + if in_srgb(oklch_to_srgb(l, mid, h)) { lo = mid } else { hi = mid } + } + lo +} + +/// The sRGB color (gamma encoded, 0..=1) of OKLCH `(l, c, h°)`, and whether its chroma was lowered: +/// a color outside sRGB keeps its lightness and hue and takes the largest chroma that fits. +/// Lightness is clamped to 0..=1 and chroma to 0 or more. +pub fn from_oklch(l: f64, c: f64, h: f64) -> ([f32; 3], bool) { + let l = if l.is_nan() { 0.0 } else { l.clamp(0.0, 1.0) }; + let c = if c.is_nan() { 0.0 } else { c.max(0.0) }; + let h = if h.is_finite() { h } else { 0.0 }; + let exact = oklch_to_srgb(l, c, h); + let (rgb, lowered) = if in_srgb(exact) { (exact, false) } else { (oklch_to_srgb(l, max_chroma(l, h).min(c), h), true) }; + (rgb.map(|v| v.clamp(0.0, 1.0) as f32), lowered) +} + +#[cfg(test)] +mod tests { + use super::*; + + fn eight(rgb: [f32; 3]) -> [u8; 3] { + rgb.map(|v| (v * 255.0).round() as u8) + } + + #[test] + fn red_has_the_oklch_of_the_oklab_matrices_and_converts_back() { + let [l, c, h] = to_oklch([1.0, 0.0, 0.0]); + assert!((l - 0.6280).abs() < 5e-5 && (c - 0.2577).abs() < 5e-5 && (h - 29.23).abs() < 5e-3, "{l} {c} {h}"); + let (rgb, lowered) = from_oklch(l, c, h); + assert_eq!((eight(rgb), lowered), ([255, 0, 0], false)); + } + + /// CSS Color 4's examples convert to the hue its oklab() and oklch() forms give. + #[test] + fn the_polar_form_matches_the_css_examples() { + for ([l, a, b], [cl, cc, ch]) in + [([0.40101, 0.1147, 0.0453], [0.40101, 0.12332, 21.555]), ([0.65125, -0.0320, 0.1274], [0.65125, 0.13138, 104.097])] + { + let rgb = oklab_to_srgb(l, a, b).map(|v| v as f32); + let [ol, oc, oh] = to_oklch(rgb); + assert!((ol - cl).abs() < 1e-4 && (oc - cc).abs() < 1e-4 && (oh - ch).abs() < 0.05, "{ol} {oc} {oh}"); + } + } + + #[test] + fn the_216_web_colors_round_trip() { + let steps = [0u8, 0x33, 0x66, 0x99, 0xcc, 0xff]; + for r in steps { + for g in steps { + for b in steps { + let rgb = [r, g, b].map(|v| f32::from(v) / 255.0); + let [l, c, h] = to_oklch(rgb); + assert_eq!(eight(from_oklch(l, c, h).0), [r, g, b], "{l} {c} {h}"); + } + } + } + } + + #[test] + fn grays_have_no_chroma_and_hue_zero() { + for v in [0.0, 0.5, 1.0] { + let [_, c, h] = to_oklch([v, v, v]); + assert!(c <= POWERLESS_CHROMA && h == 0.0, "{c} {h}"); + } + } + + /// A chroma past the gamut gives a color inside it with the same lightness and hue, and says so. + #[test] + fn a_chroma_past_the_gamut_is_lowered_keeping_lightness_and_hue() { + let (l, h) = (0.7, 150.0); + let max = max_chroma(l, h); + assert!(max > 0.05 && max < CHROMA_FULL, "{max}"); + assert!(in_srgb(oklch_to_srgb(l, max, h)) && !in_srgb(oklch_to_srgb(l, max + 1e-3, h))); + let (rgb, lowered) = from_oklch(l, CHROMA_FULL, h); + assert!(lowered); + let [ol, oc, oh] = to_oklch(rgb); + assert!((ol - l).abs() < 2e-3 && (oh - h).abs() < 1.0 && (oc - max).abs() < 2e-3, "{ol} {oc} {oh}"); + assert!(!from_oklch(l, max * 0.5, h).1); + } + + #[test] + fn black_white_and_bad_numbers_hold_no_chroma() { + assert_eq!(max_chroma(0.0, 30.0), 0.0); + assert_eq!(max_chroma(1.0, 30.0), 0.0); + assert_eq!(max_chroma(f64::NAN, 30.0), 0.0); + assert_eq!(max_chroma(0.5, f64::INFINITY), 0.0); + assert_eq!(eight(from_oklch(f64::NAN, f64::NAN, f64::NAN).0), [0, 0, 0]); + assert_eq!(eight(from_oklch(2.0, -1.0, 0.0).0), [255, 255, 255]); + } +} diff --git a/crates/engine/src/cmd/colormgmt.rs b/crates/engine/src/cmd/colormgmt.rs index 66295f50f2..c9d4daa0a9 100644 --- a/crates/engine/src/cmd/colormgmt.rs +++ b/crates/engine/src/cmd/colormgmt.rs @@ -81,7 +81,7 @@ pub fn specs() -> Vec { "Convert Color", [], None, - "{color (#rrggbbaa and #rgba are refused), to: \"rgb\"|\"cmyk\"|\"gray\"|\"lab\", intent?} → {model, values, hex, lab: [L,a,b], outOfGamut, deltaE}", + "{color (#rrggbbaa and #rgba are refused), to: \"rgb\"|\"cmyk\"|\"gray\"|\"lab\"|\"oklch\", intent?} → {model, values, hex, lab: [L,a,b], outOfGamut, deltaE}; oklch values are [L (0..100 %), C, H (0..360°)] of the color's display sRGB (CSS Color 4 OKLCH: https://www.w3.org/TR/css-color-4/#specifying-oklab-oklch), with H 0 for a gray; in a working RGB space other than sRGB, a color outside sRGB is clamped to sRGB first", always, convert_color ), @@ -707,10 +707,14 @@ fn convert_color(_: &mut Session, p: &Value) -> Result { let intent = intent_param(p, C)?.unwrap_or(c.settings().intent); let lab = c.lab(&col); let (model, vals) = match text_param(p, "to", C)?.unwrap_or("rgb") { - "rgb" => ("rgb", values(&c.convert(&col, Model::Rgb, intent))), - "cmyk" => ("cmyk", values(&c.convert(&col, Model::Cmyk, intent))), - "gray" | "grayscale" => ("gray", values(&c.convert(&col, Model::Gray, intent))), - "lab" => ("lab", vec![lab.l, lab.a, lab.b]), + "rgb" => ("rgb", json!(values(&c.convert(&col, Model::Rgb, intent)))), + "cmyk" => ("cmyk", json!(values(&c.convert(&col, Model::Cmyk, intent)))), + "gray" | "grayscale" => ("gray", json!(values(&c.convert(&col, Model::Gray, intent)))), + "lab" => ("lab", json!([lab.l, lab.a, lab.b])), + "oklch" => { + let [l, ch, h] = vectorcraft_color::oklab::to_oklch(c.display_rgb(&col)); + ("oklch", json!([l * 100.0, ch, h])) + } other => return Err(bad(C, format!("unknown model `{other}`"))), }; let de = c.gamut_error(&col); diff --git a/crates/engine/src/tests/colormgmt.rs b/crates/engine/src/tests/colormgmt.rs index 493f569805..cdc774da7f 100644 --- a/crates/engine/src/tests/colormgmt.rs +++ b/crates/engine/src/tests/colormgmt.rs @@ -295,6 +295,30 @@ fn convert_query_and_intents() { assert!(s.execute("color.convert", &json!({"color": "#808080", "intent": "vivid"})).is_err()); } +/// `to: "oklch"` answers the OKLCH of the color's display sRGB, which converts back to the color; +/// a CMYK color's display color, not its naive separation, sets them. +#[test] +fn convert_to_oklch_answers_lightness_chroma_and_hue() { + let _g = GLOBAL.lock().unwrap_or_else(|e| e.into_inner()); + let mut s = session(); + let r = s.execute("color.convert", &json!({"color": "#ff0000", "to": "oklch"})).unwrap(); + assert_eq!(r["model"], "oklch"); + let v: Vec = r["values"].as_array().unwrap().iter().map(|v| v.as_f64().unwrap()).collect(); + assert!((v[0] - 62.80).abs() < 0.005 && (v[1] - 0.2577).abs() < 5e-5 && (v[2] - 29.23).abs() < 0.005, "{r}"); + let (rgb, lowered) = vectorcraft_color::oklab::from_oklch(v[0] / 100.0, v[1], v[2]); + assert!(!lowered); + assert_eq!(Color::rgb(rgb[0], rgb[1], rgb[2]).to_hex(), "#ff0000"); + assert_eq!(r["hex"], "#ff0000"); + let gray = s.execute("color.convert", &json!({"color": "#808080", "to": "oklch"})).unwrap(); + assert_eq!(gray["values"][2], 0.0, "{gray}"); + let ink = json!({"c": 1.0, "m": 0.0, "y": 0.0, "k": 0.0}); + let cyan = s.execute("color.convert", &json!({"color": ink, "to": "oklch"})).unwrap(); + let shown = vectorcraft_color::oklab::to_oklch(cms::active().display_rgb(&Color::cmyk(1.0, 0.0, 0.0, 0.0))); + let naive = vectorcraft_color::oklab::to_oklch([0.0, 1.0, 1.0]); + let l = cyan["values"][0].as_f64().unwrap() / 100.0; + assert!((l - shown[0]).abs() < 1e-9 && (l - naive[0]).abs() > 0.02, "{cyan} {shown:?} {naive:?}"); +} + #[test] fn assign_profile_is_stored_and_undoable() { let _g = GLOBAL.lock().unwrap_or_else(|e| e.into_inner()); diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 943faa4782..965ac671a7 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, sliders?: none|oklch} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, pick the box's channel, as Box Channel does, and show no slider rows under the wheel or the box (none) or OKLCH Sliders (oklch), as OKLCH Sliders 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); OKLCH Sliders edit lightness 0 to 100 %, chroma 0 to 100 % of 0.4 and hue 0 to 360°, CSS Color 4's OKLCH of the display sRGB, and a color outside sRGB keeps L and H and takes the largest chroma that fits; 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, oklch is an error while the working RGB space is not sRGB, 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, sliders}", ), ( "ui.savePdfDialog", diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 348ac7b881..449b1c7d5d 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -1759,6 +1759,10 @@ font-technology Variable Променливи Knife Нож Knockout Group Група с изрязване Lab Lab + OKLCH Sliders Плъзгачи OKLCH + Chroma Хрома + The largest chroma sRGB holds at this lightness and hue Най-голямата хрома, която sRGB побира при тази светлина и този оттенък + OKLCH needs sRGB as the working RGB space OKLCH изисква sRGB като работно RGB пространство Lab Spot Colors: Спот цветове по Lab: Lab Values Стойности по Lab Landscape Пейзаж @@ -4242,6 +4246,8 @@ axis Both И двете @msg `aspect` must be a number (%) `aspect` трябва да бъде число (%) @msg `at` must be [x, y] `at` трябва да бъде [x, y] @msg `color` must be a colour `color` трябва да бъде цвят +@msg `sliders` must be none or oklch `sliders` трябва да бъде none или oklch +@msg OKLCH needs sRGB as the working RGB space OKLCH изисква sRGB като работно RGB пространство @msg `command` must be a command whose menu item opens a dialog (see ui.menuDialog) `command` трябва да бъде команда, чийто елемент от менюто отваря диалогов прозорец (вижте ui.menuDialog) @msg `freeform.points` must be an array `freeform.points` трябва да бъде масив @msg `freeform.lines` must be an array `freeform.lines` трябва да бъде масив diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 3b1a9e001c..028f6d111d 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -4194,6 +4194,10 @@ axis Both Obje Image Slika Ink Tinta Lab Lab + OKLCH Sliders OKLCH klizači + Chroma Hroma + The largest chroma sRGB holds at this lightness and hue Najveća hroma koju sRGB obuhvata pri ovoj svjetloći i nijansi + OKLCH needs sRGB as the working RGB space OKLCH zahtijeva sRGB kao radni RGB prostor Medium Srednje Name Naziv None Ništa @@ -4651,6 +4655,8 @@ imageTrace Outline Obris @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` mora biti grayscale, rgb, hsb, cmyk ili websafe @msg `view` must be wheel or box `view` mora biti wheel ili box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` mora biti hue, saturation, brightness, red, green ili blue +@msg `sliders` must be none or oklch `sliders` mora biti none ili oklch +@msg OKLCH needs sRGB as the working RGB space OKLCH zahtijeva sRGB kao radni RGB prostor @msg `{k}` must be [x, y] `{k}` mora biti [x, y] @msg `{name}` has no options `{name}` nema opcija @msg `{name}` is a built-in workspace; choose another name `{name}` je ugrađeni radni prostor; odaberite drugi naziv diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 488b46c4f5..2cf6e80150 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -2257,6 +2257,10 @@ digits Malayalam Malaiàlam Knife Ganivet Knockout Group Grup knockout Lab Lab + OKLCH Sliders Controls lliscants OKLCH + Chroma Croma + The largest chroma sRGB holds at this lightness and hue El croma més gran que sRGB admet amb aquesta lluminositat i aquest to + OKLCH needs sRGB as the working RGB space OKLCH necessita sRGB com a espai RGB de treball Lab Spot Colors Colors directes Lab Lab Spot Colors: Colors directes Lab: Lab Values Valors Lab @@ -5272,6 +5276,8 @@ digits Malayalam Malaiàlam @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` ha de ser grayscale, rgb, hsb, cmyk o websafe @msg `view` must be wheel or box `view` ha de ser wheel o box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` ha de ser hue, saturation, brightness, red, green o blue +@msg `sliders` must be none or oklch `sliders` ha de ser none o oklch +@msg OKLCH needs sRGB as the working RGB space OKLCH necessita sRGB com a espai RGB de treball @msg `name` is empty `name` és buit @msg `newName` is empty `newName` és buit @msg `pathfinder` must be an object `pathfinder` ha de ser un objecte diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 6a57e90e37..177d342c5d 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4250,6 +4250,10 @@ axis Both Obě Image Obraz Ink Inkoust Lab Lab + OKLCH Sliders Posuvníky OKLCH + Chroma Chroma + The largest chroma sRGB holds at this lightness and hue Největší chroma, kterou sRGB obsáhne při této světlosti a odstínu + OKLCH needs sRGB as the working RGB space OKLCH vyžaduje sRGB jako pracovní prostor RGB Medium Střední Name Název None Žádné @@ -4814,6 +4818,8 @@ imageTrace Outline Obrys @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` musí být grayscale, rgb, hsb, cmyk nebo websafe @msg `view` must be wheel or box `view` musí být wheel nebo box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` musí být hue, saturation, brightness, red, green nebo blue +@msg `sliders` must be none or oklch `sliders` musí být none nebo oklch +@msg OKLCH needs sRGB as the working RGB space OKLCH vyžaduje sRGB jako pracovní prostor RGB @msg `{k}` must be [x, y] `{k}` musí být [x, y] @msg `{name}` has no options `{name}` nemá žádné možnosti @msg `{name}` is a built-in workspace; choose another name `{name}` je vestavěný pracovní prostor; zvolte jiný název diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 54a79e38e5..fb2ccac4cd 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -3960,6 +3960,10 @@ axis Both Begge Image Billede Ink Blæk Lab Lab + OKLCH Sliders OKLCH-skydere + Chroma Kroma + The largest chroma sRGB holds at this lightness and hue Den største kroma, sRGB kan rumme ved denne lyshed og farvetone + OKLCH needs sRGB as the working RGB space OKLCH kræver sRGB som RGB-arbejdsfarverum Medium Medium Name Navn None Ingen @@ -5640,6 +5644,8 @@ mark-style Japanese Japansk @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` skal være grayscale, rgb, hsb, cmyk eller websafe @msg `view` must be wheel or box `view` skal være wheel eller box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` skal være hue, saturation, brightness, red, green eller blue +@msg `sliders` must be none or oklch `sliders` skal være none eller oklch +@msg OKLCH needs sRGB as the working RGB space OKLCH kræver sRGB som RGB-arbejdsfarverum @msg the Color Picker is not open farvevælgeren er ikke åben @msg the screen color sampler is already open skærmfarvesampleren er allerede åben @msg this system has no screen color sampler dette system har ingen skærmfarvesampler diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index ab77cb0dd7..5d6fdfc721 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -1821,6 +1821,10 @@ file-filter Templates Vorlagen Knife Messer Knockout Group Aussparungsgruppe Lab Lab + OKLCH Sliders OKLCH-Regler + Chroma Chroma + The largest chroma sRGB holds at this lightness and hue Das größte Chroma, das sRGB bei dieser Helligkeit und diesem Farbton enthält + OKLCH needs sRGB as the working RGB space OKLCH erfordert sRGB als RGB-Arbeitsfarbraum Lab Spot Colors: Lab-Volltonfarben: Lab Values Lab-Werte Landscape Querformat @@ -4427,6 +4431,8 @@ theme Appearance Erscheinungsbild @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` muss grayscale, rgb, hsb, cmyk oder websafe sein @msg `view` must be wheel or box `view` muss wheel oder box sein @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` muss hue, saturation, brightness, red, green oder blue sein +@msg `sliders` must be none or oklch `sliders` muss none oder oklch sein +@msg OKLCH needs sRGB as the working RGB space OKLCH erfordert sRGB als RGB-Arbeitsfarbraum @msg `{k}` must be [x, y] `{k}` muss [x, y] sein @msg `{name}` has no options `{name}` hat keine Optionen @msg `{name}` is a built-in workspace; choose another name `{name}` ist ein integrierter Arbeitsbereich; wählen Sie einen anderen Namen diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index a1a203a257..551003fcba 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -1722,6 +1722,10 @@ font-technology Variable Μεταβλητές Knife Μαχαίρι (Knife) Knockout Group Ομάδα διάτρησης Lab Lab + OKLCH Sliders Ρυθμιστικά OKLCH + Chroma Χρωματική ένταση + The largest chroma sRGB holds at this lightness and hue Η μεγαλύτερη χρωματική ένταση που χωρά το sRGB σε αυτή τη φωτεινότητα και απόχρωση + OKLCH needs sRGB as the working RGB space Το OKLCH απαιτεί sRGB ως χώρο εργασίας RGB Lab Spot Colors: Πλακάτα χρώματα Lab: Lab Values Τιμές Lab Landscape Οριζόντιος προσανατολισμός @@ -6098,6 +6102,8 @@ effect Points Σημεία @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe το `mode` πρέπει να είναι grayscale, rgb, hsb, cmyk ή websafe @msg `view` must be wheel or box το `view` πρέπει να είναι wheel ή box @msg `channel` must be hue, saturation, brightness, red, green or blue το `channel` πρέπει να είναι hue, saturation, brightness, red, green ή blue +@msg `sliders` must be none or oklch Το `sliders` πρέπει να είναι none ή oklch +@msg OKLCH needs sRGB as the working RGB space Το OKLCH απαιτεί sRGB ως χώρο εργασίας RGB @msg `{key}` must be an array of these names: {_1} το `{key}` πρέπει να είναι πίνακας με αυτά τα ονόματα: {_1} @msg choose a destination folder επιλέξτε φάκελο προορισμού @msg choose a source folder επιλέξτε φάκελο προέλευσης diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 45fd0d8235..e31262e04a 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -1815,6 +1815,10 @@ font-technology Variable Variables Knife Cuchilla Knockout Group Grupo de exclusión Lab Lab + OKLCH Sliders Controles deslizantes OKLCH + Chroma Croma + The largest chroma sRGB holds at this lightness and hue El croma más alto que admite sRGB con esta luminosidad y este tono + OKLCH needs sRGB as the working RGB space OKLCH necesita sRGB como espacio de trabajo RGB Lab Spot Colors: Tintas planas Lab: Lab Values Valores Lab Landscape Horizontal @@ -4504,6 +4508,8 @@ axis Both Ambos @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` debe ser grayscale, rgb, hsb, cmyk o websafe @msg `view` must be wheel or box `view` debe ser wheel o box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` debe ser hue, saturation, brightness, red, green o blue +@msg `sliders` must be none or oklch `sliders` debe ser none u oklch +@msg OKLCH needs sRGB as the working RGB space OKLCH necesita sRGB como espacio de trabajo RGB @msg `{k}` must be [x, y] `{k}` debe ser [x, y] @msg `{name}` has no options `{name}` no tiene opciones @msg `{name}` is a built-in workspace; choose another name `{name}` es un espacio de trabajo integrado; elige otro nombre diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index f6db5b8ee1..c3f1c8a1d7 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4169,6 +4169,10 @@ axis Both Molemmat Image Kuva Ink Muste Lab Lab + OKLCH Sliders OKLCH-liukusäätimet + Chroma Kroma + The largest chroma sRGB holds at this lightness and hue Suurin kroma, jonka sRGB sisältää tällä vaaleudella ja sävyllä + OKLCH needs sRGB as the working RGB space OKLCH vaatii sRGB:n RGB-työväriavaruudeksi Medium Keskitaso Name Nimi None Ei mitään @@ -6109,6 +6113,8 @@ mark-style Japanese Japanilainen @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode`-arvon on oltava grayscale, rgb, hsb, cmyk tai websafe @msg `view` must be wheel or box `view`-arvon on oltava wheel tai box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel`-arvon on oltava hue, saturation, brightness, red, green tai blue +@msg `sliders` must be none or oklch `sliders` on oltava none tai oklch +@msg OKLCH needs sRGB as the working RGB space OKLCH vaatii sRGB:n RGB-työväriavaruudeksi @msg `{key}` must be an array of these names: {_1} `{key}`-arvon on oltava taulukko, jossa on näitä nimiä: {_1} @msg choose a destination folder valitse kohdekansio @msg choose a source folder valitse lähdekansio diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index ae0bf3b436..b44504a009 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -1809,6 +1809,10 @@ font-technology Variable Variables Knife Cutter Knockout Group Groupe perçant Lab Lab + OKLCH Sliders Curseurs OKLCH + Chroma Chroma + The largest chroma sRGB holds at this lightness and hue Le plus grand chroma que sRGB contient à cette luminosité et cette teinte + OKLCH needs sRGB as the working RGB space OKLCH nécessite sRGB comme espace de travail RGB Lab Spot Colors: Tons directs Lab : Lab Values Valeurs Lab Landscape Paysage @@ -4493,6 +4497,8 @@ axis Both Les deux @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` doit valoir grayscale, rgb, hsb, cmyk ou websafe @msg `view` must be wheel or box `view` doit valoir wheel ou box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` doit valoir hue, saturation, brightness, red, green ou blue +@msg `sliders` must be none or oklch `sliders` doit valoir none ou oklch +@msg OKLCH needs sRGB as the working RGB space OKLCH nécessite sRGB comme espace de travail RGB @msg `{k}` must be [x, y] `{k}` doit être [x, y] @msg `{name}` has no options `{name}` n’a pas d’options @msg `{name}` is a built-in workspace; choose another name `{name}` est un espace de travail intégré ; choisissez un autre nom diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index f38612601c..fd6f9f7419 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -640,6 +640,11 @@ Color Themes રંગ થીમ Color Type: રંગ પ્રકાર: Color Wheel રંગ વ્હીલ + OKLCH Sliders OKLCH સ્લાઇડર્સ + Chroma ક્રોમા + The largest chroma sRGB holds at this lightness and hue આ લાઇટનેસ અને હ્યૂ પર sRGB સમાવી શકે તે સૌથી વધુ ક્રોમા + OKLCH needs sRGB as the working RGB space OKLCH માટે કાર્યકારી RGB સ્પેસ તરીકે sRGB જરૂરી છે + Lightness લાઇટનેસ Color blindness – Deuteranopia-type રંગ અંધત્વ – ડ્યુટેરેનોપિયા પ્રકાર Color blindness – Protanopia-type રંગ અંધત્વ – પ્રોટેનોપિયા પ્રકાર Color blindness – Tritanopia-type રંગ અંધત્વ – ટ્રિટેનોપિયા પ્રકાર diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 624671acca..ac9184a4ca 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -2496,6 +2496,10 @@ antiAlias Sharp शार्प Knife चाकू Knockout Group नॉकआउट समूह Lab Lab + OKLCH Sliders OKLCH स्लाइडर्स + Chroma क्रोमा + The largest chroma sRGB holds at this lightness and hue इस लाइटनेस और ह्यू पर sRGB में आने वाला सबसे अधिक क्रोमा + OKLCH needs sRGB as the working RGB space OKLCH के लिए वर्किंग RGB स्पेस sRGB होना चाहिए Lab Spot Colors लैब स्पॉट रंग Lab Spot Colors: लैब स्पॉट रंग: Lab Values लैब मूल्य @@ -6164,6 +6168,8 @@ antiAlias Sharp शार्प @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` को grayscale, rgb, hsb, cmyk या websafe होना चाहिए @msg `view` must be wheel or box `view` को wheel या box होना चाहिए @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` को hue, saturation, brightness, red, green या blue होना चाहिए +@msg `sliders` must be none or oklch `sliders` none या oklch होना चाहिए +@msg OKLCH needs sRGB as the working RGB space OKLCH के लिए वर्किंग RGB स्पेस sRGB होना चाहिए @msg `mode` must be one of {_1} `mode` को {_1} में से एक होना चाहिए @msg `mojikumi` must be "none", "yakumonoHankaku", "gyomatsuYakumonoHankaku", "gyomatsuYakumonoZenkaku", "yakumonoZenkaku" or "lineEndHalf" `mojikumi` "none", "yakumonoHankaku", "gyomatsuYakumonoHankaku", "gyomatsuYakumonoZenkaku", "yakumonoZenkaku" या "lineEndHalf" होना चाहिए। @msg `name` is empty `name` खाली है diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 3e8a200697..3d3f95031b 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -2272,6 +2272,10 @@ file-filter Templates Sablonok Knife Kés Knockout Group Kiütő csoport Lab Lab + OKLCH Sliders OKLCH csúszkák + Chroma Króma + The largest chroma sRGB holds at this lightness and hue A legnagyobb króma, amelyet az sRGB ezen a világosságon és színárnyalaton tartalmaz + OKLCH needs sRGB as the working RGB space Az OKLCH-hoz sRGB munka-RGB-színtér szükséges Lab Spot Colors Lab-direktszínek Lab Spot Colors: Lab-direktszínek: Lab Values Lab-értékek @@ -4929,6 +4933,8 @@ imageTrace Outline Körvonal @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode`: grayscale, rgb, hsb, cmyk vagy websafe kell @msg `view` must be wheel or box `view`: wheel vagy box kell @msg `channel` must be hue, saturation, brightness, red, green or blue `channel`: hue, saturation, brightness, red, green vagy blue kell +@msg `sliders` must be none or oklch A `sliders` értéke none vagy oklch lehet +@msg OKLCH needs sRGB as the working RGB space Az OKLCH-hoz sRGB munka-RGB-színtér szükséges @msg `{k}` must be [x, y] `{k}`: [x, y] kell @msg `{name}` has no options ennek nincsenek beállításai: `{name}` @msg `{name}` is a built-in workspace; choose another name beépített munkaterület: `{name}`; válassz másik nevet diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 2107a23bf0..8e3944aaae 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -3960,6 +3960,10 @@ axis Both Keduanya Image Gambar Ink Tinta Lab Lab + OKLCH Sliders Penggeser OKLCH + Chroma Kroma + The largest chroma sRGB holds at this lightness and hue Kroma terbesar yang dapat dimuat sRGB pada kecerahan dan rona ini + OKLCH needs sRGB as the working RGB space OKLCH memerlukan sRGB sebagai ruang RGB kerja Medium Sedang Name Nama None Nihil @@ -5640,6 +5644,8 @@ mark-style Japanese Jepang @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` harus grayscale, rgb, hsb, cmyk atau websafe @msg `view` must be wheel or box `view` harus wheel atau box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` harus hue, saturation, brightness, red, green atau blue +@msg `sliders` must be none or oklch `sliders` harus none atau oklch +@msg OKLCH needs sRGB as the working RGB space OKLCH memerlukan sRGB sebagai ruang RGB kerja @msg the Color Picker is not open Pemilih Warna tidak terbuka @msg the screen color sampler is already open pengambil warna layar sudah terbuka @msg this system has no screen color sampler sistem ini tidak memiliki pengambil warna layar diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index f75dc629db..41cb669d34 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -1853,6 +1853,10 @@ file-filter Templates Modelli Knife Coltello Knockout Group Gruppo con foratura Lab Lab + OKLCH Sliders Cursori OKLCH + Chroma Croma + The largest chroma sRGB holds at this lightness and hue Il croma più alto che sRGB contiene con questa luminosità e tonalità + OKLCH needs sRGB as the working RGB space OKLCH richiede sRGB come spazio di lavoro RGB Lab Spot Colors: Colori spot Lab: Lab Values Valori Lab Landscape Orizzontale @@ -4556,6 +4560,8 @@ axis Both Entrambi @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` deve essere grayscale, rgb, hsb, cmyk o websafe @msg `view` must be wheel or box `view` deve essere wheel o box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` deve essere hue, saturation, brightness, red, green o blue +@msg `sliders` must be none or oklch `sliders` deve essere none o oklch +@msg OKLCH needs sRGB as the working RGB space OKLCH richiede sRGB come spazio di lavoro RGB @msg `{k}` must be [x, y] `{k}` deve essere [x, y] @msg `{name}` has no options `{name}` non ha opzioni @msg `{name}` is a built-in workspace; choose another name `{name}` è un'area di lavoro integrata; scegli un altro nome diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 67072cc8b3..d8739a0800 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -3899,6 +3899,10 @@ file-filter Templates テンプレート Keep the pasted color as a new swatch with a numbered name. ペーストしたカラーを、番号付きの名前で新規スウォッチとして残します。 Keep: 保持: Lab Lab + OKLCH Sliders OKLCH スライダー + Chroma クロマ + The largest chroma sRGB holds at this lightness and hue この明度と色相で sRGB に収まる最大のクロマ + OKLCH needs sRGB as the working RGB space OKLCH には作業用 RGB スペースとして sRGB が必要です Lab Values Lab 値 Large List View 大きいリスト表示 Large Thumbnail View 大きいサムネール表示 @@ -5016,6 +5020,8 @@ swatch Bright Violet ビビッドバイオレット @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` には grayscale、rgb、hsb、cmyk、websafe のいずれかを指定してください @msg `view` must be wheel or box `view` には wheel、box のいずれかを指定してください @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` には hue、saturation、brightness、red、green、blue のいずれかを指定してください +@msg `sliders` must be none or oklch `sliders` は none または oklch でなければなりません +@msg OKLCH needs sRGB as the working RGB space OKLCH には作業用 RGB スペースとして sRGB が必要です @msg `{key}` must be true or false `{key}` には true または false を指定してください @msg `top` and `below` can't both be true `top` と `below` を同時に true にすることはできません @msg `select` must be true or false `select` には true または false を指定してください diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index c8513b84c3..28c90166d9 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -3780,6 +3780,10 @@ axis Both ორივე Image გამოსახულება Ink მელანი Lab Lab + OKLCH Sliders OKLCH სლაიდერები + Chroma ქრომა + The largest chroma sRGB holds at this lightness and hue უდიდესი ქრომა, რომელსაც sRGB იტევს ამ სიღიავესა და ფერის ტონზე + OKLCH needs sRGB as the working RGB space OKLCH-ს სამუშაო RGB სივრცედ sRGB სჭირდება Medium საშუალო Name სახელი None არცერთი @@ -5794,6 +5798,8 @@ imageTrace Outline კონტური @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` უნდა იყოს grayscale, rgb, hsb, cmyk ან websafe @msg `view` must be wheel or box `view` უნდა იყოს wheel ან box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` უნდა იყოს hue, saturation, brightness, red, green ან blue +@msg `sliders` must be none or oklch `sliders` უნდა იყოს none ან oklch +@msg OKLCH needs sRGB as the working RGB space OKLCH-ს სამუშაო RGB სივრცედ sRGB სჭირდება @msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), not a PDF: File › Open and File › Place read it as EPS ეს PostScript ფაილია (ძველ ფორმატში ან PDF-თან თავსებადობის გარეშე შენახული .ai, ან EPS ფაილი) და არა PDF: ფაილი › გახსნა და ფაილი › განთავსება მას EPS-ად კითხულობს # Upstream sync 2026-10-16 (3): Intertwine, symbol registration, gradient span, data sets, Batch. Intertwine გადახლართვა diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 8aa0bc41ca..f853524c7d 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3887,6 +3887,10 @@ file-filter Templates 템플릿 Keep the pasted color as a new swatch with a numbered name. 붙여넣은 색상을 번호가 붙은 이름의 새 견본으로 보관합니다. Keep: 유지: Lab Lab + OKLCH Sliders OKLCH 슬라이더 + Chroma 크로마 + The largest chroma sRGB holds at this lightness and hue 이 명도와 색조에서 sRGB가 담을 수 있는 최대 크로마 + OKLCH needs sRGB as the working RGB space OKLCH를 사용하려면 작업 RGB 공간이 sRGB여야 합니다 Lab Values Lab 값 Large List View 큰 목록 보기 Large Thumbnail View 큰 축소판 보기 @@ -4943,6 +4947,8 @@ theme Appearance 외관 @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode`은(는) grayscale, rgb, hsb, cmyk, websafe 중 하나여야 합니다 @msg `view` must be wheel or box `view`은(는) wheel, box 중 하나여야 합니다 @msg `channel` must be hue, saturation, brightness, red, green or blue `channel`은(는) hue, saturation, brightness, red, green, blue 중 하나여야 합니다 +@msg `sliders` must be none or oklch `sliders`는 none 또는 oklch여야 합니다 +@msg OKLCH needs sRGB as the working RGB space OKLCH를 사용하려면 작업 RGB 공간이 sRGB여야 합니다 @msg `{key}` must be true or false `{key}`은(는) true 또는 false여야 합니다 @msg `top` and `below` can't both be true `top`과 `below`를 동시에 true로 지정할 수 없습니다 @msg `select` must be true or false `select`은(는) true 또는 false여야 합니다 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index de5b7a3cf6..a73911ae0c 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -4478,6 +4478,10 @@ axis Both Beide Image Afbeelding Ink Inkt Lab Lab + OKLCH Sliders OKLCH-schuifregelaars + Chroma Chroma + The largest chroma sRGB holds at this lightness and hue De grootste chroma die sRGB bij deze helderheid en tint bevat + OKLCH needs sRGB as the working RGB space OKLCH vereist sRGB als werk-RGB-ruimte Medium Gemiddeld Name Naam None Geen @@ -6217,6 +6221,8 @@ mark-style Japanese Japans @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` moet grayscale, rgb, hsb, cmyk of websafe zijn @msg `view` must be wheel or box `view` moet wheel of box zijn @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` moet hue, saturation, brightness, red, green of blue zijn +@msg `sliders` must be none or oklch `sliders` moet none of oklch zijn +@msg OKLCH needs sRGB as the working RGB space OKLCH vereist sRGB als werk-RGB-ruimte @msg the Color Picker is not open de kleurenkiezer is niet open @msg the screen color sampler is already open de schermkleurkiezer is al open @msg this system has no screen color sampler dit systeem heeft geen schermkleurkiezer diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index f9bdc664f1..a437403c48 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4091,6 +4091,10 @@ axis Both Obie Image Obraz Ink Farba Lab Lab + OKLCH Sliders Suwaki OKLCH + Chroma Chroma + The largest chroma sRGB holds at this lightness and hue Największa chroma, jaką sRGB mieści przy tej jasności i barwie + OKLCH needs sRGB as the working RGB space OKLCH wymaga sRGB jako roboczej przestrzeni RGB Medium Średni Name Nazwa None Brak @@ -4638,6 +4642,8 @@ imageTrace Outline Kontur @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` musi mieć wartość grayscale, rgb, hsb, cmyk lub websafe @msg `view` must be wheel or box `view` musi mieć wartość wheel lub box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` musi mieć wartość hue, saturation, brightness, red, green lub blue +@msg `sliders` must be none or oklch `sliders` musi mieć wartość none lub oklch +@msg OKLCH needs sRGB as the working RGB space OKLCH wymaga sRGB jako roboczej przestrzeni RGB @msg `{k}` must be [x, y] `{k}` musi mieć postać [x, y] @msg `{name}` has no options `{name}` nie ma opcji @msg `{name}` is a built-in workspace; choose another name `{name}` to wbudowany obszar roboczy; wybierz inną nazwę diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 07cd9c6fd6..92fa701cfa 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -5039,6 +5039,10 @@ axis Both Ambos @plural agrees with {n} default shortcut|agrees with {n} default shortcuts coincide com {n} atalho padrão|coincide com {n} atalhos padrão @plural {n} part of the file wasn't read|{n} parts of the file weren't read {n} parte do arquivo não foi lida|{n} partes do arquivo não foram lidas Lab Lab + OKLCH Sliders Controles Deslizantes OKLCH + Chroma Croma + The largest chroma sRGB holds at this lightness and hue O maior croma que o sRGB comporta nesta luminosidade e neste tom + OKLCH needs sRGB as the working RGB space OKLCH requer sRGB como espaço de trabalho RGB Lab Values Valores Lab Large List View Exibição em Lista Grande Large Thumbnail View Exibição em Miniaturas Grandes @@ -6097,6 +6101,8 @@ mark-style Japanese Japonesas @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` deve ser grayscale, rgb, hsb, cmyk ou websafe @msg `view` must be wheel or box `view` deve ser wheel ou box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` deve ser hue, saturation, brightness, red, green ou blue +@msg `sliders` must be none or oklch `sliders` deve ser none ou oklch +@msg OKLCH needs sRGB as the working RGB space OKLCH requer sRGB como espaço de trabalho RGB @msg the image can't be read as a texture a imagem não pode ser lida como textura # User Interface › Accent Color diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index fcf44192cd..3e8741e309 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -1842,6 +1842,10 @@ file-filter Templates Шаблоны Knife Нож Knockout Group Группа с вырезанием Lab Lab + OKLCH Sliders Ползунки OKLCH + Chroma Хрома + The largest chroma sRGB holds at this lightness and hue Наибольшая хрома, которую вмещает sRGB при этой светлоте и оттенке + OKLCH needs sRGB as the working RGB space Для OKLCH рабочим пространством RGB должно быть sRGB Lab Spot Colors: Плашечные цвета Lab: Lab Values Значения Lab Landscape Альбомная @@ -4541,6 +4545,8 @@ axis Both Оба @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` должно быть grayscale, rgb, hsb, cmyk или websafe @msg `view` must be wheel or box `view` должно быть wheel или box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` должно быть hue, saturation, brightness, red, green или blue +@msg `sliders` must be none or oklch `sliders` должен быть none или oklch +@msg OKLCH needs sRGB as the working RGB space Для OKLCH рабочим пространством RGB должно быть sRGB @msg `{k}` must be [x, y] `{k}` должно быть [x, y] @msg `{name}` has no options `{name}` не имеет параметров @msg `{name}` is a built-in workspace; choose another name `{name}` — встроенная рабочая среда; выберите другое имя diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index d68878734e..8e690f5baf 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -1770,6 +1770,10 @@ font-technology Variable Variabla Knife Kniv Knockout Group Utsparningsgrupp Lab Lab + OKLCH Sliders OKLCH-reglage + Chroma Kroma + The largest chroma sRGB holds at this lightness and hue Den största kroma som sRGB rymmer vid denna ljushet och nyans + OKLCH needs sRGB as the working RGB space OKLCH kräver sRGB som RGB-arbetsfärgrymd Lab Spot Colors: Lab-dekorfärger: Lab Values Lab-värden Landscape Liggande @@ -6099,6 +6103,8 @@ theme Appearance Utseende @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` måste vara grayscale, rgb, hsb, cmyk eller websafe @msg `view` must be wheel or box `view` måste vara wheel eller box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` måste vara hue, saturation, brightness, red, green eller blue +@msg `sliders` must be none or oklch `sliders` måste vara none eller oklch +@msg OKLCH needs sRGB as the working RGB space OKLCH kräver sRGB som RGB-arbetsfärgrymd @msg `{key}` must be an array of these names: {_1} `{key}` måste vara en lista med dessa namn: {_1} @msg choose a destination folder välj en målmapp @msg choose a source folder välj en källmapp diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index b3c88cc563..2d6ebbe2a4 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -1649,6 +1649,10 @@ font-technology Variable Değişken Knife Bıçak Knockout Group Nakavt Grubu Lab Laboratuvar + OKLCH Sliders OKLCH Kaydırıcıları + Chroma Kroma + The largest chroma sRGB holds at this lightness and hue sRGB'nin bu açıklık ve renk tonunda alabileceği en yüksek kroma + OKLCH needs sRGB as the working RGB space OKLCH, çalışma RGB alanı olarak sRGB gerektirir Lab Spot Colors: Laboratuvar Spot Renkleri: Lab Values Laboratuvar Değerleri Landscape Manzara @@ -4261,6 +4265,8 @@ axis Both Her İkisi @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` grayscale, rgb, hsb, cmyk veya websafe olmalıdır @msg `view` must be wheel or box `view` wheel veya box olmalıdır @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` hue, saturation, brightness, red, green veya blue olmalıdır +@msg `sliders` must be none or oklch `sliders` none veya oklch olmalıdır +@msg OKLCH needs sRGB as the working RGB space OKLCH, çalışma RGB alanı olarak sRGB gerektirir @msg `{k}` must be [x, y] `{k}` [x, y] olmalıdır @msg `{name}` has no options `{name}`nin seçeneği yok @msg `{name}` is a built-in workspace; choose another name `{name}` yerleşik bir çalışma alanıdır; başka bir isim seç diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 0ab6257df4..95a58c1e0e 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -1847,6 +1847,10 @@ file-filter Templates Шаблони Knife Ніж Knockout Group Група з вирізуванням Lab Lab + OKLCH Sliders Повзунки OKLCH + Chroma Хрома + The largest chroma sRGB holds at this lightness and hue Найбільша хрома, яку вміщує sRGB за цієї світлоти й відтінку + OKLCH needs sRGB as the working RGB space Для OKLCH робочим простором RGB має бути sRGB Lab Spot Colors: Плашкові кольори Lab: Lab Values Значення Lab Landscape Альбомна @@ -4540,6 +4544,8 @@ axis Both Обидві @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` має бути grayscale, rgb, hsb, cmyk або websafe @msg `view` must be wheel or box `view` має бути wheel або box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` має бути hue, saturation, brightness, red, green або blue +@msg `sliders` must be none or oklch `sliders` має бути none або oklch +@msg OKLCH needs sRGB as the working RGB space Для OKLCH робочим простором RGB має бути sRGB @msg `{k}` must be [x, y] `{k}` має бути [x, y] @msg `{name}` has no options `{name}` не має параметрів @msg `{name}` is a built-in workspace; choose another name `{name}` - вбудоване робоче середовище; виберіть інше ім’я diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 80cc4951cf..f196c0b3e5 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -2119,6 +2119,10 @@ digits Hindi Hindi Knife Dao Knockout Group Nhóm Knockout Lab Lab + OKLCH Sliders Thanh trượt OKLCH + Chroma Độ tươi màu + The largest chroma sRGB holds at this lightness and hue Độ tươi màu lớn nhất mà sRGB chứa được ở độ sáng và sắc độ này + OKLCH needs sRGB as the working RGB space OKLCH cần sRGB làm không gian RGB làm việc Lab Spot Colors: Màu đặc Lab: Lab Values Giá trị Lab Landscape Ngang @@ -4589,6 +4593,8 @@ theme Appearance Giao diện @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` phải là grayscale, rgb, hsb, cmyk hoặc websafe @msg `view` must be wheel or box `view` phải là wheel hoặc box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` phải là hue, saturation, brightness, red, green hoặc blue +@msg `sliders` must be none or oklch `sliders` phải là none hoặc oklch +@msg OKLCH needs sRGB as the working RGB space OKLCH cần sRGB làm không gian RGB làm việc @msg `{k}` must be [x, y] `{k}` phải là [x, y] @msg `{name}` has no options `{name}` không có tùy chọn @msg `{name}` is a built-in workspace; choose another name `{name}` là không gian làm việc tích hợp sẵn; hãy chọn tên khác diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 9561a51baf..024c708e5e 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -1731,6 +1731,10 @@ file-filter Templates 模板 Knife 刻刀 Knockout Group 挖空组 Lab Lab + OKLCH Sliders OKLCH 滑块 + Chroma 色度 + The largest chroma sRGB holds at this lightness and hue sRGB 在此亮度和色相下可容纳的最大色度 + OKLCH needs sRGB as the working RGB space OKLCH 需要将 sRGB 用作 RGB 工作空间 Lab Spot Colors: Lab 专色: Lab Values Lab 值 Landscape 横向 @@ -4699,6 +4703,8 @@ imageTrace Outline 轮廓 @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` 必须是 grayscale、rgb、hsb、cmyk 或 websafe @msg `view` must be wheel or box `view` 必须是 wheel 或 box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` 必须是 hue、saturation、brightness、red、green 或 blue +@msg `sliders` must be none or oklch `sliders` 必须是 none 或 oklch +@msg OKLCH needs sRGB as the working RGB space OKLCH 需要将 sRGB 用作 RGB 工作空间 @msg `{key}` must be true or false `{key}` 必须是 true 或 false @msg `top` and `below` can't both be true `top` 和 `below` 不能同时为 true @msg `select` must be true or false `select` 必须是 true 或 false diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 7489e3d4d9..0b0c0b61b8 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -2413,6 +2413,8 @@ file-filter Templates 範本 @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` 必須是 grayscale、rgb、hsb、cmyk 或 websafe @msg `view` must be wheel or box `view` 必須是 wheel 或 box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` 必須是 hue、saturation、brightness、red、green 或 blue +@msg `sliders` must be none or oklch `sliders` 必須是 none 或 oklch +@msg OKLCH needs sRGB as the working RGB space OKLCH 需要將 sRGB 用作 RGB 工作空間 @msg `{key}` must be true or false `{key}` 必須是 true 或 false @msg `top` and `below` can't both be true `top` 和 `below` 不能同時為 true @msg `select` must be true or false `select` 必須是 true 或 false @@ -2908,6 +2910,10 @@ file-filter Templates 範本 Knife 美工刀 Knockout Group 去底群組 Lab Lab + OKLCH Sliders OKLCH 滑桿 + Chroma 色度 + The largest chroma sRGB holds at this lightness and hue sRGB 在此亮度和色相下可容納的最大色度 + OKLCH needs sRGB as the working RGB space OKLCH 需要將 sRGB 用作 RGB 工作空間 Lab Spot Colors: Lab 特別色: Lab Values Lab 值 Landscape 橫向 diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index d36ecae60f..68c48c392f 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, sliders?: none|oklch} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, pick the box's channel, as Box Channel does, and show no slider rows under the wheel or the box (none) or OKLCH Sliders (oklch), as OKLCH Sliders 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); OKLCH Sliders edit lightness 0 to 100 %, chroma 0 to 100 % of 0.4 and hue 0 to 360°, CSS Color 4's OKLCH of the display sRGB, and a color outside sRGB keeps L and H and takes the largest chroma that fits; 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, oklch is an error while the working RGB space is not sRGB, 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, sliders}", ), ( "ui.savePdfDialog", diff --git a/crates/ui-egui/src/panels/color_wheel.rs b/crates/ui-egui/src/panels/color_wheel.rs index 31522578e5..64393be866 100644 --- a/crates/ui-egui/src/panels/color_wheel.rs +++ b/crates/ui-egui/src/panels/color_wheel.rs @@ -11,11 +11,17 @@ //! 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`). +//! +//! Panel menu › OKLCH Sliders shows L, C and H rows under the wheel or the box that edit the color +//! by OKLCH lightness, chroma and hue (CSS Color 4: +//! ), while the working RGB space is +//! sRGB. The choice is kept with the preferences too. -use egui::{Ui, UiBuilder, vec2}; +use egui::{Color32, Rect, Stroke, Ui, UiBuilder, pos2, vec2}; use serde::{Deserialize, Serialize}; use serde_json::{Value, json}; use vectorcraft_color::cms::{self, Cms}; +use vectorcraft_color::oklab::{self, CHROMA_FULL}; use vectorcraft_color::{Color, Paint, hsb_to_rgb, rgb_to_hsb}; use vectorcraft_doc::{ColorMode, NodeId}; @@ -23,6 +29,7 @@ use super::color::{Target, apply, wheel_target}; use super::{pstate, set_pstate}; use crate::VectorcraftApp; use crate::dialogs::color_picker::Channel; +use crate::theme::Tokens; use crate::widgets::{self, FieldAxis, Live, SliderValue, menu_item}; pub const ID: &str = "colorWheel"; @@ -67,6 +74,39 @@ pub struct Settings { pub view: View, #[serde(serialize_with = "serialize_channel", deserialize_with = "deserialize_channel")] pub channel: Channel, + #[serde(deserialize_with = "deserialize_sliders")] + pub sliders: Sliders, +} + +/// The slider rows under the wheel or the box (panel menu, `ui.colorWheel {sliders}`). +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize)] +#[serde(rename_all = "camelCase")] +pub enum Sliders { + #[default] + None, + /// OKLCH Sliders: lightness, chroma and hue. + Oklch, +} + +impl Sliders { + pub const ALL: [Sliders; 2] = [Sliders::None, Sliders::Oklch]; + + /// The id `ui.colorWheel` and the preferences use. + pub fn id(self) -> &'static str { + match self { + Sliders::None => "none", + Sliders::Oklch => "oklch", + } + } + + pub fn parse(s: &str) -> Option { + Self::ALL.into_iter().find(|v| v.id() == s) + } +} + +fn deserialize_sliders<'de, D: serde::Deserializer<'de>>(d: D) -> Result { + let v = ::deserialize(d)?; + Ok(v.as_str().and_then(Sliders::parse).unwrap_or_default()) } fn deserialize_view<'de, D: serde::Deserializer<'de>>(d: D) -> Result { @@ -90,11 +130,19 @@ pub fn deserialize_settings<'de, D: serde::Deserializer<'de>>(d: D) -> Result Result { - const KEYS: [&str; 2] = ["view", "channel"]; + set(&mut app.ui.color_wheel, p, &cms::active())?; + Ok(json!(app.ui.color_wheel)) +} + +/// Set the keys of `ui.colorWheel` params `p` in `settings`, with the color settings `cms`; on an +/// error `settings` stay as they were. +pub(crate) fn set(settings: &mut Settings, p: &Value, cms: &Cms) -> Result<(), String> { + const KEYS: [&str; 3] = ["view", "channel", "sliders"]; match p { Value::Null => {} Value::Object(o) => { @@ -104,7 +152,7 @@ pub(crate) fn command(app: &mut VectorcraftApp, p: &Value) -> Result return Err(format!("the params must be an object, not {got}")), } - let mut set = app.ui.color_wheel.clone(); + let mut set = settings.clone(); match p.get("view") { None | Some(Value::Null) => {} Some(v) => set.view = v.as_str().and_then(View::parse).ok_or("`view` must be wheel or box")?, @@ -113,11 +161,21 @@ 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")?, } - app.ui.color_wheel = set; - Ok(json!(app.ui.color_wheel)) + match p.get("sliders") { + None | Some(Value::Null) => {} + Some(v) => { + let sliders = v.as_str().and_then(Sliders::parse).ok_or("`sliders` must be none or oklch")?; + if sliders == Sliders::Oklch && !cms.rgb_is_srgb() { + return Err(OKLCH_NEEDS_SRGB.to_string()); + } + set.sliders = sliders; + } + } + *settings = set; + Ok(()) } -/// 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 OKLCH Sliders. 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 +192,16 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) { } }); }); + ui.separator(); + let on = set.sliders == Sliders::Oklch; + // While the rows show, the item stays enabled so that they can be hidden. + let enabled = on || cms::active().rgb_is_srgb(); + if widgets::menu_item_name_hint(ui, tl!("OKLCH Sliders"), enabled, on, tl!("OKLCH needs sRGB as the working RGB space")) { + let sliders = if on { Sliders::None } else { Sliders::Oklch }; + if let Err(e) = app.run("ui.colorWheel", json!({ "sliders": sliders.id() })) { + app.status(e); + } + } } /// The display values of HSB `hsb` in `ch`'s space, from 0 to 1: hue, saturation and brightness, @@ -207,6 +275,11 @@ fn show_box(ui: &mut Ui, ch: Channel, hsb: [f32; 3], marked: bool, size: f32) -> /// Panel state: the HSB picked last, its [`Owner`] and the display sRGB of the color it stored. const MEMORY: &str = "color-wheel-hsb"; +/// Panel state: the OKLCH the slider rows asked for last, the [`Owner`] of the color they stored +/// and its display sRGB. +const OKLCH_MEMORY: &str = "color-wheel-oklch"; +/// The message for OKLCH Sliders while the working RGB space is not sRGB. +const OKLCH_NEEDS_SRGB: &str = "OKLCH needs sRGB as the working RGB space"; /// What the HSB picked last belongs to: the document, the selected objects or text characters, /// the appearance item, the proxy, the gradient stop or freeform point, its paint, and the color @@ -265,7 +338,12 @@ pub(crate) fn remembered_hsb(cms: &Cms, c: &Color, shown: [f32; 3], hsb: [f32; 3 /// model with the color settings. Anything else (no color, a Gray color, a tint of a global swatch) /// becomes a process color in the document's color mode: managed CMYK when `cmyk_doc`, else RGB. pub(crate) fn stored(cms: &Cms, hsb: [f32; 3], was: Option<&Color>, cmyk_doc: bool) -> Color { - let [r, g, b] = cms.srgb_to_rgb(hsb_to_rgb(hsb)); + stored_srgb(cms, hsb_to_rgb(hsb), was, cmyk_doc) +} + +/// [`stored`] for a pick of display sRGB `srgb`. +pub(crate) fn stored_srgb(cms: &Cms, srgb: [f32; 3], was: Option<&Color>, cmyk_doc: bool) -> Color { + let [r, g, b] = cms.srgb_to_rgb(srgb); let rgb = Color::rgb(r, g, b); let cmyk = || { let [c, m, y, k] = cms.to_cmyk(&rgb, cms.settings().intent); @@ -299,6 +377,103 @@ fn replaced(app: &VectorcraftApp, tgt: &Target, behind: bool) -> Option { } } +/// The OKLCH `[l, c, h°]` the rows show for `c` through `cms` when `lch` was asked for last and `c` +/// then displayed as the sRGB `shown`: `lch` while `c` still displays as `shown` (a chroma past the +/// gamut and the hue of a gray stay), else `c`'s own. +pub(crate) fn remembered_oklch(cms: &Cms, c: &Color, shown: [f32; 3], lch: [f64; 3]) -> [f64; 3] { + if cms.display_rgb(c) == shown { lch } else { oklab::to_oklch(cms.display_rgb(c)) } +} + +/// The color a track shows at OKLCH `lch`: the color itself inside sRGB, and outside it dimmed. +/// With `max_chroma` (the C track, whose L and H stay fixed) a chroma past it shows the color at +/// that chroma; without it, a color outside sRGB shows clamped to it. +pub(crate) fn oklch_track(lch: [f64; 3], max_chroma: Option) -> Color32 { + let (rgb, outside) = match max_chroma { + Some(m) if lch[1] > m => (oklab::oklch_to_srgb(lch[0], m, lch[2]), true), + Some(_) => (oklab::oklch_to_srgb(lch[0], lch[1], lch[2]), false), + None => { + let exact = oklab::oklch_to_srgb(lch[0], lch[1], lch[2]); + (exact, !oklab::in_srgb(exact)) + } + }; + let [r, g, b] = rgb.map(|v| (v.clamp(0.0, 1.0) * 255.0).round() as u8); + let c = Color32::from_rgb(r, g, b); + if outside { c.gamma_multiply(0.3) } else { c } +} + +/// Where the C track's tick sits, from 0 at its left to 1 at its right: at the largest chroma +/// `max_chroma`, of the track's 0 to 0.4. +pub(crate) fn chroma_tick(max_chroma: f64) -> f32 { + (max_chroma / CHROMA_FULL).clamp(0.0, 1.0) as f32 +} + +/// The L, C and H rows of OKLCH Sliders for the target's `color` through `cms`: lightness from 0 to +/// 100 %, chroma from 0 to 100 % of 0.4 (as CSS reads a chroma percentage) and hue from 0 to 360°. +/// Each track shows the colors its slider reaches and dims the part outside sRGB, and a tick on the +/// C track marks the largest chroma sRGB holds at the row's L and H. The rows are gray with no +/// color to edit and while the working RGB space is not sRGB. Returns the OKLCH a drag, an arrow +/// key, a screen reader or a field asks for, and its phase. +pub(crate) fn oklch_rows(app: &VectorcraftApp, ui: &mut Ui, tgt: &Target, color: Option, cms: &Cms) -> Option<([f64; 3], Live)> { + let t = Tokens::get(ui.ctx()); + let enabled = color.is_some() && cms.rgb_is_srgb(); + let lch = match (color, pstate::>(ui.ctx(), OKLCH_MEMORY)) { + (Some(c), Some((owner, shown, lch))) if owner == Owner::of(app, tgt, c) => remembered_oklch(cms, &c, shown, lch), + (Some(c), _) => oklab::to_oklch(cms.display_rgb(&c)), + (None, _) => [0.0; 3], + }; + // Each row: its letter, its screen-reader name, the end of its range and the field's suffix. + let rows = [("L", tl!("Lightness"), 100.0, "%"), ("C", tl!("Chroma"), 100.0, "%"), ("H", tl!("Hue"), 360.0, "°")]; + let shown = [lch[0] * 100.0, lch[1] / CHROMA_FULL * 100.0, lch[2]]; + // The OKLCH with row `i` set to `v` in the row's units. + let with = |i: usize, v: f64| { + let mut out = lch; + match i { + 0 => out[0] = (v / 100.0).clamp(0.0, 1.0), + 1 => out[1] = (v / 100.0 * CHROMA_FULL).clamp(0.0, CHROMA_FULL), + _ => out[2] = v.clamp(0.0, 360.0), + } + out + }; + let mut out = None; + ui.add_enabled_ui(enabled, |ui| { + let field_w = 48.0; + let slider_w = (ui.available_width() - field_w - 12.0 - 3.0 * ui.spacing().item_spacing.x).max(60.0); + // The C track's L and H stay fixed, so its largest chroma is found once per frame. + let max_c = if enabled { oklab::max_chroma(lch[0], lch[2]) } else { 0.0 }; + for (i, (letter, name, max, suffix)) in rows.into_iter().enumerate() { + ui.horizontal(|ui| { + ui.add_sized(vec2(12.0, 22.0), egui::Label::new(egui::RichText::new(letter).size(12.5).color(t.text))); + let v = shown[i].clamp(0.0, max); + let at = |x: f32| with(i, f64::from(x) * max); + let track = |x: f32| if enabled { oklch_track(at(x), (i == 1).then_some(max_c)) } else { t.input }; + let rail = Rect::from_min_size(ui.cursor().min, vec2(slider_w, 22.0)); + let value = SliderValue::field(v, 0.0..=max, suffix, 0); + let (dragged, phase, keyed) = + widgets::color_slider_stepped(ui, ("color-wheel-oklch", i), name, Some(value), (v / max) as f32, slider_w, &track); + if i == 1 && enabled { + // The bar of `color_slider_stepped`'s rail: 4 points in from its left, top and right. + let bar = Rect::from_min_size(rail.min + vec2(4.0, 4.0), vec2(slider_w - 8.0, 7.0)); + let x = bar.left() + chroma_tick(max_c) * bar.width(); + ui.painter().line_segment([pos2(x, bar.top() - 3.0), pos2(x, bar.bottom())], Stroke::new(1.5, t.text)); + let tip = Rect::from_x_y_ranges(x - 3.0..=x + 3.0, bar.top() - 3.0..=bar.bottom()); + ui.interact(tip, ui.scope_id().with("color-wheel-oklch-tick"), egui::Sense::hover()) + .on_hover_text(tl!("The largest chroma sRGB holds at this lightness and hue")); + } + if let Some(x) = dragged { + out = Some((at(x), phase)); + } + if let Some(k) = keyed { + out = Some((with(i, k), Live::Released)); + } + if let Some(f) = widgets::plain_field_named(ui, ("color-wheel-oklch-field", i), Some(name), v, suffix, 0, field_w) { + out = Some((with(i, f), Live::Released)); + } + }); + } + }); + out.filter(|_| enabled) +} + pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { let tgt = wheel_target(app, ui); let color = tgt.color(); @@ -344,9 +519,23 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { pick = Some(([hsb[0], x, 1.0 - y], field_phase)); } }); - let Some((hsb, phase)) = pick else { return }; + let mut picked_lch = None; + if app.ui.color_wheel.sliders == Sliders::Oklch { + ui.add_space(4.0); + picked_lch = oklch_rows(app, ui, &tgt, color, &cms); + } let behind = super::alt_held(ui); let cmyk_doc = app.session.active().is_some_and(|d| d.doc.color_mode == ColorMode::Cmyk); + if let Some((lch, phase)) = picked_lch { + let (srgb, _) = oklab::from_oklch(lch[0], lch[1], lch[2]); + let c = stored_srgb(&cms, srgb, replaced(app, &tgt, behind).as_ref(), cmyk_doc); + apply(app, &tgt, c, phase, behind); + if !behind { + set_pstate(ui.ctx(), OKLCH_MEMORY, Some((Owner::of(app, &tgt, c), cms.display_rgb(&c), lch))); + } + return; + } + let Some((hsb, phase)) = pick else { return }; let c = stored(&cms, hsb, replaced(app, &tgt, behind).as_ref(), cmyk_doc); apply(app, &tgt, c, phase, behind); if !behind { diff --git a/crates/ui-egui/src/panels/tests_color_wheel.rs b/crates/ui-egui/src/panels/tests_color_wheel.rs index 798a842e4c..e07dffa54a 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel.rs @@ -11,7 +11,9 @@ use vectorcraft_color::cms::{self, Cms, ColorSettings, delta_e2000}; use vectorcraft_color::{Color, Paint}; use vectorcraft_engine::Session; -use super::color_wheel::{ID, display_hsb, remembered_hsb, show, stored}; +use super::color_wheel::{ + ID, Settings, Sliders, chroma_tick, display_hsb, oklch_rows, oklch_track, remembered_hsb, remembered_oklch, set, show, stored, +}; use crate::VectorcraftApp; /// An app with a selected rectangle filled with `fill`. @@ -581,3 +583,260 @@ fn the_color_pickers_field_takes_the_arrow_keys() { assert!(near(stepped, [after[0], after[1] + 0.01, after[2]], [1e-3, 1e-4, 1e-4]), "{after:?} → {stepped:?}"); assert!(h.state().ui.dialog.is_some(), "the dialog stays open"); } + +/// The panel with OKLCH Sliders shown, in a flyout tall enough for the rows. +fn oklch_harness(mut app: VectorcraftApp) -> Harness<'static, VectorcraftApp> { + app.run("ui.colorWheel", json!({"sliders": "oklch"})).unwrap(); + oklch_harness_shown(app) +} + +/// The panel in a flyout tall enough for the rows, with the app's settings as they are. +fn oklch_harness_shown(app: VectorcraftApp) -> Harness<'static, VectorcraftApp> { + let mut h = Harness::builder().with_size(vec2(260.0, 420.0)).build_ui_state( + |ui, app: &mut VectorcraftApp| { + show(app, ui); + crate::shortcuts::handle(app, ui.ctx()); + }, + app, + ); + h.run_steps(2); + h +} + +/// The slider row named `name` (its number field has the same name). +fn oklch_slider<'a>(h: &'a Harness<'static, VectorcraftApp>, name: &'a str) -> egui_kittest::Node<'a> { + h.query_all_by_label(name).find(|n| n.accesskit_node().role() == egui::accesskit::Role::Slider).expect("a slider row") +} + +/// The point at `t` (0..1) along the bar of a slider row. +fn on_rail(rail: Rect, t: f32) -> Pos2 { + Pos2::new(rail.left() + 4.0 + t * (rail.width() - 8.0), rail.top() + 7.0) +} + +fn fill_oklch(app: &VectorcraftApp) -> [f64; 3] { + vectorcraft_color::oklab::to_oklch(cms::active().display_rgb(&fill(app))) +} + +/// `ui.colorWheel {sliders: "oklch"}` shows L, C and H rows with the fill's OKLCH, and the panel +/// keeps the setting with the preferences. +#[test] +fn oklch_sliders_show_the_fills_lightness_chroma_and_hue() { + let h = oklch_harness(app(json!("#ff0000"))); + assert_eq!(h.state().ui.color_wheel.sliders, Sliders::Oklch); + let value = |name: &str| oklch_slider(&h, name).accesskit_node().numeric_value().unwrap(); + assert_eq!((value("Lightness"), value("Chroma"), value("Hue")), (63.0, 64.0, 29.0)); + let saved = serde_json::to_value(&h.state().ui).unwrap(); + assert_eq!(saved["color_wheel"]["sliders"], json!("oklch")); +} + +/// A drag on L past the chroma sRGB holds stores the largest chroma that fits at the same hue, and +/// the C row keeps the chroma asked for, so dragging L back brings it back. +#[test] +fn a_drag_on_lightness_keeps_the_chroma_asked_for() { + let mut h = oklch_harness(app(json!("#0000ff"))); + let [l0, c0, h0] = fill_oklch(h.state()); + let rail = oklch_slider(&h, "Lightness").rect(); + drag(&mut h, &[on_rail(rail, l0 as f32), on_rail(rail, 0.9)], Modifiers::NONE); + let [l1, c1, h1] = fill_oklch(h.state()); + assert!((l1 - 0.9).abs() < 0.01 && c1 < c0 - 0.1 && (h1 - h0).abs() < 1.0, "{:?} → {:?}", [l0, c0, h0], [l1, c1, h1]); + let chroma = oklch_slider(&h, "Chroma").accesskit_node().numeric_value().unwrap(); + assert_eq!(chroma, (c0 / 0.4 * 100.0).round(), "the C row keeps the requested chroma"); + drag(&mut h, &[on_rail(rail, 0.9), on_rail(rail, l0 as f32)], Modifiers::NONE); + let [l2, c2, _] = fill_oklch(h.state()); + assert!((l2 - l0).abs() < 0.01 && (c2 - c0).abs() < 0.01, "{:?} → {:?}", [l0, c0], [l2, c2]); +} + +/// A press on a row gives it the keyboard focus, and → raises it by one unit as one undo step. +/// Each row reports its range and the adjust actions to screen readers. +#[test] +fn the_oklch_rows_take_the_arrow_keys_and_screen_readers_actions() { + let mut h = oklch_harness(app(json!("#808080"))); + for (name, max) in [("Lightness", 100.0), ("Chroma", 100.0), ("Hue", 360.0)] { + let node = oklch_slider(&h, name).accesskit_node(); + assert_eq!((node.min_numeric_value(), node.max_numeric_value(), node.numeric_value_step()), (Some(0.0), Some(max), Some(1.0)), "{name}"); + assert!([Action::Increment, Action::Decrement, Action::SetValue].iter().all(|a| node.data().supports_action(*a)), "{name}"); + } + let rail = oklch_slider(&h, "Lightness").rect(); + let l = fill_oklch(h.state())[0]; + click(&mut h, on_rail(rail, l as f32), Modifiers::NONE); + let before = fill_oklch(h.state())[0]; + let undo = undo_len(h.state()); + key(&mut h, egui::Key::ArrowRight, Modifiers::NONE); + let after = fill_oklch(h.state())[0]; + assert!((after - ((before * 100.0).round() + 1.0) / 100.0).abs() < 0.003, "{before} → {after}"); + assert_eq!(undo_len(h.state()), undo + 1, "one undo step"); + let (gray, undo) = (fill(h.state()), undo_len(h.state())); + let (target_node, target_tree) = oklch_slider(&h, "Hue").accesskit_node().locate(); + let data = Some(ActionData::NumericValue(200.0)); + h.event(Event::AccessKitActionRequest(ActionRequest { target_node, target_tree, action: Action::SetValue, data })); + // The frame that takes the request draws the row before it applies it. + h.run_steps(2); + assert_eq!(oklch_slider(&h, "Hue").accesskit_node().numeric_value(), Some(200.0), "a gray keeps the hue it was given"); + assert_eq!((fill(h.state()), undo_len(h.state())), (gray, undo), "a hue on a gray changes nothing and records no undo step"); +} + +/// Each track dims the colors outside sRGB, and the C track's tick sits at the largest chroma sRGB +/// holds, along the track's 0 to 0.4. +#[test] +fn the_oklch_tracks_dim_the_colors_outside_srgb_and_the_tick_marks_the_largest_chroma() { + let (l, h) = (0.7, 150.0); + let max = vectorcraft_color::oklab::max_chroma(l, h); + for max_chroma in [Some(max), None] { + assert_eq!(oklch_track([l, max * 0.5, h], max_chroma).a(), 255, "{max_chroma:?}: inside sRGB"); + assert!(oklch_track([l, 0.4, h], max_chroma).a() < 255, "{max_chroma:?}: outside sRGB is dimmed"); + } + assert!((chroma_tick(max) - (max / 0.4) as f32).abs() < 1e-6 && chroma_tick(max) > 0.1 && chroma_tick(max) < 1.0); + assert_eq!((chroma_tick(0.0), chroma_tick(0.5)), (0.0, 1.0)); +} + +/// After Edit › Color Settings picks a working RGB space other than sRGB, Panel menu › OKLCH Sliders +/// is gray and `ui.colorWheel {sliders: "oklch"}` answers an error; rows already shown are gray. +#[test] +fn oklch_sliders_are_gray_after_the_working_space_changes() { + const CHILD: &str = "VECTORCRAFT_TEST_COLOR_WHEEL_P3"; + if std::env::var_os(CHILD).is_none() { + // Color settings are process-wide: change them in a separate test process. + let output = std::process::Command::new(std::env::current_exe().unwrap()) + .args(["--exact", "panels::tests_color_wheel::oklch_sliders_are_gray_after_the_working_space_changes", "--nocapture"]) + .env(CHILD, "1") + .output() + .unwrap(); + let stdout = String::from_utf8_lossy(&output.stdout); + assert!( + output.status.success() && stdout.contains("test result: ok. 1 passed; 0 failed;"), + "isolated working space test failed:\n{stdout}\n{}", + String::from_utf8_lossy(&output.stderr), + ); + return; + } + let mut app = app(json!("#ff0000")); + app.run("edit.colorSettings", json!({"rgb": cms::DISPLAY_P3})).unwrap(); + assert_eq!(app.run("ui.colorWheel", json!({"sliders": "oklch"})).unwrap_err(), "OKLCH needs sRGB as the working RGB space"); + assert_eq!(app.ui.color_wheel.sliders, Sliders::None); + let mut fonts = false; + let mut h = Harness::builder().with_size(vec2(260.0, 200.0)).build_ui_state( + move |ui, app: &mut VectorcraftApp| { + if !fonts { + crate::theme::install_fonts(ui.ctx()); + fonts = true; + return; + } + super::color_wheel::menu(app, ui); + }, + app, + ); + h.run_steps(3); + assert!(h.get_by_label(" OKLCH Sliders").accesskit_node().is_disabled()); + // The color settings stay with the process, so a new app works in Display P3 as well. + let mut app = self::app(json!("#ff0000")); + app.ui.color_wheel.sliders = Sliders::Oklch; + let h = oklch_harness_shown(app); + assert!(oklch_slider(&h, "Lightness").accesskit_node().is_disabled()); +} + +/// A CMYK fill's L, C and H are those of its display color, not of its naive separation. +#[test] +fn a_cmyk_fills_oklch_is_that_of_its_display_color() { + let h = oklch_harness(app(json!({"c": 1.0, "m": 0.0, "y": 0.0, "k": 0.0}))); + let shown = vectorcraft_color::oklab::to_oklch(cms::active().display_rgb(&Color::cmyk(1.0, 0.0, 0.0, 0.0))); + let naive = vectorcraft_color::oklab::to_oklch([0.0, 1.0, 1.0]); + let lightness = oklch_slider(&h, "Lightness").accesskit_node().numeric_value().unwrap(); + assert_eq!(lightness, (shown[0] * 100.0).round()); + assert_ne!(lightness, (naive[0] * 100.0).round()); +} + +/// Panel menu › OKLCH Sliders shows the rows and, checked, hides them. +#[test] +fn the_panel_menu_shows_and_hides_the_oklch_rows() { + let mut fonts = false; + let mut h = Harness::builder().with_size(vec2(260.0, 200.0)).build_ui_state( + move |ui, app: &mut VectorcraftApp| { + // The fonts, which hold the check mark, take effect from the next frame. + if !fonts { + crate::theme::install_fonts(ui.ctx()); + fonts = true; + return; + } + super::color_wheel::menu(app, ui); + }, + app(json!("#ff0000")), + ); + h.run_steps(3); + h.get_by_label(" OKLCH Sliders").click(); + h.run_steps(2); + assert_eq!(h.state().ui.color_wheel.sliders, Sliders::Oklch); + h.get_by_label("✓ OKLCH Sliders").click(); + h.run_steps(2); + assert_eq!(h.state().ui.color_wheel.sliders, Sliders::None); +} + +/// In a working RGB space other than sRGB, `sliders: "oklch"` is an error and the rows are gray; +/// the error leaves the settings as they were. +#[test] +fn oklch_sliders_need_srgb_as_the_working_space() { + let p3 = Cms::new(&ColorSettings { rgb: cms::DISPLAY_P3.into(), ..ColorSettings::default() }).unwrap(); + let mut settings = Settings::default(); + assert_eq!(set(&mut settings, &json!({"sliders": "oklch"}), &p3).unwrap_err(), "OKLCH needs sRGB as the working RGB space"); + assert_eq!(settings.sliders, Sliders::None); + set(&mut settings, &json!({"sliders": "oklch"}), &Cms::default()).unwrap(); + assert_eq!(settings.sliders, Sliders::Oklch); + set(&mut settings, &json!({"sliders": "none"}), &p3).unwrap(); + assert_eq!(settings.sliders, Sliders::None, "the rows can be hidden in any working space"); + let mut h = Harness::builder().with_size(vec2(260.0, 200.0)).build_ui_state( + move |ui, app: &mut VectorcraftApp| { + let tgt = super::color::wheel_target(app, ui); + let color = tgt.color(); + let _ = oklch_rows(app, ui, &tgt, color, &p3); + }, + app(json!("#ff0000")), + ); + h.run_steps(2); + assert!(oklch_slider(&h, "Lightness").accesskit_node().is_disabled()); + let undo = undo_len(h.state()); + let rail = oklch_slider(&h, "Lightness").rect(); + click(&mut h, on_rail(rail, 0.2), Modifiers::NONE); + assert_eq!(undo_len(h.state()), undo, "a gray row picks nothing"); +} + +/// The rows show what they asked for while the color displays as it did, and the color's own +/// OKLCH after the color settings change its display. +#[test] +fn the_remembered_oklch_follows_a_change_of_working_space() { + let srgb = Cms::default(); + let p3 = Cms::new(&ColorSettings { rgb: cms::DISPLAY_P3.into(), ..ColorSettings::default() }).unwrap(); + let c = Color::rgb(0.5, 0.3, 0.2); + let asked = [0.5, 0.3, 40.0]; + let shown = srgb.display_rgb(&c); + assert_eq!(remembered_oklch(&srgb, &c, shown, asked), asked); + assert_eq!(remembered_oklch(&p3, &c, shown, asked), vectorcraft_color::oklab::to_oklch(p3.display_rgb(&c))); +} + +/// Saved settings are read key by key: a value this version does not know (one a newer version +/// wrote) gives the default, and the other preferences still load. +#[test] +fn saved_color_wheel_settings_are_read_leniently() { + let mut saved = serde_json::to_value(crate::UiState::default()).unwrap(); + saved["color_rgb_percent"] = json!(true); + for (value, sliders) in + [(json!({"sliders": "oklch"}), Sliders::Oklch), (json!({"sliders": "hsl", "view": "box"}), Sliders::None), (json!(5), Sliders::None)] + { + saved["color_wheel"] = value.clone(); + let ui: crate::UiState = serde_json::from_value(saved.clone()).unwrap(); + assert_eq!((ui.color_wheel.sliders, ui.color_rgb_percent), (sliders, true), "{value}"); + } +} + +/// `ui.colorWheel {sliders}` sets the rows and keeps the view and the channel, and an unknown +/// `sliders` value is an error that changes nothing. +#[test] +fn ui_color_wheel_sets_and_reads_the_sliders() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("ui.colorWheel", json!({"view": "box", "channel": "red"})).unwrap(); + assert_eq!(app.run("ui.colorWheel", json!({})).unwrap()["sliders"], json!("none")); + assert_eq!(app.run("ui.colorWheel", json!({"sliders": "hsl"})).unwrap_err(), "`sliders` must be none or oklch"); + let got = app.run("ui.colorWheel", json!({"sliders": "oklch"})).unwrap(); + assert_eq!(got, json!({"view": "box", "channel": "red", "sliders": "oklch"})); + let e = app.run("ui.colorWheel", json!({"view": "wheel", "sliders": "hsl"})).unwrap_err(); + assert_eq!(e, "`sliders` must be none or oklch"); + assert_eq!(app.ui.color_wheel.view, crate::panels::color_wheel::View::Box, "an error changes nothing"); +} 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..3a4280f533 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", "sliders": "none"})); + assert_eq!(app.run("ui.colorWheel", json!({"view": "box"})).unwrap(), json!({"view": "box", "channel": "hue", "sliders": "none"})); + assert_eq!(app.run("ui.colorWheel", json!({"channel": "green"})).unwrap(), json!({"view": "box", "channel": "green", "sliders": "none"})); 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", "sliders": "none"})); } /// 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, sliders"); 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, sliders"); + 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,11 @@ 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 ui = crate::UiState { + color_wheel: Settings { view: View::Box, channel: Channel::Blue, ..Default::default() }, + 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 +266,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/state.rs b/crates/ui-egui/src/state.rs index d1722e8b72..5c1e98f2d1 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 slider rows (`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..e197a24f4a 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -27,8 +27,8 @@ pub use blend::{ reference_point_named, }; pub use buttons::{ - SPLIT_ARROW, flat_button, flat_button_fit, icon_button, icon_button_enabled, menu_item, menu_item_name, paint_icon_button, primary_button, - primary_button_enabled, secondary_button, split_button, split_button_named, toggle_icon, + SPLIT_ARROW, flat_button, flat_button_fit, icon_button, icon_button_enabled, menu_item, menu_item_name, menu_item_name_hint, paint_icon_button, + primary_button, primary_button_enabled, secondary_button, split_button, split_button_named, toggle_icon, }; pub(crate) use buttons::{button_width, icon_button_info, primary_button_width, secondary_button_width}; #[cfg(test)] diff --git a/crates/ui-egui/src/widgets/buttons.rs b/crates/ui-egui/src/widgets/buttons.rs index a33f7cac84..e2bd87a7e2 100644 --- a/crates/ui-egui/src/widgets/buttons.rs +++ b/crates/ui-egui/src/widgets/buttons.rs @@ -204,6 +204,16 @@ pub fn menu_item(ui: &mut Ui, label: &str, enabled: bool, checked: bool) -> bool /// [`menu_item`] for a name that is user or file data (a library, a recent URL), never translated. /// Like the menu bar's items, the row lights up under the pointer. pub fn menu_item_name(ui: &mut Ui, label: &str, enabled: bool, checked: bool) -> bool { + menu_row(ui, label, enabled, checked).clicked() +} + +/// [`menu_item_name`] that shows `hint` (already translated) under the pointer while the row is +/// disabled, to say why it is gray. +pub fn menu_item_name_hint(ui: &mut Ui, label: &str, enabled: bool, checked: bool, hint: &str) -> bool { + menu_row(ui, label, enabled, checked).on_disabled_hover_text(hint).clicked() +} + +fn menu_row(ui: &mut Ui, label: &str, enabled: bool, checked: bool) -> egui::Response { let text = if checked { format!("✓ {label}") } else { format!(" {label}") }; - ui.add_enabled(enabled, egui::Button::new(egui::RichText::new(text).size(12.5)).frame_when_inactive(false)).clicked() + ui.add_enabled(enabled, egui::Button::new(egui::RichText::new(text).size(12.5)).frame_when_inactive(false)) } diff --git a/docs/control-protocol.md b/docs/control-protocol.md index bb13e0d5f5..1d9970bf40 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -265,8 +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` +point (the first stop or point when none is selected). `ui.colorWheel {view?, channel?, sliders?}` shows the wheel or +the box (a color field with a channel strip at its right), picks the box's channel, and shows or hides OKLCH Sliders +(`sliders: "oklch"` is an error while the working RGB space is not sRGB); 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`/ diff --git a/docs/mcp.md b/docs/mcp.md index 12c1f38184..d8b25024ff 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -623,8 +623,12 @@ 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. +the list return an error and change nothing. The command returns `{view, channel, sliders}`, and the settings are +kept with the preferences. + +`ui.colorWheel {"sliders": "oklch"}` shows the Color Wheel panel's OKLCH Sliders (L, C and H rows under the wheel or +the box), and `"none"` hides them; `"oklch"` is an error while the working RGB space is not sRGB. `color.convert {"to": "oklch"}` answers the color's OKLCH as `[L %, C, H°]` of its display sRGB, +and headless MCP reaches it too. 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..babcf7be6c 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1503,6 +1503,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **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. + - **OKLCH Sliders (Color Wheel panel):** as VectorCraft's own addition, the Color Wheel panel's menu item OKLCH Sliders (`ui.colorWheel {sliders: "oklch"}`, kept with the preferences) shows L, C and H rows under the wheel or the box that edit the color by the OKLCH lightness (0 to 100 %), chroma (0 to 100 % of 0.4) and hue (0 to 360°) of its display sRGB, as CSS Color 4 defines them (https://www.w3.org/TR/css-color-4/#specifying-oklab-oklch). Each track dims the colors outside sRGB, and a tick on the C track marks the largest chroma sRGB holds at the row's L and H; a color outside sRGB keeps L and H and takes the largest chroma that fits, and the C row keeps the chroma asked for. The rows take the arrow keys after a click and report their names, values, ranges and adjust actions to screen readers. The item is gray, and `ui.colorWheel` answers an error, while the working RGB space is not sRGB. `color.convert {to: "oklch"}` answers the same L, C and H. Evidence: `crates/color/src/oklab.rs` tests; `convert_to_oklch_answers_lightness_chroma_and_hue` in `crates/engine/src/tests/colormgmt.rs`; the OKLCH tests in `crates/ui-egui/src/panels/tests_color_wheel.rs`, `the_oklch_tracks_dim_the_colors_outside_srgb_and_the_tick_marks_the_largest_chroma` and `oklch_sliders_are_gray_after_the_working_space_changes` among them. Scores and estimates are unchanged. - **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 3608506214e0ce5229dada21edf09f386b73365b Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 14 Nov 2026 09:27:39 -0800 Subject: [PATCH 02/55] Color Wheel: OKLCH Sliders place the chroma tick on the drawn rail - The C row's tick reads the slider's own rect, so it stays on the bar when the row is taller than the rail. `color_rail_bar` gives the bar for both the rail and the tick. - The L and H tracks show a color outside sRGB at the largest chroma that fits, the color a pick there stores, instead of clamping each channel. - The menu item uses `menu_item_hint`, which translates like `menu_item`, and `menu_item_name` is unchanged. - `color.convert {to: "oklch"}` says that any color outside sRGB (Lab, CMYK, or RGB in a wider working RGB space) is clipped to sRGB first, with a test for a Lab color. - docs/mcp.md wraps the new paragraph; gu.tsv puts the new rows where the other catalogs put them. --- crates/engine/src/cmd/colormgmt.rs | 2 +- crates/engine/src/tests/colormgmt.rs | 6 ++++++ crates/ui-egui/src/i18n/gu.tsv | 10 +++++----- crates/ui-egui/src/panels/color_wheel.rs | 19 ++++++++++--------- .../ui-egui/src/panels/tests_color_wheel.rs | 6 ++++++ crates/ui-egui/src/widgets.rs | 4 ++-- crates/ui-egui/src/widgets/buttons.rs | 16 ++++++++-------- crates/ui-egui/src/widgets/color.rs | 7 ++++++- docs/mcp.md | 5 +++-- 9 files changed, 47 insertions(+), 28 deletions(-) diff --git a/crates/engine/src/cmd/colormgmt.rs b/crates/engine/src/cmd/colormgmt.rs index c9d4daa0a9..8a7c8d29db 100644 --- a/crates/engine/src/cmd/colormgmt.rs +++ b/crates/engine/src/cmd/colormgmt.rs @@ -81,7 +81,7 @@ pub fn specs() -> Vec { "Convert Color", [], None, - "{color (#rrggbbaa and #rgba are refused), to: \"rgb\"|\"cmyk\"|\"gray\"|\"lab\"|\"oklch\", intent?} → {model, values, hex, lab: [L,a,b], outOfGamut, deltaE}; oklch values are [L (0..100 %), C, H (0..360°)] of the color's display sRGB (CSS Color 4 OKLCH: https://www.w3.org/TR/css-color-4/#specifying-oklab-oklch), with H 0 for a gray; in a working RGB space other than sRGB, a color outside sRGB is clamped to sRGB first", + "{color (#rrggbbaa and #rgba are refused), to: \"rgb\"|\"cmyk\"|\"gray\"|\"lab\"|\"oklch\", intent?} → {model, values, hex, lab: [L,a,b], outOfGamut, deltaE}; oklch values are [L (0..100 %), C, H (0..360°)] of the color's display sRGB (CSS Color 4 OKLCH: https://www.w3.org/TR/css-color-4/#specifying-oklab-oklch), with H 0 for a gray; a color outside sRGB (a Lab color, a CMYK color or an RGB color in a wider working RGB space) is clipped to sRGB first", always, convert_color ), diff --git a/crates/engine/src/tests/colormgmt.rs b/crates/engine/src/tests/colormgmt.rs index cdc774da7f..f28bbaf0d3 100644 --- a/crates/engine/src/tests/colormgmt.rs +++ b/crates/engine/src/tests/colormgmt.rs @@ -317,6 +317,12 @@ fn convert_to_oklch_answers_lightness_chroma_and_hue() { let naive = vectorcraft_color::oklab::to_oklch([0.0, 1.0, 1.0]); let l = cyan["values"][0].as_f64().unwrap() / 100.0; assert!((l - shown[0]).abs() < 1e-9 && (l - naive[0]).abs() > 0.02, "{cyan} {shown:?} {naive:?}"); + // A Lab color outside sRGB answers the OKLCH of its color clipped to sRGB. + let vivid = s.execute("color.convert", &json!({"color": {"l": 50.0, "a": 100.0, "b": 0.0}, "to": "oklch"})).unwrap(); + let w: Vec = vivid["values"].as_array().unwrap().iter().map(|v| v.as_f64().unwrap()).collect(); + let clipped = vectorcraft_color::oklab::to_oklch(cms::active().display_rgb(&Color::lab(50.0, 100.0, 0.0))); + assert!((w[0] / 100.0 - clipped[0]).abs() < 1e-9 && (w[1] - clipped[1]).abs() < 1e-9, "{vivid} {clipped:?}"); + assert!(vectorcraft_color::oklab::in_srgb(vectorcraft_color::oklab::oklch_to_srgb(w[0] / 100.0, w[1], w[2])), "{vivid}"); } #[test] diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index fd6f9f7419..e4a519d121 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -640,11 +640,6 @@ Color Themes રંગ થીમ Color Type: રંગ પ્રકાર: Color Wheel રંગ વ્હીલ - OKLCH Sliders OKLCH સ્લાઇડર્સ - Chroma ક્રોમા - The largest chroma sRGB holds at this lightness and hue આ લાઇટનેસ અને હ્યૂ પર sRGB સમાવી શકે તે સૌથી વધુ ક્રોમા - OKLCH needs sRGB as the working RGB space OKLCH માટે કાર્યકારી RGB સ્પેસ તરીકે sRGB જરૂરી છે - Lightness લાઇટનેસ Color blindness – Deuteranopia-type રંગ અંધત્વ – ડ્યુટેરેનોપિયા પ્રકાર Color blindness – Protanopia-type રંગ અંધત્વ – પ્રોટેનોપિયા પ્રકાર Color blindness – Tritanopia-type રંગ અંધત્વ – ટ્રિટેનોપિયા પ્રકાર @@ -1852,6 +1847,11 @@ Knife નાઇફ Knockout Group નૉકઆઉટ ગ્રૂપ LZW Compression LZW કમ્પ્રેશન + OKLCH Sliders OKLCH સ્લાઇડર્સ + Chroma ક્રોમા + The largest chroma sRGB holds at this lightness and hue આ લાઇટનેસ અને હ્યૂ પર sRGB સમાવી શકે તે સૌથી વધુ ક્રોમા + OKLCH needs sRGB as the working RGB space OKLCH માટે કાર્યકારી RGB સ્પેસ તરીકે sRGB જરૂરી છે + Lightness લાઇટનેસ Lab Spot Colors: Lab સ્પોટ રંગો: Landscape લેન્ડસ્કેપ Language ભાષા diff --git a/crates/ui-egui/src/panels/color_wheel.rs b/crates/ui-egui/src/panels/color_wheel.rs index 64393be866..2a88a3f54a 100644 --- a/crates/ui-egui/src/panels/color_wheel.rs +++ b/crates/ui-egui/src/panels/color_wheel.rs @@ -196,7 +196,7 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) { let on = set.sliders == Sliders::Oklch; // While the rows show, the item stays enabled so that they can be hidden. let enabled = on || cms::active().rgb_is_srgb(); - if widgets::menu_item_name_hint(ui, tl!("OKLCH Sliders"), enabled, on, tl!("OKLCH needs sRGB as the working RGB space")) { + if widgets::menu_item_hint(ui, tl!("OKLCH Sliders"), enabled, on, tl!("OKLCH needs sRGB as the working RGB space")) { let sliders = if on { Sliders::None } else { Sliders::Oklch }; if let Err(e) = app.run("ui.colorWheel", json!({ "sliders": sliders.id() })) { app.status(e); @@ -385,15 +385,16 @@ pub(crate) fn remembered_oklch(cms: &Cms, c: &Color, shown: [f32; 3], lch: [f64; } /// The color a track shows at OKLCH `lch`: the color itself inside sRGB, and outside it dimmed. -/// With `max_chroma` (the C track, whose L and H stay fixed) a chroma past it shows the color at -/// that chroma; without it, a color outside sRGB shows clamped to it. +/// A color outside sRGB shows at the largest chroma that fits at its L and H, the color a pick +/// there stores. With `max_chroma` (the C track, whose L and H stay fixed) that chroma is given; +/// without it, it is found for each color. pub(crate) fn oklch_track(lch: [f64; 3], max_chroma: Option) -> Color32 { let (rgb, outside) = match max_chroma { Some(m) if lch[1] > m => (oklab::oklch_to_srgb(lch[0], m, lch[2]), true), Some(_) => (oklab::oklch_to_srgb(lch[0], lch[1], lch[2]), false), None => { - let exact = oklab::oklch_to_srgb(lch[0], lch[1], lch[2]); - (exact, !oklab::in_srgb(exact)) + let (rgb, lowered) = oklab::from_oklch(lch[0], lch[1], lch[2]); + (rgb.map(f64::from), lowered) } }; let [r, g, b] = rgb.map(|v| (v.clamp(0.0, 1.0) * 255.0).round() as u8); @@ -446,13 +447,13 @@ pub(crate) fn oklch_rows(app: &VectorcraftApp, ui: &mut Ui, tgt: &Target, color: let v = shown[i].clamp(0.0, max); let at = |x: f32| with(i, f64::from(x) * max); let track = |x: f32| if enabled { oklch_track(at(x), (i == 1).then_some(max_c)) } else { t.input }; - let rail = Rect::from_min_size(ui.cursor().min, vec2(slider_w, 22.0)); let value = SliderValue::field(v, 0.0..=max, suffix, 0); let (dragged, phase, keyed) = widgets::color_slider_stepped(ui, ("color-wheel-oklch", i), name, Some(value), (v / max) as f32, slider_w, &track); - if i == 1 && enabled { - // The bar of `color_slider_stepped`'s rail: 4 points in from its left, top and right. - let bar = Rect::from_min_size(rail.min + vec2(4.0, 4.0), vec2(slider_w - 8.0, 7.0)); + // The tick goes on the bar of the rail as the row laid it out. + let rail = (i == 1 && enabled).then(|| ui.ctx().read_response(widgets::id_with(ui.scope_id(), ("color-wheel-oklch", i)))).flatten(); + if let Some(rail) = rail { + let bar = widgets::color_rail_bar(rail.rect); let x = bar.left() + chroma_tick(max_c) * bar.width(); ui.painter().line_segment([pos2(x, bar.top() - 3.0), pos2(x, bar.bottom())], Stroke::new(1.5, t.text)); let tip = Rect::from_x_y_ranges(x - 3.0..=x + 3.0, bar.top() - 3.0..=bar.bottom()); diff --git a/crates/ui-egui/src/panels/tests_color_wheel.rs b/crates/ui-egui/src/panels/tests_color_wheel.rs index e07dffa54a..407f6ffabe 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel.rs @@ -685,6 +685,12 @@ fn the_oklch_tracks_dim_the_colors_outside_srgb_and_the_tick_marks_the_largest_c assert_eq!(oklch_track([l, max * 0.5, h], max_chroma).a(), 255, "{max_chroma:?}: inside sRGB"); assert!(oklch_track([l, 0.4, h], max_chroma).a() < 255, "{max_chroma:?}: outside sRGB is dimmed"); } + // Near white, an L or H track shows the color a pick there stores: the largest chroma that fits, + // not each channel clamped on its own. + let (stored, lowered) = vectorcraft_color::oklab::from_oklch(0.98, 0.2, h); + let [r, g, b] = stored.map(|v| (f64::from(v).clamp(0.0, 1.0) * 255.0).round() as u8); + assert!(lowered); + assert_eq!(oklch_track([0.98, 0.2, h], None), egui::Color32::from_rgb(r, g, b).gamma_multiply(0.3)); assert!((chroma_tick(max) - (max / 0.4) as f32).abs() < 1e-6 && chroma_tick(max) > 0.1 && chroma_tick(max) < 1.0); assert_eq!((chroma_tick(0.0), chroma_tick(0.5)), (0.0, 1.0)); } diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index e197a24f4a..d481984f58 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -27,7 +27,7 @@ pub use blend::{ reference_point_named, }; pub use buttons::{ - SPLIT_ARROW, flat_button, flat_button_fit, icon_button, icon_button_enabled, menu_item, menu_item_name, menu_item_name_hint, paint_icon_button, + SPLIT_ARROW, flat_button, flat_button_fit, icon_button, icon_button_enabled, menu_item, menu_item_hint, menu_item_name, paint_icon_button, primary_button, primary_button_enabled, secondary_button, split_button, split_button_named, toggle_icon, }; pub(crate) use buttons::{button_width, icon_button_info, primary_button_width, secondary_button_width}; @@ -39,7 +39,7 @@ pub use color::{ 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, }; -pub(crate) use color::{HEX_FIELD_CHARS, hex_text, pointer_phase}; +pub(crate) use color::{HEX_FIELD_CHARS, color_rail_bar, hex_text, pointer_phase}; 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/buttons.rs b/crates/ui-egui/src/widgets/buttons.rs index e2bd87a7e2..7ddf88bda5 100644 --- a/crates/ui-egui/src/widgets/buttons.rs +++ b/crates/ui-egui/src/widgets/buttons.rs @@ -204,16 +204,16 @@ pub fn menu_item(ui: &mut Ui, label: &str, enabled: bool, checked: bool) -> bool /// [`menu_item`] for a name that is user or file data (a library, a recent URL), never translated. /// Like the menu bar's items, the row lights up under the pointer. pub fn menu_item_name(ui: &mut Ui, label: &str, enabled: bool, checked: bool) -> bool { - menu_row(ui, label, enabled, checked).clicked() + let text = if checked { format!("✓ {label}") } else { format!(" {label}") }; + ui.add_enabled(enabled, egui::Button::new(egui::RichText::new(text).size(12.5)).frame_when_inactive(false)).clicked() } -/// [`menu_item_name`] that shows `hint` (already translated) under the pointer while the row is -/// disabled, to say why it is gray. -pub fn menu_item_name_hint(ui: &mut Ui, label: &str, enabled: bool, checked: bool, hint: &str) -> bool { - menu_row(ui, label, enabled, checked).on_disabled_hover_text(hint).clicked() -} - -fn menu_row(ui: &mut Ui, label: &str, enabled: bool, checked: bool) -> egui::Response { +/// [`menu_item`] that shows `hint` under the pointer while the row is disabled, to say why it is +/// gray. +pub fn menu_item_hint(ui: &mut Ui, label: &str, enabled: bool, checked: bool, hint: &str) -> bool { + let label = tl!(label); let text = if checked { format!("✓ {label}") } else { format!(" {label}") }; ui.add_enabled(enabled, egui::Button::new(egui::RichText::new(text).size(12.5)).frame_when_inactive(false)) + .on_disabled_hover_text(tl!(hint)) + .clicked() } diff --git a/crates/ui-egui/src/widgets/color.rs b/crates/ui-egui/src/widgets/color.rs index f7c1d9365b..eb5f11d150 100644 --- a/crates/ui-egui/src/widgets/color.rs +++ b/crates/ui-egui/src/widgets/color.rs @@ -265,6 +265,11 @@ fn rail_step(ui: &Ui, id: egui::Id, focused: bool, s: &SliderValue) -> Option Rect { + Rect::from_min_size(pos2(rect.left() + 4.0, rect.top() + 4.0), vec2(rect.width() - 8.0, 7.0)) +} + /// The rail of [`color_slider_valued`] with the id `id`: its response, the new value from 0 to 1 /// that a click or drag gives and the phase. fn color_rail( @@ -278,7 +283,7 @@ fn color_rail( ) -> (Response, Option, Live) { let t = Tokens::get(ui.ctx()); let (rect, _) = ui.allocate_exact_size(vec2(width, 22.0), Sense::hover()); - let bar = Rect::from_min_size(pos2(rect.left() + 4.0, rect.top() + 4.0), vec2(width - 8.0, 7.0)); + let bar = color_rail_bar(rect); let resp = ui.interact(rect, id, Sense::click_and_drag()); gradient_strip(ui, bar, (bar.width() / 2.0).ceil().max(2.0) as usize, false, track); ui.painter().rect_stroke(bar, 0.0, Stroke::new(1.0, t.border), StrokeKind::Outside); diff --git a/docs/mcp.md b/docs/mcp.md index d8b25024ff..3734007f6d 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -627,8 +627,9 @@ the list return an error and change nothing. The command returns `{view, channel kept with the preferences. `ui.colorWheel {"sliders": "oklch"}` shows the Color Wheel panel's OKLCH Sliders (L, C and H rows under the wheel or -the box), and `"none"` hides them; `"oklch"` is an error while the working RGB space is not sRGB. `color.convert {"to": "oklch"}` answers the color's OKLCH as `[L %, C, H°]` of its display sRGB, -and headless MCP reaches it too. +the box), and `"none"` hides them; `"oklch"` is an error while the working RGB space is not sRGB. +`color.convert {"to": "oklch"}` answers the color's OKLCH as `[L %, C, H°]` of its display sRGB. A color outside sRGB +(a Lab or CMYK color, or an RGB color in a wider working RGB space) is clipped to sRGB first. 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 From d601ec31ca6595f141fba9a9232fd17369def357 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 14 Nov 2026 18:19:55 -0800 Subject: [PATCH 03/55] Symbols: the Symbol Shifter, Sizer, Stainer and Styler take Shift A Shift-click with the Symbol Shifter brings the symbol instances under the brush one place forward in the stacking order, and Alt+Shift-click sends them one place backward, without moving them on the canvas. The Symbol Sizer with Shift keeps each instance's center, so the set's density stays as it was, even with Resizing Affects Density. The Symbol Stainer and the Symbol Styler with Shift keep the amount of an instance's stain or style and move its color toward the fill color or the selected style; an instance without one is left as it is. symbol.adjust takes shift. No undo step is added when nothing moves or changes, and a shift that is not true or false is an error. --- crates/engine/src/cmd/brushsym.rs | 2 +- crates/engine/src/cmd/brushsym/symbols.rs | 99 +++++++++- crates/engine/src/tests.rs | 1 + crates/engine/src/tests/symbolism_shift.rs | 209 +++++++++++++++++++++ crates/tools/src/symbolism.rs | 40 ++++ docs/mcp.md | 14 ++ docs/target-app-parity.md | 1 + 7 files changed, 363 insertions(+), 3 deletions(-) create mode 100644 crates/engine/src/tests/symbolism_shift.rs diff --git a/crates/engine/src/cmd/brushsym.rs b/crates/engine/src/cmd/brushsym.rs index 3a31281f30..2ba9b2ad29 100644 --- a/crates/engine/src/cmd/brushsym.rs +++ b/crates/engine/src/cmd/brushsym.rs @@ -368,7 +368,7 @@ pub fn specs() -> Vec { "Symbolism Tool", [], None, - "{tool: shift|scrunch|size|spin|stain|screen|style, points: [[x,y,pressure?]…] (pen pressure 0..1, default 1), radius?: 40, intensity?: 1..10 (5), usePressure?: bool (each point's pressure is the intensity there, in place of `intensity`), method?: userDefined|average|random (userDefined; not used by shift), proportional?: bool (size; true), affectsDensity?: bool (size; false), alt?: bool, color? (#rrggbbaa and #rgba are refused), keepModel?: bool (as paint.setFill), style?: name} adjust instances near the points (selection, else all) → {count}. `method` userDefined changes each instance by the tool's amount at its distance from the point; random gives each instance its own share of that amount for the whole stroke, from none to twice it (spin: a turn either way); average moves each instance's value toward the mean of the instances within `radius` of the point (scrunch: its distance from their middle toward their mean distance; size: the geometric mean of their sizes; spin: their mean direction; stain and style: their mean amount; screen: their mean opacity), and `alt` does not reverse it. With `proportional` false a drag resizes along its own direction (a level drag the width, an upright one the height; the first point takes the direction to the second) and one point resizes both; average resizes both whatever `proportional` is. With `affectsDensity` an instance also moves away from the point as it grows and toward it as it shrinks. No undo step is added when no instance changes (none under the brush, or average with each already at the mean). A `method` that is none of the three, or a pressure that isn't a number, is an error", + "{tool: shift|scrunch|size|spin|stain|screen|style, points: [[x,y,pressure?]…] (pen pressure 0..1, default 1), radius?: 40, intensity?: 1..10 (5), usePressure?: bool (each point's pressure is the intensity there, in place of `intensity`), method?: userDefined|average|random (userDefined; not used by shift), proportional?: bool (size; true), affectsDensity?: bool (size; false), alt?: bool, shift?: bool (shift, size, stain and style; false), color? (#rrggbbaa and #rgba are refused), keepModel?: bool (as paint.setFill), style?: name} adjust instances near the points (selection, else all) → {count}. `method` userDefined changes each instance by the tool's amount at its distance from the point; random gives each instance its own share of that amount for the whole stroke, from none to twice it (spin: a turn either way); average moves each instance's value toward the mean of the instances within `radius` of the point (scrunch: its distance from their middle toward their mean distance; size: the geometric mean of their sizes; spin: their mean direction; stain and style: their mean amount; screen: their mean opacity), and `alt` does not reverse it. With `proportional` false a drag resizes along its own direction (a level drag the width, an upright one the height; the first point takes the direction to the second) and one point resizes both; average resizes both whatever `proportional` is. With `affectsDensity` an instance also moves away from the point as it grows and toward it as it shrinks. `shift` is the tool's Shift form: shift brings the instances within `radius` of any point one place forward among their siblings (with `alt`, one place backward), once for the stroke, and does not move them; size keeps the instances where they are, `affectsDensity` included; stain and style keep each instance's amount and move its paint toward `color` or the style (stain by the tool's amount at its distance from the point, style by the brush's strength there), whatever `method` is, and leave an instance without a stain or style as it is, and `alt` has no effect. No undo step is added when no instance changes (none under the brush, average with each already at the mean, or shift with nothing to move or change). A `method` that is none of the three, or a pressure that isn't a number, is an error", has_doc, symbol_adjust ), diff --git a/crates/engine/src/cmd/brushsym/symbols.rs b/crates/engine/src/cmd/brushsym/symbols.rs index 4ba3b22b62..46a6b5b3c3 100644 --- a/crates/engine/src/cmd/brushsym/symbols.rs +++ b/crates/engine/src/cmd/brushsym/symbols.rs @@ -1041,6 +1041,7 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result { let use_pressure = switch_or(p, "usePressure", false, C)?; let proportional = switch_or(p, "proportional", true, C)?; let affects_density = switch_or(p, "affectsDensity", false, C)?; + let shift = switch_or(p, "shift", false, C)?; // The Symbol Shifter has no Method. let method = if tool == "shift" { method_param(p, C).map(|_| Method::UserDefined)? } else { method_param(p, C)? }; // Refused while an object of a dynamic instance's art is selected: the instance stays as it is. @@ -1084,6 +1085,33 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result { // for the whole stroke (and for every preview of it). let first = pts.first().map_or(Point::ZERO, |(q, _)| *q); let share = |id: NodeId| if method == Method::Random { jitter(id.0 as usize, first).0 + 1.0 } else { 1.0 }; + // Shift with the Symbol Shifter: the instances under the brush come one place forward among + // their siblings (with `alt`, go one place backward), once for the whole stroke. + if tool == "shift" && shift { + let count = crate::cmd::colorcmds::edit_if_changed(s, label, |_, d| { + let under: std::collections::HashSet = candidates + .iter() + .copied() + .filter(|id| { + d.node(*id).and_then(instance_center).is_some_and(|c| { + pts.iter().any(|(q, pressure)| (if use_pressure { *pressure } else { intensity }) > 0.0 && c.distance(*q) < radius) + }) + }) + .collect(); + let moved = restack(d, &under, alt)?; + Ok((moved, moved > 0)) + })?; + return Ok(json!({ "count": count })); + } + // Shift with the Symbol Stainer or the Symbol Styler: the paint an instance's stain or style + // moves toward, and the share of the brush's strength it moves by. Shift with the Symbol Sizer + // keeps the instances where they are, Resizing Affects Density included. + let recolor = match tool.as_str() { + "stain" if shift => Some((Paint::solid(color), 0.15)), + "style" if shift => Some((style_paint.clone().unwrap_or(Paint::solid(color)), 1.0)), + _ => None, + }; + let spread = affects_density && !shift; // No undo step when no instance changes (none under the brush, or Average with each at the mean). let count = crate::cmd::colorcmds::edit_if_changed(s, label, |_, d| { let mut touched = std::collections::BTreeSet::new(); @@ -1110,6 +1138,15 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result { continue; } let Some(cur) = d.node(*id).and_then(|n| look(d, n)) else { continue }; + // Shift with the Symbol Stainer or the Symbol Styler: the instance keeps the amount + // of its stain or style, and its paint moves toward the color or the style. An + // instance without one is left as it is. + if let Some((to, step)) = &recolor { + if recolor_keeping_amount(d, *id, cur.fill, to, step * w) { + touched.insert(*id); + } + continue; + } // Average leaves an instance that already has the mean as it is. let at_mean = target.as_ref().is_some_and(|t| match tool.as_str() { "scrunch" => { @@ -1161,8 +1198,9 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result { }; n.transform(about(Affine::scale_non_uniform(kx, ky)), false); // Resizing Affects Density: instances move away from the brush's center as - // they grow and toward it as they shrink. - if affects_density { + // they grow and toward it as they shrink. Shift keeps the instances where + // they are, so the set's density stays as it was. + if spread { n.transform(Affine::translate((c - *q) * ((kx * ky).sqrt() - 1.0)), false); } } @@ -1221,3 +1259,60 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result { })?; Ok(json!({ "count": count })) } + +/// Move the paint of instance `id`'s stain or style (`fill`, with its amount) toward `to` by `t`, +/// keeping the amount. An instance without a stain or style, or one whose paint does not change, is +/// left as it is. Returns whether it changed. +fn recolor_keeping_amount(d: &mut Document, id: NodeId, fill: Option<(Paint, f64)>, to: &Paint, t: f64) -> bool { + let Some((own, amount)) = fill.filter(|(_, o)| *o > 0.0) else { return false }; + let paint = vectorcraft_doc::blend::lerp_paint(&own, to, t.clamp(0.0, 1.0) as f32); + if paint == own { + return false; + } + let Some(n) = d.node_mut(id) else { return false }; + n.appearance.items.retain(|i| !matches!(i, AppearanceItem::Fill(_))); + let mut f = FillLayer::new(paint); + f.opacity = (amount as f32).min(1.0); + n.appearance.items.insert(0, AppearanceItem::Fill(f)); + true +} + +/// Bring each of `ids` one place forward among its siblings past a sibling that is not one of them +/// (`back`: one place backward). Ones already in front of (behind) every other sibling stay, and +/// so do the clipping path of a clip group and the ruler guides above a layer's art. Returns how +/// many moved. +fn restack(d: &mut Document, ids: &std::collections::HashSet, back: bool) -> Result { + let mut parents: Vec> = vec![]; + for id in ids { + let par = d.parent_of(*id); + if !parents.contains(&par) { + parents.push(par); + } + } + let mut moved = 0; + for par in parents { + let floor = usize::from(par.and_then(|p| d.node(p)).is_some_and(Node::clips)); + let ch = d.children_mut(par)?; + let len = Node::guide_run_start(ch); + if len <= floor + 1 { + continue; + } + let picked = |n: &Arc| ids.contains(&n.id); + if back { + for i in floor + 1..len { + if picked(&ch[i]) && !picked(&ch[i - 1]) { + ch.swap(i - 1, i); + moved += 1; + } + } + } else { + for i in (floor..len - 1).rev() { + if picked(&ch[i]) && !picked(&ch[i + 1]) { + ch.swap(i, i + 1); + moved += 1; + } + } + } + } + Ok(moved) +} diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index 47bb05b696..53d8633178 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -194,6 +194,7 @@ mod symbol_nine_slice; mod symbolbounds; mod symboledit; mod symbolism_options; +mod symbolism_shift; mod symbollib; mod targeting; mod textcombos; diff --git a/crates/engine/src/tests/symbolism_shift.rs b/crates/engine/src/tests/symbolism_shift.rs new file mode 100644 index 0000000000..e9ebea9c33 --- /dev/null +++ b/crates/engine/src/tests/symbolism_shift.rs @@ -0,0 +1,209 @@ +//! The symbolism tools' Shift forms in `symbol.adjust {shift}`: the Symbol Shifter's stacking +//! order, the Symbol Sizer keeping the set's density, and the Symbol Stainer and Symbol Styler +//! keeping their amount while the color or style changes. + +use serde_json::{Value, json}; +use vectorcraft_doc::{Document, Node, NodeKind}; +use vectorcraft_geom::Point; + +use crate::*; + +/// A document with the 20 pt square symbol "Dot" and nothing selected. +fn session() -> Session { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 20, "height": 20})).unwrap(); + s.execute("symbol.new", &json!({"name": "Dot"})).unwrap(); + s.select(|_, sel| sel.clear()).unwrap(); + s +} + +/// An instance of Dot centered on (`x`, `y`), not selected. +fn dot(s: &mut Session, x: f64, y: f64) -> NodeId { + let id = NodeId(s.execute("symbol.place", &json!({"name": "Dot", "x": x, "y": y})).unwrap()["id"].as_u64().unwrap()); + s.select(|_, sel| sel.clear()).unwrap(); + id +} + +fn node(s: &Session, id: NodeId) -> Node { + s.doc().unwrap().doc.node(id).cloned().unwrap() +} + +fn center(s: &Session, id: NodeId) -> Point { + match node(s, id).kind { + NodeKind::SymbolInstance { xf, .. } => xf * Point::ZERO, + other => panic!("not an instance: {other:?}"), + } +} + +fn width(s: &Session, id: NodeId) -> f64 { + node(s, id).geometric_bounds().unwrap().width() +} + +fn undo_len(s: &Session) -> usize { + s.doc().unwrap().history.undo.len() +} + +fn state(s: &Session) -> (Document, usize) { + ((*s.doc().unwrap().doc).clone(), undo_len(s)) +} + +fn adjust(s: &mut Session, p: Value) -> Value { + s.execute("symbol.adjust", &p).unwrap() +} + +/// The children of symbol set `set`, in stacking order (the first is at the back). +fn members(s: &Session, set: NodeId) -> Vec { + node(s, set).children().unwrap().iter().map(|c| c.id).collect() +} + +/// The instance's fill: its color as RGB and its amount. +fn fill(s: &Session, id: NodeId) -> Option<([f32; 3], f32)> { + node(s, id).appearance.fill().map(|f| (f.paint.color().map_or([0.0; 3], |c| c.to_rgb()), f.opacity)) +} + +/// A symbol set of four instances in a row at x = 40, 120, 200 and 280, selected. +fn row(s: &mut Session) -> (NodeId, Vec) { + let pts: Vec = (0..4).map(|i| json!([40.0 + 80.0 * f64::from(i), 150.0])).collect(); + let set = NodeId(s.execute("symbol.spray", &json!({"name": "Dot", "points": pts, "radius": 4})).unwrap()["id"].as_u64().unwrap()); + let ids = members(s, set); + assert_eq!(ids.len(), 4); + (set, ids) +} + +/// Shift-click with the Symbol Shifter brings the instances under the brush one place forward in +/// the set, and Alt+Shift-click sends them one place backward, without moving them on the canvas. +#[test] +fn shift_click_with_the_shifter_changes_the_stacking_order() { + let mut s = session(); + let (set, ids) = row(&mut s); + let centers: Vec = ids.iter().map(|id| center(&s, *id)).collect(); + let click = |s: &mut Session, x: f64, alt: bool| { + adjust(s, json!({"tool": "shift", "points": [[x, 150]], "radius": 10, "intensity": 10, "shift": true, "alt": alt}))["count"].clone() + }; + let steps = undo_len(&s); + assert_eq!(click(&mut s, 120.0, false), 1); + assert_eq!(members(&s, set), [ids[0], ids[2], ids[1], ids[3]]); + assert_eq!(undo_len(&s), steps + 1, "one undo step"); + assert_eq!(ids.iter().map(|id| center(&s, *id)).collect::>(), centers, "nothing moves on the canvas"); + assert_eq!(click(&mut s, 120.0, false), 1); + assert_eq!(members(&s, set), [ids[0], ids[2], ids[3], ids[1]]); + // Already in front of the others: nothing changes and no undo step is added. + let before = state(&s); + assert_eq!(click(&mut s, 120.0, false), 0); + assert!(state(&s) == before); + // Alt sends it back one place at a time; at the back it stays. + assert_eq!(click(&mut s, 120.0, true), 1); + assert_eq!(members(&s, set), [ids[0], ids[2], ids[1], ids[3]]); + click(&mut s, 120.0, true); + click(&mut s, 120.0, true); + assert_eq!(members(&s, set), [ids[1], ids[0], ids[2], ids[3]]); + assert_eq!(click(&mut s, 120.0, true), 0); + // Two instances under the brush move together past the next one. + s.execute("edit.undo", &json!({})).unwrap(); + let both = adjust(&mut s, json!({"tool": "shift", "points": [[40, 150], [120, 150]], "radius": 10, "intensity": 10, "shift": true})); + assert_eq!(both["count"], 2); + assert_eq!(members(&s, set), [ids[2], ids[0], ids[1], ids[3]]); + // Without Shift a drag moves the instances, as before. + adjust(&mut s, json!({"tool": "shift", "points": [[280, 150], [290, 150]], "radius": 30, "intensity": 10})); + assert!(center(&s, ids[3]).x > centers[3].x); +} + +/// Shift with the Symbol Sizer resizes the instances and keeps their centers where they are, even +/// with Resizing Affects Density. +#[test] +fn shift_with_the_sizer_keeps_the_density() { + let at = |affects: bool, shift: bool| { + let mut s = session(); + let a = dot(&mut s, 220.0, 150.0); + adjust( + &mut s, + json!({"tool": "size", "points": [[200, 150], [200, 150]], "radius": 60, "intensity": 10, "affectsDensity": affects, "shift": shift}), + ); + (center(&s, a), width(&s, a)) + }; + let (moved, _) = at(true, false); + assert!(moved.x > 220.5, "{moved:?}"); + let (kept, grown) = at(true, true); + assert!((kept.x - 220.0).abs() < 1e-9 && (kept.y - 150.0).abs() < 1e-9 && grown > 20.5, "{kept:?} {grown}"); + // It resizes as the Sizer does with Resizing Affects Density off. + assert_eq!(at(false, false), (kept, grown)); + assert_eq!(at(false, true), (kept, grown)); +} + +/// Shift with the Symbol Stainer keeps the stain's amount and moves its color toward the fill +/// color; an instance without a stain is left as it is. +#[test] +fn shift_with_the_stainer_keeps_the_amount_and_changes_the_color() { + let mut s = session(); + let (a, b) = (dot(&mut s, 100.0, 150.0), dot(&mut s, 300.0, 150.0)); + adjust(&mut s, json!({"tool": "stain", "points": [[100, 150], [100, 150]], "radius": 5, "intensity": 10, "color": "#ff0000"})); + let (red, amount) = fill(&s, a).unwrap(); + assert!(amount > 0.2 && red[0] > 0.99 && red[2] < 0.01, "{red:?} {amount}"); + let stain = |s: &mut Session, x: f64| { + adjust(s, json!({"tool": "stain", "points": [[x, 150], [x, 150]], "radius": 5, "intensity": 10, "color": "#0000ff", "shift": true})) + }; + assert_eq!(stain(&mut s, 100.0)["count"], 1); + let (color, kept) = fill(&s, a).unwrap(); + assert_eq!(kept, amount, "the amount stays"); + assert!(color[0] < red[0] && color[2] > 0.01, "toward blue: {color:?}"); + // More strokes go on toward blue, with the amount still the same. + for _ in 0..30 { + stain(&mut s, 100.0); + } + let (bluer, kept) = fill(&s, a).unwrap(); + assert_eq!(kept, amount); + assert!(bluer[2] > 0.9 && bluer[0] < 0.1, "{bluer:?}"); + // Alt has no effect with Shift. + let green = json!({"tool": "stain", "points": [[100, 150]], "radius": 5, "intensity": 10, "color": "#00ff00", "shift": true}); + adjust(&mut s, green.clone()); + let plain = fill(&s, a); + s.execute("edit.undo", &json!({})).unwrap(); + let mut with_alt = green; + with_alt["alt"] = json!(true); + adjust(&mut s, with_alt); + assert_eq!(fill(&s, a), plain); + // No stain on b: nothing changes and no undo step is added. + let before = state(&s); + assert_eq!(stain(&mut s, 300.0)["count"], 0); + assert!(state(&s) == before && fill(&s, b).is_none()); +} + +/// Shift with the Symbol Styler keeps the amount of the instance's stain or style and moves its +/// fill toward the selected style's fill. +#[test] +fn shift_with_the_styler_keeps_the_amount_and_changes_the_style() { + let mut s = session(); + let a = dot(&mut s, 100.0, 150.0); + let id = s.execute("shape.rectangle", &json!({"x": 300, "y": 250, "width": 10, "height": 10})).unwrap()["id"].as_u64().unwrap(); + s.execute("paint.setFill", &json!({"color": "#0000ff"})).unwrap(); + s.execute("graphicStyle.new", &json!({"name": "Blue", "id": id})).unwrap(); + s.select(|_, sel| sel.clear()).unwrap(); + // A red stain at part strength. + adjust(&mut s, json!({"tool": "stain", "points": [[100, 150]], "radius": 5, "intensity": 10, "color": "#ff0000"})); + let (red, amount) = fill(&s, a).unwrap(); + assert!(red[0] > 0.99 && amount > 0.0 && amount < 0.5, "{red:?} {amount}"); + // Half the brush's strength at a point 2.5 pt from the instance: half way to blue. + adjust(&mut s, json!({"tool": "style", "points": [[102.5, 150]], "radius": 5, "intensity": 10, "style": "Blue", "shift": true})); + let (mixed, kept) = fill(&s, a).unwrap(); + assert_eq!(kept, amount); + assert!(mixed[0] < 0.99 && mixed[2] > 0.01, "{mixed:?}"); + // At the brush's center with full intensity it takes the style's fill. + adjust(&mut s, json!({"tool": "style", "points": [[100, 150]], "radius": 5, "intensity": 10, "style": "Blue", "shift": true})); + let (blue, kept) = fill(&s, a).unwrap(); + assert_eq!(kept, amount); + assert!(blue[2] > 0.99 && blue[0] < 0.01, "{blue:?}"); +} + +/// A `shift` that is not true, false or null is refused and changes nothing. +#[test] +fn a_bad_shift_is_refused() { + let mut s = session(); + dot(&mut s, 100.0, 150.0); + for tool in ["shift", "size", "stain", "style"] { + let before = state(&s); + let r = s.execute("symbol.adjust", &json!({"tool": tool, "points": [[100, 150]], "shift": "yes"})); + assert!(matches!(&r, Err(EngineError::BadParams { msg, .. }) if msg == "`shift` must be true or false"), "{tool}: {r:?}"); + assert!(state(&s) == before); + } +} diff --git a/crates/tools/src/symbolism.rs b/crates/tools/src/symbolism.rs index f407792170..2b810ddd61 100644 --- a/crates/tools/src/symbolism.rs +++ b/crates/tools/src/symbolism.rs @@ -48,6 +48,8 @@ pub struct SymbolismTool { active: bool, hover: Option, alt: bool, + /// Shift was held when the drag began (the Shifter, Sizer, Stainer and Styler have a Shift form). + shift: bool, /// Brush diameter in points. pub diameter: f64, /// 1..10. @@ -97,6 +99,7 @@ impl SymbolismTool { active: false, hover: None, alt: false, + shift: false, diameter: 80.0, intensity: 5.0, density: 5.0, @@ -179,6 +182,9 @@ impl SymbolismTool { v["proportional"] = json!(self.proportional); v["affectsDensity"] = json!(self.affects_density); } + if self.shift && matches!(tool, "shift" | "size" | "stain" | "style") { + v["shift"] = json!(true); + } ("symbol.adjust".into(), v) } } @@ -213,6 +219,7 @@ impl Tool for SymbolismTool { self.previewed = 1; self.active = true; self.alt = ev.mods.alt; + self.shift = ev.mods.shift; let (c, v) = self.command(cx); vec![Action::Begin(self.label().into()), Action::Preview(c, v)] } @@ -536,6 +543,39 @@ mod tests { assert!(v["method"] == "random" && v.get("proportional").is_none(), "{v}"); } + /// A drag begun with Shift sends `shift` with the Shifter, Sizer, Stainer and Styler, and only + /// with them; one begun without it sends none. + #[test] + fn shift_reaches_the_tools_that_have_a_shift_form() { + let (d, _) = doc_with_rect(); + let (s, p) = (Selection::default(), paint()); + let cx = cx(&d, &s, &p); + let shifted = Mods { shift: true, ..Default::default() }; + for (id, sends) in [ + ("symbolShifter", true), + ("symbolSizer", true), + ("symbolStainer", true), + ("symbolStyler", true), + ("symbolScruncher", false), + ("symbolSpinner", false), + ("symbolScreener", false), + ("symbolSprayer", false), + ] { + let mut t = SymbolismTool::new(id); + let a = t.pointer(&cx, &PointerEvent::new(PointerKind::Down, 5.0, 5.0).with_mods(shifted)); + let Action::Preview(_, v) = &a[1] else { panic!("{a:?}") }; + assert_eq!(v.get("shift"), sends.then_some(&json!(true)), "{id}"); + // The drag keeps the Shift it began with. + let a = t.pointer(&cx, &PointerEvent::new(PointerKind::Drag, 60.0, 5.0)); + let Action::Preview(_, v) = &a[0] else { panic!("{a:?}") }; + assert_eq!(v.get("shift"), sends.then_some(&json!(true)), "{id} drag"); + t.pointer(&cx, &PointerEvent::new(PointerKind::Up, 60.0, 5.0)); + let a = t.pointer(&cx, &PointerEvent::new(PointerKind::Down, 5.0, 5.0)); + let Action::Preview(_, v) = &a[1] else { panic!("{a:?}") }; + assert!(v.get("shift").is_none(), "{id} without Shift: {v}"); + } + } + /// The Sprayer sends its six options as `attributes`, and the fill color only while Stain is /// User Defined. #[test] diff --git a/docs/mcp.md b/docs/mcp.md index 3bafb737c6..a48458f075 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3167,6 +3167,20 @@ already walks Image Trace. Short agent entry points: instances moved. - A `method`, an attribute or a density outside these values, a pressure that isn't a number, or no symbol set among the objects of `symbol.setDensity`, is an error and changes nothing. +- The symbolism tools with Shift held ([the manual](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=199), + [the CS6 reference](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=136)) send + `shift: true` with `symbol.adjust`: a Shift-click with the Symbol Shifter brings the instances under the brush + forward in the stacking order and Alt+Shift sends them backward; the Symbol Sizer keeps the set's density while it + resizes; the Symbol Stainer and the Symbol Styler keep the amount of stain or style and move the color or style + toward the current fill or the selected style. VectorCraft's own rules: + - The Shifter moves each instance within `radius` of any stroke point one place forward among its siblings (with + `alt`, one place backward), past the next one that is not under the brush, once for the whole stroke. It does not + move them on the canvas. It returns `{count}`, the instances that moved. + - The Sizer keeps each instance's center where it is, even with `affectsDensity`. + - The Stainer moves an instance's paint toward `color` by the tool's amount at its distance from the point, and the + Styler toward the style by the brush's strength there, whatever `method` is. An instance without a stain or style + is left as it is, and `alt` has no effect. + - No undo step is added when nothing moves or changes. - Dynamic symbols: an instance of a symbol whose `type` is `dynamic` changes the appearance of objects in the symbol's art for itself only and stays linked. `symbol.instance.setAppearance {id?, path, fill?, stroke?, opacity?, blend?}` names the object by `path`, child indices in paint order from the art's root down through its groups (`[]` is the diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index bd5fd1c8b8..c071cd7b74 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -983,6 +983,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Expand of symbol instances:** Object › Expand turns selected symbol instances (without effects, not in perspective, in groups or placed documents too) into their art as Break Link to Symbol places it, one level deep, as one undo step; the Expand dialog's Fill and Stroke reach that art (`object.expand`, `crates/engine/src/tests/expand_symbols.rs`; estimated, score unchanged). - **Reset Transformation** ([Transform symbols](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/transform-symbols.html), [Symbols panel options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbols-panel-options.html)): the Symbols panel menu's Reset Transformation and the Control bar's Reset, shown while symbol instances are selected, give the selected instances their symbol's own scale again, without rotation or shear, as one undo step (`symbol.instance.resetTransform`); an instance in perspective is left as it is. VectorCraft's own rules: each instance keeps the center of its bounding box in place, reflection is removed too, and the menu item and the button are enabled only while a selected instance would change. Tests: `tests::brushsym::reset_transformation_restores_the_symbols_scale_and_keeps_the_center`, `reset_transformation_keeps_the_center_of_art_away_from_the_origin`, `reset_transformation_ignores_a_stored_size_that_is_not_positive`, `reset_transformation_leaves_unchanged_instances_and_refuses_bad_ids`, `panels::symbols::tests::reset_transformation_is_enabled_for_a_transformed_instance_and_resets_it`. - **Symbolism Tools Options** ([Symbolism tool options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbolism-tool-options.html), [the archived manual](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=118)): the dialog a double-click on a symbolism tool opens has, besides Diameter, Intensity and Symbol Set Density, Use Pressure Pen (a pen's pressure is the intensity), Method (User Defined, Average or Random) for the Scruncher, Sizer, Spinner, Stainer, Screener and Styler, Show Brush Size and Intensity, the Symbol Sprayer's Scrunch, Size, Spin, Screen, Stain and Style (each Average or User Defined), and the Symbol Sizer's Proportional Resizing and Resizing Affects Density; a new Symbol Set Density spaces the instances of the selected symbol sets (`symbol.setDensity`). VectorCraft's own rules: a Tool row lists the eight tools by name and shows the chosen one's options; Random gives each instance its own share of the change for the whole stroke; Average moves each value toward the mean of the instances under the brush; the starting values are Method User Defined, the Sprayer's six options Average, Proportional Resizing on and Resizing Affects Density off, so only a Sprayer stroke over instances of the selected set changes from before (its new instances take their mean values); the brush shows the intensity as a dashed ring. The Symbol Sprayer does not use Intensity or pen pressure. Tests: `crates/engine/src/tests/symbolism_options.rs`, `symbolism::tests` in `crates/tools`, `dialogs::symbolism_options::tests`. + - **Symbolism tools with Shift** ([the manual](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=199), [the CS6 reference](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=136)): a Shift-click with the Symbol Shifter brings the instances under the brush forward in the stacking order and Alt+Shift-click sends them backward; the Symbol Sizer with Shift keeps the set's density while it resizes; the Symbol Stainer and the Symbol Styler with Shift keep the amount of stain or style and move the color or style toward the current fill or the selected style (`symbol.adjust {shift}`). VectorCraft's own rules: the Shifter moves each instance one place among its siblings, once per stroke, without moving it on the canvas; the Sizer keeps each instance's center, even with Resizing Affects Density; an instance without a stain or style is left as it is, and Alt has no effect on the Stainer or the Styler with Shift. Tests: `crates/engine/src/tests/symbolism_shift.rs`, `symbolism::tests::shift_reaches_the_tools_that_have_a_shift_form`. - **Expand of dimensions:** Object › Expand, Expand Appearance, Create Outlines and Outline Stroke turn a dimension whose art they change into a plain group of that art, which stays as it is through later moves, scales and edits of what it measured; undo gives the live dimension back (`crates/engine/tests/it/dimensions.rs`; VectorCraft's own rule; estimated, score unchanged). - **Brush libraries** ([public source](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/create-new-brush-libraries.html), [import](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/import-brushes-from-brush-libraries-or-other-files.html), [Brushes panel](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/brushes-panel-overview.html)): Window › Brush Libraries, the Brushes panel's Brush Libraries Menu and its menu's Open Brush Library open each library in a library panel of its own, as swatch, graphic style and symbol libraries do. The built-in libraries (Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media) are original brushes generated in code (`crates/engine/src/cmd/brushlib.rs`); Striped Ribbon's art is filled with the library's own pattern and Sparkles scatters the library's own symbol; Ink and Wash adds ink and wash brushes (the [help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html) lists an Ink brush library of strokes with varied thickness and texture; the names, shapes and opacities are VectorCraft's own): Tapered Ink, an art brush broad near its start that thins to a fine tip; Brush Pen, a calligraphic brush whose size follows the pen pressure; and Soft Wash and Pooling Wash, art brushes of translucent gray layers that take the stroke color as tints; Game Trails adds motion art brushes (Speed Line, Dash Trail, Burst Ray, Zigzag); Energy Beams adds laser and plasma art brushes (Laser Bolt, Plasma Arc, Charge Wave, Spark Trail); Dry Media adds grainy art brushes (Chalk Grain, Graphite Pencil, Wax Crayon, Charcoal Dust). A click on a brush adds it to the document's Brushes as one undo step with every resource its art uses (patterns, symbols, swatches, graphic styles, images), makes it the current brush and, with paths selected, applies it to them in the same step; a brush the document already has is not added again and a different brush of the same name comes in numbered ("Wave 2"). Shift/Cmd-clicks select brushes for Add to Brushes; a brush dragged onto a path is added and applied to it, and one dragged onto the Brushes panel is added. Save Brushes… / the Brushes panel's Save Brush Library… write the document's brushes (or the selected ones) as a `.vectorcraft` library into the `Brushes` folder next to the preferences, listed under User Defined, or to a file; Other Library… reads the brushes of any document VectorCraft opens. Thumbnails, in the library panels, the Brushes panel and Brush Options, render brush art with the patterns and symbols it uses. Copying brushed art now carries the patterns and symbols its brush's art uses too. Tests: `crates/engine/src/tests/brushlib.rs`, `crates/ui-egui/src/panels/tests_brush_libraries.rs`, `panels::brushes::tests::library_brush_previews_show_the_patterns_their_art_uses`, `canvas::tests::a_library_brush_dropped_on_a_path_is_added_and_applied_in_one_step`. - **Bristle Brushes library** ([What's new](https://helpx.adobe.com/illustrator/desktop/new-features/whats-new.html), [About brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html)): Window › Brush Libraries › Bristle Brushes holds ten bristle brushes, one for each tip shape (Fine Liner, Pointed Flat, Stubby Round, Dry Scrub, Soft Dome, Filbert, Angled Round, Angled Flat, Fan Blender, Grass Fan). The brushes, their names and their values are VectorCraft's own, and every value lies inside the range the bristle brush keeps (`brush.libraries`, `brush.addFromLibrary`; `the_bristle_brushes_library_covers_every_tip_shape_within_the_bristle_ranges`). From dba9c8066d45df585ceab9aecca42cfdd6339a29 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 14 Nov 2026 18:48:17 -0800 Subject: [PATCH 04/55] Symbols: Shift with the Symbol Stainer and Styler keeps the instance's other fills The paint of the topmost fill changes in place, so its blend mode, effects and the instance's other appearance items stay as they are. --- crates/engine/src/cmd/brushsym/symbols.rs | 16 +++++++--------- crates/engine/src/tests/symbolism_shift.rs | 10 ++++++++++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/crates/engine/src/cmd/brushsym/symbols.rs b/crates/engine/src/cmd/brushsym/symbols.rs index 46a6b5b3c3..e8e99117cc 100644 --- a/crates/engine/src/cmd/brushsym/symbols.rs +++ b/crates/engine/src/cmd/brushsym/symbols.rs @@ -1260,20 +1260,18 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result { Ok(json!({ "count": count })) } -/// Move the paint of instance `id`'s stain or style (`fill`, with its amount) toward `to` by `t`, -/// keeping the amount. An instance without a stain or style, or one whose paint does not change, is -/// left as it is. Returns whether it changed. +/// Move the paint of instance `id`'s stain or style (`fill`, its topmost fill with the amount) +/// toward `to` by `t`. The fill keeps its amount and everything else it has, and the instance's +/// other appearance items stay as they are. An instance without a stain or style, or one whose +/// paint does not change, is left as it is. Returns whether it changed. fn recolor_keeping_amount(d: &mut Document, id: NodeId, fill: Option<(Paint, f64)>, to: &Paint, t: f64) -> bool { - let Some((own, amount)) = fill.filter(|(_, o)| *o > 0.0) else { return false }; + let Some((own, _)) = fill.filter(|(_, o)| *o > 0.0) else { return false }; let paint = vectorcraft_doc::blend::lerp_paint(&own, to, t.clamp(0.0, 1.0) as f32); if paint == own { return false; } - let Some(n) = d.node_mut(id) else { return false }; - n.appearance.items.retain(|i| !matches!(i, AppearanceItem::Fill(_))); - let mut f = FillLayer::new(paint); - f.opacity = (amount as f32).min(1.0); - n.appearance.items.insert(0, AppearanceItem::Fill(f)); + let Some(f) = d.node_mut(id).and_then(|n| n.appearance.fill_mut()) else { return false }; + f.paint = paint; true } diff --git a/crates/engine/src/tests/symbolism_shift.rs b/crates/engine/src/tests/symbolism_shift.rs index e9ebea9c33..391c267844 100644 --- a/crates/engine/src/tests/symbolism_shift.rs +++ b/crates/engine/src/tests/symbolism_shift.rs @@ -140,6 +140,15 @@ fn shift_with_the_stainer_keeps_the_amount_and_changes_the_color() { adjust(&mut s, json!({"tool": "stain", "points": [[100, 150], [100, 150]], "radius": 5, "intensity": 10, "color": "#ff0000"})); let (red, amount) = fill(&s, a).unwrap(); assert!(amount > 0.2 && red[0] > 0.99 && red[2] < 0.01, "{red:?} {amount}"); + // A second fill below the stain, which Shift leaves as it is. + s.edit("Add fill", |d, _| { + let n = d.node_mut(a).unwrap(); + let lower = n.appearance.fill().unwrap().clone(); + n.appearance.items.insert(0, vectorcraft_doc::AppearanceItem::Fill(vectorcraft_doc::FillLayer { opacity: 0.5, ..lower })); + Ok(()) + }) + .unwrap(); + let lower = node(&s, a).appearance.items[0].clone(); let stain = |s: &mut Session, x: f64| { adjust(s, json!({"tool": "stain", "points": [[x, 150], [x, 150]], "radius": 5, "intensity": 10, "color": "#0000ff", "shift": true})) }; @@ -147,6 +156,7 @@ fn shift_with_the_stainer_keeps_the_amount_and_changes_the_color() { let (color, kept) = fill(&s, a).unwrap(); assert_eq!(kept, amount, "the amount stays"); assert!(color[0] < red[0] && color[2] > 0.01, "toward blue: {color:?}"); + assert_eq!((node(&s, a).appearance.items.len(), &node(&s, a).appearance.items[0]), (2, &lower), "the other fill stays"); // More strokes go on toward blue, with the amount still the same. for _ in 0..30 { stain(&mut s, 100.0); From 9590e0f35a9e3bc31ba06023cfb4a0d0439569b5 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 08:56:27 -0800 Subject: [PATCH 05/55] Symbolism: copied sets keep their density, and the options dialog scrolls - A symbol set duplicated in the same document gets the Symbol Set Density recorded for its source, and a pasted set gets the density recorded for it at Copy (also after Cut, after the source changed, and in another document), so symbol.setDensity spaces the copy from that density. A set with no record at Copy pastes with none. Document::reid copies the record only when the source is the document's own node with that id; the clipboard carries the records. - symbol.adjust counts only the instances it changed: an instance the brush reached but left as it was (the Symbol Screener at a limit) is not counted, and a stroke that changes none adds no undo step. - Method Average gives the Symbol Sprayer's new instance and the Symbol Screener's instances the mean opacity also when it is below 5%. - With Use Pressure Pen, a pressure change of 0.05 or more within a step of the last point gives that point the new pressure. Once a drag has its most points, a change away from the last point is not kept, and a pressure change on a long stroke waits for the next preview or the release instead of sending the whole stroke again. - The Symbolism Tools Options rows scroll, so OK and Cancel stay in view in a short window. --- crates/doc/src/document_guides.rs | 62 ++++++++++++++ crates/doc/src/tests.rs | 37 +++++++++ crates/engine/src/cmd/brushsym/symbolism.rs | 5 +- crates/engine/src/cmd/brushsym/symbols.rs | 8 +- crates/engine/src/cmd/clipboard.rs | 3 + crates/engine/src/cmd/clipboard/resources.rs | 1 + crates/engine/src/cmd/edit.rs | 2 + crates/engine/src/tests/symbolism_options.rs | 81 ++++++++++++++++++ crates/tools/src/symbolism.rs | 83 +++++++++++++++++-- .../ui-egui/src/dialogs/symbolism_options.rs | 44 +++++++++- docs/mcp.md | 3 +- 11 files changed, 315 insertions(+), 14 deletions(-) diff --git a/crates/doc/src/document_guides.rs b/crates/doc/src/document_guides.rs index ba6e4dc428..ba203610d6 100644 --- a/crates/doc/src/document_guides.rs +++ b/crates/doc/src/document_guides.rs @@ -500,11 +500,73 @@ impl Document { self.patterns.iter_mut().find(|p| p.name == name) } + /// The [`Self::unknown`] key that holds each symbol set's Symbol Set Density, `{set id: density}`. + /// [`Self::reid`] gives a copy of a set in this document the density recorded for its source, and + /// [`Self::carry_set_densities`] gives a pasted set the density recorded for it at Copy. + pub const SYMBOL_SET_DENSITY_KEY: &'static str = "symbolSetDensity"; + + /// The Symbol Set Densities recorded for `nodes` and their descendants, by id. + pub fn set_densities_of(&self, nodes: &[Node]) -> std::collections::BTreeMap { + let Some(serde_json::Value::Object(record)) = self.unknown.get(Self::SYMBOL_SET_DENSITY_KEY) else { return Default::default() }; + let mut out = std::collections::BTreeMap::new(); + let mut stack: Vec<&Node> = nodes.iter().collect(); + while let Some(n) = stack.pop() { + if let Some(v) = record.get(&n.id.0.to_string()) { + out.insert(n.id, v.clone()); + } + stack.extend(n.children().into_iter().flatten().map(|c| &**c)); + } + out + } + + /// Record for `copy`, a [`Self::reid`] copy of `source`, and its descendants the Symbol Set + /// Densities that `densities` holds for `source` and its descendants, and none for those it + /// holds none for (whatever [`Self::reid`] recorded). + pub fn carry_set_densities(&mut self, source: &Node, copy: &Node, densities: &std::collections::BTreeMap) { + if densities.is_empty() && !self.unknown.contains_key(Self::SYMBOL_SET_DENSITY_KEY) { + return; + } + let mut pairs = vec![(source, copy)]; + while let Some((s, c)) = pairs.pop() { + match densities.get(&s.id) { + Some(v) => { + if let serde_json::Value::Object(m) = + self.unknown.entry(Self::SYMBOL_SET_DENSITY_KEY).or_insert_with(|| serde_json::Value::Object(Default::default())) + { + m.insert(c.id.0.to_string(), v.clone()); + } + } + None => { + if let Some(serde_json::Value::Object(m)) = self.unknown.get_mut(Self::SYMBOL_SET_DENSITY_KEY) { + m.remove(&c.id.0.to_string()); + } + } + } + if let (Some(sc), Some(cc)) = (s.children(), c.children()) { + pairs.extend(sc.iter().zip(cc.iter()).map(|(a, b)| (&**a, &**b))); + } + } + } + /// Deep-clone `node` with fresh ids for it and all descendants, its images' own pixels taken /// in ([`Self::adopt_pixels`]). pub fn reid(&mut self, node: &Node) -> Node { let mut n = node.clone(); n.id = self.alloc_id(); + // A copy of a symbol set keeps the Symbol Set Density recorded for its source, when the source + // is this document's node with that id; a node from another document may share the id of an + // unrelated set here. + let density = self + .unknown + .get(Self::SYMBOL_SET_DENSITY_KEY) + .and_then(|m| m.get(node.id.0.to_string())) + .filter(|_| self.node(node.id) == Some(node)) + .cloned(); + if let Some(v) = density + && let Some(serde_json::Value::Object(m)) = self.unknown.get_mut(Self::SYMBOL_SET_DENSITY_KEY) + { + m.insert(n.id.0.to_string(), v); + } if let NodeKind::Image(im) = &mut n.kind { self.adopt_image_pixels(im); } diff --git a/crates/doc/src/tests.rs b/crates/doc/src/tests.rs index dcbcd87028..0801187b6d 100644 --- a/crates/doc/src/tests.rs +++ b/crates/doc/src/tests.rs @@ -686,6 +686,43 @@ fn reid_gives_fresh_ids() { assert!(!ids.contains(&a) && !ids.contains(&b)); } +/// A copy of a node in the document takes the Symbol Set Density recorded for it; a node from +/// another document with the same id does not. +#[test] +fn reid_copies_the_set_density_of_the_documents_own_node() { + let (mut d, a, _) = doc_with_rects(); + d.unknown.insert(Document::SYMBOL_SET_DENSITY_KEY.into(), serde_json::json!({ a.0.to_string(): 2.0 })); + let density = |d: &Document, id: NodeId| d.unknown[Document::SYMBOL_SET_DENSITY_KEY].get(id.0.to_string()).cloned(); + let own = d.node(a).cloned().unwrap(); + let copy = d.reid(&own); + assert_eq!(density(&d, copy.id), Some(serde_json::json!(2.0))); + let foreign = Node::group(a, vec![]); + let copy = d.reid(&foreign); + assert_eq!(density(&d, copy.id), None); +} + +/// A pasted copy and its descendants take the densities recorded at Copy, and none where Copy +/// recorded none, whatever [`Document::reid`] found for an identical node in the document. +#[test] +fn carry_set_densities_gives_the_densities_recorded_at_copy() { + let (mut d, a, b) = doc_with_rects(); + d.unknown.insert(Document::SYMBOL_SET_DENSITY_KEY.into(), serde_json::json!({ a.0.to_string(): 2.0 })); + let density = |d: &Document, id: NodeId| d.unknown[Document::SYMBOL_SET_DENSITY_KEY].get(id.0.to_string()).cloned(); + let (na, nb) = (d.node(a).cloned().unwrap(), d.node(b).cloned().unwrap()); + // Copy recorded nothing for `a`: the copy reid gave a density loses it. + let copy = d.reid(&na); + assert_eq!(density(&d, copy.id), Some(serde_json::json!(2.0))); + d.carry_set_densities(&na, ©, &Default::default()); + assert_eq!(density(&d, copy.id), None); + // Copy recorded 7 for `b` inside a group: the group's copy has none, and `b`'s copy has 7. + let g = d.alloc_id(); + let group = Node::group(g, vec![Arc::new(nb)]); + let copy = d.reid(&group); + d.carry_set_densities(&group, ©, &[(b, serde_json::json!(7.0))].into_iter().collect()); + let inner = copy.children().unwrap()[0].id; + assert_eq!((density(&d, copy.id), density(&d, inner)), (None, Some(serde_json::json!(7.0)))); +} + #[test] fn setup_round_trips_and_old_files_load() { let (mut d, _, _) = doc_with_rects(); diff --git a/crates/engine/src/cmd/brushsym/symbolism.rs b/crates/engine/src/cmd/brushsym/symbolism.rs index f5df078745..0be2ee37f8 100644 --- a/crates/engine/src/cmd/brushsym/symbolism.rs +++ b/crates/engine/src/cmd/brushsym/symbolism.rs @@ -84,8 +84,9 @@ pub(super) fn spacing(density: f64) -> f64 { } /// The document key that holds each symbol set's Symbol Set Density: `{set id: density}`, written -/// when the Symbol Sprayer creates a set and when `symbol.setDensity` spaces it. -const SET_DENSITY_KEY: &str = "symbolSetDensity"; +/// when the Symbol Sprayer creates a set and when `symbol.setDensity` spaces it, and copied to a +/// copy of a set by [`Document::reid`]. +const SET_DENSITY_KEY: &str = Document::SYMBOL_SET_DENSITY_KEY; /// The Symbol Set Density symbol set `set` was created at or last given (None when not recorded). fn set_density_of(d: &Document, set: NodeId) -> Option { diff --git a/crates/engine/src/cmd/brushsym/symbols.rs b/crates/engine/src/cmd/brushsym/symbols.rs index e8e99117cc..2319e02810 100644 --- a/crates/engine/src/cmd/brushsym/symbols.rs +++ b/crates/engine/src/cmd/brushsym/symbols.rs @@ -975,7 +975,7 @@ pub(super) fn symbol_spray(s: &mut Session, p: &Value) -> Result { if modes.screen && let Some(m) = near { - n.opacity = (m.opacity as f32).clamp(0.05, 1.0); + n.opacity = (m.opacity as f32).clamp(0.0, 1.0); } // The stain and the style are both the instance's fill: the style, set last, replaces // the stain, an averaged one too when the instances under the brush have a fill. @@ -1113,7 +1113,7 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result { }; let spread = affects_density && !shift; // No undo step when no instance changes (none under the brush, or Average with each at the mean). - let count = crate::cmd::colorcmds::edit_if_changed(s, label, |_, d| { + let count = crate::cmd::colorcmds::edit_if_changed(s, label, |before, d| { let mut touched = std::collections::BTreeSet::new(); for (j, (q, pressure)) in pts.iter().enumerate() { let delta = if j > 0 { *q - pts[j - 1].0 } else { Vec2::ZERO }; @@ -1247,7 +1247,7 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result { _ => { let step = (0.1 * w * share) as f32; n.opacity = match &target { - Some(t) => (n.opacity + ((t.opacity - f64::from(n.opacity)) * w.min(1.0)) as f32).clamp(0.05, 1.0), + Some(t) => (n.opacity + ((t.opacity - f64::from(n.opacity)) * w.min(1.0)) as f32).clamp(0.0, 1.0), None if alt => (n.opacity + step).min(1.0), None => (n.opacity - step).max(0.05), }; @@ -1255,6 +1255,8 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result { } } } + // An instance the brush reached but left as it was (at a limit already) is not counted. + touched.retain(|id| d.node(*id) != before.node(*id)); Ok((touched.len(), !touched.is_empty())) })?; Ok(json!({ "count": count })) diff --git a/crates/engine/src/cmd/clipboard.rs b/crates/engine/src/cmd/clipboard.rs index 4e086569ae..a25dc857dd 100644 --- a/crates/engine/src/cmd/clipboard.rs +++ b/crates/engine/src/cmd/clipboard.rs @@ -100,6 +100,9 @@ pub struct Clipboard { /// The selected ruler guides copied with (or without) the objects (#3226), as canvas guides on /// no layer: pasting puts them on the layer new art goes to, moved as the objects are. pub guides: Vec, + /// The Symbol Set Density recorded at Copy for each copied symbol set, by its id in + /// [`Self::nodes`]: a pasted set packs from it. + pub set_densities: BTreeMap, } /// The layer an object was copied from, as Paste Remembers Layers finds it again: the top-level diff --git a/crates/engine/src/cmd/clipboard/resources.rs b/crates/engine/src/cmd/clipboard/resources.rs index f457712415..29c562d1dc 100644 --- a/crates/engine/src/cmd/clipboard/resources.rs +++ b/crates/engine/src/cmd/clipboard/resources.rs @@ -1071,6 +1071,7 @@ impl Clipboard { char_styles: pick(Res::CharStyle, &src.char_styles), para_styles: pick(Res::ParaStyle, &src.para_styles), brushes, + set_densities: src.set_densities_of(&nodes), nodes, ..Default::default() } diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index 00b6a338f2..09e6178b82 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -1454,6 +1454,8 @@ fn paste_clip(s: &mut Session, p: &Value, mode: PasteMode, clip: &Clipboard, cho for xf in placements { for (k, n) in clip.nodes.iter().enumerate() { let mut c = d.reid(n); + // A pasted symbol set packs from the density recorded for it at Copy. + d.carry_set_densities(n, &c, &clip.set_densities); imported.apply(&mut c); let sc = vectorcraft_doc::Scaling { patterns: mode == PasteMode::Drag, ..Default::default() }; if xf != Affine::IDENTITY { diff --git a/crates/engine/src/tests/symbolism_options.rs b/crates/engine/src/tests/symbolism_options.rs index 05b707f799..061fbe41c3 100644 --- a/crates/engine/src/tests/symbolism_options.rs +++ b/crates/engine/src/tests/symbolism_options.rs @@ -136,6 +136,48 @@ fn average_at_the_mean_adds_no_undo_step() { assert!(state(&s) == before); } +/// An instance the brush reaches but leaves as it is (the Symbol Screener with Alt on an opaque +/// instance, or without Alt on one at the lowest opacity it gives) is not counted, and a stroke +/// that changes no instance adds no undo step. +#[test] +fn an_instance_left_as_it_is_is_not_counted() { + let mut s = session(); + let (opaque, faint) = (dot(&mut s, 100.0, 150.0), dot(&mut s, 300.0, 150.0)); + s.execute("transparency.set", &json!({"ids": [faint.0], "opacity": 5})).unwrap(); + let before = state(&s); + let r = adjust(&mut s, json!({"tool": "screen", "points": [[100, 150]], "radius": 30, "intensity": 10, "alt": true})); + assert_eq!(r["count"], 0, "Alt on an opaque instance"); + let r = adjust(&mut s, json!({"tool": "screen", "points": [[300, 150]], "radius": 30, "intensity": 10})); + assert_eq!(r["count"], 0, "an instance at 5%"); + assert!(state(&s) == before, "a stroke that changes nothing changed the document or its history"); + // A stroke over both counts only the instance it changes. + let r = adjust(&mut s, json!({"tool": "screen", "points": [[200, 150]], "radius": 150, "intensity": 10})); + assert_eq!(r["count"], 1); + assert!(node(&s, opaque).opacity < 1.0 && node(&s, faint).opacity == 0.05); +} + +/// Average gives an opacity below 5% when that is the mean: the Symbol Sprayer's new instance and +/// the Symbol Screener's instances take the mean of the instances under the brush. +#[test] +fn average_keeps_a_mean_opacity_below_five_percent() { + let mut s = session(); + let set = NodeId(s.execute("symbol.spray", &json!({"name": "Dot", "points": [[200, 150]], "radius": 4})).unwrap()["id"].as_u64().unwrap()); + let first = members(&s, set)[0]; + s.execute("transparency.set", &json!({"ids": [first.0], "opacity": 2})).unwrap(); + s.select(|_, sel| sel.set([set])).unwrap(); + s.execute("symbol.spray", &json!({"name": "Dot", "points": [[215, 150]], "radius": 30})).unwrap(); + let sprayed = *members(&s, set).last().unwrap(); + assert!((node(&s, sprayed).opacity - 0.02).abs() < 1e-6, "{}", node(&s, sprayed).opacity); + // Two instances at 0% and 4%: Average brings both toward 2%, and neither goes past it. + let mut s = session(); + let (a, b) = (dot(&mut s, 200.0, 150.0), dot(&mut s, 220.0, 150.0)); + s.execute("transparency.set", &json!({"ids": [a.0], "opacity": 0})).unwrap(); + s.execute("transparency.set", &json!({"ids": [b.0], "opacity": 4})).unwrap(); + adjust(&mut s, json!({"tool": "screen", "points": [[210, 150]], "radius": 40, "intensity": 10, "method": "average"})); + let (pa, pb) = (node(&s, a).opacity, node(&s, b).opacity); + assert!(pa > 0.0 && pa <= 0.02 + 1e-6 && (0.02 - 1e-6..0.04).contains(&pb), "{pa} {pb}"); +} + /// Average evens out the Symbol Stainer's amount and the Symbol Scruncher's spacing. #[test] fn average_evens_out_the_stain_and_the_spacing() { @@ -508,6 +550,45 @@ fn set_density_starts_from_the_density_a_set_was_sprayed_at() { assert!((center(&s, a).x - (150.0 - 50.0 * 0.25 / 0.65)).abs() < 1e-9, "{:?}", center(&s, a)); } +/// A set duplicated packs from the density recorded for its source, and a pasted set from the +/// density its source had at Copy: after Cut, after the source is given another density, and in +/// another document. +#[test] +fn a_copied_set_packs_from_the_density_of_its_source() { + for copy in ["duplicate", "paste", "cut", "changed after copy", "other document"] { + let mut s = session(); + let row: Vec = (0..4).map(|i| json!([60.0 + 60.0 * f64::from(i), 150.0])).collect(); + let set = + NodeId(s.execute("symbol.spray", &json!({"name": "Dot", "points": row, "radius": 4, "density": 2})).unwrap()["id"].as_u64().unwrap()); + s.select(|_, sel| sel.set([set])).unwrap(); + let first = match copy { + "duplicate" => "edit.duplicate", + "cut" => "edit.cut", + _ => "edit.copy", + }; + s.execute(first, &json!({})).unwrap(); + if copy == "changed after copy" { + s.execute("symbol.setDensity", &json!({"from": 5, "to": 9, "ids": [set.0]})).unwrap(); + } + if copy == "other document" { + s.execute("file.new", &json!({"width": 400, "height": 300})).unwrap(); + } + if copy != "duplicate" { + s.execute("edit.paste", &json!({})).unwrap(); + } + let copied = s.doc().unwrap().selection.objects.clone(); + assert!(copied.len() == 1 && (copy == "other document" || copied[0] != set), "{copy}: {copied:?}"); + let ids = members(&s, copied[0]); + let xs = |s: &Session| ids.iter().map(|id| center(s, *id).x).collect::>(); + let was = xs(&s); + let middle = was.iter().sum::() / 4.0; + s.execute("symbol.setDensity", &json!({"from": 5, "to": 9, "ids": [copied[0].0]})).unwrap(); + for (before, after) in was.iter().zip(xs(&s)) { + assert!((after - (middle + (before - middle) * 0.25 / 0.95)).abs() < 1e-9, "{copy}: {before} -> {after}"); + } + } +} + /// A locked instance of the set stays where it is, and the others move. #[test] fn set_density_leaves_a_locked_instance_in_place() { diff --git a/crates/tools/src/symbolism.rs b/crates/tools/src/symbolism.rs index f01b1b7f0a..c2672e16c1 100644 --- a/crates/tools/src/symbolism.rs +++ b/crates/tools/src/symbolism.rs @@ -11,7 +11,9 @@ use serde_json::{Value, json}; use vectorcraft_geom::{Point, Shape}; use crate::draw2::{FEEDBACK, GestureTool, points_json}; -use crate::{Action, Cursor, MAX_STROKE_SAMPLES, Mods, Overlay, PointerEvent, PointerKind, Tool, ToolContext, ToolKey, previews_at}; +use crate::{ + Action, Cursor, MAX_STROKE_SAMPLES, Mods, Overlay, PREVIEW_ALL_UNTIL, PointerEvent, PointerKind, Tool, ToolContext, ToolKey, previews_at, +}; /// Create a symbolism tool or the brush-aware Paintbrush (None = not one of ours). pub fn create(id: &str) -> Option> { @@ -29,6 +31,10 @@ pub const METHODS: [&str; 3] = ["userDefined", "average", "random"]; /// The values of each Symbol Sprayer option in the Symbolism Tools Options. pub const SPRAY_MODES: [&str; 2] = ["average", "userDefined"]; +/// The smallest change of pen pressure, with Use Pressure Pen, that a drag sample within a step of +/// the last point gives that point. VectorCraft's own value. +const PRESSURE_STEP: f64 = 0.05; + /// The Symbol Sprayer options: (tool option, key in `symbol.spray`'s `attributes`). pub const SPRAY_ATTRIBUTES: [(&str, &str); 6] = [ ("sprayScrunch", "scrunch"), @@ -227,11 +233,27 @@ impl Tool for SymbolismTool { // Sprayer: thin the samples to a fraction of the brush; others: every few pixels. let step = if self.id == "symbolSprayer" { (self.diameter * 0.15).max(cx.tol(3.0)) } else { cx.tol(3.0) }; // Each preview carries every point so far: a long drag stops growing and previews less often. - if self.points.len() >= MAX_STROKE_SAMPLES || self.points.last().is_some_and(|(l, _)| l.distance(p) < step) { - return vec![]; - } - self.points.push(sample); - if !previews_at(self.points.len()) { + let full = self.points.len() >= MAX_STROKE_SAMPLES; + let near = self.points.last().is_some_and(|(l, _)| l.distance(p) < step); + let pressed = match self.points.last_mut().filter(|_| full || near) { + // With Use Pressure Pen, the last point takes a pressure change made within a step of it. + Some(last) if near && self.use_pressure && (sample.1 - last.1).abs() >= PRESSURE_STEP => { + last.1 = sample.1; + true + } + Some(_) => return vec![], + None => { + self.points.push(sample); + false + } + }; + // A pressure change adds no point: past the points that all preview, it waits for the + // next preview or the release, so a long stroke is not sent again for each change. + if !previews_at(self.points.len()) || (pressed && self.points.len() > PREVIEW_ALL_UNTIL) { + // A changed pressure on a point already shown leaves the preview out of date. + if pressed { + self.previewed = 0; + } return vec![]; } self.previewed = self.points.len(); @@ -546,6 +568,55 @@ mod tests { assert!(v["method"] == "random" && v.get("proportional").is_none(), "{v}"); } + /// With Use Pressure Pen, a pressure change within a step of the last point gives that point the + /// new pressure and previews it; a smaller change, or one without the option, adds nothing. + #[test] + fn a_pressure_change_in_place_is_kept() { + let (d, _) = doc_with_rect(); + let (s, p) = (Selection::default(), paint()); + let cx = cx(&d, &s, &p); + let at = |kind, x: f64, pressure: f32| PointerEvent { pressure, ..PointerEvent::new(kind, x, 5.0) }; + for use_pressure in [true, false] { + let mut t = SymbolismTool::new("symbolSizer"); + t.set_option("usePressure", &json!(use_pressure)); + t.pointer(&cx, &at(PointerKind::Down, 5.0, 0.0)); + let a = t.pointer(&cx, &at(PointerKind::Drag, 6.0, 0.8)); + if use_pressure { + let [Action::Preview(_, v)] = a.as_slice() else { panic!("{a:?}") }; + assert_eq!(v["points"], json!([[5.0, 5.0, f64::from(0.8f32)]])); + assert_eq!(t.pointer(&cx, &at(PointerKind::Drag, 6.5, 0.82)), vec![]); + } else { + assert_eq!(a, vec![]); + } + assert_eq!(t.pointer(&cx, &at(PointerKind::Up, 6.5, 0.0)), vec![Action::Commit]); + } + } + + /// Once a drag has its most points, a pressure change away from the last point leaves that + /// point's pressure as it was. + #[test] + fn a_pressure_change_away_from_the_last_point_of_a_full_drag_is_not_kept() { + let (d, _) = doc_with_rect(); + let (s, p) = (Selection::default(), paint()); + let cx = cx(&d, &s, &p); + let at = |kind, x: f64, pressure: f32| PointerEvent { pressure, ..PointerEvent::new(kind, x, 5.0) }; + let mut t = SymbolismTool::new("symbolSizer"); + t.set_option("usePressure", &json!(true)); + t.pointer(&cx, &at(PointerKind::Down, 0.0, 0.5)); + t.points = (0..MAX_STROKE_SAMPLES).map(|i| (Point::new(50.0 * i as f64, 5.0), 0.5)).collect(); + let far = 50.0 * (MAX_STROKE_SAMPLES + 10) as f64; + assert_eq!(t.pointer(&cx, &at(PointerKind::Drag, far, 1.0)), vec![]); + assert_eq!((t.points.len(), t.points.last().map(|(_, pressure)| *pressure)), (MAX_STROKE_SAMPLES, Some(0.5))); + // Within a step of the last point the change is kept, and the long stroke is not previewed + // again for it: the release sends it. + let last = 50.0 * (MAX_STROKE_SAMPLES - 1) as f64; + assert_eq!(t.pointer(&cx, &at(PointerKind::Drag, last + 1.0, 1.0)), vec![]); + assert_eq!(t.points.last().map(|(_, pressure)| *pressure), Some(1.0)); + let a = t.pointer(&cx, &at(PointerKind::Up, last + 1.0, 0.0)); + assert!(matches!(a.first(), Some(Action::Preview(_, v)) if v["points"].as_array().map(Vec::len) == Some(MAX_STROKE_SAMPLES)), "{}", a.len()); + assert_eq!(a.last(), Some(&Action::Commit)); + } + /// A drag begun with Shift sends `shift` with the Shifter, Sizer, Stainer and Styler, and only /// with them; one begun without it sends none. #[test] diff --git a/crates/ui-egui/src/dialogs/symbolism_options.rs b/crates/ui-egui/src/dialogs/symbolism_options.rs index 524b4e5c8c..c930e5de37 100644 --- a/crates/ui-egui/src/dialogs/symbolism_options.rs +++ b/crates/ui-egui/src/dialogs/symbolism_options.rs @@ -12,7 +12,7 @@ use serde_json::{Map, Value, json}; use vectorcraft_tools::settings::SYMBOLISM; -use super::{DialogResult, DialogSpec, form, run_and_close}; +use super::{DialogResult, DialogSpec, form, modal, run_and_close}; use crate::state::Dialog; use crate::{VectorcraftApp, widgets}; @@ -55,6 +55,13 @@ pub fn open(app: &mut VectorcraftApp, tool: &str) -> Value { } fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { + // The rows scroll when the window is shorter than they are, so the heading and the buttons + // stay in view. + modal::scrolled_rows(ui, "symbolism-options-rows", |ui| rows(app, ui, d)); + false +} + +fn rows(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) { let unit = app.session.general_unit(); // The tool whose options show below (the eight tools share one toolbar icon, so they are listed // by name). @@ -103,7 +110,6 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { } ui.add_space(10.0); form::check(ui, d, "showBrush", tl!("Show Brush Size and Intensity")); - false } /// The selected symbol sets. @@ -130,6 +136,7 @@ fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> DialogResult { #[cfg(test)] mod tests { use super::*; + use egui_kittest::kittest::Queryable; use vectorcraft_engine::Session; fn app() -> VectorcraftApp { @@ -142,6 +149,39 @@ mod tests { crate::tests_labels::painted_text(app, |app, ui| super::super::show(app, ui.ctx())) } + /// In a short window the rows scroll, and the heading, OK and Cancel stay on the screen. + #[test] + fn the_buttons_stay_in_view_in_a_short_window() { + let mut app = app(); + app.run("tool.options", json!({"tool": "symbolSprayer"})).unwrap(); + let mut fonts = false; + let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(900.0, 800.0)).build_ui_state( + move |ui, app: &mut VectorcraftApp| { + if !std::mem::replace(&mut fonts, true) { + crate::theme::install_fonts(ui.ctx()); + return; + } + super::super::show(app, ui.ctx()); + }, + app, + ); + h.run_steps(4); + for (physical, zoom) in [(egui::vec2(1366.0, 768.0), 1.5), (egui::vec2(1280.0, 720.0), 1.5), (egui::vec2(800.0, 600.0), 1.0)] { + h.ctx.set_zoom_factor(zoom); + for _ in 0..12 { + h.set_size(physical / zoom); + h.run_steps(1); + } + let screen = h.ctx.content_rect(); + let heading = h.get_by_role_and_label(egui::accesskit::Role::Label, "Symbolism Tools Options").rect(); + assert!(screen.contains_rect(heading), "{physical:?} at {zoom}: the heading {heading:?} in {screen:?}"); + for label in ["OK", "Cancel"] { + let rect = h.get_by_label(label).rect(); + assert!(screen.contains_rect(rect), "{physical:?} at {zoom}: {label} {rect:?} in {screen:?}"); + } + } + } + #[test] fn the_symbolism_tools_share_the_options_ok_sets() { let mut app = app(); diff --git a/docs/mcp.md b/docs/mcp.md index 991140e3b9..1056f256c4 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3324,7 +3324,8 @@ already walks Image Trace. Short agent entry points: style. `attributes` left out means `average` for all six. - `symbol.setDensity` moves each instance of a set along the line from the middle of the set's instances, to (1.15 − 0.1·`to`) / (1.15 − 0.1·`from`) of its distance from it (each factor at least 0.1), as one undo step, and - adds none when no instance moves. `from` is the density each set was created at or last given, and the + adds none when no instance moves. `from` is the density each set was created at or last given (a set + duplicated has its source's, and a pasted set the one its source had at Copy), and the `from` passed applies only to a set without one (a group named "Symbol Set" by hand); the sets moved then have density `to`. A locked or hidden instance stays where it is. It returns `{ids, count}`: the sets changed and the instances moved. From c883b808cce7ed2b601a2530b807da0c3a6f5e5a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 09:17:13 -0800 Subject: [PATCH 06/55] Symbolism: a bad pen pressure is refused on a point without coordinates symbol.adjust and symbol.spray skip a point whose x or y is not a number, and the pressure check came after that skip, so a stroke with a point such as [null, 0, "bad"] beside a valid one was applied. The pressure is now checked first, and the command fails with the bad-pressure error and leaves the document as it was. --- crates/engine/src/cmd/brushsym/symbols.rs | 3 ++- crates/engine/src/tests/symbolism_options.rs | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/brushsym/symbols.rs b/crates/engine/src/cmd/brushsym/symbols.rs index 2319e02810..7f727e3147 100644 --- a/crates/engine/src/cmd/brushsym/symbols.rs +++ b/crates/engine/src/cmd/brushsym/symbols.rs @@ -854,11 +854,12 @@ fn samples(p: &Value, cmd: &str) -> Result> { let a = p.get("points").and_then(Value::as_array).ok_or_else(|| bad(cmd, "missing points [[x,y]…]"))?; let mut v = Vec::with_capacity(a.len()); for q in a { - let (Some(x), Some(y)) = (q.get(0).and_then(Value::as_f64), q.get(1).and_then(Value::as_f64)) else { continue }; + // The pressure is checked first: a point skipped for its coordinates still has a bad one refused. let pressure = match q.get(2) { None | Some(Value::Null) => 1.0, Some(f) => f.as_f64().filter(|f| f.is_finite()).ok_or_else(|| bad(cmd, format!("a point's pressure must be a number, not {f}")))?, }; + let (Some(x), Some(y)) = (q.get(0).and_then(Value::as_f64), q.get(1).and_then(Value::as_f64)) else { continue }; v.push((Point::new(x, y), pressure.clamp(0.0, 1.0))); } if v.is_empty() || v.iter().any(|(q, _)| !q.x.is_finite() || !q.y.is_finite()) { diff --git a/crates/engine/src/tests/symbolism_options.rs b/crates/engine/src/tests/symbolism_options.rs index 061fbe41c3..62d4188e3d 100644 --- a/crates/engine/src/tests/symbolism_options.rs +++ b/crates/engine/src/tests/symbolism_options.rs @@ -296,6 +296,13 @@ fn pen_pressure_is_the_intensity_with_use_pressure() { json!({"tool": tool, "points": [[200, 150, "hard"]], "usePressure": true}), "a point's pressure must be a number, not \"hard\"", ); + // Also on a point without coordinates, beside one that has them. + refused( + &mut s, + "symbol.adjust", + json!({"tool": tool, "points": [[200, 150], [null, 0, "bad"]], "usePressure": true}), + "a point's pressure must be a number, not \"bad\"", + ); } for key in ["usePressure", "proportional", "affectsDensity"] { let mut p = json!({"tool": "size", "points": [[200, 150]]}); From b782cfbd9e03b490b32e01385cbd6b37a5673564 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 10:31:46 -0800 Subject: [PATCH 07/55] Symbolism: the Symbol Styler applies the style picked in Graphic Styles A click that puts a style into the Graphic Styles panel's selection now sets it as the Symbol Styler's style, and the Styler keeps it when another tool is active. A style name the document has no style for (one picked in another document, renamed or deleted) moves instances toward the document's first style after the default one, as no name does, instead of toward the current fill. --- crates/engine/src/cmd/brushsym.rs | 2 +- crates/engine/src/cmd/brushsym/symbols.rs | 14 ++++++----- crates/engine/src/tests/symbolism_shift.rs | 20 +++++++++++++++ crates/tools/src/settings.rs | 2 ++ crates/ui-egui/src/panels/graphic_styles.rs | 27 +++++++++++++++------ docs/mcp.md | 4 ++- docs/target-app-parity.md | 2 +- 7 files changed, 54 insertions(+), 17 deletions(-) diff --git a/crates/engine/src/cmd/brushsym.rs b/crates/engine/src/cmd/brushsym.rs index a9fabb5446..abe9cca786 100644 --- a/crates/engine/src/cmd/brushsym.rs +++ b/crates/engine/src/cmd/brushsym.rs @@ -368,7 +368,7 @@ pub fn specs() -> Vec { "Symbolism Tool", [], None, - "{tool: shift|scrunch|size|spin|stain|screen|style, points: [[x,y,pressure?]…] (pen pressure 0..1, default 1), radius?: 40, intensity?: 1..10 (5), usePressure?: bool (each point's pressure is the intensity there, in place of `intensity`), method?: userDefined|average|random (userDefined; not used by shift), proportional?: bool (size; true), affectsDensity?: bool (size; false), alt?: bool, shift?: bool (shift, size, stain and style; false), color? (#rrggbbaa and #rgba are refused), keepModel?: bool (as paint.setFill), style?: name} adjust instances near the points (selection, else all) → {count}. `method` userDefined changes each instance by the tool's amount at its distance from the point; random gives each instance its own share of that amount for the whole stroke, from none to twice it (spin: a turn either way); average moves each instance's value toward the mean of the instances within `radius` of the point (scrunch: its distance from their middle toward their mean distance; size: the geometric mean of their sizes; spin: their mean direction; stain and style: their mean amount; screen: their mean opacity), and `alt` does not reverse it. With `proportional` false a drag resizes along its own direction (a level drag the width, an upright one the height; the first point takes the direction to the second) and one point resizes both; average resizes both whatever `proportional` is. With `affectsDensity` an instance also moves away from the point as it grows and toward it as it shrinks. `shift` is the tool's Shift form: shift brings the instances within `radius` of any point one place forward among their siblings (with `alt`, one place backward), once for the stroke, and does not move them; size keeps the instances where they are, `affectsDensity` included; stain and style keep each instance's amount and move its paint toward `color` or the style (stain by the tool's amount at its distance from the point, style by the brush's strength there), whatever `method` is, and leave an instance without a stain or style as it is, and `alt` has no effect. No undo step is added when no instance changes (none under the brush, average with each already at the mean, or shift with nothing to move or change). A `method` that is none of the three, or a pressure that isn't a number, is an error", + "{tool: shift|scrunch|size|spin|stain|screen|style, points: [[x,y,pressure?]…] (pen pressure 0..1, default 1), radius?: 40, intensity?: 1..10 (5), usePressure?: bool (each point's pressure is the intensity there, in place of `intensity`), method?: userDefined|average|random (userDefined; not used by shift), proportional?: bool (size; true), affectsDensity?: bool (size; false), alt?: bool, shift?: bool (shift, size, stain and style; false), color? (#rrggbbaa and #rgba are refused), keepModel?: bool (as paint.setFill), style?: name (a graphic style's; left out, or naming no style in the document, the first style after the default one)} adjust instances near the points (selection, else all) → {count}. `method` userDefined changes each instance by the tool's amount at its distance from the point; random gives each instance its own share of that amount for the whole stroke, from none to twice it (spin: a turn either way); average moves each instance's value toward the mean of the instances within `radius` of the point (scrunch: its distance from their middle toward their mean distance; size: the geometric mean of their sizes; spin: their mean direction; stain and style: their mean amount; screen: their mean opacity), and `alt` does not reverse it. With `proportional` false a drag resizes along its own direction (a level drag the width, an upright one the height; the first point takes the direction to the second) and one point resizes both; average resizes both whatever `proportional` is. With `affectsDensity` an instance also moves away from the point as it grows and toward it as it shrinks. `shift` is the tool's Shift form: shift brings the instances within `radius` of any point one place forward among their siblings (with `alt`, one place backward), once for the stroke, and does not move them; size keeps the instances where they are, `affectsDensity` included; stain and style keep each instance's amount and move its paint toward `color` or the style (stain by the tool's amount at its distance from the point, style by the brush's strength there), whatever `method` is, and leave an instance without a stain or style as it is, and `alt` has no effect. No undo step is added when no instance changes (none under the brush, average with each already at the mean, or shift with nothing to move or change). A `method` that is none of the three, or a pressure that isn't a number, is an error", has_doc, symbol_adjust ), diff --git a/crates/engine/src/cmd/brushsym/symbols.rs b/crates/engine/src/cmd/brushsym/symbols.rs index 7f727e3147..50212848a6 100644 --- a/crates/engine/src/cmd/brushsym/symbols.rs +++ b/crates/engine/src/cmd/brushsym/symbols.rs @@ -868,13 +868,15 @@ fn samples(p: &Value, cmd: &str) -> Result> { Ok(v) } -/// The fill of the graphic style `p` names with `style`, else of the document's first style after -/// the default one. +/// The fill of the graphic style `p` names with `style`, else (no name, or one the document has no +/// style for, such as the Symbol Styler's style from another document) of the document's first +/// style after the default one. fn style_paint(d: &Document, p: &Value) -> Option { - match str_param(p, "style") { - Some(n) => d.graphic_styles.iter().find(|g| g.name == n).map(|g| g.appearance.fill_paint()), - None => d.graphic_styles.get(1).or(d.graphic_styles.first()).map(|g| g.appearance.fill_paint()), - } + str_param(p, "style") + .and_then(|n| d.graphic_styles.iter().find(|g| g.name == n)) + .or(d.graphic_styles.get(1)) + .or(d.graphic_styles.first()) + .map(|g| g.appearance.fill_paint()) } /// Deterministic per-point jitter in [-1, 1]² (so previews re-applied on the snapshot agree). diff --git a/crates/engine/src/tests/symbolism_shift.rs b/crates/engine/src/tests/symbolism_shift.rs index 391c267844..aa081e4386 100644 --- a/crates/engine/src/tests/symbolism_shift.rs +++ b/crates/engine/src/tests/symbolism_shift.rs @@ -205,6 +205,26 @@ fn shift_with_the_styler_keeps_the_amount_and_changes_the_style() { assert!(blue[2] > 0.99 && blue[0] < 0.01, "{blue:?}"); } +/// A style name the document has no style for (the Styler's style from another document, or one +/// since renamed or deleted) moves the fill toward the same style as no name. +#[test] +fn the_styler_takes_the_first_style_for_a_name_the_document_lacks() { + let styled = |style: Option<&str>| { + let mut s = session(); + let a = dot(&mut s, 100.0, 150.0); + s.execute("paint.setFill", &json!({"color": "#00ff00"})).unwrap(); + s.select(|_, sel| sel.clear()).unwrap(); + adjust(&mut s, json!({"tool": "stain", "points": [[100, 150]], "radius": 5, "intensity": 10, "color": "#ff0000"})); + let mut p = json!({"tool": "style", "points": [[100, 150]], "radius": 5, "intensity": 10, "shift": true}); + if let Some(n) = style { + p["style"] = json!(n); + } + adjust(&mut s, p); + fill(&s, a).unwrap() + }; + assert_eq!(styled(Some("No Such Style")), styled(None)); +} + /// A `shift` that is not true, false or null is refused and changes nothing. #[test] fn a_bad_shift_is_refused() { diff --git a/crates/tools/src/settings.rs b/crates/tools/src/settings.rs index 3132c640a4..ce633bbf84 100644 --- a/crates/tools/src/settings.rs +++ b/crates/tools/src/settings.rs @@ -44,6 +44,8 @@ const ROWS: &[Row] = &[ "affectsDensity", ], ), + // The graphic style the Symbol Styler applies, set from the Graphic Styles panel. + (&["symbolStyler"], None, &["style"]), (&["mirrorCut"], None, &["axis", "keep"]), (&["puppetWarp"], None, &["showMesh", "expand"]), (&["arc"], None, &["closed", "lengthX", "lengthY", "reference", "baseAlong", "slope", "fillArc"]), diff --git a/crates/ui-egui/src/panels/graphic_styles.rs b/crates/ui-egui/src/panels/graphic_styles.rs index d7b622ba77..f643630ee4 100644 --- a/crates/ui-egui/src/panels/graphic_styles.rs +++ b/crates/ui-egui/src/panels/graphic_styles.rs @@ -1,12 +1,13 @@ //! Graphic Styles panel: the document's styles as rendered thumbnails (Thumbnail View) or rows //! (Small and Large List View), shown on a square or on type. Clicking a style applies it to the //! selection (Alt-click adds it on top); Shift-click adds to the panel's selection every style from -//! the last one clicked without Shift through this one; Cmd/Ctrl-click adds or removes one; -//! double-click opens Graphic Style Options. Dragging a style moves it in the list, or applies it -//! to the art it is dropped on (`canvas::panel_drop`); art dragged off the canvas or the Appearance -//! panel's thumbnail dropped on the panel becomes a new style. Holding the right button on a style -//! shows it large, on the selected object when there is one. The Control bar's Style picker lists -//! the same tiles ([`picker`]). Graphic style libraries open in library panels +//! the last one clicked without Shift through this one; Cmd/Ctrl-click adds or removes one. The +//! style last clicked into the selection is the one the Symbol Styler applies. Double-click opens +//! Graphic Style Options. Dragging a style moves it in the list, or applies it to the art it is +//! dropped on (`canvas::panel_drop`); art dragged off the canvas or the Appearance panel's +//! thumbnail dropped on the panel becomes a new style. Holding the right button on a style shows +//! it large, on the selected object when there is one. The Control bar's Style picker lists the +//! same tiles ([`picker`]). Graphic style libraries open in library panels //! ([`GraphicStyleLibraries`]). use std::cell::RefCell; @@ -434,6 +435,10 @@ fn act(app: &mut VectorcraftApp, ui: &Ui, s: &Shown, ev: Events, picker: bool) { Some(Click::Pick(name, m)) => { let order: Vec<&str> = s.d.graphic_styles.iter().map(|g| g.name.as_str()).collect(); let sel = super::swatches::click_selection(ui, "gs-anchor", selected(ui.ctx(), s.d), &order, &name, m); + // The style clicked into the selection is the one the Symbol Styler applies. + if sel.contains(&name) { + app.run("tool.setOption", json!({"tool": "symbolStyler", "values": {"style": name}})).ok(); + } set_pstate(ui.ctx(), "gs-sel", sel); // A plain click also applies the style (with nothing selected the next object drawn // takes it); Shift and Cmd/Ctrl clicks only select. @@ -1016,15 +1021,21 @@ mod tests { selected(&ctx, &app.session.active().unwrap().doc.clone()) }; let linked = |app: &VectorcraftApp| app.session.selection_graphic_style().map(|(g, _)| g.name.clone()); - // A plain click applies the style and selects it alone. + let styler = |app: &VectorcraftApp| app.session.tool_options_of("symbolStyler")["style"].as_str().map(str::to_string); + // A plain click applies the style and selects it alone; the Symbol Styler takes it. assert_eq!(click(&mut app, 0, egui::Modifiers::NONE), [n[0].clone()]); assert_eq!(linked(&app).as_ref(), Some(&n[0])); + assert_eq!(styler(&app).as_ref(), Some(&n[0])); // Shift-click selects from that style to the clicked one, and applies nothing. assert_eq!(click(&mut app, 3, egui::Modifiers::SHIFT), n[..4]); assert_eq!(linked(&app).as_ref(), Some(&n[0])); - // Cmd/Ctrl-click removes a selected style and adds it back. + assert_eq!(styler(&app).as_ref(), Some(&n[3])); + // Cmd/Ctrl-click removes a selected style and adds it back; the Styler keeps its style + // while one is removed. assert_eq!(click(&mut app, 2, egui::Modifiers::COMMAND), [n[0].clone(), n[1].clone(), n[3].clone()]); + assert_eq!(styler(&app).as_ref(), Some(&n[3])); assert_eq!(click(&mut app, 2, egui::Modifiers::COMMAND), [n[0].clone(), n[1].clone(), n[3].clone(), n[2].clone()]); + assert_eq!(styler(&app).as_ref(), Some(&n[2])); // Shift-click extends from the style Cmd/Ctrl-clicked last. click(&mut app, 0, egui::Modifiers::NONE); click(&mut app, 2, egui::Modifiers::COMMAND); diff --git a/docs/mcp.md b/docs/mcp.md index 1c0fb16e96..e6ab6e472a 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3304,7 +3304,9 @@ already walks Image Trace. Short agent entry points: [the archived manual](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=118)): `symbol.adjust` takes `method` (`userDefined`, `average` or `random`; not used by `shift`), `usePressure` with `points` as `[x, y, pressure]` (each point's pen pressure, 0..1, is the intensity there), and for `size` - `proportional` (true) and `affectsDensity` (false). `symbol.spray` takes `attributes` + `proportional` (true) and `affectsDensity` (false). With `tool: style`, a `style` name the document has no graphic style + for counts as none (the document's first style after the default one). The Symbol Styler sends the style last + clicked into the Graphic Styles panel's selection. `symbol.spray` takes `attributes` `{scrunch?, size?, spin?, screen?, stain?, style?}`, each `average` or `userDefined`, with `color`, `keepModel` and `style` for the User Defined stain and style. `symbol.setDensity {from, to, ids?|id?}` gives the selected symbol sets a new Symbol Set Density. VectorCraft's own rules: diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 7d7b15000b..2608039e24 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1023,7 +1023,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Expand of symbol instances:** Object › Expand turns selected symbol instances (without effects, not in perspective, in groups or placed documents too) into their art as Break Link to Symbol places it, one level deep, as one undo step; the Expand dialog's Fill and Stroke reach that art (`object.expand`, `crates/engine/src/tests/expand_symbols.rs`; estimated, score unchanged). - **Reset Transformation** ([Transform symbols](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/transform-symbols.html), [Symbols panel options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbols-panel-options.html)): the Symbols panel menu's Reset Transformation and the Control bar's Reset, shown while symbol instances are selected, give the selected instances their symbol's own scale again, without rotation or shear, as one undo step (`symbol.instance.resetTransform`); an instance in perspective is left as it is. VectorCraft's own rules: each instance keeps the center of its bounding box in place, reflection is removed too, and the menu item and the button are enabled only while a selected instance would change. Tests: `tests::brushsym::reset_transformation_restores_the_symbols_scale_and_keeps_the_center`, `reset_transformation_keeps_the_center_of_art_away_from_the_origin`, `reset_transformation_ignores_a_stored_size_that_is_not_positive`, `reset_transformation_leaves_unchanged_instances_and_refuses_bad_ids`, `panels::symbols::tests::reset_transformation_is_enabled_for_a_transformed_instance_and_resets_it`. - **Symbolism Tools Options** ([Symbolism tool options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbolism-tool-options.html), [the archived manual](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=118)): the dialog a double-click on a symbolism tool opens has, besides Diameter, Intensity and Symbol Set Density, Use Pressure Pen (a pen's pressure is the intensity), Method (User Defined, Average or Random) for the Scruncher, Sizer, Spinner, Stainer, Screener and Styler, Show Brush Size and Intensity, the Symbol Sprayer's Scrunch, Size, Spin, Screen, Stain and Style (each Average or User Defined), and the Symbol Sizer's Proportional Resizing and Resizing Affects Density; a new Symbol Set Density spaces the instances of the selected symbol sets (`symbol.setDensity`). VectorCraft's own rules: a Tool row lists the eight tools by name and shows the chosen one's options; Random gives each instance its own share of the change for the whole stroke; Average moves each value toward the mean of the instances under the brush; the starting values are Method User Defined, the Sprayer's six options Average, Proportional Resizing on and Resizing Affects Density off, so only a Sprayer stroke over instances of the selected set changes from before (its new instances take their mean values); the brush shows the intensity as a dashed ring. The Symbol Sprayer does not use Intensity or pen pressure. Tests: `crates/engine/src/tests/symbolism_options.rs`, `symbolism::tests` in `crates/tools`, `dialogs::symbolism_options::tests`. - - **Symbolism tools with Shift** ([the manual](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=199), [the CS6 reference](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=136)): a Shift-click with the Symbol Shifter brings the instances under the brush forward in the stacking order and Alt+Shift-click sends them backward; the Symbol Sizer with Shift keeps the set's density while it resizes; the Symbol Stainer and the Symbol Styler with Shift keep the amount of stain or style and move the color or style toward the current fill or the selected style (`symbol.adjust {shift}`). VectorCraft's own rules: the Shifter moves each instance one place among its siblings, once per stroke, without moving it on the canvas; the Sizer keeps each instance's center, even with Resizing Affects Density; an instance without a stain or style is left as it is, and Alt has no effect on the Stainer or the Styler with Shift. Tests: `crates/engine/src/tests/symbolism_shift.rs`, `symbolism::tests::shift_reaches_the_tools_that_have_a_shift_form`. + - **Symbolism tools with Shift** ([the manual](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=199), [the CS6 reference](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=136)): a Shift-click with the Symbol Shifter brings the instances under the brush forward in the stacking order and Alt+Shift-click sends them backward; the Symbol Sizer with Shift keeps the set's density while it resizes; the Symbol Stainer and the Symbol Styler with Shift keep the amount of stain or style and move the color or style toward the current fill or the selected style (`symbol.adjust {shift}`). VectorCraft's own rules: the Shifter moves each instance one place among its siblings, once per stroke, without moving it on the canvas; the Sizer keeps each instance's center, even with Resizing Affects Density; an instance without a stain or style is left as it is, and Alt has no effect on the Stainer or the Styler with Shift. The selected style is the one last clicked into the Graphic Styles panel's selection. Tests: `crates/engine/src/tests/symbolism_shift.rs`, `symbolism::tests::shift_reaches_the_tools_that_have_a_shift_form`, `panels::graphic_styles::tests::shift_click_selects_a_range_and_cmd_click_adds_or_removes_one_style`. - **Expand of dimensions:** Object › Expand, Expand Appearance, Create Outlines and Outline Stroke turn a dimension whose art they change into a plain group of that art, which stays as it is through later moves, scales and edits of what it measured; undo gives the live dimension back (`crates/engine/tests/it/dimensions.rs`; VectorCraft's own rule; estimated, score unchanged). - **Brush libraries** ([public source](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/create-new-brush-libraries.html), [import](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/import-brushes-from-brush-libraries-or-other-files.html), [Brushes panel](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/brushes-panel-overview.html)): Window › Brush Libraries, the Brushes panel's Brush Libraries Menu and its menu's Open Brush Library open each library in a library panel of its own, as swatch, graphic style and symbol libraries do. The built-in libraries (Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media, Tech Circuit) are original brushes generated in code (`crates/engine/src/cmd/brushlib.rs`); Striped Ribbon's art is filled with the library's own pattern and Sparkles scatters the library's own symbol; Ink and Wash adds ink and wash brushes (the [help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html) lists an Ink brush library of strokes with varied thickness and texture; the names, shapes and opacities are VectorCraft's own): Tapered Ink, an art brush broad near its start that thins to a fine tip; Brush Pen, a calligraphic brush whose size follows the pen pressure; and Soft Wash and Pooling Wash, art brushes of translucent gray layers that take the stroke color as tints; Game Trails adds motion art brushes (Speed Line, Dash Trail, Burst Ray, Zigzag); Energy Beams adds laser and plasma art brushes (Laser Bolt, Plasma Arc, Charge Wave, Spark Trail); Dry Media adds grainy art brushes (Chalk Grain, Graphite Pencil, Wax Crayon, Charcoal Dust). A click on a brush adds it to the document's Brushes as one undo step with every resource its art uses (patterns, symbols, swatches, graphic styles, images), makes it the current brush and, with paths selected, applies it to them in the same step; a brush the document already has is not added again and a different brush of the same name comes in numbered ("Wave 2"). Shift/Cmd-clicks select brushes for Add to Brushes; a brush dragged onto a path is added and applied to it, and one dragged onto the Brushes panel is added. Save Brushes… / the Brushes panel's Save Brush Library… write the document's brushes (or the selected ones) as a `.vectorcraft` library into the `Brushes` folder next to the preferences, listed under User Defined, or to a file; Other Library… reads the brushes of any document VectorCraft opens. Thumbnails, in the library panels, the Brushes panel and Brush Options, render brush art with the patterns and symbols it uses. Copying brushed art now carries the patterns and symbols its brush's art uses too. Tests: `crates/engine/src/tests/brushlib.rs`, `crates/ui-egui/src/panels/tests_brush_libraries.rs`, `panels::brushes::tests::library_brush_previews_show_the_patterns_their_art_uses`, `canvas::tests::a_library_brush_dropped_on_a_path_is_added_and_applied_in_one_step`. - **Bristle Brushes library** ([What's new](https://helpx.adobe.com/illustrator/desktop/new-features/whats-new.html), [About brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html)): Window › Brush Libraries › Bristle Brushes holds ten bristle brushes, one for each tip shape (Fine Liner, Pointed Flat, Stubby Round, Dry Scrub, Soft Dome, Filbert, Angled Round, Angled Flat, Fan Blender, Grass Fan). The brushes, their names and their values are VectorCraft's own, and every value lies inside the range the bristle brush keeps (`brush.libraries`, `brush.addFromLibrary`; `the_bristle_brushes_library_covers_every_tip_shape_within_the_bristle_ranges`). From 8ed0bd80a75b9fe23663ad72acf46f541bc40665 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 11:24:09 -0800 Subject: [PATCH 08/55] Symbolism: tool.setOption refuses bad Symbolism Tools Options values A `method` or Symbol Sprayer option that is not one of its names, a `diameter`, `intensity` or `density` that is not a number, a switch that is not true or false, and a `symbol` or `style` that is neither a name nor null are errors, and none of the values is set. The Symbolism Tools Options dialog checks the same values before it changes the selected sets' density. --- crates/engine/src/tests/symbolism_options.rs | 21 +++++++++++++ crates/engine/src/tooling.rs | 1 + crates/tools/src/symbolism.rs | 31 +++++++++++++++++++ .../ui-egui/src/dialogs/symbolism_options.rs | 10 ++++++ docs/mcp.md | 5 ++- 5 files changed, 67 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/tests/symbolism_options.rs b/crates/engine/src/tests/symbolism_options.rs index 62d4188e3d..44d1427fb9 100644 --- a/crates/engine/src/tests/symbolism_options.rs +++ b/crates/engine/src/tests/symbolism_options.rs @@ -259,6 +259,27 @@ fn an_unknown_method_is_refused() { assert_eq!(center(&s, a), Point::new(200.0, 150.0)); } +/// `tool.setOption` refuses a Symbolism Tools Options value of the wrong kind or name, and the +/// tool's options stay as they were. +#[test] +fn tool_set_option_refuses_bad_symbolism_options() { + let mut s = session(); + let before = s.tool_options_of("symbolSizer"); + for (key, bad, want) in [ + ("method", json!("smooth"), "`method` must be userDefined, average or random, not \"smooth\""), + ("sprayStain", json!("random"), "`sprayStain` must be average or userDefined, not \"random\""), + ("usePressure", json!("yes"), "`usePressure` must be true or false"), + ("diameter", json!("big"), "`diameter` must be a number"), + ("style", json!(3), "`style` must be a name or null"), + ] { + let r = s.set_tool_option_cmd(&json!({"tool": "symbolSizer", "values": {key: bad}})); + assert_eq!(r, Err(want.to_string()), "{key}"); + assert_eq!(s.tool_options_of("symbolSizer"), before, "{key}"); + } + let r = s.set_tool_option_cmd(&json!({"tool": "symbolSizer", "values": {"method": "random", "sprayStain": "userDefined"}})).unwrap(); + assert_eq!((r["method"].as_str(), r["sprayStain"].as_str()), (Some("random"), Some("userDefined"))); +} + /// With `usePressure` each point's pen pressure is the intensity there; without it the pressure is /// not used. A pressure that isn't a number is an error. #[test] diff --git a/crates/engine/src/tooling.rs b/crates/engine/src/tooling.rs index 66ed0a41e3..dd4acc83a5 100644 --- a/crates/engine/src/tooling.rs +++ b/crates/engine/src/tooling.rs @@ -1338,6 +1338,7 @@ impl Session { } // Every value is checked before any is set, so an invalid one changes nothing. vectorcraft_tools::builder::check_builder_options(tool.unwrap_or(self.tool.id()), &values)?; + vectorcraft_tools::symbolism::check_options(tool.unwrap_or(self.tool.id()), &values)?; // The Place queue is read later, by a click outside any automation scope: its files must // be readable now, under the roots of whoever sets it. if let Some(entries) = values.get("queue").and_then(|q| q.get("entries")).and_then(Value::as_array) { diff --git a/crates/tools/src/symbolism.rs b/crates/tools/src/symbolism.rs index c2672e16c1..845052ce43 100644 --- a/crates/tools/src/symbolism.rs +++ b/crates/tools/src/symbolism.rs @@ -86,6 +86,37 @@ fn one_of(v: &Value, allowed: &[&'static str]) -> Option<&'static str> { allowed.iter().copied().find(|a| *a == s) } +/// Check the Symbolism Tools Options `values` that `tool.setOption` sets on symbolism tool `tool`: +/// a value of the wrong kind, or a `method` or Symbol Sprayer option that is not one of its names, +/// is an error (stored preferences are not checked: an unknown value there keeps the default). +/// Other tools' options pass. +pub fn check_options(tool: &str, values: &serde_json::Map) -> Result<(), String> { + if !crate::settings::SYMBOLISM.contains(&tool) { + return Ok(()); + } + let names = |allowed: &[&str]| match allowed { + [a, b] => format!("{a} or {b}"), + [rest @ .., last] => format!("{} or {last}", rest.join(", ")), + [] => String::new(), + }; + for (key, v) in values { + let error = match key.as_str() { + "diameter" | "intensity" | "density" => (!v.as_f64().is_some_and(f64::is_finite)).then(|| format!("`{key}` must be a number")), + "usePressure" | "showBrush" | "proportional" | "affectsDensity" => (!v.is_boolean()).then(|| format!("`{key}` must be true or false")), + "symbol" | "style" => (!(v.is_string() || v.is_null())).then(|| format!("`{key}` must be a name or null")), + "method" => one_of(v, &METHODS).is_none().then(|| format!("`method` must be {}, not {v}", names(&METHODS))), + _ if SPRAY_ATTRIBUTES.iter().any(|(k, _)| k == key) => { + one_of(v, &SPRAY_MODES).is_none().then(|| format!("`{key}` must be {}, not {v}", names(&SPRAY_MODES))) + } + _ => None, + }; + if let Some(e) = error { + return Err(e); + } + } + Ok(()) +} + impl SymbolismTool { pub fn new(id: &str) -> Self { let id: &'static str = match id { diff --git a/crates/ui-egui/src/dialogs/symbolism_options.rs b/crates/ui-egui/src/dialogs/symbolism_options.rs index c930e5de37..c0878996f3 100644 --- a/crates/ui-egui/src/dialogs/symbolism_options.rs +++ b/crates/ui-egui/src/dialogs/symbolism_options.rs @@ -125,6 +125,8 @@ fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> DialogResult { NUMBERS.iter().filter(|k| d.fields.contains_key(**k)).map(|k| (k.to_string(), json!(d.f64(k, 0.0)))).collect(); values.extend(SWITCHES.iter().filter(|k| d.fields.contains_key(**k)).map(|k| (k.to_string(), json!(d.bool(k))))); values.extend(SPRAY.iter().chain(&["method"]).filter(|k| d.fields.contains_key(**k)).map(|k| (k.to_string(), json!(d.str(k))))); + // A value `tool.setOption` refuses changes no density either. + vectorcraft_tools::symbolism::check_options(&d.str("tool"), &values)?; let (from, to) = (d.f64(DENSITY_WAS, 0.0).clamp(1.0, 10.0), d.f64("density", 0.0).clamp(1.0, 10.0)); let sets = selected_sets(app); if d.fields.contains_key(DENSITY_WAS) && from != to && !sets.is_empty() { @@ -281,6 +283,14 @@ mod tests { app.run("tool.options", json!({"tool": "symbolSprayer"})).unwrap(); super::super::confirm(&mut app).unwrap(); assert_eq!((width(&app), undo(&app)), (was, steps)); + // An option that `tool.setOption` refuses changes neither the density nor the set. + app.run("tool.options", json!({"tool": "symbolSprayer"})).unwrap(); + let fields = &mut app.ui.dialog.as_mut().unwrap().fields; + fields.insert("density".into(), json!(9)); + fields.insert("method".into(), json!("smooth")); + assert!(super::super::confirm(&mut app).is_err()); + assert_eq!((width(&app), undo(&app)), (was, steps)); + assert_eq!(app.session.tool_options_of("symbolSizer")["density"].as_f64(), Some(5.0)); // A higher density packs the set closer, as one undo step. app.run("tool.options", json!({"tool": "symbolSprayer"})).unwrap(); app.ui.dialog.as_mut().unwrap().fields.insert("density".into(), json!(9)); diff --git a/docs/mcp.md b/docs/mcp.md index e6ab6e472a..d866bc8a31 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3306,7 +3306,10 @@ already walks Image Trace. Short agent entry points: `points` as `[x, y, pressure]` (each point's pen pressure, 0..1, is the intensity there), and for `size` `proportional` (true) and `affectsDensity` (false). With `tool: style`, a `style` name the document has no graphic style for counts as none (the document's first style after the default one). The Symbol Styler sends the style last - clicked into the Graphic Styles panel's selection. `symbol.spray` takes `attributes` + clicked into the Graphic Styles panel's selection. `tool.setOption` on a symbolism tool refuses a `method` or + Symbol Sprayer option that is not one of its names, a non-number `diameter`, `intensity` or `density`, a + non-boolean switch, and a `symbol` or `style` that is neither a name nor null, and sets none of the values. + `symbol.spray` takes `attributes` `{scrunch?, size?, spin?, screen?, stain?, style?}`, each `average` or `userDefined`, with `color`, `keepModel` and `style` for the User Defined stain and style. `symbol.setDensity {from, to, ids?|id?}` gives the selected symbol sets a new Symbol Set Density. VectorCraft's own rules: From 11942b04d61219becad8896ae0450d8c059bd046 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 21:36:36 -0800 Subject: [PATCH 09/55] Symbolism: Shift recolors a pattern stain, and the options dialog refuses bad values With Shift, the Symbol Stainer and the Symbol Styler move an instance's stain or style toward the new paint. A pair with no form in between, such as a solid color and a pattern, only switched at half strength, so strokes below that never changed it. Such a paint now takes the new one at once, keeping its amount. OK in Symbolism Tools Options read a checkbox stored as a value other than true or false as false, and a number stored as text that is no number as 0, so the check passed and the density could change. Each value now goes to the check as it is stored, and a value of the wrong kind is refused with no density change. --- crates/engine/src/cmd/brushsym/symbols.rs | 14 ++++++++--- crates/engine/src/tests/symbolism_shift.rs | 22 ++++++++++++++++++ .../ui-egui/src/dialogs/symbolism_options.rs | 23 ++++++++++++++++--- docs/mcp.md | 5 ++-- docs/target-app-parity.md | 2 +- 5 files changed, 57 insertions(+), 9 deletions(-) diff --git a/crates/engine/src/cmd/brushsym/symbols.rs b/crates/engine/src/cmd/brushsym/symbols.rs index 708750806b..ffb7cca8ba 100644 --- a/crates/engine/src/cmd/brushsym/symbols.rs +++ b/crates/engine/src/cmd/brushsym/symbols.rs @@ -1300,11 +1300,19 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result { /// Move the paint of instance `id`'s stain or style (`fill`, its topmost fill with the amount) /// toward `to` by `t`. The fill keeps its amount and everything else it has, and the instance's -/// other appearance items stay as they are. An instance without a stain or style, or one whose -/// paint does not change, is left as it is. Returns whether it changed. +/// other appearance items stay as they are. A paint with no form between it and `to` (a solid +/// color and a pattern, say) takes `to` at once, so repeated strokes below half strength still +/// reach it. An instance without a stain or style, or one whose paint does not change, is left as +/// it is. Returns whether it changed. fn recolor_keeping_amount(d: &mut Document, id: NodeId, fill: Option<(Paint, f64)>, to: &Paint, t: f64) -> bool { + use vectorcraft_doc::blend::lerp_paint; let Some((own, _)) = fill.filter(|(_, o)| *o > 0.0) else { return false }; - let paint = vectorcraft_doc::blend::lerp_paint(&own, to, t.clamp(0.0, 1.0) as f32); + let t = t.clamp(0.0, 1.0) as f32; + let mut paint = lerp_paint(&own, to, t); + // `lerp_paint` switches such a pair halfway, so just below half it still gives `own`. + if paint == own && t > 0.0 && lerp_paint(&own, to, 0.49) == own { + paint = to.clone(); + } if paint == own { return false; } diff --git a/crates/engine/src/tests/symbolism_shift.rs b/crates/engine/src/tests/symbolism_shift.rs index aa081e4386..c1c8bdcae0 100644 --- a/crates/engine/src/tests/symbolism_shift.rs +++ b/crates/engine/src/tests/symbolism_shift.rs @@ -205,6 +205,28 @@ fn shift_with_the_styler_keeps_the_amount_and_changes_the_style() { assert!(blue[2] > 0.99 && blue[0] < 0.01, "{blue:?}"); } +/// A stain or style with no form between it and the new paint (a pattern and a solid color) takes +/// the new paint at once, at any strength, and keeps its amount. +#[test] +fn shift_changes_a_paint_that_has_no_form_in_between() { + use vectorcraft_color::Paint; + let mut s = session(); + let a = dot(&mut s, 100.0, 150.0); + s.edit("Pattern fill", |d, _| { + let mut f = vectorcraft_doc::FillLayer::new(Paint::Pattern { pattern: "Tile".into(), xf: Default::default() }); + f.opacity = 0.4; + d.node_mut(a).unwrap().appearance.items.insert(0, vectorcraft_doc::AppearanceItem::Fill(f)); + Ok(()) + }) + .unwrap(); + // Low intensity, near the brush's edge: far below half strength. + let r = adjust(&mut s, json!({"tool": "stain", "points": [[104, 150]], "radius": 5, "intensity": 1, "color": "#ff0000", "shift": true})); + assert_eq!(r["count"], 1); + let f = node(&s, a).appearance.fill().cloned().unwrap(); + assert_eq!(f.opacity, 0.4, "the amount stays"); + assert!(f.paint.color().is_some_and(|c| c.to_rgb()[0] > 0.99), "{:?}", f.paint); +} + /// A style name the document has no style for (the Styler's style from another document, or one /// since renamed or deleted) moves the fill toward the same style as no name. #[test] diff --git a/crates/ui-egui/src/dialogs/symbolism_options.rs b/crates/ui-egui/src/dialogs/symbolism_options.rs index c0878996f3..39c5b6ec9d 100644 --- a/crates/ui-egui/src/dialogs/symbolism_options.rs +++ b/crates/ui-egui/src/dialogs/symbolism_options.rs @@ -121,9 +121,15 @@ fn selected_sets(app: &VectorcraftApp) -> Vec { /// OK: set the brush the Symbolism tools share (the tool keeps it within its ranges), after giving /// a new Symbol Set Density to the selected symbol sets. fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> DialogResult { - let mut values: Map = - NUMBERS.iter().filter(|k| d.fields.contains_key(**k)).map(|k| (k.to_string(), json!(d.f64(k, 0.0)))).collect(); - values.extend(SWITCHES.iter().filter(|k| d.fields.contains_key(**k)).map(|k| (k.to_string(), json!(d.bool(k))))); + // Each value goes to the check as it is stored, so one of the wrong kind is refused rather than + // read as 0 or false. A number stored as text is read as the field reads it, and other text is + // refused. + let stored = |k: &str| match d.fields.get(k) { + Some(Value::String(s)) => Some(vectorcraft_doc::Unit::Points.parse(s).map_or_else(|| json!(s), |n| json!(n))), + v => v.cloned(), + }; + let mut values: Map = NUMBERS.iter().filter_map(|k| Some((k.to_string(), stored(k)?))).collect(); + values.extend(SWITCHES.iter().filter_map(|k| Some((k.to_string(), d.fields.get(*k)?.clone())))); values.extend(SPRAY.iter().chain(&["method"]).filter(|k| d.fields.contains_key(**k)).map(|k| (k.to_string(), json!(d.str(k))))); // A value `tool.setOption` refuses changes no density either. vectorcraft_tools::symbolism::check_options(&d.str("tool"), &values)?; @@ -291,6 +297,17 @@ mod tests { assert!(super::super::confirm(&mut app).is_err()); assert_eq!((width(&app), undo(&app)), (was, steps)); assert_eq!(app.session.tool_options_of("symbolSizer")["density"].as_f64(), Some(5.0)); + // So does a checkbox or a number stored as a value of the wrong kind. + for (k, v) in [("usePressure", json!("invalid")), ("proportional", json!(1)), ("intensity", json!("strong")), ("diameter", json!(true))] { + app.run("tool.options", json!({"tool": "symbolSprayer"})).unwrap(); + let fields = &mut app.ui.dialog.as_mut().unwrap().fields; + fields.insert("density".into(), json!(9)); + fields.insert(k.into(), v); + assert!(super::super::confirm(&mut app).is_err(), "{k}"); + assert_eq!((width(&app), undo(&app)), (was, steps), "{k}"); + let o = app.session.tool_options_of("symbolSizer"); + assert_eq!((o["density"].as_f64(), o["usePressure"].as_bool()), (Some(5.0), Some(false)), "{k}"); + } // A higher density packs the set closer, as one undo step. app.run("tool.options", json!({"tool": "symbolSprayer"})).unwrap(); app.ui.dialog.as_mut().unwrap().fields.insert("density".into(), json!(9)); diff --git a/docs/mcp.md b/docs/mcp.md index 1215dd2d9d..5f9ea72ac0 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3460,8 +3460,9 @@ already walks Image Trace. Short agent entry points: move them on the canvas. It returns `{count}`, the instances that moved. - The Sizer keeps each instance's center where it is, even with `affectsDensity`. - The Stainer moves an instance's paint toward `color` by the tool's amount at its distance from the point, and the - Styler toward the style by the brush's strength there, whatever `method` is. An instance without a stain or style - is left as it is, and `alt` has no effect. + Styler toward the style by the brush's strength there, whatever `method` is. A paint with no form between it and + the new one (a solid color and a pattern) takes the new one at once. An instance without a stain or style is left + as it is, and `alt` has no effect. - No undo step is added when nothing moves or changes. - Dynamic symbols: an instance of a symbol whose `type` is `dynamic` changes the appearance of objects in the symbol's art for itself only and stays linked. `symbol.instance.setAppearance {id?, path, fill?, stroke?, opacity?, blend?}` diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 49b85c8e77..0e76908e11 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1053,7 +1053,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Expand of symbol instances:** Object › Expand turns selected symbol instances (without effects, not in perspective, in groups or placed documents too) into their art as Break Link to Symbol places it, one level deep, as one undo step; the Expand dialog's Fill and Stroke reach that art (`object.expand`, `crates/engine/src/tests/expand_symbols.rs`; estimated, score unchanged). - **Reset Transformation** ([Transform symbols](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/transform-symbols.html), [Symbols panel options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbols-panel-options.html)): the Symbols panel menu's Reset Transformation and the Control bar's Reset, shown while symbol instances are selected, give the selected instances their symbol's own scale again, without rotation or shear, as one undo step (`symbol.instance.resetTransform`); an instance in perspective is left as it is. VectorCraft's own rules: each instance keeps the center of its bounding box in place, reflection is removed too, and the menu item and the button are enabled only while a selected instance would change. Tests: `tests::brushsym::reset_transformation_restores_the_symbols_scale_and_keeps_the_center`, `reset_transformation_keeps_the_center_of_art_away_from_the_origin`, `reset_transformation_ignores_a_stored_size_that_is_not_positive`, `reset_transformation_leaves_unchanged_instances_and_refuses_bad_ids`, `panels::symbols::tests::reset_transformation_is_enabled_for_a_transformed_instance_and_resets_it`. - **Symbolism Tools Options** ([Symbolism tool options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbolism-tool-options.html), [the archived manual](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=118)): the dialog a double-click on a symbolism tool opens has, besides Diameter, Intensity and Symbol Set Density, Use Pressure Pen (a pen's pressure is the intensity), Method (User Defined, Average or Random) for the Scruncher, Sizer, Spinner, Stainer, Screener and Styler, Show Brush Size and Intensity, the Symbol Sprayer's Scrunch, Size, Spin, Screen, Stain and Style (each Average or User Defined), and the Symbol Sizer's Proportional Resizing and Resizing Affects Density; a new Symbol Set Density spaces the instances of the selected symbol sets (`symbol.setDensity`). VectorCraft's own rules: a Tool row lists the eight tools by name and shows the chosen one's options; Random gives each instance its own share of the change for the whole stroke; Average moves each value toward the mean of the instances under the brush; the starting values are Method User Defined, the Sprayer's six options Average, Proportional Resizing on and Resizing Affects Density off, so only a Sprayer stroke over instances of the selected set changes from before (its new instances take their mean values); the brush shows the intensity as a dashed ring. The Symbol Sprayer does not use Intensity or pen pressure. Tests: `crates/engine/src/tests/symbolism_options.rs`, `symbolism::tests` in `crates/tools`, `dialogs::symbolism_options::tests`. - - **Symbolism tools with Shift** ([the manual](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=199), [the CS6 reference](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=136)): a Shift-click with the Symbol Shifter brings the instances under the brush forward in the stacking order and Alt+Shift-click sends them backward; the Symbol Sizer with Shift keeps the set's density while it resizes; the Symbol Stainer and the Symbol Styler with Shift keep the amount of stain or style and move the color or style toward the current fill or the selected style (`symbol.adjust {shift}`). VectorCraft's own rules: the Shifter moves each instance one place among its siblings, once per stroke, without moving it on the canvas; the Sizer keeps each instance's center, even with Resizing Affects Density; an instance without a stain or style is left as it is, and Alt has no effect on the Stainer or the Styler with Shift. The selected style is the one last clicked into the Graphic Styles panel's selection. Tests: `crates/engine/src/tests/symbolism_shift.rs`, `symbolism::tests::shift_reaches_the_tools_that_have_a_shift_form`, `panels::graphic_styles::tests::shift_click_selects_a_range_and_cmd_click_adds_or_removes_one_style`. + - **Symbolism tools with Shift** ([the manual](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=199), [the CS6 reference](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=136)): a Shift-click with the Symbol Shifter brings the instances under the brush forward in the stacking order and Alt+Shift-click sends them backward; the Symbol Sizer with Shift keeps the set's density while it resizes; the Symbol Stainer and the Symbol Styler with Shift keep the amount of stain or style and move the color or style toward the current fill or the selected style (`symbol.adjust {shift}`). VectorCraft's own rules: the Shifter moves each instance one place among its siblings, once per stroke, without moving it on the canvas; the Sizer keeps each instance's center, even with Resizing Affects Density; a stain or style with no form between it and the new paint (a solid color and a pattern) takes the new paint at once; an instance without a stain or style is left as it is, and Alt has no effect on the Stainer or the Styler with Shift. The selected style is the one last clicked into the Graphic Styles panel's selection. Tests: `crates/engine/src/tests/symbolism_shift.rs`, `symbolism::tests::shift_reaches_the_tools_that_have_a_shift_form`, `panels::graphic_styles::tests::shift_click_selects_a_range_and_cmd_click_adds_or_removes_one_style`. - **Expand of dimensions:** Object › Expand, Expand Appearance, Create Outlines and Outline Stroke turn a dimension whose art they change into a plain group of that art, which stays as it is through later moves, scales and edits of what it measured; undo gives the live dimension back (`crates/engine/tests/it/dimensions.rs`; VectorCraft's own rule; estimated, score unchanged). - **Brush libraries** ([public source](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/create-new-brush-libraries.html), [import](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/import-brushes-from-brush-libraries-or-other-files.html), [Brushes panel](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/brushes-panel-overview.html)): Window › Brush Libraries, the Brushes panel's Brush Libraries Menu and its menu's Open Brush Library open each library in a library panel of its own, as swatch, graphic style and symbol libraries do. The built-in libraries (Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media, Tech Circuit) are original brushes generated in code (`crates/engine/src/cmd/brushlib.rs`); Striped Ribbon's art is filled with the library's own pattern and Sparkles scatters the library's own symbol; Ink and Wash adds ink and wash brushes (the [help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html) lists an Ink brush library of strokes with varied thickness and texture; the names, shapes and opacities are VectorCraft's own): Tapered Ink, an art brush broad near its start that thins to a fine tip; Brush Pen, a calligraphic brush whose size follows the pen pressure; and Soft Wash and Pooling Wash, art brushes of translucent gray layers that take the stroke color as tints; Game Trails adds motion art brushes (Speed Line, Dash Trail, Burst Ray, Zigzag); Energy Beams adds laser and plasma art brushes (Laser Bolt, Plasma Arc, Charge Wave, Spark Trail); Dry Media adds grainy art brushes (Chalk Grain, Graphite Pencil, Wax Crayon, Charcoal Dust). A click on a brush adds it to the document's Brushes as one undo step with every resource its art uses (patterns, symbols, swatches, graphic styles, images), makes it the current brush and, with paths selected, applies it to them in the same step; a brush the document already has is not added again and a different brush of the same name comes in numbered ("Wave 2"). Shift/Cmd-clicks select brushes for Add to Brushes; a brush dragged onto a path is added and applied to it, and one dragged onto the Brushes panel is added. Save Brushes… / the Brushes panel's Save Brush Library… write the document's brushes (or the selected ones) as a `.vectorcraft` library into the `Brushes` folder next to the preferences, listed under User Defined, or to a file; Other Library… reads the brushes of any document VectorCraft opens. Thumbnails, in the library panels, the Brushes panel and Brush Options, render brush art with the patterns and symbols it uses. Copying brushed art now carries the patterns and symbols its brush's art uses too. Tests: `crates/engine/src/tests/brushlib.rs`, `crates/ui-egui/src/panels/tests_brush_libraries.rs`, `panels::brushes::tests::library_brush_previews_show_the_patterns_their_art_uses`, `canvas::tests::a_library_brush_dropped_on_a_path_is_added_and_applied_in_one_step`. - **Bristle Brushes library** ([What's new](https://helpx.adobe.com/illustrator/desktop/new-features/whats-new.html), [About brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html)): Window › Brush Libraries › Bristle Brushes holds ten bristle brushes, one for each tip shape (Fine Liner, Pointed Flat, Stubby Round, Dry Scrub, Soft Dome, Filbert, Angled Round, Angled Flat, Fan Blender, Grass Fan). The brushes, their names and their values are VectorCraft's own, and every value lies inside the range the bristle brush keeps (`brush.libraries`, `brush.addFromLibrary`; `the_bristle_brushes_library_covers_every_tip_shape_within_the_bristle_ranges`). From 0e1592d76a271ad6a01dd24ceb43d94fa1e56885 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 21:55:27 -0800 Subject: [PATCH 10/55] Symbolism: the Symbol Styler applies the style by the brush's strength Without Shift, the Symbol Styler gave each instance under the brush the style in full (and Random a fixed share of it), whatever the intensity, the pen pressure or the instance's distance from the brush's center. It now applies the style gradually, as it does the stain: by the brush's strength at the instance, in full only at the center at intensity 10 or full pressure. Random gives each instance its share of that amount. --- crates/engine/src/cmd/brushsym/symbols.rs | 6 +++-- crates/engine/src/tests/symbolism_options.rs | 28 ++++++++++++++++++++ docs/mcp.md | 7 ++--- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/cmd/brushsym/symbols.rs b/crates/engine/src/cmd/brushsym/symbols.rs index ffb7cca8ba..bdce448ebc 100644 --- a/crates/engine/src/cmd/brushsym/symbols.rs +++ b/crates/engine/src/cmd/brushsym/symbols.rs @@ -1265,9 +1265,11 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result { continue; } let cur = n.appearance.fill().filter(|f| f.paint == paint).map(|f| f.opacity).unwrap_or(0.0); + // The style goes on gradually, by the brush's strength there: in + // full at the center at full intensity or pressure. let step = match (tool.as_str(), method) { - ("style", Method::Random) => (share / 2.0) as f32, - ("style", _) => 1.0, + ("style", Method::Random) => (w * share / 2.0) as f32, + ("style", _) => w as f32, _ => (0.15 * w * share) as f32, }; (paint, if alt { cur - step } else { cur + step }) diff --git a/crates/engine/src/tests/symbolism_options.rs b/crates/engine/src/tests/symbolism_options.rs index 44d1427fb9..bd9d021b31 100644 --- a/crates/engine/src/tests/symbolism_options.rs +++ b/crates/engine/src/tests/symbolism_options.rs @@ -666,3 +666,31 @@ fn set_density_refuses_bad_densities_and_objects_without_a_set() { assert!(matches!(&r, Err(EngineError::Other(msg)) if msg == "no symbol set selected"), "{r:?}"); assert!(state(&s) == before); } + +/// The Symbol Styler applies the style gradually, by the brush's strength at the instance: the pen +/// pressure with Use Pressure Pen, else the intensity, less toward the brush's edge. Random gives +/// each instance a share of that amount. +#[test] +fn the_styler_applies_the_style_by_the_brushs_strength() { + let styled = |extra: Value, x: f64| { + let mut s = session(); + let a = dot(&mut s, 100.0, 150.0); + let id = s.execute("shape.rectangle", &json!({"x": 300, "y": 250, "width": 10, "height": 10})).unwrap()["id"].as_u64().unwrap(); + s.execute("paint.setFill", &json!({"color": "#0000ff"})).unwrap(); + s.execute("graphicStyle.new", &json!({"name": "Blue", "id": id})).unwrap(); + s.select(|_, sel| sel.clear()).unwrap(); + let mut p = json!({"tool": "style", "points": [[x, 150]], "radius": 10, "style": "Blue"}); + p.as_object_mut().unwrap().extend(extra.as_object().unwrap().clone()); + adjust(&mut s, p); + node(&s, a).appearance.fill().map_or(0.0, |f| f.opacity) + }; + let near = |a: f32, b: f32| (a - b).abs() < 1e-6; + assert!(near(styled(json!({"intensity": 10}), 100.0), 1.0), "full strength at the center"); + assert!(near(styled(json!({"intensity": 5}), 100.0), 0.5)); + assert!(near(styled(json!({"intensity": 10}), 105.0), 0.5), "half way to the edge"); + assert!(near(styled(json!({"usePressure": true, "points": [[100, 150, 0.25]]}), 100.0), 0.25)); + assert!(near(styled(json!({"usePressure": true, "points": [[100, 150, 1.0]]}), 100.0), 1.0)); + assert_eq!(styled(json!({"usePressure": true, "points": [[100, 150, 0.0]]}), 100.0), 0.0, "no pressure, no style"); + let random = styled(json!({"usePressure": true, "points": [[100, 150, 0.25]], "method": "random"}), 100.0); + assert!(random <= 0.25 + 1e-6, "{random}"); +} diff --git a/docs/mcp.md b/docs/mcp.md index 5f9ea72ac0..d15cae6275 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3417,9 +3417,10 @@ already walks Image Trace. Short agent entry points: [the archived manual](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=118)): `symbol.adjust` takes `method` (`userDefined`, `average` or `random`; not used by `shift`), `usePressure` with `points` as `[x, y, pressure]` (each point's pen pressure, 0..1, is the intensity there), and for `size` - `proportional` (true) and `affectsDensity` (false). With `tool: style`, a `style` name the document has no graphic style - for counts as none (the document's first style after the default one). The Symbol Styler sends the style last - clicked into the Graphic Styles panel's selection. `tool.setOption` on a symbolism tool refuses a `method` or + `proportional` (true) and `affectsDensity` (false). With `tool: style`, the style goes on by the brush's strength at + each instance, in full only at the brush's center at intensity 10 or full pressure, and a `style` name the document + has no graphic style for counts as none (the document's first style after the default one). The Symbol Styler sends + the style last clicked into the Graphic Styles panel's selection. `tool.setOption` on a symbolism tool refuses a `method` or Symbol Sprayer option that is not one of its names, a non-number `diameter`, `intensity` or `density`, a non-boolean switch, and a `symbol` or `style` that is neither a name nor null, and sets none of the values. `symbol.spray` takes `attributes` From 6f70483c433101863a68d616dcf58949f42891e4 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 22:07:07 -0800 Subject: [PATCH 11/55] Symbolism: the options dialog skips locked or hidden symbol sets With a locked or hidden symbol set selected, a new Symbol Set Density in Symbolism Tools Options asked symbol.setDensity for that set alone. The command refused it ("no symbol set selected"), so OK failed and none of the options were set. The dialog now leaves out sets that cannot be edited: they keep their density, and the options are set. --- .../ui-egui/src/dialogs/symbolism_options.rs | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/dialogs/symbolism_options.rs b/crates/ui-egui/src/dialogs/symbolism_options.rs index 39c5b6ec9d..388049c29d 100644 --- a/crates/ui-egui/src/dialogs/symbolism_options.rs +++ b/crates/ui-egui/src/dialogs/symbolism_options.rs @@ -112,10 +112,16 @@ fn rows(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) { form::check(ui, d, "showBrush", tl!("Show Brush Size and Intensity")); } -/// The selected symbol sets. +/// The selected symbol sets that can be edited (a locked or hidden one keeps its density). fn selected_sets(app: &VectorcraftApp) -> Vec { let Some(st) = app.session.active() else { return vec![] }; - st.selection.objects.iter().filter(|id| st.doc.node(**id).is_some_and(vectorcraft_engine::cmd::is_symbol_set)).map(|id| id.0).collect() + let editable = st.doc.editable(); + st.selection + .objects + .iter() + .filter(|id| st.doc.node(**id).is_some_and(vectorcraft_engine::cmd::is_symbol_set) && editable(**id)) + .map(|id| id.0) + .collect() } /// OK: set the brush the Symbolism tools share (the tool keeps it within its ranges), after giving @@ -308,6 +314,27 @@ mod tests { let o = app.session.tool_options_of("symbolSizer"); assert_eq!((o["density"].as_f64(), o["usePressure"].as_bool()), (Some(5.0), Some(false)), "{k}"); } + // A selected set that is locked keeps its density, and OK still sets the options. + let lock = |app: &mut VectorcraftApp, on: bool| { + app.session + .edit("Lock", |d, _| { + d.node_mut(vectorcraft_doc::NodeId(set)).unwrap().locked = on; + Ok(()) + }) + .unwrap(); + }; + lock(&mut app, true); + let steps_locked = undo(&app); + app.run("tool.options", json!({"tool": "symbolSprayer"})).unwrap(); + app.ui.dialog.as_mut().unwrap().fields.insert("density".into(), json!(8)); + super::super::confirm(&mut app).unwrap(); + assert_eq!((width(&app), undo(&app)), (was, steps_locked)); + assert_eq!(app.session.tool_options_of("symbolSizer")["density"].as_f64(), Some(8.0)); + lock(&mut app, false); + app.run("tool.options", json!({"tool": "symbolSprayer"})).unwrap(); + app.ui.dialog.as_mut().unwrap().fields.insert("density".into(), json!(5)); + super::super::confirm(&mut app).unwrap(); + let steps = undo(&app); // A higher density packs the set closer, as one undo step. app.run("tool.options", json!({"tool": "symbolSprayer"})).unwrap(); app.ui.dialog.as_mut().unwrap().fields.insert("density".into(), json!(9)); From f5e9840333bf2362e2daa06f03e537c48e33a6d8 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 21:49:32 -0800 Subject: [PATCH 12/55] Color Wheel: HSL Sliders edit a color by hue, saturation and lightness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Part of #978. The Color Wheel panel menu gains HSL Sliders, shown in place of OKLCH Sliders: H (0 to 360°), S and L (0 to 100 %) rows under the wheel or the box that edit the hue, saturation and lightness of the color's display sRGB, as CSS Color 4 defines HSL (https://www.w3.org/TR/css-color-4/#the-hsl-notation). A pick goes into the working RGB space as the wheel's picks do, the rows keep the hue of a gray, and they take the arrow keys and report their names, values and ranges to screen readers as the OKLCH rows do. - vectorcraft-color: rgb_to_hsl and hsl_to_rgb follow the conversions in CSS Color 4 sections 7.1 and 7.2, with Color::to_hsl and Color::from_hsl beside to_hsb and from_hsb. - ui.colorWheel takes sliders: "hsl"; an unknown value now answers "`sliders` must be none, oklch or hsl". - Docs: docs/mcp.md, docs/control-protocol.md and the Color Wheel evidence in docs/target-app-parity.md. --- crates/color/src/lib.rs | 100 +++++++++ crates/mcp/src/ui_catalog.rs | 2 +- crates/ui-egui/src/i18n/bg.tsv | 3 +- crates/ui-egui/src/i18n/bs.tsv | 3 +- crates/ui-egui/src/i18n/ca.tsv | 3 +- crates/ui-egui/src/i18n/cs.tsv | 3 +- crates/ui-egui/src/i18n/da.tsv | 3 +- crates/ui-egui/src/i18n/de.tsv | 3 +- crates/ui-egui/src/i18n/el.tsv | 3 +- crates/ui-egui/src/i18n/es.tsv | 3 +- crates/ui-egui/src/i18n/fi.tsv | 3 +- crates/ui-egui/src/i18n/fr.tsv | 3 +- crates/ui-egui/src/i18n/gu.tsv | 1 + crates/ui-egui/src/i18n/hi.tsv | 3 +- crates/ui-egui/src/i18n/hu.tsv | 3 +- crates/ui-egui/src/i18n/id.tsv | 3 +- crates/ui-egui/src/i18n/it.tsv | 3 +- crates/ui-egui/src/i18n/ja.tsv | 3 +- crates/ui-egui/src/i18n/ka.tsv | 3 +- crates/ui-egui/src/i18n/ko.tsv | 3 +- crates/ui-egui/src/i18n/nl.tsv | 3 +- crates/ui-egui/src/i18n/pl.tsv | 3 +- crates/ui-egui/src/i18n/pt-br.tsv | 3 +- crates/ui-egui/src/i18n/ru.tsv | 3 +- crates/ui-egui/src/i18n/sv.tsv | 3 +- crates/ui-egui/src/i18n/tr.tsv | 3 +- crates/ui-egui/src/i18n/uk.tsv | 3 +- crates/ui-egui/src/i18n/vi.tsv | 3 +- crates/ui-egui/src/i18n/zh-hans.tsv | 3 +- crates/ui-egui/src/i18n/zh-hant.tsv | 3 +- crates/ui-egui/src/menus/ui_commands.rs | 2 +- crates/ui-egui/src/panels/color_wheel.rs | 125 ++++++++++-- .../ui-egui/src/panels/tests_color_wheel.rs | 192 +++++++++++++++++- docs/control-protocol.md | 6 +- docs/mcp.md | 2 + docs/target-app-parity.md | 1 + 36 files changed, 461 insertions(+), 51 deletions(-) diff --git a/crates/color/src/lib.rs b/crates/color/src/lib.rs index 846dadb940..8180f1c459 100644 --- a/crates/color/src/lib.rs +++ b/crates/color/src/lib.rs @@ -151,6 +151,15 @@ impl Color { let [r, g, b] = hsb_to_rgb([h, s, v]); Color::Rgb { r, g, b } } + /// HSL with hue in degrees 0..360, saturation and lightness 0..1 ([`rgb_to_hsl`] of the + /// display color). + pub fn to_hsl(&self) -> [f32; 3] { + rgb_to_hsl(self.to_rgb()) + } + pub fn from_hsl(h: f32, s: f32, l: f32) -> Self { + let [r, g, b] = hsl_to_rgb([h, s, l]); + Color::Rgb { r, g, b } + } /// `#rrggbb` (display RGB). pub fn to_hex(&self) -> String { let [r, g, b, _] = self.to_rgba8(1.0); @@ -341,6 +350,48 @@ pub fn hsb_to_rgb([h, s, v]: [f32; 3]) -> [f32; 3] { [r + m, g + m, b + m] } +/// HSL (hue in degrees 0..360, saturation and lightness 0..1) of RGB numbers 0..1, with no color +/// conversion, as CSS Color 4 converts sRGB to HSL +/// (). The hue is 0 while the saturation is +/// powerless, and a color outside 0..1 that gives a negative saturation turns its hue by 180°. As in +/// the specification's conversion, a lightness of 0.00001 or less, a lightness less than 0.00001 +/// below 1, or a saturation of 0.00001 or less reads as a gray. +pub fn rgb_to_hsl([r, g, b]: [f32; 3]) -> [f32; 3] { + const EPSILON: f32 = 1e-5; + let max = r.max(g).max(b); + let min = r.min(g).min(b); + let d = max - min; + let l = (max + min) / 2.0; + if d <= 0.0 { + return [0.0, 0.0, l]; + } + let mut s = if l.abs() <= EPSILON || (1.0 - l).abs() < EPSILON { 0.0 } else { (max - l) / l.min(1.0 - l) }; + let mut h = rgb_to_hsb([r, g, b])[0]; + if s < 0.0 { + h += 180.0; + s = -s; + } + if s <= EPSILON { + return [0.0, 0.0, l]; + } + let h = h.rem_euclid(360.0); + [if h >= 360.0 { 0.0 } else { h }, s, l] +} + +/// RGB numbers 0..1 of HSL `[h, s, l]` (hue in degrees, saturation and lightness 0..1), as CSS +/// Color 4 converts HSL to sRGB (): the inverse of +/// [`rgb_to_hsl`]. A hue outside 0..360 wraps into that range, so -120° gives the color of 240°. +/// The specification's sample code uses JavaScript's remainder operator and gives a different +/// color for a negative hue. +pub fn hsl_to_rgb([h, s, l]: [f32; 3]) -> [f32; 3] { + let a = s * l.min(1.0 - l); + let f = |n: f32| { + let k = (n + h / 30.0).rem_euclid(12.0); + l - a * (k - 3.0).min(9.0 - k).clamp(-1.0, 1.0) + }; + [f(0.0), f(8.0), f(4.0)] +} + /// `new` expressed in the colour model of `orig` ([`Color::in_model`]): results of colour operations /// (harmonies, blends, inversions, recolouring) keep the model of the colour they came from. pub fn keep_model(orig: Color, new: Color) -> Color { @@ -500,6 +551,55 @@ mod tests { } } + /// The HSL examples of CSS Color 4, section 7 (), + /// the first six rows, and two hues outside 0..360 that wrap into that range. + #[test] + fn hsl_follows_css_color_4() { + for (hsl, hex) in [ + ([0.0, 1.0, 0.5], "#ff0000"), + ([120.0, 1.0, 0.5], "#00ff00"), + ([120.0, 1.0, 0.25], "#008000"), + ([120.0, 1.0, 0.75], "#80ff80"), + ([240.0, 1.0, 0.5], "#0000ff"), + ([60.0, 1.0, 0.5], "#ffff00"), + ([360.0, 1.0, 0.5], "#ff0000"), + ([-120.0, 1.0, 0.5], "#0000ff"), + ] { + assert_eq!(Color::from_hsl(hsl[0], hsl[1], hsl[2]).to_hex(), hex, "{hsl:?}"); + } + let [h, s, l] = rgb_to_hsl([1.0, 0.5, 0.0]); + assert!((h - 30.0).abs() < 1e-4 && (s - 1.0).abs() < 1e-6 && (l - 0.5).abs() < 1e-6, "{h} {s} {l}"); + let [h, s, l] = Color::rgb8(255, 128, 0).to_hsl(); + assert!((h - 30.0).abs() < 0.2 && (s - 1.0).abs() < 1e-6 && (l - 0.5).abs() < 1e-3, "{h} {s} {l}"); + // A gray has no hue: the hue is 0 and the saturation 0, at any lightness. + for v in [0.0, 0.25, 0.5, 1.0] { + assert_eq!(rgb_to_hsl([v, v, v]), [0.0, 0.0, v]); + } + // Black and white keep any hue and saturation they are given. + assert_eq!(hsl_to_rgb([200.0, 0.7, 0.0]), [0.0, 0.0, 0.0]); + assert_eq!(hsl_to_rgb([200.0, 0.7, 1.0]), [1.0, 1.0, 1.0]); + // A color past the gamut that gives a negative saturation turns its hue by 180°. + let [h, s, _] = rgb_to_hsl([1.2, 1.5, 1.4]); + assert!(s > 0.0 && (h - (160.0 + 180.0)).abs() < 1e-3, "{h} {s}"); + } + + /// The 216 web colors go to HSL and back to the same 8-bit color. + #[test] + fn hsl_roundtrip() { + let steps = [0x00, 0x33, 0x66, 0x99, 0xcc, 0xff]; + for r in steps { + for g in steps { + for b in steps { + let c = Color::rgb8(r, g, b); + let [h, s, l] = rgb_to_hsl(c.to_rgb_uncalibrated()); + assert!((0.0..360.0).contains(&h) && (0.0..=1.0).contains(&s) && (0.0..=1.0).contains(&l), "{}", c.to_hex()); + let back = hsl_to_rgb([h, s, l]).map(|v| (v * 255.0).round() as u8); + assert_eq!(back, [r, g, b], "{}", c.to_hex()); + } + } + } + } + #[test] fn cmyk_conversions() { assert_eq!(Color::cmyk(0.0, 0.0, 0.0, 1.0).to_rgb_uncalibrated(), [0.0, 0.0, 0.0]); diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index ae517a6b7b..14671dbe78 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1354,7 +1354,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.colorWheel", "Color Wheel Options", "", - "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, sliders?: none|oklch} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, pick the box's channel, as Box Channel does, and show no slider rows under the wheel or the box (none) or OKLCH Sliders (oklch), as OKLCH Sliders 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); OKLCH Sliders edit lightness 0 to 100 %, chroma 0 to 100 % of 0.4 and hue 0 to 360°, CSS Color 4's OKLCH of the display sRGB, and a color outside sRGB keeps L and H and takes the largest chroma that fits; 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, oklch is an error while the working RGB space is not sRGB, 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, sliders}", + "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, sliders?: none|oklch|hsl} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, pick the box's channel, as Box Channel does, and show no slider rows under the wheel or the box (none), OKLCH Sliders (oklch) or HSL Sliders (hsl), as the menu items of those names do: the box is a color field with the channel's strip at its right, and the field shows the other two components (hue: saturation across and brightness up; saturation: hue across and brightness up; brightness: hue across and saturation up; red: blue across and green up; green: blue across and red up; blue: red across and green up); OKLCH Sliders edit lightness 0 to 100 %, chroma 0 to 100 % of 0.4 and hue 0 to 360°, CSS Color 4's OKLCH of the display sRGB, and a color outside sRGB keeps L and H and takes the largest chroma that fits; HSL Sliders edit hue 0 to 360°, saturation 0 to 100 % and lightness 0 to 100 %, CSS Color 4's HSL of the display sRGB; 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, oklch is an error while the working RGB space is not sRGB, 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, sliders}", ), ( "ui.savePdfDialog", diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index ab505f121b..96082641cc 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -1765,6 +1765,7 @@ font-technology Variable Променливи Knockout Group Група с изрязване Lab Lab OKLCH Sliders Плъзгачи OKLCH + HSL Sliders Плъзгачи HSL Chroma Хрома The largest chroma sRGB holds at this lightness and hue Най-голямата хрома, която sRGB побира при тази светлина и този оттенък OKLCH needs sRGB as the working RGB space OKLCH изисква sRGB като работно RGB пространство @@ -4264,7 +4265,7 @@ axis Both И двете @msg `aspect` must be a number (%) `aspect` трябва да бъде число (%) @msg `at` must be [x, y] `at` трябва да бъде [x, y] @msg `color` must be a colour `color` трябва да бъде цвят -@msg `sliders` must be none or oklch `sliders` трябва да бъде none или oklch +@msg `sliders` must be none, oklch or hsl `sliders` трябва да бъде none, oklch или hsl @msg OKLCH needs sRGB as the working RGB space OKLCH изисква sRGB като работно RGB пространство @msg `command` must be a command whose menu item opens a dialog (see ui.menuDialog) `command` трябва да бъде команда, чийто елемент от менюто отваря диалогов прозорец (вижте ui.menuDialog) @msg `freeform.points` must be an array `freeform.points` трябва да бъде масив diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 13731ee514..8a31e4b028 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -4213,6 +4213,7 @@ axis Both Obje Ink Tinta Lab Lab OKLCH Sliders OKLCH klizači + HSL Sliders HSL klizači Chroma Hroma The largest chroma sRGB holds at this lightness and hue Najveća hroma koju sRGB obuhvata pri ovoj svjetloći i nijansi OKLCH needs sRGB as the working RGB space OKLCH zahtijeva sRGB kao radni RGB prostor @@ -4673,7 +4674,7 @@ imageTrace Outline Obris @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` mora biti grayscale, rgb, hsb, cmyk ili websafe @msg `view` must be wheel or box `view` mora biti wheel ili box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` mora biti hue, saturation, brightness, red, green ili blue -@msg `sliders` must be none or oklch `sliders` mora biti none ili oklch +@msg `sliders` must be none, oklch or hsl `sliders` mora biti none, oklch ili hsl @msg OKLCH needs sRGB as the working RGB space OKLCH zahtijeva sRGB kao radni RGB prostor @msg `{k}` must be [x, y] `{k}` mora biti [x, y] @msg `{name}` has no options `{name}` nema opcija diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 66e580261c..9517f4a375 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -2263,6 +2263,7 @@ digits Malayalam Malaiàlam Knockout Group Grup knockout Lab Lab OKLCH Sliders Controls lliscants OKLCH + HSL Sliders Controls lliscants HSL Chroma Croma The largest chroma sRGB holds at this lightness and hue El croma més gran que sRGB admet amb aquesta lluminositat i aquest to OKLCH needs sRGB as the working RGB space OKLCH necessita sRGB com a espai RGB de treball @@ -5294,7 +5295,7 @@ digits Malayalam Malaiàlam @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` ha de ser grayscale, rgb, hsb, cmyk o websafe @msg `view` must be wheel or box `view` ha de ser wheel o box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` ha de ser hue, saturation, brightness, red, green o blue -@msg `sliders` must be none or oklch `sliders` ha de ser none o oklch +@msg `sliders` must be none, oklch or hsl `sliders` ha de ser none, oklch o hsl @msg OKLCH needs sRGB as the working RGB space OKLCH necessita sRGB com a espai RGB de treball @msg `name` is empty `name` és buit @msg `newName` is empty `newName` és buit diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index be19b2b1f0..e7b438f8e8 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4269,6 +4269,7 @@ axis Both Obě Ink Inkoust Lab Lab OKLCH Sliders Posuvníky OKLCH + HSL Sliders Posuvníky HSL Chroma Chroma The largest chroma sRGB holds at this lightness and hue Největší chroma, kterou sRGB obsáhne při této světlosti a odstínu OKLCH needs sRGB as the working RGB space OKLCH vyžaduje sRGB jako pracovní prostor RGB @@ -4836,7 +4837,7 @@ imageTrace Outline Obrys @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` musí být grayscale, rgb, hsb, cmyk nebo websafe @msg `view` must be wheel or box `view` musí být wheel nebo box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` musí být hue, saturation, brightness, red, green nebo blue -@msg `sliders` must be none or oklch `sliders` musí být none nebo oklch +@msg `sliders` must be none, oklch or hsl `sliders` musí být none, oklch nebo hsl @msg OKLCH needs sRGB as the working RGB space OKLCH vyžaduje sRGB jako pracovní prostor RGB @msg `{k}` must be [x, y] `{k}` musí být [x, y] @msg `{name}` has no options `{name}` nemá žádné možnosti diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 4e49d32782..48e4c5cd03 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -4588,6 +4588,7 @@ axis Both Begge Ink Blæk Lab Lab OKLCH Sliders OKLCH-skydere + HSL Sliders HSL-skydere Chroma Kroma The largest chroma sRGB holds at this lightness and hue Den største kroma, sRGB kan rumme ved denne lyshed og farvetone OKLCH needs sRGB as the working RGB space OKLCH kræver sRGB som RGB-arbejdsfarverum @@ -6272,7 +6273,7 @@ mark-style Japanese Japansk @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` skal være grayscale, rgb, hsb, cmyk eller websafe @msg `view` must be wheel or box `view` skal være wheel eller box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` skal være hue, saturation, brightness, red, green eller blue -@msg `sliders` must be none or oklch `sliders` skal være none eller oklch +@msg `sliders` must be none, oklch or hsl `sliders` skal være none, oklch eller hsl @msg OKLCH needs sRGB as the working RGB space OKLCH kræver sRGB som RGB-arbejdsfarverum @msg the Color Picker is not open farvevælgeren er ikke åben @msg the screen color sampler is already open skærmfarvesampleren er allerede åben diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 2bdb11e926..2402fea14b 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -1827,6 +1827,7 @@ file-filter Templates Vorlagen Knockout Group Aussparungsgruppe Lab Lab OKLCH Sliders OKLCH-Regler + HSL Sliders HSL-Regler Chroma Chroma The largest chroma sRGB holds at this lightness and hue Das größte Chroma, das sRGB bei dieser Helligkeit und diesem Farbton enthält OKLCH needs sRGB as the working RGB space OKLCH erfordert sRGB als RGB-Arbeitsfarbraum @@ -4449,7 +4450,7 @@ theme Appearance Erscheinungsbild @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` muss grayscale, rgb, hsb, cmyk oder websafe sein @msg `view` must be wheel or box `view` muss wheel oder box sein @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` muss hue, saturation, brightness, red, green oder blue sein -@msg `sliders` must be none or oklch `sliders` muss none oder oklch sein +@msg `sliders` must be none, oklch or hsl `sliders` muss none, oklch oder hsl sein @msg OKLCH needs sRGB as the working RGB space OKLCH erfordert sRGB als RGB-Arbeitsfarbraum @msg `{k}` must be [x, y] `{k}` muss [x, y] sein @msg `{name}` has no options `{name}` hat keine Optionen diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 8714c99bc4..4be5c75096 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -1728,6 +1728,7 @@ font-technology Variable Μεταβλητές Knockout Group Ομάδα διάτρησης Lab Lab OKLCH Sliders Ρυθμιστικά OKLCH + HSL Sliders Ρυθμιστικά HSL Chroma Χρωματική ένταση The largest chroma sRGB holds at this lightness and hue Η μεγαλύτερη χρωματική ένταση που χωρά το sRGB σε αυτή τη φωτεινότητα και απόχρωση OKLCH needs sRGB as the working RGB space Το OKLCH απαιτεί sRGB ως χώρο εργασίας RGB @@ -6123,7 +6124,7 @@ effect Points Σημεία @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe το `mode` πρέπει να είναι grayscale, rgb, hsb, cmyk ή websafe @msg `view` must be wheel or box το `view` πρέπει να είναι wheel ή box @msg `channel` must be hue, saturation, brightness, red, green or blue το `channel` πρέπει να είναι hue, saturation, brightness, red, green ή blue -@msg `sliders` must be none or oklch Το `sliders` πρέπει να είναι none ή oklch +@msg `sliders` must be none, oklch or hsl Το `sliders` πρέπει να είναι none, oklch ή hsl @msg OKLCH needs sRGB as the working RGB space Το OKLCH απαιτεί sRGB ως χώρο εργασίας RGB @msg `{key}` must be an array of these names: {_1} το `{key}` πρέπει να είναι πίνακας με αυτά τα ονόματα: {_1} @msg choose a destination folder επιλέξτε φάκελο προορισμού diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 4302320f81..f44c51605f 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -1821,6 +1821,7 @@ font-technology Variable Variables Knockout Group Grupo de exclusión Lab Lab OKLCH Sliders Controles deslizantes OKLCH + HSL Sliders Controles deslizantes HSL Chroma Croma The largest chroma sRGB holds at this lightness and hue El croma más alto que admite sRGB con esta luminosidad y este tono OKLCH needs sRGB as the working RGB space OKLCH necesita sRGB como espacio de trabajo RGB @@ -4526,7 +4527,7 @@ axis Both Ambos @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` debe ser grayscale, rgb, hsb, cmyk o websafe @msg `view` must be wheel or box `view` debe ser wheel o box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` debe ser hue, saturation, brightness, red, green o blue -@msg `sliders` must be none or oklch `sliders` debe ser none u oklch +@msg `sliders` must be none, oklch or hsl `sliders` debe ser none, oklch o hsl @msg OKLCH needs sRGB as the working RGB space OKLCH necesita sRGB como espacio de trabajo RGB @msg `{k}` must be [x, y] `{k}` debe ser [x, y] @msg `{name}` has no options `{name}` no tiene opciones diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index be85c4b560..ac35ad665d 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4188,6 +4188,7 @@ axis Both Molemmat Ink Muste Lab Lab OKLCH Sliders OKLCH-liukusäätimet + HSL Sliders HSL-liukusäätimet Chroma Kroma The largest chroma sRGB holds at this lightness and hue Suurin kroma, jonka sRGB sisältää tällä vaaleudella ja sävyllä OKLCH needs sRGB as the working RGB space OKLCH vaatii sRGB:n RGB-työväriavaruudeksi @@ -6134,7 +6135,7 @@ mark-style Japanese Japanilainen @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode`-arvon on oltava grayscale, rgb, hsb, cmyk tai websafe @msg `view` must be wheel or box `view`-arvon on oltava wheel tai box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel`-arvon on oltava hue, saturation, brightness, red, green tai blue -@msg `sliders` must be none or oklch `sliders` on oltava none tai oklch +@msg `sliders` must be none, oklch or hsl `sliders` on oltava none, oklch tai hsl @msg OKLCH needs sRGB as the working RGB space OKLCH vaatii sRGB:n RGB-työväriavaruudeksi @msg `{key}` must be an array of these names: {_1} `{key}`-arvon on oltava taulukko, jossa on näitä nimiä: {_1} @msg choose a destination folder valitse kohdekansio diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 620508ac05..5975b5f957 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -1815,6 +1815,7 @@ font-technology Variable Variables Knockout Group Groupe perçant Lab Lab OKLCH Sliders Curseurs OKLCH + HSL Sliders Curseurs HSL Chroma Chroma The largest chroma sRGB holds at this lightness and hue Le plus grand chroma que sRGB contient à cette luminosité et cette teinte OKLCH needs sRGB as the working RGB space OKLCH nécessite sRGB comme espace de travail RGB @@ -4515,7 +4516,7 @@ axis Both Les deux @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` doit valoir grayscale, rgb, hsb, cmyk ou websafe @msg `view` must be wheel or box `view` doit valoir wheel ou box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` doit valoir hue, saturation, brightness, red, green ou blue -@msg `sliders` must be none or oklch `sliders` doit valoir none ou oklch +@msg `sliders` must be none, oklch or hsl `sliders` doit valoir none, oklch ou hsl @msg OKLCH needs sRGB as the working RGB space OKLCH nécessite sRGB comme espace de travail RGB @msg `{k}` must be [x, y] `{k}` doit être [x, y] @msg `{name}` has no options `{name}` n’a pas d’options diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 32c652dd0c..5ac1a3004e 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -1853,6 +1853,7 @@ Knockout Group નૉકઆઉટ ગ્રૂપ LZW Compression LZW કમ્પ્રેશન OKLCH Sliders OKLCH સ્લાઇડર્સ + HSL Sliders HSL સ્લાઇડર્સ Chroma ક્રોમા The largest chroma sRGB holds at this lightness and hue આ લાઇટનેસ અને હ્યૂ પર sRGB સમાવી શકે તે સૌથી વધુ ક્રોમા OKLCH needs sRGB as the working RGB space OKLCH માટે કાર્યકારી RGB સ્પેસ તરીકે sRGB જરૂરી છે diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 83a994aa31..04c8ead6f3 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -2502,6 +2502,7 @@ antiAlias Sharp शार्प Knockout Group नॉकआउट समूह Lab Lab OKLCH Sliders OKLCH स्लाइडर्स + HSL Sliders HSL स्लाइडर्स Chroma क्रोमा The largest chroma sRGB holds at this lightness and hue इस लाइटनेस और ह्यू पर sRGB में आने वाला सबसे अधिक क्रोमा OKLCH needs sRGB as the working RGB space OKLCH के लिए वर्किंग RGB स्पेस sRGB होना चाहिए @@ -6186,7 +6187,7 @@ antiAlias Sharp शार्प @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` को grayscale, rgb, hsb, cmyk या websafe होना चाहिए @msg `view` must be wheel or box `view` को wheel या box होना चाहिए @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` को hue, saturation, brightness, red, green या blue होना चाहिए -@msg `sliders` must be none or oklch `sliders` none या oklch होना चाहिए +@msg `sliders` must be none, oklch or hsl `sliders` none, oklch या hsl होना चाहिए @msg OKLCH needs sRGB as the working RGB space OKLCH के लिए वर्किंग RGB स्पेस sRGB होना चाहिए @msg `mode` must be one of {_1} `mode` को {_1} में से एक होना चाहिए @msg `mojikumi` must be "none", "yakumonoHankaku", "gyomatsuYakumonoHankaku", "gyomatsuYakumonoZenkaku", "yakumonoZenkaku" or "lineEndHalf" `mojikumi` "none", "yakumonoHankaku", "gyomatsuYakumonoHankaku", "gyomatsuYakumonoZenkaku", "yakumonoZenkaku" या "lineEndHalf" होना चाहिए। diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 440a1502ce..bbbc9dcb08 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -2278,6 +2278,7 @@ file-filter Templates Sablonok Knockout Group Kiütő csoport Lab Lab OKLCH Sliders OKLCH csúszkák + HSL Sliders HSL csúszkák Chroma Króma The largest chroma sRGB holds at this lightness and hue A legnagyobb króma, amelyet az sRGB ezen a világosságon és színárnyalaton tartalmaz OKLCH needs sRGB as the working RGB space Az OKLCH-hoz sRGB munka-RGB-színtér szükséges @@ -4951,7 +4952,7 @@ imageTrace Outline Körvonal @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode`: grayscale, rgb, hsb, cmyk vagy websafe kell @msg `view` must be wheel or box `view`: wheel vagy box kell @msg `channel` must be hue, saturation, brightness, red, green or blue `channel`: hue, saturation, brightness, red, green vagy blue kell -@msg `sliders` must be none or oklch A `sliders` értéke none vagy oklch lehet +@msg `sliders` must be none, oklch or hsl A `sliders` értéke none, oklch vagy hsl lehet @msg OKLCH needs sRGB as the working RGB space Az OKLCH-hoz sRGB munka-RGB-színtér szükséges @msg `{k}` must be [x, y] `{k}`: [x, y] kell @msg `{name}` has no options ennek nincsenek beállításai: `{name}` diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index cafd55eb3b..7247ddb603 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -3979,6 +3979,7 @@ axis Both Keduanya Ink Tinta Lab Lab OKLCH Sliders Penggeser OKLCH + HSL Sliders Penggeser HSL Chroma Kroma The largest chroma sRGB holds at this lightness and hue Kroma terbesar yang dapat dimuat sRGB pada kecerahan dan rona ini OKLCH needs sRGB as the working RGB space OKLCH memerlukan sRGB sebagai ruang RGB kerja @@ -5662,7 +5663,7 @@ mark-style Japanese Jepang @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` harus grayscale, rgb, hsb, cmyk atau websafe @msg `view` must be wheel or box `view` harus wheel atau box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` harus hue, saturation, brightness, red, green atau blue -@msg `sliders` must be none or oklch `sliders` harus none atau oklch +@msg `sliders` must be none, oklch or hsl `sliders` harus none, oklch, atau hsl @msg OKLCH needs sRGB as the working RGB space OKLCH memerlukan sRGB sebagai ruang RGB kerja @msg the Color Picker is not open Pemilih Warna tidak terbuka @msg the screen color sampler is already open pengambil warna layar sudah terbuka diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 7bdc9e209b..927e633748 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -1859,6 +1859,7 @@ file-filter Templates Modelli Knockout Group Gruppo con foratura Lab Lab OKLCH Sliders Cursori OKLCH + HSL Sliders Cursori HSL Chroma Croma The largest chroma sRGB holds at this lightness and hue Il croma più alto che sRGB contiene con questa luminosità e tonalità OKLCH needs sRGB as the working RGB space OKLCH richiede sRGB come spazio di lavoro RGB @@ -4578,7 +4579,7 @@ axis Both Entrambi @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` deve essere grayscale, rgb, hsb, cmyk o websafe @msg `view` must be wheel or box `view` deve essere wheel o box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` deve essere hue, saturation, brightness, red, green o blue -@msg `sliders` must be none or oklch `sliders` deve essere none o oklch +@msg `sliders` must be none, oklch or hsl `sliders` deve essere none, oklch o hsl @msg OKLCH needs sRGB as the working RGB space OKLCH richiede sRGB come spazio di lavoro RGB @msg `{k}` must be [x, y] `{k}` deve essere [x, y] @msg `{name}` has no options `{name}` non ha opzioni diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index afdd3199b9..dcbf8bac90 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -3917,6 +3917,7 @@ file-filter Templates テンプレート Keep: 保持: Lab Lab OKLCH Sliders OKLCH スライダー + HSL Sliders HSL スライダー Chroma クロマ The largest chroma sRGB holds at this lightness and hue この明度と色相で sRGB に収まる最大のクロマ OKLCH needs sRGB as the working RGB space OKLCH には作業用 RGB スペースとして sRGB が必要です @@ -5039,7 +5040,7 @@ swatch Bright Violet ビビッドバイオレット @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` には grayscale、rgb、hsb、cmyk、websafe のいずれかを指定してください @msg `view` must be wheel or box `view` には wheel、box のいずれかを指定してください @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` には hue、saturation、brightness、red、green、blue のいずれかを指定してください -@msg `sliders` must be none or oklch `sliders` は none または oklch でなければなりません +@msg `sliders` must be none, oklch or hsl `sliders` には none、oklch、hsl のいずれかを指定してください @msg OKLCH needs sRGB as the working RGB space OKLCH には作業用 RGB スペースとして sRGB が必要です @msg `{key}` must be true or false `{key}` には true または false を指定してください @msg `top` and `below` can't both be true `top` と `below` を同時に true にすることはできません diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 943314c94e..834ebf3333 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -3799,6 +3799,7 @@ axis Both ორივე Ink მელანი Lab Lab OKLCH Sliders OKLCH სლაიდერები + HSL Sliders HSL სლაიდერები Chroma ქრომა The largest chroma sRGB holds at this lightness and hue უდიდესი ქრომა, რომელსაც sRGB იტევს ამ სიღიავესა და ფერის ტონზე OKLCH needs sRGB as the working RGB space OKLCH-ს სამუშაო RGB სივრცედ sRGB სჭირდება @@ -5819,7 +5820,7 @@ imageTrace Outline კონტური @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` უნდა იყოს grayscale, rgb, hsb, cmyk ან websafe @msg `view` must be wheel or box `view` უნდა იყოს wheel ან box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` უნდა იყოს hue, saturation, brightness, red, green ან blue -@msg `sliders` must be none or oklch `sliders` უნდა იყოს none ან oklch +@msg `sliders` must be none, oklch or hsl `sliders` უნდა იყოს none, oklch ან hsl @msg OKLCH needs sRGB as the working RGB space OKLCH-ს სამუშაო RGB სივრცედ sRGB სჭირდება @msg this is a PostScript file (an .ai saved in an older format or without PDF compatibility, or an EPS file), not a PDF: File › Open and File › Place read it as EPS ეს PostScript ფაილია (ძველ ფორმატში ან PDF-თან თავსებადობის გარეშე შენახული .ai, ან EPS ფაილი) და არა PDF: ფაილი › გახსნა და ფაილი › განთავსება მას EPS-ად კითხულობს # Upstream sync 2026-10-16 (3): Intertwine, symbol registration, gradient span, data sets, Batch. diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 575b9832f1..d79e7eb9ed 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3905,6 +3905,7 @@ file-filter Templates 템플릿 Keep: 유지: Lab Lab OKLCH Sliders OKLCH 슬라이더 + HSL Sliders HSL 슬라이더 Chroma 크로마 The largest chroma sRGB holds at this lightness and hue 이 명도와 색조에서 sRGB가 담을 수 있는 최대 크로마 OKLCH needs sRGB as the working RGB space OKLCH를 사용하려면 작업 RGB 공간이 sRGB여야 합니다 @@ -4966,7 +4967,7 @@ theme Appearance 외관 @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode`은(는) grayscale, rgb, hsb, cmyk, websafe 중 하나여야 합니다 @msg `view` must be wheel or box `view`은(는) wheel, box 중 하나여야 합니다 @msg `channel` must be hue, saturation, brightness, red, green or blue `channel`은(는) hue, saturation, brightness, red, green, blue 중 하나여야 합니다 -@msg `sliders` must be none or oklch `sliders`는 none 또는 oklch여야 합니다 +@msg `sliders` must be none, oklch or hsl `sliders`는 none, oklch 또는 hsl이어야 합니다 @msg OKLCH needs sRGB as the working RGB space OKLCH를 사용하려면 작업 RGB 공간이 sRGB여야 합니다 @msg `{key}` must be true or false `{key}`은(는) true 또는 false여야 합니다 @msg `top` and `below` can't both be true `top`과 `below`를 동시에 true로 지정할 수 없습니다 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index b9253f4126..24102c783c 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -4497,6 +4497,7 @@ axis Both Beide Ink Inkt Lab Lab OKLCH Sliders OKLCH-schuifregelaars + HSL Sliders HSL-schuifregelaars Chroma Chroma The largest chroma sRGB holds at this lightness and hue De grootste chroma die sRGB bij deze helderheid en tint bevat OKLCH needs sRGB as the working RGB space OKLCH vereist sRGB als werk-RGB-ruimte @@ -8060,7 +8061,7 @@ mark-style Japanese Japans @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` moet grayscale, rgb, hsb, cmyk of websafe zijn @msg `view` must be wheel or box `view` moet wheel of box zijn @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` moet hue, saturation, brightness, red, green of blue zijn -@msg `sliders` must be none or oklch `sliders` moet none of oklch zijn +@msg `sliders` must be none, oklch or hsl `sliders` moet none, oklch of hsl zijn @msg OKLCH needs sRGB as the working RGB space OKLCH vereist sRGB als werk-RGB-ruimte @msg the Color Picker is not open de kleurenkiezer is niet open @msg the screen color sampler is already open de schermkleurkiezer is al open diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 0bc13e2719..56c090925b 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4110,6 +4110,7 @@ axis Both Obie Ink Farba Lab Lab OKLCH Sliders Suwaki OKLCH + HSL Sliders Suwaki HSL Chroma Chroma The largest chroma sRGB holds at this lightness and hue Największa chroma, jaką sRGB mieści przy tej jasności i barwie OKLCH needs sRGB as the working RGB space OKLCH wymaga sRGB jako roboczej przestrzeni RGB @@ -4660,7 +4661,7 @@ imageTrace Outline Kontur @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` musi mieć wartość grayscale, rgb, hsb, cmyk lub websafe @msg `view` must be wheel or box `view` musi mieć wartość wheel lub box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` musi mieć wartość hue, saturation, brightness, red, green lub blue -@msg `sliders` must be none or oklch `sliders` musi mieć wartość none lub oklch +@msg `sliders` must be none, oklch or hsl `sliders` musi mieć wartość none, oklch lub hsl @msg OKLCH needs sRGB as the working RGB space OKLCH wymaga sRGB jako roboczej przestrzeni RGB @msg `{k}` must be [x, y] `{k}` musi mieć postać [x, y] @msg `{name}` has no options `{name}` nie ma opcji diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 1930951832..cdab6fb420 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -5059,6 +5059,7 @@ axis Both Ambos @plural {n} part of the file wasn't read|{n} parts of the file weren't read {n} parte do arquivo não foi lida|{n} partes do arquivo não foram lidas Lab Lab OKLCH Sliders Controles Deslizantes OKLCH + HSL Sliders Controles Deslizantes HSL Chroma Croma The largest chroma sRGB holds at this lightness and hue O maior croma que o sRGB comporta nesta luminosidade e neste tom OKLCH needs sRGB as the working RGB space OKLCH requer sRGB como espaço de trabalho RGB @@ -6121,7 +6122,7 @@ mark-style Japanese Japonesas @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` deve ser grayscale, rgb, hsb, cmyk ou websafe @msg `view` must be wheel or box `view` deve ser wheel ou box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` deve ser hue, saturation, brightness, red, green ou blue -@msg `sliders` must be none or oklch `sliders` deve ser none ou oklch +@msg `sliders` must be none, oklch or hsl `sliders` deve ser none, oklch ou hsl @msg OKLCH needs sRGB as the working RGB space OKLCH requer sRGB como espaço de trabalho RGB @msg the image can't be read as a texture a imagem não pode ser lida como textura diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index f3837f3b39..21fc4784fe 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -1848,6 +1848,7 @@ file-filter Templates Шаблоны Knockout Group Группа с вырезанием Lab Lab OKLCH Sliders Ползунки OKLCH + HSL Sliders Ползунки HSL Chroma Хрома The largest chroma sRGB holds at this lightness and hue Наибольшая хрома, которую вмещает sRGB при этой светлоте и оттенке OKLCH needs sRGB as the working RGB space Для OKLCH рабочим пространством RGB должно быть sRGB @@ -4563,7 +4564,7 @@ axis Both Оба @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` должно быть grayscale, rgb, hsb, cmyk или websafe @msg `view` must be wheel or box `view` должно быть wheel или box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` должно быть hue, saturation, brightness, red, green или blue -@msg `sliders` must be none or oklch `sliders` должен быть none или oklch +@msg `sliders` must be none, oklch or hsl `sliders` должен быть none, oklch или hsl @msg OKLCH needs sRGB as the working RGB space Для OKLCH рабочим пространством RGB должно быть sRGB @msg `{k}` must be [x, y] `{k}` должно быть [x, y] @msg `{name}` has no options `{name}` не имеет параметров diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 4179e375c2..4b9f7e1422 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -1776,6 +1776,7 @@ font-technology Variable Variabla Knockout Group Utsparningsgrupp Lab Lab OKLCH Sliders OKLCH-reglage + HSL Sliders HSL-reglage Chroma Kroma The largest chroma sRGB holds at this lightness and hue Den största kroma som sRGB rymmer vid denna ljushet och nyans OKLCH needs sRGB as the working RGB space OKLCH kräver sRGB som RGB-arbetsfärgrymd @@ -6123,7 +6124,7 @@ theme Appearance Utseende @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` måste vara grayscale, rgb, hsb, cmyk eller websafe @msg `view` must be wheel or box `view` måste vara wheel eller box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` måste vara hue, saturation, brightness, red, green eller blue -@msg `sliders` must be none or oklch `sliders` måste vara none eller oklch +@msg `sliders` must be none, oklch or hsl `sliders` måste vara none, oklch eller hsl @msg OKLCH needs sRGB as the working RGB space OKLCH kräver sRGB som RGB-arbetsfärgrymd @msg `{key}` must be an array of these names: {_1} `{key}` måste vara en lista med dessa namn: {_1} @msg choose a destination folder välj en målmapp diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 3ebb0cda79..812dbdfe27 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -1655,6 +1655,7 @@ font-technology Variable Değişken Knockout Group Nakavt Grubu Lab Laboratuvar OKLCH Sliders OKLCH Kaydırıcıları + HSL Sliders HSL Kaydırıcıları Chroma Kroma The largest chroma sRGB holds at this lightness and hue sRGB'nin bu açıklık ve renk tonunda alabileceği en yüksek kroma OKLCH needs sRGB as the working RGB space OKLCH, çalışma RGB alanı olarak sRGB gerektirir @@ -4292,7 +4293,7 @@ axis Both Her İkisi @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` grayscale, rgb, hsb, cmyk veya websafe olmalıdır @msg `view` must be wheel or box `view` wheel veya box olmalıdır @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` hue, saturation, brightness, red, green veya blue olmalıdır -@msg `sliders` must be none or oklch `sliders` none veya oklch olmalıdır +@msg `sliders` must be none, oklch or hsl `sliders` none, oklch veya hsl olmalıdır @msg OKLCH needs sRGB as the working RGB space OKLCH, çalışma RGB alanı olarak sRGB gerektirir @msg `{k}` must be [x, y] `{k}` [x, y] olmalıdır @msg `{name}` has no options `{name}`nin seçeneği yok diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index ce6a9ddb66..0dfa7631f1 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -1853,6 +1853,7 @@ file-filter Templates Шаблони Knockout Group Група з вирізуванням Lab Lab OKLCH Sliders Повзунки OKLCH + HSL Sliders Повзунки HSL Chroma Хрома The largest chroma sRGB holds at this lightness and hue Найбільша хрома, яку вміщує sRGB за цієї світлоти й відтінку OKLCH needs sRGB as the working RGB space Для OKLCH робочим простором RGB має бути sRGB @@ -4562,7 +4563,7 @@ axis Both Обидві @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` має бути grayscale, rgb, hsb, cmyk або websafe @msg `view` must be wheel or box `view` має бути wheel або box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` має бути hue, saturation, brightness, red, green або blue -@msg `sliders` must be none or oklch `sliders` має бути none або oklch +@msg `sliders` must be none, oklch or hsl `sliders` має бути none, oklch або hsl @msg OKLCH needs sRGB as the working RGB space Для OKLCH робочим простором RGB має бути sRGB @msg `{k}` must be [x, y] `{k}` має бути [x, y] @msg `{name}` has no options `{name}` не має параметрів diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 9b0db7ab99..4f22b35a01 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -2125,6 +2125,7 @@ digits Hindi Hindi Knockout Group Nhóm Knockout Lab Lab OKLCH Sliders Thanh trượt OKLCH + HSL Sliders Thanh trượt HSL Chroma Độ tươi màu The largest chroma sRGB holds at this lightness and hue Độ tươi màu lớn nhất mà sRGB chứa được ở độ sáng và sắc độ này OKLCH needs sRGB as the working RGB space OKLCH cần sRGB làm không gian RGB làm việc @@ -4611,7 +4612,7 @@ theme Appearance Giao diện @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` phải là grayscale, rgb, hsb, cmyk hoặc websafe @msg `view` must be wheel or box `view` phải là wheel hoặc box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` phải là hue, saturation, brightness, red, green hoặc blue -@msg `sliders` must be none or oklch `sliders` phải là none hoặc oklch +@msg `sliders` must be none, oklch or hsl `sliders` phải là none, oklch hoặc hsl @msg OKLCH needs sRGB as the working RGB space OKLCH cần sRGB làm không gian RGB làm việc @msg `{k}` must be [x, y] `{k}` phải là [x, y] @msg `{name}` has no options `{name}` không có tùy chọn diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index c1393ec92c..7bf214053a 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -1737,6 +1737,7 @@ file-filter Templates 模板 Knockout Group 挖空组 Lab Lab OKLCH Sliders OKLCH 滑块 + HSL Sliders HSL 滑块 Chroma 色度 The largest chroma sRGB holds at this lightness and hue sRGB 在此亮度和色相下可容纳的最大色度 OKLCH needs sRGB as the working RGB space OKLCH 需要将 sRGB 用作 RGB 工作空间 @@ -4722,7 +4723,7 @@ imageTrace Outline 轮廓 @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` 必须是 grayscale、rgb、hsb、cmyk 或 websafe @msg `view` must be wheel or box `view` 必须是 wheel 或 box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` 必须是 hue、saturation、brightness、red、green 或 blue -@msg `sliders` must be none or oklch `sliders` 必须是 none 或 oklch +@msg `sliders` must be none, oklch or hsl `sliders` 必须是 none、oklch 或 hsl @msg OKLCH needs sRGB as the working RGB space OKLCH 需要将 sRGB 用作 RGB 工作空间 @msg `{key}` must be true or false `{key}` 必须是 true 或 false @msg `top` and `below` can't both be true `top` 和 `below` 不能同时为 true diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 4a7b55f335..8f2a9186e4 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -2419,7 +2419,7 @@ file-filter Templates 範本 @msg `mode` must be grayscale, rgb, hsb, cmyk or websafe `mode` 必須是 grayscale、rgb、hsb、cmyk 或 websafe @msg `view` must be wheel or box `view` 必須是 wheel 或 box @msg `channel` must be hue, saturation, brightness, red, green or blue `channel` 必須是 hue、saturation、brightness、red、green 或 blue -@msg `sliders` must be none or oklch `sliders` 必須是 none 或 oklch +@msg `sliders` must be none, oklch or hsl `sliders` 必須是 none、oklch 或 hsl @msg OKLCH needs sRGB as the working RGB space OKLCH 需要將 sRGB 用作 RGB 工作空間 @msg `{key}` must be true or false `{key}` 必須是 true 或 false @msg `top` and `below` can't both be true `top` 和 `below` 不能同時為 true @@ -2918,6 +2918,7 @@ file-filter Templates 範本 Knockout Group 去底群組 Lab Lab OKLCH Sliders OKLCH 滑桿 + HSL Sliders HSL 滑桿 Chroma 色度 The largest chroma sRGB holds at this lightness and hue sRGB 在此亮度和色相下可容納的最大色度 OKLCH needs sRGB as the working RGB space OKLCH 需要將 sRGB 用作 RGB 工作空間 diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index afb4c70d1d..31e6b1a23d 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -1355,7 +1355,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.colorWheel", "Color Wheel Options", "", - "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, sliders?: none|oklch} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, pick the box's channel, as Box Channel does, and show no slider rows under the wheel or the box (none) or OKLCH Sliders (oklch), as OKLCH Sliders 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); OKLCH Sliders edit lightness 0 to 100 %, chroma 0 to 100 % of 0.4 and hue 0 to 360°, CSS Color 4's OKLCH of the display sRGB, and a color outside sRGB keeps L and H and takes the largest chroma that fits; 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, oklch is an error while the working RGB space is not sRGB, 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, sliders}", + "{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, sliders?: none|oklch|hsl} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, pick the box's channel, as Box Channel does, and show no slider rows under the wheel or the box (none), OKLCH Sliders (oklch) or HSL Sliders (hsl), as the menu items of those names do: the box is a color field with the channel's strip at its right, and the field shows the other two components (hue: saturation across and brightness up; saturation: hue across and brightness up; brightness: hue across and saturation up; red: blue across and green up; green: blue across and red up; blue: red across and green up); OKLCH Sliders edit lightness 0 to 100 %, chroma 0 to 100 % of 0.4 and hue 0 to 360°, CSS Color 4's OKLCH of the display sRGB, and a color outside sRGB keeps L and H and takes the largest chroma that fits; HSL Sliders edit hue 0 to 360°, saturation 0 to 100 % and lightness 0 to 100 %, CSS Color 4's HSL of the display sRGB; 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, oklch is an error while the working RGB space is not sRGB, 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, sliders}", ), ( "ui.savePdfDialog", diff --git a/crates/ui-egui/src/panels/color_wheel.rs b/crates/ui-egui/src/panels/color_wheel.rs index 2a88a3f54a..0b3549311f 100644 --- a/crates/ui-egui/src/panels/color_wheel.rs +++ b/crates/ui-egui/src/panels/color_wheel.rs @@ -15,14 +15,17 @@ //! Panel menu › OKLCH Sliders shows L, C and H rows under the wheel or the box that edit the color //! by OKLCH lightness, chroma and hue (CSS Color 4: //! ), while the working RGB space is -//! sRGB. The choice is kept with the preferences too. +//! sRGB. Panel menu › HSL Sliders shows H, S and L rows in their place that edit the color by the +//! hue, saturation and lightness of CSS Color 4's HSL +//! (). The choice is kept with the +//! preferences too. use egui::{Color32, Rect, Stroke, Ui, UiBuilder, pos2, vec2}; use serde::{Deserialize, Serialize}; use serde_json::{Value, json}; use vectorcraft_color::cms::{self, Cms}; use vectorcraft_color::oklab::{self, CHROMA_FULL}; -use vectorcraft_color::{Color, Paint, hsb_to_rgb, rgb_to_hsb}; +use vectorcraft_color::{Color, Paint, hsb_to_rgb, hsl_to_rgb, rgb_to_hsb, rgb_to_hsl}; use vectorcraft_doc::{ColorMode, NodeId}; use super::color::{Target, apply, wheel_target}; @@ -86,16 +89,19 @@ pub enum Sliders { None, /// OKLCH Sliders: lightness, chroma and hue. Oklch, + /// HSL Sliders: hue, saturation and lightness. + Hsl, } impl Sliders { - pub const ALL: [Sliders; 2] = [Sliders::None, Sliders::Oklch]; + pub const ALL: [Sliders; 3] = [Sliders::None, Sliders::Oklch, Sliders::Hsl]; /// The id `ui.colorWheel` and the preferences use. pub fn id(self) -> &'static str { match self { Sliders::None => "none", Sliders::Oklch => "oklch", + Sliders::Hsl => "hsl", } } @@ -131,9 +137,9 @@ pub fn deserialize_settings<'de, D: serde::Deserializer<'de>>(d: D) -> Result Result { set(&mut app.ui.color_wheel, p, &cms::active())?; Ok(json!(app.ui.color_wheel)) @@ -164,7 +170,7 @@ pub(crate) fn set(settings: &mut Settings, p: &Value, cms: &Cms) -> Result<(), S match p.get("sliders") { None | Some(Value::Null) => {} Some(v) => { - let sliders = v.as_str().and_then(Sliders::parse).ok_or("`sliders` must be none or oklch")?; + let sliders = v.as_str().and_then(Sliders::parse).ok_or("`sliders` must be none, oklch or hsl")?; if sliders == Sliders::Oklch && !cms.rgb_is_srgb() { return Err(OKLCH_NEEDS_SRGB.to_string()); } @@ -175,7 +181,8 @@ pub(crate) fn set(settings: &mut Settings, p: &Value, cms: &Cms) -> Result<(), S Ok(()) } -/// The panel menu: Wheel View and Box View, Box Channel while the box shows, and OKLCH Sliders. +/// The panel menu: Wheel View and Box View, Box Channel while the box shows, HSL Sliders and OKLCH +/// Sliders. 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)] { @@ -193,6 +200,13 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) { }); }); ui.separator(); + let on = set.sliders == Sliders::Hsl; + if menu_item(ui, tl!("HSL Sliders"), true, on) { + let sliders = if on { Sliders::None } else { Sliders::Hsl }; + if let Err(e) = app.run("ui.colorWheel", json!({ "sliders": sliders.id() })) { + app.status(e); + } + } let on = set.sliders == Sliders::Oklch; // While the rows show, the item stays enabled so that they can be hidden. let enabled = on || cms::active().rgb_is_srgb(); @@ -280,6 +294,9 @@ const MEMORY: &str = "color-wheel-hsb"; const OKLCH_MEMORY: &str = "color-wheel-oklch"; /// The message for OKLCH Sliders while the working RGB space is not sRGB. const OKLCH_NEEDS_SRGB: &str = "OKLCH needs sRGB as the working RGB space"; +/// Panel state: the HSL the slider rows asked for last, the [`Owner`] of the color they stored and +/// its display sRGB. +const HSL_MEMORY: &str = "color-wheel-hsl"; /// What the HSB picked last belongs to: the document, the selected objects or text characters, /// the appearance item, the proxy, the gradient stop or freeform point, its paint, and the color @@ -475,6 +492,75 @@ pub(crate) fn oklch_rows(app: &VectorcraftApp, ui: &mut Ui, tgt: &Target, color: out.filter(|_| enabled) } +/// The HSL `[h°, s, l]` the rows show for `c` through `cms` when `hsl` was asked for last and `c` +/// then displayed as the sRGB `shown`: `hsl` while `c` still displays as `shown` (the hue of a gray +/// and the saturation of black and white stay), else `c`'s own. +pub(crate) fn remembered_hsl(cms: &Cms, c: &Color, shown: [f32; 3], hsl: [f32; 3]) -> [f32; 3] { + if cms.display_rgb(c) == shown { hsl } else { rgb_to_hsl(cms.display_rgb(c)) } +} + +/// The color a track shows at HSL `hsl`. +fn hsl32(hsl: [f32; 3]) -> Color32 { + let [r, g, b] = hsl_to_rgb(hsl).map(|v| (v.clamp(0.0, 1.0) * 255.0).round() as u8); + Color32::from_rgb(r, g, b) +} + +/// The H, S and L rows of HSL Sliders for the target's `color` through `cms`: hue from 0 to 360°, +/// saturation and lightness from 0 to 100 %, CSS Color 4's HSL of the display sRGB. Each track +/// shows the colors its slider reaches. The rows are gray with no color to edit. Returns the HSL a +/// drag, an arrow key, a screen reader or a field asks for, and its phase. +pub(crate) fn hsl_rows(app: &VectorcraftApp, ui: &mut Ui, tgt: &Target, color: Option, cms: &Cms) -> Option<([f32; 3], Live)> { + let t = Tokens::get(ui.ctx()); + let enabled = color.is_some(); + let hsl = match (color, pstate::>(ui.ctx(), HSL_MEMORY)) { + (Some(c), Some((owner, shown, hsl))) if owner == Owner::of(app, tgt, c) => remembered_hsl(cms, &c, shown, hsl), + (Some(c), _) => rgb_to_hsl(cms.display_rgb(&c)), + (None, _) => [0.0; 3], + }; + // Each row: its letter, its screen-reader name, the end of its range and the field's suffix. The + // names start with "HSL" so that they differ from the box strip's HSB Hue and Saturation. + let hsl_name = |name: &str| format!("HSL {name}"); + let rows = + [("H", hsl_name(tl!("Hue")), 360.0, "°"), ("S", hsl_name(tl!("Saturation")), 100.0, "%"), ("L", hsl_name(tl!("Lightness")), 100.0, "%")]; + let shown = [f64::from(hsl[0]), f64::from(hsl[1]) * 100.0, f64::from(hsl[2]) * 100.0]; + // The HSL with row `i` set to `v` in the row's units. + let with = |i: usize, v: f64| { + let mut out = hsl; + match i { + 0 => out[0] = v.clamp(0.0, 360.0) as f32, + 1 => out[1] = (v / 100.0).clamp(0.0, 1.0) as f32, + _ => out[2] = (v / 100.0).clamp(0.0, 1.0) as f32, + } + out + }; + let mut out = None; + ui.add_enabled_ui(enabled, |ui| { + let field_w = 48.0; + let slider_w = (ui.available_width() - field_w - 12.0 - 3.0 * ui.spacing().item_spacing.x).max(60.0); + for (i, (letter, name, max, suffix)) in rows.into_iter().enumerate() { + ui.horizontal(|ui| { + ui.add_sized(vec2(12.0, 22.0), egui::Label::new(egui::RichText::new(letter).size(12.5).color(t.text))); + let v = shown[i].clamp(0.0, max); + let at = |x: f32| with(i, f64::from(x) * max); + let track = |x: f32| if enabled { hsl32(at(x)) } else { t.input }; + let value = SliderValue::field(v, 0.0..=max, suffix, 0); + let (dragged, phase, keyed) = + widgets::color_slider_stepped(ui, ("color-wheel-hsl", i), &name, Some(value), (v / max) as f32, slider_w, &track); + if let Some(x) = dragged { + out = Some((at(x), phase)); + } + if let Some(k) = keyed { + out = Some((with(i, k), Live::Released)); + } + if let Some(f) = widgets::plain_field_named(ui, ("color-wheel-hsl-field", i), Some(&name), v, suffix, 0, field_w) { + out = Some((with(i, f), Live::Released)); + } + }); + } + }); + out.filter(|_| enabled) +} + pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { let tgt = wheel_target(app, ui); let color = tgt.color(); @@ -520,13 +606,28 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { pick = Some(([hsb[0], x, 1.0 - y], field_phase)); } }); - let mut picked_lch = None; - if app.ui.color_wheel.sliders == Sliders::Oklch { - ui.add_space(4.0); - picked_lch = oklch_rows(app, ui, &tgt, color, &cms); + let (mut picked_lch, mut picked_hsl) = (None, None); + match app.ui.color_wheel.sliders { + Sliders::None => {} + Sliders::Oklch => { + ui.add_space(4.0); + picked_lch = oklch_rows(app, ui, &tgt, color, &cms); + } + Sliders::Hsl => { + ui.add_space(4.0); + picked_hsl = hsl_rows(app, ui, &tgt, color, &cms); + } } let behind = super::alt_held(ui); let cmyk_doc = app.session.active().is_some_and(|d| d.doc.color_mode == ColorMode::Cmyk); + if let Some((hsl, phase)) = picked_hsl { + let c = stored_srgb(&cms, hsl_to_rgb(hsl), replaced(app, &tgt, behind).as_ref(), cmyk_doc); + apply(app, &tgt, c, phase, behind); + if !behind { + set_pstate(ui.ctx(), HSL_MEMORY, Some((Owner::of(app, &tgt, c), cms.display_rgb(&c), hsl))); + } + return; + } if let Some((lch, phase)) = picked_lch { let (srgb, _) = oklab::from_oklch(lch[0], lch[1], lch[2]); let c = stored_srgb(&cms, srgb, replaced(app, &tgt, behind).as_ref(), cmyk_doc); diff --git a/crates/ui-egui/src/panels/tests_color_wheel.rs b/crates/ui-egui/src/panels/tests_color_wheel.rs index 407f6ffabe..7cba14af3a 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel.rs @@ -12,7 +12,7 @@ use vectorcraft_color::{Color, Paint}; use vectorcraft_engine::Session; use super::color_wheel::{ - ID, Settings, Sliders, chroma_tick, display_hsb, oklch_rows, oklch_track, remembered_hsb, remembered_oklch, set, show, stored, + ID, Settings, Sliders, chroma_tick, display_hsb, oklch_rows, oklch_track, remembered_hsb, remembered_hsl, remembered_oklch, set, show, stored, }; use crate::VectorcraftApp; @@ -817,15 +817,193 @@ fn the_remembered_oklch_follows_a_change_of_working_space() { assert_eq!(remembered_oklch(&p3, &c, shown, asked), vectorcraft_color::oklab::to_oklch(p3.display_rgb(&c))); } +/// The panel with HSL Sliders shown, in a flyout tall enough for the rows. `oklch_slider` and +/// `oklch_harness_shown` find and draw any slider row, the HSL rows included. +fn hsl_harness(mut app: VectorcraftApp) -> Harness<'static, VectorcraftApp> { + app.run("ui.colorWheel", json!({"sliders": "hsl"})).unwrap(); + oklch_harness_shown(app) +} + +fn fill_hsl(app: &VectorcraftApp) -> [f32; 3] { + vectorcraft_color::rgb_to_hsl(cms::active().display_rgb(&fill(app))) +} + +/// Sets the slider row named `name` to `v` as a screen reader does. +fn set_slider_value(h: &mut Harness<'static, VectorcraftApp>, name: &str, v: f64) { + let (target_node, target_tree) = oklch_slider(h, name).accesskit_node().locate(); + let data = Some(ActionData::NumericValue(v)); + h.event(Event::AccessKitActionRequest(ActionRequest { target_node, target_tree, action: Action::SetValue, data })); + // The frame that takes the request draws the row before it applies it. + h.run_steps(2); +} + +/// `ui.colorWheel {sliders: "hsl"}` shows H, S and L rows with the fill's HSL, CSS Color 4's +/// `hsl()` of its display sRGB, and the panel keeps the setting with the preferences. +#[test] +fn hsl_sliders_show_the_fills_hue_saturation_and_lightness() { + let h = hsl_harness(app(json!("#ff8000"))); + assert_eq!(h.state().ui.color_wheel.sliders, Sliders::Hsl); + let value = |name: &str| oklch_slider(&h, name).accesskit_node().numeric_value().unwrap(); + assert_eq!((value("HSL Hue"), value("HSL Saturation"), value("HSL Lightness")), (30.0, 100.0, 50.0)); + assert!(h.query_by_label("Chroma").is_none(), "OKLCH Sliders are hidden"); + let saved = serde_json::to_value(&h.state().ui).unwrap(); + assert_eq!(saved["color_wheel"]["sliders"], json!("hsl")); +} + +/// In Box View with the Saturation channel, screen readers tell the box strip's HSB saturation +/// from the S row's HSL saturation by their names. +#[test] +fn the_hsl_rows_names_differ_from_the_box_strips() { + let mut app = app(json!("#996633")); + app.run("ui.colorWheel", json!({"view": "box", "channel": "saturation"})).unwrap(); + let h = hsl_harness(app); + let sliders = |name: &str| h.query_all_by_label(name).filter(|n| n.accesskit_node().role() == egui::accesskit::Role::Slider).count(); + assert_eq!((sliders("Saturation"), sliders("HSL Saturation")), (1, 1)); + let strip = oklch_slider(&h, "Saturation").accesskit_node().numeric_value().unwrap(); + let row = oklch_slider(&h, "HSL Saturation").accesskit_node().numeric_value().unwrap(); + assert_ne!(strip, row, "HSB and HSL saturation differ for this color"); +} + +/// A drag on L changes the lightness and keeps the hue and the saturation. +#[test] +fn a_drag_on_hsl_lightness_keeps_the_hue_and_saturation() { + let mut h = hsl_harness(app(json!("#ff8000"))); + let rail = oklch_slider(&h, "HSL Lightness").rect(); + let undo = undo_len(h.state()); + drag(&mut h, &[on_rail(rail, 0.5), on_rail(rail, 0.25)], Modifiers::NONE); + assert!(near(fill_hsl(h.state()), [30.0, 1.0, 0.25], [1.0, 0.01, 0.01]), "{:?}", fill_hsl(h.state())); + assert_eq!(undo_len(h.state()), undo + 1, "a drag is one undo step"); +} + +/// A press on S gives it the keyboard focus, and → raises it by 1 % as one undo step. Each row +/// reports its range and the adjust actions to screen readers. +#[test] +fn the_hsl_rows_take_the_arrow_keys_and_screen_readers_actions() { + let mut h = hsl_harness(app(json!("#996633"))); + for (name, max) in [("HSL Hue", 360.0), ("HSL Saturation", 100.0), ("HSL Lightness", 100.0)] { + let node = oklch_slider(&h, name).accesskit_node(); + assert_eq!((node.min_numeric_value(), node.max_numeric_value(), node.numeric_value_step()), (Some(0.0), Some(max), Some(1.0)), "{name}"); + assert!([Action::Increment, Action::Decrement, Action::SetValue].iter().all(|a| node.data().supports_action(*a)), "{name}"); + } + let rail = oklch_slider(&h, "HSL Saturation").rect(); + let s = fill_hsl(h.state())[1]; + click(&mut h, on_rail(rail, s), Modifiers::NONE); + let before = fill_hsl(h.state()); + let undo = undo_len(h.state()); + key(&mut h, egui::Key::ArrowRight, Modifiers::NONE); + let after = fill_hsl(h.state()); + let raised = ((before[1] * 100.0).round() + 1.0) / 100.0; + assert!(near(after, [before[0], raised, before[2]], [1.0, 0.008, 0.003]), "{before:?} → {after:?}"); + assert_eq!(undo_len(h.state()), undo + 1, "one undo step"); +} + +/// A gray has no hue: a hue given to it stays on the H row while the color is unchanged, and a +/// saturation picked next uses that hue. +#[test] +fn a_gray_keeps_the_hsl_hue_it_was_given() { + let mut h = hsl_harness(app(json!("#808080"))); + let (gray, undo) = (fill(h.state()), undo_len(h.state())); + set_slider_value(&mut h, "HSL Hue", 200.0); + assert_eq!(oklch_slider(&h, "HSL Hue").accesskit_node().numeric_value(), Some(200.0), "a gray keeps the hue it was given"); + assert_eq!((fill(h.state()), undo_len(h.state())), (gray, undo), "a hue on a gray changes nothing and records no undo step"); + set_slider_value(&mut h, "HSL Saturation", 60.0); + let got = fill_hsl(h.state()); + assert!(near(got, [200.0, 0.6, 0.5], [1.0, 0.01, 0.01]), "{got:?}"); +} + +/// In a working RGB space wider than sRGB, an HSL pick goes from display sRGB into that space +/// through the color settings: the fill displays the HSL asked for, and its stored RGB numbers are +/// those of the working space, not the sRGB numbers of that HSL. +#[test] +fn an_hsl_pick_in_display_p3_goes_into_the_working_space() { + const CHILD: &str = "VECTORCRAFT_TEST_COLOR_WHEEL_HSL_P3"; + if std::env::var_os(CHILD).is_none() { + // Color settings are process-wide: change them in a separate test process. + let output = std::process::Command::new(std::env::current_exe().unwrap()) + .args(["--exact", "panels::tests_color_wheel::an_hsl_pick_in_display_p3_goes_into_the_working_space", "--nocapture"]) + .env(CHILD, "1") + .output() + .unwrap(); + let stdout = String::from_utf8_lossy(&output.stdout); + assert!( + output.status.success() && stdout.contains("test result: ok. 1 passed; 0 failed;"), + "isolated working space test failed:\n{stdout}\n{}", + String::from_utf8_lossy(&output.stderr), + ); + return; + } + let mut app = app(json!("#996633")); + app.run("edit.colorSettings", json!({"rgb": cms::DISPLAY_P3})).unwrap(); + let mut h = hsl_harness(app); + let [hue, sat, _] = fill_hsl(h.state()); + let undo = undo_len(h.state()); + set_slider_value(&mut h, "HSL Lightness", 60.0); + let asked = [hue, sat, 0.6]; + assert!(near(fill_hsl(h.state()), asked, [0.5, 0.005, 0.005]), "{asked:?} → {:?}", fill_hsl(h.state())); + assert_eq!(undo_len(h.state()), undo + 1, "one undo step"); + let Color::Rgb { r, g, b } = fill(h.state()) else { panic!("an RGB fill stays RGB") }; + let srgb = vectorcraft_color::hsl_to_rgb(asked); + assert!((0..3).any(|i| ([r, g, b][i] - srgb[i]).abs() > 0.01), "{:?} is stored as the sRGB numbers {srgb:?}", [r, g, b]); +} + +/// Panel menu › HSL Sliders shows the H, S and L rows in place of OKLCH Sliders and, checked, +/// hides them; it is offered in any working RGB space. +#[test] +fn the_panel_menu_shows_and_hides_the_hsl_rows() { + let mut fonts = false; + let mut app = app(json!("#ff0000")); + app.run("ui.colorWheel", json!({"sliders": "oklch"})).unwrap(); + let mut h = Harness::builder().with_size(vec2(260.0, 200.0)).build_ui_state( + move |ui, app: &mut VectorcraftApp| { + // The fonts, which hold the check mark, take effect from the next frame. + if !fonts { + crate::theme::install_fonts(ui.ctx()); + fonts = true; + return; + } + super::color_wheel::menu(app, ui); + }, + app, + ); + h.run_steps(3); + h.get_by_label(" HSL Sliders").click(); + h.run_steps(2); + assert_eq!(h.state().ui.color_wheel.sliders, Sliders::Hsl); + assert!(h.query_by_label("✓ OKLCH Sliders").is_none(), "the two slider sets show one at a time"); + h.get_by_label("✓ HSL Sliders").click(); + h.run_steps(2); + assert_eq!(h.state().ui.color_wheel.sliders, Sliders::None); + let p3 = Cms::new(&ColorSettings { rgb: cms::DISPLAY_P3.into(), ..ColorSettings::default() }).unwrap(); + let mut settings = Settings::default(); + set(&mut settings, &json!({"sliders": "hsl"}), &p3).unwrap(); + assert_eq!(settings.sliders, Sliders::Hsl, "HSL needs no particular working space"); +} + +/// The rows show what they asked for while the color displays as it did, and the color's own HSL +/// after the color settings change its display. +#[test] +fn the_remembered_hsl_follows_a_change_of_working_space() { + let srgb = Cms::default(); + let p3 = Cms::new(&ColorSettings { rgb: cms::DISPLAY_P3.into(), ..ColorSettings::default() }).unwrap(); + let c = Color::rgb(0.5, 0.3, 0.2); + let asked = [20.0, 0.43, 0.35]; + let shown = srgb.display_rgb(&c); + assert_eq!(remembered_hsl(&srgb, &c, shown, asked), asked); + assert_eq!(remembered_hsl(&p3, &c, shown, asked), vectorcraft_color::rgb_to_hsl(p3.display_rgb(&c))); +} + /// Saved settings are read key by key: a value this version does not know (one a newer version /// wrote) gives the default, and the other preferences still load. #[test] fn saved_color_wheel_settings_are_read_leniently() { let mut saved = serde_json::to_value(crate::UiState::default()).unwrap(); saved["color_rgb_percent"] = json!(true); - for (value, sliders) in - [(json!({"sliders": "oklch"}), Sliders::Oklch), (json!({"sliders": "hsl", "view": "box"}), Sliders::None), (json!(5), Sliders::None)] - { + for (value, sliders) in [ + (json!({"sliders": "oklch"}), Sliders::Oklch), + (json!({"sliders": "hsl"}), Sliders::Hsl), + (json!({"sliders": "hwb", "view": "box"}), Sliders::None), + (json!(5), Sliders::None), + ] { saved["color_wheel"] = value.clone(); let ui: crate::UiState = serde_json::from_value(saved.clone()).unwrap(); assert_eq!((ui.color_wheel.sliders, ui.color_rgb_percent), (sliders, true), "{value}"); @@ -839,10 +1017,10 @@ fn ui_color_wheel_sets_and_reads_the_sliders() { let mut app = VectorcraftApp::new(Session::new(), Default::default()); app.run("ui.colorWheel", json!({"view": "box", "channel": "red"})).unwrap(); assert_eq!(app.run("ui.colorWheel", json!({})).unwrap()["sliders"], json!("none")); - assert_eq!(app.run("ui.colorWheel", json!({"sliders": "hsl"})).unwrap_err(), "`sliders` must be none or oklch"); + assert_eq!(app.run("ui.colorWheel", json!({"sliders": "hwb"})).unwrap_err(), "`sliders` must be none, oklch or hsl"); let got = app.run("ui.colorWheel", json!({"sliders": "oklch"})).unwrap(); assert_eq!(got, json!({"view": "box", "channel": "red", "sliders": "oklch"})); - let e = app.run("ui.colorWheel", json!({"view": "wheel", "sliders": "hsl"})).unwrap_err(); - assert_eq!(e, "`sliders` must be none or oklch"); + let e = app.run("ui.colorWheel", json!({"view": "wheel", "sliders": "hwb"})).unwrap_err(); + assert_eq!(e, "`sliders` must be none, oklch or hsl"); assert_eq!(app.ui.color_wheel.view, crate::panels::color_wheel::View::Box, "an error changes nothing"); } diff --git a/docs/control-protocol.md b/docs/control-protocol.md index 1f3e8c45ee..8136585625 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -266,9 +266,9 @@ Color Wheel panel (`window.panel {panel: "colorWheel"}`): a hue ring around a sa 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?, sliders?}` shows the wheel or -the box (a color field with a channel strip at its right), picks the box's channel, and shows or hides OKLCH Sliders -(`sliders: "oklch"` is an error while the working RGB space is not sRGB); it returns the settings, and `ui.inspect` -reports them as `ui.color_wheel`. +the box (a color field with a channel strip at its right), picks the box's channel, and shows OKLCH Sliders, HSL +Sliders or neither (`sliders: "oklch"`, `"hsl"` or `"none"`; `"oklch"` is an error while the working RGB space is not +sRGB); 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 58e7ea3a0c..f34952f048 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -634,6 +634,8 @@ kept with the preferences. `ui.colorWheel {"sliders": "oklch"}` shows the Color Wheel panel's OKLCH Sliders (L, C and H rows under the wheel or the box), and `"none"` hides them; `"oklch"` is an error while the working RGB space is not sRGB. +`ui.colorWheel {"sliders": "hsl"}` shows HSL Sliders in their place: H, S and L rows with the hue (0 to 360°), +saturation and lightness (0 to 100 %) of the color's display sRGB, as CSS Color 4's `hsl()` defines them. `color.convert {"to": "oklch"}` answers the color's OKLCH as `[L %, C, H°]` of its display sRGB. A color outside sRGB (a Lab or CMYK color, or an RGB color in a wider working RGB space) is clipped to sRGB first. diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 17be7b4c6c..cbd747051a 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1556,6 +1556,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Swatch library and Recolor Artwork parameters:** the `swatch.library.*` commands, `swatch.resetDefaults`, the graphic style library save, load and add, the `recolor.*` commands and `color.harmony`'s `limitTo` refuse parameters of the wrong form, such as `names: "Grays"`, `limitTo: 5` or `includeImages: "false"`. Errors name the parameter, except that a `limitTo` that is not a string, such as `5`, gets an unknown-library error. A `null` counts as left out except for `recolor.apply`'s `model`, which must be a string when given. - **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. - **OKLCH Sliders (Color Wheel panel):** as VectorCraft's own addition, the Color Wheel panel's menu item OKLCH Sliders (`ui.colorWheel {sliders: "oklch"}`, kept with the preferences) shows L, C and H rows under the wheel or the box that edit the color by the OKLCH lightness (0 to 100 %), chroma (0 to 100 % of 0.4) and hue (0 to 360°) of its display sRGB, as CSS Color 4 defines them (https://www.w3.org/TR/css-color-4/#specifying-oklab-oklch). Each track dims the colors outside sRGB, and a tick on the C track marks the largest chroma sRGB holds at the row's L and H; a color outside sRGB keeps L and H and takes the largest chroma that fits, and the C row keeps the chroma asked for. The rows take the arrow keys after a click and report their names, values, ranges and adjust actions to screen readers. The item is gray, and `ui.colorWheel` answers an error, while the working RGB space is not sRGB. `color.convert {to: "oklch"}` answers the same L, C and H. Evidence: `crates/color/src/oklab.rs` tests; `convert_to_oklch_answers_lightness_chroma_and_hue` in `crates/engine/src/tests/colormgmt.rs`; the OKLCH tests in `crates/ui-egui/src/panels/tests_color_wheel.rs`, `the_oklch_tracks_dim_the_colors_outside_srgb_and_the_tick_marks_the_largest_chroma` and `oklch_sliders_are_gray_after_the_working_space_changes` among them. Scores and estimates are unchanged. + - **HSL Sliders (Color Wheel panel):** as VectorCraft's own addition, the Color Wheel panel's menu item HSL Sliders (`ui.colorWheel {sliders: "hsl"}`, kept with the preferences) shows H, S and L rows in place of OKLCH Sliders that edit the color by the hue (0 to 360°), saturation and lightness (0 to 100 %) of its display sRGB, as CSS Color 4 defines HSL (https://www.w3.org/TR/css-color-4/#the-hsl-notation). A pick goes from display sRGB into the working RGB space as the wheel's picks do, and the rows keep the hue of a gray. The rows take the arrow keys after a click and report their names, values, ranges and adjust actions to screen readers. Evidence: `hsl_follows_css_color_4` and `hsl_roundtrip` in `crates/color/src/lib.rs`; the HSL tests in `crates/ui-egui/src/panels/tests_color_wheel.rs`, `a_gray_keeps_the_hsl_hue_it_was_given` among them. Scores and estimates are unchanged. - **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 7cf2036a17c23ddef36ba5457e0206eb439b3089 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 22:21:08 -0800 Subject: [PATCH 13/55] Symbolism: the options dialog refuses an unknown tool before any density change OK in Symbolism Tools Options with a tool field that names no symbolism tool gave the selected symbol sets the new density before tool.setOption refused the tool. The dialog now refuses the tool first, and nothing changes. --- .../ui-egui/src/dialogs/symbolism_options.rs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/dialogs/symbolism_options.rs b/crates/ui-egui/src/dialogs/symbolism_options.rs index 388049c29d..b70a250f97 100644 --- a/crates/ui-egui/src/dialogs/symbolism_options.rs +++ b/crates/ui-egui/src/dialogs/symbolism_options.rs @@ -137,14 +137,18 @@ fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> DialogResult { let mut values: Map = NUMBERS.iter().filter_map(|k| Some((k.to_string(), stored(k)?))).collect(); values.extend(SWITCHES.iter().filter_map(|k| Some((k.to_string(), d.fields.get(*k)?.clone())))); values.extend(SPRAY.iter().chain(&["method"]).filter(|k| d.fields.contains_key(**k)).map(|k| (k.to_string(), json!(d.str(k))))); - // A value `tool.setOption` refuses changes no density either. - vectorcraft_tools::symbolism::check_options(&d.str("tool"), &values)?; + // A tool or a value `tool.setOption` refuses changes no density either. + let tool = d.str("tool"); + if !SYMBOLISM.contains(&tool.as_str()) { + return Err(format!("unknown tool `{tool}`")); + } + vectorcraft_tools::symbolism::check_options(&tool, &values)?; let (from, to) = (d.f64(DENSITY_WAS, 0.0).clamp(1.0, 10.0), d.f64("density", 0.0).clamp(1.0, 10.0)); let sets = selected_sets(app); if d.fields.contains_key(DENSITY_WAS) && from != to && !sets.is_empty() { app.run("symbol.setDensity", json!({ "from": from, "to": to, "ids": sets }))?; } - run_and_close(app, "tool.setOption", json!({ "tool": d.str("tool"), "values": values })) + run_and_close(app, "tool.setOption", json!({ "tool": tool, "values": values })) } #[cfg(test)] @@ -304,7 +308,14 @@ mod tests { assert_eq!((width(&app), undo(&app)), (was, steps)); assert_eq!(app.session.tool_options_of("symbolSizer")["density"].as_f64(), Some(5.0)); // So does a checkbox or a number stored as a value of the wrong kind. - for (k, v) in [("usePressure", json!("invalid")), ("proportional", json!(1)), ("intensity", json!("strong")), ("diameter", json!(true))] { + for (k, v) in [ + ("usePressure", json!("invalid")), + ("proportional", json!(1)), + ("intensity", json!("strong")), + ("diameter", json!(true)), + ("tool", json!("pen")), + ("tool", json!(null)), + ] { app.run("tool.options", json!({"tool": "symbolSprayer"})).unwrap(); let fields = &mut app.ui.dialog.as_mut().unwrap().fields; fields.insert("density".into(), json!(9)); From 4d9fa0a2c26791f49f5a7d66b57513ff025635c7 Mon Sep 17 00:00:00 2001 From: haseeb Date: Tue, 17 Nov 2026 11:05:11 +0300 Subject: [PATCH 14/55] Show full room and solid scrollbar in dropdown popups --- crates/ui-egui/src/widgets/dropdowns.rs | 7 +- crates/ui-egui/src/widgets/look_tests.rs | 90 ++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/widgets/dropdowns.rs b/crates/ui-egui/src/widgets/dropdowns.rs index 7f088f25ef..d77333e7d6 100644 --- a/crates/ui-egui/src/widgets/dropdowns.rs +++ b/crates/ui-egui/src/widgets/dropdowns.rs @@ -148,10 +148,15 @@ fn combo_atoms_named<'a, R>( .show(ui, |ui| { let button_id = combo_button_id(ui, &id); let enter_for_combo = ui.memory(|m| m.has_focus(button_id)) || craft_ui::ComboBox::is_open(ui.ctx(), button_id); + let max_height = (ui.ctx().content_rect().height() - MENU_GAP).max(ui.spacing().combo_height); let response = craft_ui::ComboBox::from_id_salt(HashOnly(&id)) .selected_text(current) .width(width - 4.0) - .height(ui.spacing().combo_height) + .height(max_height) + .popup_style(egui::style::StyleModifier::new(|style| { + egui::containers::menu::menu_style(style); + style.spacing.scroll = list_scroll_style(); + })) .show_ui(ui, list); // The button or open list handles Enter before the modal can accept it. if enter_for_combo { diff --git a/crates/ui-egui/src/widgets/look_tests.rs b/crates/ui-egui/src/widgets/look_tests.rs index 274861386b..210d707d81 100644 --- a/crates/ui-egui/src/widgets/look_tests.rs +++ b/crates/ui-egui/src/widgets/look_tests.rs @@ -524,3 +524,93 @@ fn kerning_reads_parentheses_around_its_text_with_a_manual_value_too() { assert_eq!(typed(automatic, "(1,5)"), Some(SpinPick::Value(1.5)), "a decimal comma, automatic: {automatic}"); } } + +/// Long dropdown lists use the window's room instead of stopping at `combo_height` (200 pt), and +/// show a solid scroll bar without hovering when the list still overflows. +#[test] +fn a_long_dropdown_uses_window_room_and_shows_its_scroll_bar_when_clipped() { + let items: Vec = (0..20).map(|i| format!("Format {i:02}")).collect(); + let labels: Vec<&str> = items.iter().map(String::as_str).collect(); + let run = |win_h: f32| { + let ctx = themed(Default::default()); + let button_rect = std::cell::Cell::new(Rect::NOTHING); + let mut draw = |ui: &mut Ui| { + ui.add_space(16.0); + ui.horizontal(|ui| { + ui.add_space(16.0); + let before = ui.next_widget_position(); + let _ = dropdown_names(ui, "long-formats", labels[0], &labels, 160.0); + button_rect.set(Rect::from_min_size(before, vec2(160.0, 26.0))); + }); + }; + let mut step = |time: f64, events: Vec| { + let raw = egui::RawInput { + time: Some(time), + screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(400.0, win_h))), + events, + ..Default::default() + }; + let mut out = ctx.run_ui(raw, &mut draw); + out.textures_delta.clear(); + out.shapes + }; + step(0.0, vec![]); + let at = button_rect.get().center(); + let click = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + step(0.1, vec![egui::Event::PointerMoved(at), click(true)]); + step(0.2, vec![click(false)]); + // Move the pointer away so the scroll bar is dormant, not hovered, and let the popup settle. + step(0.3, vec![egui::Event::PointerMoved(pos2(350.0, 10.0))]); + let mut clipped = vec![]; + for i in 4..10 { + clipped = step(f64::from(i) * 0.1, vec![]); + } + (ctx, clipped) + }; + + // In a tall window, all 20 items show without stopping at the 200 pt cap. + let (_tall_ctx, tall_shapes) = run(720.0); + let mut texts = vec![]; + fn collect_text(s: &egui::Shape, out: &mut Vec) { + match s { + egui::Shape::Vec(v) => v.iter().for_each(|s| collect_text(s, out)), + egui::Shape::Text(t) => out.push(t.galley.text().to_string()), + _ => {} + } + } + for c in &tall_shapes { + collect_text(&c.shape, &mut texts); + } + assert!(texts.iter().any(|t| t == "Format 19"), "the 20th option is shown without scrolling: {texts:?}"); + + // In a short window where the list overflows, a solid scroll bar is drawn even while dormant. + let (short_ctx, short_shapes) = run(220.0); + let mut short_texts = vec![]; + for c in &short_shapes { + collect_text(&c.shape, &mut short_texts); + } + assert!(!short_texts.iter().any(|t| t == "Format 19"), "the list overflows the 220 pt window"); + let popup = short_ctx + .memory(|m| m.layer_ids().filter(|l| l.order == egui::Order::Foreground && m.areas().is_visible(l)).last().and_then(|l| m.area_rect(l.id))) + .expect("the popup is open"); + let mut bar_rects = vec![]; + fn collect_rects(s: &egui::Shape, out: &mut Vec) { + match s { + egui::Shape::Vec(v) => v.iter().for_each(|s| collect_rects(s, out)), + egui::Shape::Rect(r) => out.push(r.clone()), + _ => {} + } + } + for c in &short_shapes { + collect_rects(&c.shape, &mut bar_rects); + } + let has_scroll_bar = bar_rects.iter().any(|r| { + r.fill != Color32::TRANSPARENT + && r.rect.width() <= list_scroll_style().bar_width + 1.0 + && r.rect.height() >= 12.0 + && r.rect.height() < popup.height() + && r.rect.right() <= popup.right() + && r.rect.left() >= popup.right() - list_scroll_style().allocated_width() - 8.0 + }); + assert!(has_scroll_bar, "the overflowing dropdown draws its scroll bar without hover in {popup:?}"); +} From 07f852fb5940641f41bc9802494f1b493121b1cc Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 14:52:57 -0800 Subject: [PATCH 15/55] Brushes: Add original Artistic brush library --- crates/engine/src/cmd/brushlib.rs | 37 +++++++++++++++++++ crates/engine/src/tests/brushlib.rs | 29 ++++++++++++++- 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/gu.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/tests.rs | 3 +- 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 ++ .../src/panels/tests_brush_libraries.rs | 9 ++++- docs/mcp.md | 4 +- docs/target-app-parity.md | 3 +- 34 files changed, 191 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/cmd/brushlib.rs b/crates/engine/src/cmd/brushlib.rs index 34becd7c02..629701fa11 100644 --- a/crates/engine/src/cmd/brushlib.rs +++ b/crates/engine/src/cmd/brushlib.rs @@ -179,6 +179,7 @@ pub const BUILTIN: &[BuiltinBrushLibrary] = &[ BuiltinBrushLibrary { id: "energy-beams", name: "Energy Beams", make: energy_beams }, BuiltinBrushLibrary { id: "dry-media", name: "Dry Media", make: dry_media }, BuiltinBrushLibrary { id: "tech-circuit", name: "Tech Circuit", make: tech_circuit }, + BuiltinBrushLibrary { id: "artistic", name: "Artistic", make: artistic }, ]; /// Built-in library `id`, made once. @@ -232,6 +233,42 @@ fn art(name: &str, art: Node, colorization: Colorization) -> Brush { Brush { name: name.into(), kind: BrushKind::Art(ArtBrush { art, colorization, ..Default::default() }) } } +/// Artistic: four original vector compositions that stretch along a path and take its color. +fn artistic() -> BrushLibrary { + let orbit = group(vec![ + black(band(100.0, 1.4, 64, |x| 3.0 * (x * std::f64::consts::TAU / 40.0).sin())), + black(band(100.0, 1.4, 64, |x| -3.0 * (x * std::f64::consts::TAU / 40.0).sin())), + ]); + let mut petals = vec![black(band(100.0, 0.8, 4, |_| 0.0))]; + for i in 0..6 { + let x = 9.0 + 16.0 * i as f64; + let side = if i % 2 == 0 { 1.0 } else { -1.0 }; + petals.push(black(polygon(&[(x - 6.0, 0.0), (x - 2.0, 5.0 * side), (x + 5.0, 7.0 * side), (x + 2.0, 2.0 * side)]))); + } + let mut lattice = vec![black(band(100.0, 0.9, 4, |_| 0.0))]; + for i in 0..5 { + let x = 20.0 * i as f64; + lattice.push(black(polygon(&[(x, -4.0), (x + 1.0, -4.0), (x + 20.0, 4.0), (x + 19.0, 4.0)]))); + lattice.push(black(polygon(&[(x, 4.0), (x + 1.0, 4.0), (x + 20.0, -4.0), (x + 19.0, -4.0)]))); + } + let mut facets = Vec::new(); + for i in 0..8 { + let x = 12.5 * i as f64; + let high = if i % 2 == 0 { 6.0 } else { 3.5 }; + facets.push(black(polygon(&[(x, -high), (x + 11.0, -high / 2.0), (x + 12.5, 0.0), (x + 11.0, high / 2.0), (x, high)]))); + } + built( + "Artistic", + Document::new(100.0, 100.0), + vec![ + art("Orbit Lines", orbit, Colorization::Tints), + art("Petal Garland", group(petals), Colorization::Tints), + art("Lattice Braid", group(lattice), Colorization::Tints), + art("Facet Sweep", group(facets), Colorization::Tints), + ], + ) +} + /// Art Ribbons: art brushes, 100 pt long, drawn here; Striped Ribbon is filled with the library's /// own pattern, Pinstripes. fn art_ribbons() -> BrushLibrary { diff --git a/crates/engine/src/tests/brushlib.rs b/crates/engine/src/tests/brushlib.rs index 4f0b739951..19ca14a3f0 100644 --- a/crates/engine/src/tests/brushlib.rs +++ b/crates/engine/src/tests/brushlib.rs @@ -116,7 +116,8 @@ fn the_builtin_libraries_are_original_brushes_generated_in_code() { "game-trails", "energy-beams", "dry-media", - "tech-circuit" + "tech-circuit", + "artistic" ] ); assert!(libs.iter().all(|l| l["category"] == "builtIn")); @@ -160,6 +161,7 @@ fn the_builtin_libraries_are_original_brushes_generated_in_code() { ("game-trails", "art"), ("energy-beams", "art"), ("dry-media", "art"), + ("artistic", "art"), ] { let (_, lib) = cmd::brushlib::library(&s, id).unwrap(); assert!(lib.len() >= 4, "{id}"); @@ -190,6 +192,31 @@ fn the_builtin_libraries_are_original_brushes_generated_in_code() { assert!(s.execute("brush.library", &json!({"library": "nope"})).is_err()); } +#[test] +fn artistic_library_strokes_are_editable_and_reopen_from_a_saved_library() { + let mut s = session(); + let (_, lib) = cmd::brushlib::library(&s, "artistic").unwrap(); + let names = ["Orbit Lines", "Petal Garland", "Lattice Braid", "Facet Sweep"]; + assert_eq!(lib.brushes.iter().map(|b| b.name.as_str()).collect::>(), names); + let line = run(&mut s, "shape.line", json!({"x1": 10, "y1": 50, "x2": 190, "y2": 50}))["id"].as_u64().unwrap(); + for b in &lib.brushes { + let BrushKind::Art(a) = &b.kind else { panic!("{} is not an art brush", b.name) }; + assert!(art_paths(&a.art).len() >= 2, "{} has no editable vector art", b.name); + for path in [line_to(180.0), line_to(1.0)] { + assert!(!vectorcraft_brush::stroke_pieces(&lib.doc, b, &path, &black_stroke()).is_empty(), "{} draws nothing", b.name); + } + let before = undo_len(&s); + let added = run(&mut s, "brush.addFromLibrary", json!({"library": "artistic", "name": b.name, "apply": true, "ids": [line]})); + assert_eq!(strs(&added["added"]), [b.name.as_str()]); + assert_eq!(added["applied"], json!([line])); + assert_eq!(undo_len(&s), before + 1); + } + let saved = run(&mut s, "brush.saveLibrary", json!({"names": names})); + let bytes = vectorcraft_format::base64_decode(saved["dataBase64"].as_str().unwrap()).unwrap(); + let reopened = vectorcraft_format::load(&bytes).unwrap(); + assert_eq!(vectorcraft_brush::library(&reopened), lib.brushes); +} + /// Every path of brush art `n`: (anchors, opacity). fn art_paths(n: &vectorcraft_doc::Node) -> Vec<(usize, f32)> { let mut out = vec![]; diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index bb039bb08e..3cbbddaa1d 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -7237,3 +7237,7 @@ breakText Glyphs Глифи @msg A fold line is on a non-printing layer. Линия на сгъване е на слой, който не се печата. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Панели: {panels}, панти: {hinges}, грешки: {errors}, предупреждения: {warnings} @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer трябва да е "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine" + Orbit Lines Орбитални линии + Petal Garland Гирлянд от венчелистчета + Lattice Braid Решетъчна плетка + Facet Sweep Фасетен щрих diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 99f23d313c..ce8d8a4ab1 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -7291,3 +7291,7 @@ shape Open Otvoren @msg A fold line is on a non-printing layer. Linija savijanja je na sloju koji se ne štampa. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneli: {panels}, šarke: {hinges}, greške: {errors}, upozorenja: {warnings} @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer mora biti "singleLine", "everyLine", "standardSingleLine" ili "standardEveryLine" + Orbit Lines Orbitalne linije + Petal Garland Vijenac od latica + Lattice Braid Rešetkasti preplet + Facet Sweep Fasetni potez diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index c54311799d..f1cffbafe9 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -8126,3 +8126,7 @@ breakText Glyphs Glifs @msg A fold line is on a non-printing layer. Una línia de plegat és en una capa que no s’imprimeix. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panells: {panels}, frontisses: {hinges}, errors: {errors}, avisos: {warnings} @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer ha de ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine" + Orbit Lines Línies orbitals + Petal Garland Garlanda de pètals + Lattice Braid Trena reticular + Facet Sweep Traç facetat diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index a5d7bb948a..4c7f75f26e 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -9917,3 +9917,7 @@ breakText Glyphs Glyfy @msg A panel is not joined to the rest by a crease. Panel není se zbytkem spojen žádnou linií bigu. @msg A fold line is on a non-printing layer. Linie skladu je na netisknutelné vrstvě. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panely: {panels}, panty: {hinges}, chyby: {errors}, upozornění: {warnings} + Orbit Lines Orbitální čáry + Petal Garland Okvětní girlanda + Lattice Braid Mřížkový cop + Facet Sweep Fazetový tah diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 08100f593f..525afef49c 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -10025,3 +10025,7 @@ breakText Glyphs Glyffer @msg A fold line is on a non-printing layer. En foldelinje ligger på et lag, der ikke udskrives. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneler: {panels}, hængsler: {hinges}, fejl: {errors}, advarsler: {warnings} @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer skal være "singleLine", "everyLine", "standardSingleLine" eller "standardEveryLine" + Orbit Lines Banekurver + Petal Garland Kronbladsguirlande + Lattice Braid Gitterfletning + Facet Sweep Facetteret strøg diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 10147b2d45..6697f76f1d 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -9516,3 +9516,7 @@ breakText Glyphs Glyphen @msg A panel is not joined to the rest by a crease. Ein Feld ist durch keine Rilllinie mit den übrigen verbunden. @msg A fold line is on a non-printing layer. Eine Faltlinie liegt auf einer nicht druckbaren Ebene. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Felder: {panels}, Scharniere: {hinges}, Fehler: {errors}, Warnungen: {warnings} + Orbit Lines Orbitlinien + Petal Garland Blütengirlande + Lattice Braid Gittergeflecht + Facet Sweep Facettenstrich diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 1ebf6e5684..63445bf761 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -8100,3 +8100,7 @@ breakText Glyphs Γλύφοι @msg A fold line is on a non-printing layer. Μια γραμμή δίπλωσης βρίσκεται σε επίπεδο που δεν εκτυπώνεται. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Πάνελ: {panels}, μεντεσέδες: {hinges}, σφάλματα: {errors}, προειδοποιήσεις: {warnings} @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" το composer πρέπει να είναι "singleLine", "everyLine", "standardSingleLine" ή "standardEveryLine" + Orbit Lines Τροχιακές γραμμές + Petal Garland Γιρλάντα πετάλων + Lattice Braid Πλεξούδα πλέγματος + Facet Sweep Πολυεδρική πινελιά diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index a456910a16..9ebf373510 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -8087,3 +8087,7 @@ breakText Glyphs Glifos @msg A fold line is on a non-printing layer. Una línea de plegado está en una capa que no se imprime. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneles: {panels}, bisagras: {hinges}, errores: {errors}, advertencias: {warnings} @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer debe ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine" + Orbit Lines Líneas orbitales + Petal Garland Guirnalda de pétalos + Lattice Braid Trenza reticular + Facet Sweep Trazo facetado diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index bff46fc0d7..728e5fd50f 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -8183,3 +8183,7 @@ breakText Glyphs Merkit @msg A fold line is on a non-printing layer. Taittoviiva on tasolla, jota ei tulosteta. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneelit: {panels}, saranat: {hinges}, virheet: {errors}, varoitukset: {warnings} @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer on oltava "singleLine", "everyLine", "standardSingleLine" tai "standardEveryLine" + Orbit Lines Kiertoradan viivat + Petal Garland Terälehtiköynnös + Lattice Braid Ristikkopunos + Facet Sweep Särmikäs veto diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 3be3497f97..3501d9d831 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -9902,3 +9902,7 @@ breakText Glyphs Glyphes @msg A fold line is on a non-printing layer. Une ligne de pliage se trouve sur un calque non imprimable. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} {panels} panneau(x), {hinges} charnière(s), {errors} erreur(s), {warnings} avertissement(s) @msg {_1} × {_2} pixels is too large for GIF (at most 65535 pixels a side): lower the resolution {_1} × {_2} pixels, c’est trop grand pour le GIF (65535 pixels par côté au plus) : réduisez la résolution + Orbit Lines Lignes orbitales + Petal Garland Guirlande de pétales + Lattice Braid Tresse en treillis + Facet Sweep Trait à facettes diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index c427fc527c..c220068e1d 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -4987,3 +4987,7 @@ swatch [Registration] [રજિસ્ટ્રેશન] Standard Single-line Composer સ્ટાન્ડર્ડ સિંગલ-લાઇન કમ્પોઝર Standard Every-line Composer સ્ટાન્ડર્ડ એવરી-લાઇન કમ્પોઝર @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer આમાંથી એક હોવું જોઈએ: "singleLine", "everyLine", "standardSingleLine" અથવા "standardEveryLine" + Orbit Lines ભ્રમણકક્ષાની રેખાઓ + Petal Garland પાંખડીઓની માળા + Lattice Braid જાળી વેણી + Facet Sweep પાસાદાર રેખા diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index cbfb4f51d1..853faccbf8 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -9524,3 +9524,7 @@ theme Appearance अपीयरेंस @msg A panel is not joined to the rest by a crease. कोई पैनल किसी क्रीज़ लाइन से बाकी से जुड़ा नहीं है। @msg A fold line is on a non-printing layer. एक फ़ोल्ड लाइन नॉन-प्रिंटिंग लेयर पर है। @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} पैनल: {panels}, हिंज: {hinges}, एरर: {errors}, वॉर्निंग: {warnings} + Orbit Lines कक्षीय रेखाएँ + Petal Garland पंखुड़ी माला + Lattice Braid जाली चोटी + Facet Sweep पहलूदार स्ट्रोक diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 0f81a72036..2ebba74ca4 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -9905,3 +9905,7 @@ breakText Glyphs Glifák @msg A panel is not joined to the rest by a crease. Egy panelt egyetlen bigvonal sem köt a többihez. @msg A fold line is on a non-printing layer. Egy hajtásvonal nem nyomtatható rétegen van. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panelek: {panels}, zsanérok: {hinges}, hibák: {errors}, figyelmeztetések: {warnings} + Orbit Lines Pályavonalak + Petal Garland Sziromfüzér + Lattice Braid Rácsfonat + Facet Sweep Fazettás vonás diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 28ea2b5ab3..a26e217a71 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -7252,3 +7252,7 @@ breakText Glyphs Glif @msg A fold line is on a non-printing layer. Sebuah garis lipat berada di lapisan yang tidak dicetak. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panel: {panels}, engsel: {hinges}, galat: {errors}, peringatan: {warnings} @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer harus "singleLine", "everyLine", "standardSingleLine", atau "standardEveryLine" + Orbit Lines Garis Orbit + Petal Garland Rangkaian Kelopak + Lattice Braid Anyaman Kisi + Facet Sweep Sapuan Berfaset diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 8f2ed3216c..048b51cdfb 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -9550,3 +9550,7 @@ breakText Glyphs Glifi @msg A panel is not joined to the rest by a crease. Un pannello non è unito al resto da alcuna linea di cordonatura. @msg A fold line is on a non-printing layer. Una linea di piega si trova su un livello non stampabile. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Pannelli: {panels}, cerniere: {hinges}, errori: {errors}, avvisi: {warnings} + Orbit Lines Linee orbitali + Petal Garland Ghirlanda di petali + Lattice Braid Intreccio a reticolo + Facet Sweep Tratto sfaccettato diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index c429f204a1..a942a98e0e 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -9617,3 +9617,7 @@ breakText Glyphs 字形 @msg A panel is not joined to the rest by a crease. パネルがどの筋入れ線でも他とつながっていません。 @msg A fold line is on a non-printing layer. 折り線が印刷しないレイヤーにあります。 @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} パネル: {panels}、ヒンジ: {hinges}、エラー: {errors}、警告: {warnings} + Orbit Lines 軌道線 + Petal Garland 花びらのガーランド + Lattice Braid 格子編み + Facet Sweep 多面体のストローク diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 414f45171c..20f8c08415 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -10285,3 +10285,7 @@ font-script Japanese იაპონური @msg A fold line is on a non-printing layer. მოკეცვის ხაზი არაბეჭდვად შრეზეა. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} პანელები: {panels}, ანჯამები: {hinges}, შეცდომები: {errors}, გაფრთხილებები: {warnings} @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer უნდა იყოს "singleLine", "everyLine", "standardSingleLine" ან "standardEveryLine" + Orbit Lines ორბიტული ხაზები + Petal Garland ფურცლების გირლანდა + Lattice Braid ბადის ნაწნავი + Facet Sweep წახნაგოვანი მონასმი diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index dbda53243f..7376c3321a 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -9514,3 +9514,7 @@ breakText Glyphs 글리프 @msg A panel is not joined to the rest by a crease. 패널이 어떤 오시선으로도 나머지와 연결되어 있지 않습니다. @msg A fold line is on a non-printing layer. 접는 선이 인쇄되지 않는 레이어에 있습니다. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} 패널: {panels}, 힌지: {hinges}, 오류: {errors}, 경고: {warnings} + Orbit Lines 궤도 선 + Petal Garland 꽃잎 화환 + Lattice Braid 격자 땋기 + Facet Sweep 면 분할 붓질 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 69aef91cfc..b1f9cf82cd 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -9953,3 +9953,7 @@ breakText Glyphs Glyphs @msg A panel is not joined to the rest by a crease. Een paneel is door geen rillijn met de rest verbonden. @msg A fold line is on a non-printing layer. Een vouwlijn staat op een laag die niet wordt afgedrukt. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panelen: {panels}, scharnieren: {hinges}, fouten: {errors}, waarschuwingen: {warnings} + Orbit Lines Baanlijnen + Petal Garland Bloemblaadjesslinger + Lattice Braid Rastervlecht + Facet Sweep Gefacetteerde streek diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 0147515ffe..0a7463b817 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -9770,3 +9770,7 @@ breakText Glyphs Glify @msg A panel is not joined to the rest by a crease. Panel nie jest połączony z resztą żadną linią bigowania. @msg A fold line is on a non-printing layer. Linia zgięcia znajduje się na warstwie niedrukowanej. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panele: {panels}, zawiasy: {hinges}, błędy: {errors}, ostrzeżenia: {warnings} + Orbit Lines Linie orbitalne + Petal Garland Girlanda płatków + Lattice Braid Plecionka kratowa + Facet Sweep Fasetowane pociągnięcie diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 8201db7ab6..5278240f2c 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -9988,3 +9988,7 @@ swatch Yellow Green Verde-amarelado @msg A panel is not joined to the rest by a crease. Um painel não está unido ao restante por nenhuma linha de vinco. @msg A fold line is on a non-printing layer. Uma linha de dobra está em uma camada não imprimível. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Painéis: {panels}, dobradiças: {hinges}, erros: {errors}, avisos: {warnings} + Orbit Lines Linhas orbitais + Petal Garland Guirlanda de pétalas + Lattice Braid Trança em grade + Facet Sweep Traço facetado diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index d1593508d3..e27905223e 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -10011,3 +10011,7 @@ shape Open Открытый @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Панели: {panels}, шарниры: {hinges}, ошибки: {errors}, предупреждения: {warnings} @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} пикселей — слишком большой размер для PSD (не более {MAX_SIDE} пикселей по стороне): уменьшите разрешение @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer должен быть "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine" + Orbit Lines Орбитальные линии + Petal Garland Гирлянда лепестков + Lattice Braid Решётчатое плетение + Facet Sweep Гранёный мазок diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 5c0420fcd3..9ac219ec4d 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -9601,3 +9601,7 @@ digits Hindi Hindi @msg A fold line is on a non-printing layer. En falslinje ligger på ett lager som inte skrivs ut. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneler: {panels}, gångjärn: {hinges}, fel: {errors}, varningar: {warnings} @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} pixlar är för stort för PSD (högst {MAX_SIDE} pixlar per sida): sänk upplösningen + Orbit Lines Banlinjer + Petal Garland Kronbladsgirlang + Lattice Braid Gallerfläta + Facet Sweep Fasetterat drag diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index 97fccd9167..bf6fa61a89 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -501,8 +501,9 @@ fn built_in_library_brush_names_are_in_complete_catalogs() { .flat_map(|(_, lib)| lib.brushes.iter().map(|b| b.name.clone()).collect::>()) .collect(); names.sort(); + let duplicates: Vec<&str> = names.windows(2).filter(|pair| pair[0] == pair[1]).map(|pair| pair[0].as_str()).collect(); + assert_eq!(duplicates, ["Zigzag"], "only the established Pattern Borders / Game Trails name is shared"); names.dedup(); - assert_eq!(names.len(), 46, "{names:?}"); let mut bad = vec![]; for lang in LANGUAGES.iter().filter(|lang| lang.complete_menus) { let missing: Vec<&String> = names.iter().filter(|n| lang.catalog().plain(n).is_none()).collect(); diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 910a7fc5b1..1ec43640be 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -9875,3 +9875,7 @@ breakText Glyphs Glifler @msg A panel is not joined to the rest by a crease. Bir panel geri kalanlara hiçbir pilyaj çizgisiyle bağlı değil. @msg A fold line is on a non-printing layer. Bir katlama çizgisi yazdırılmayan bir katmanda. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneller: {panels}, menteşeler: {hinges}, hatalar: {errors}, uyarılar: {warnings} + Orbit Lines Yörünge Çizgileri + Petal Garland Taç Yaprağı Çelengi + Lattice Braid Kafes Örgü + Facet Sweep Fasetli Darbe diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index dbd6d2609e..51c66702ad 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -9526,3 +9526,7 @@ breakText Glyphs Гліфи @msg A panel is not joined to the rest by a crease. Панель не з’єднана з рештою жодною лінією біговки. @msg A fold line is on a non-printing layer. Лінія згину лежить на шарі, що не друкується. @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Панелі: {panels}, шарніри: {hinges}, помилки: {errors}, попередження: {warnings} + Orbit Lines Орбітальні лінії + Petal Garland Гірлянда пелюсток + Lattice Braid Ґратчасте плетіння + Facet Sweep Гранований мазок diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 519c5d8f0d..935710a096 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -7759,3 +7759,7 @@ breakText Glyphs Glyph @msg {width} × {height} pixels is too large for Targa (at most 65535 pixels a side): lower the resolution {width} × {height} điểm ảnh quá lớn cho Targa (tối đa 65535 điểm ảnh mỗi cạnh): hãy giảm độ phân giải @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} điểm ảnh quá lớn cho PSD (tối đa {MAX_SIDE} điểm ảnh mỗi cạnh): hãy giảm độ phân giải @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer phải là "singleLine", "everyLine", "standardSingleLine" hoặc "standardEveryLine" + Orbit Lines Đường quỹ đạo + Petal Garland Vòng hoa cánh + Lattice Braid Bện lưới + Facet Sweep Nét đa diện diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index c6696a9ec6..411d5357f1 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -9758,3 +9758,7 @@ breakText Glyphs 字形 @msg A fold line is on a non-printing layer. 一条折线位于不打印的图层上。 @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} 面板:{panels},铰链:{hinges},错误:{errors},警告:{warnings} @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} 像素对 PSD 而言过大 (每边最多 {MAX_SIDE} 像素):请降低分辨率 + Orbit Lines 轨道线 + Petal Garland 花瓣花环 + Lattice Braid 格纹编织 + Facet Sweep 切面笔触 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 1480422931..8c2fd76802 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -9568,3 +9568,7 @@ breakText Glyphs 字符 @msg A fold line is on a non-printing layer. 一條摺線位於不列印的圖層上。 @msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} 面板:{panels},鉸鏈:{hinges},錯誤:{errors},警告:{warnings} @msg {what} would print on more than {MAX_TILES} tiles: scale it down {what} 會列印在超過 {MAX_TILES} 個拼貼上:請縮小 + Orbit Lines 軌道線 + Petal Garland 花瓣花環 + Lattice Braid 格紋編織 + Facet Sweep 切面筆觸 diff --git a/crates/ui-egui/src/panels/tests_brush_libraries.rs b/crates/ui-egui/src/panels/tests_brush_libraries.rs index 87fe34953f..7343068348 100644 --- a/crates/ui-egui/src/panels/tests_brush_libraries.rs +++ b/crates/ui-egui/src/panels/tests_brush_libraries.rs @@ -201,7 +201,8 @@ fn the_window_menu_and_the_brushes_panel_open_brush_libraries() { json!("game-trails"), json!("energy-beams"), json!("dry-media"), - json!("tech-circuit") + json!("tech-circuit"), + json!("artistic") ] ); let dry = entries.iter().find(|e| under(e) && e.params["library"] == "dry-media").map(|e| e.label.as_str()); @@ -232,6 +233,12 @@ fn the_window_menu_and_the_brushes_panel_open_brush_libraries() { click(&mut app, &ctx, "Circuit Trace", Modifiers::NONE, 2.0); assert!(has(&app, "Circuit Trace") && !has(&app, "Bus Lines")); assert_eq!(undo_len(&app), undo + 1); + let r = app.run("window.brushLibrary", json!({"library": "Artistic"})).unwrap(); + assert_eq!((r["open"].as_str(), r["count"].as_u64()), (Some("artistic"), Some(4))); + let undo = undo_len(&app); + click(&mut app, &ctx, "Orbit Lines", Modifiers::NONE, 3.0); + assert!(has(&app, "Orbit Lines") && !has(&app, "Facet Sweep")); + assert_eq!(undo_len(&app), undo + 1); // Without brushes there is nothing to save. let all: Vec = vectorcraft_brush::library(&app.session.doc().unwrap().doc).into_iter().map(|b| b.name).collect(); app.run("brush.delete", json!({ "names": all })).unwrap(); diff --git a/docs/mcp.md b/docs/mcp.md index 4c1b661f42..425badc8e5 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5051,9 +5051,9 @@ error. ## Brush libraries -Brush libraries are read-only sets of brushes: ten generated in code (Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle +Brush libraries are read-only sets of brushes: eleven generated in code (Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes with one bristle brush for each tip shape, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, and Dry Media with the Chalk Grain, Graphite Pencil, Wax Crayon and -Charcoal Dust art brushes, id `dry-media`, and Tech Circuit with Circuit Trace (art), Bus Lines and Terminal Nodes (pattern), id `tech-circuit`), the `.vectorcraft` files in the user library folder of the desktop app (User +Charcoal Dust art brushes, id `dry-media`, and Tech Circuit with Circuit Trace (art), Bus Lines and Terminal Nodes (pattern), id `tech-circuit`, and Artistic with four original vector art brushes, id `artistic`), the `.vectorcraft` files in the user library folder of the desktop app (User Defined) and the brushes of any document loaded with `brush.loadLibrary` (a document without brushes of its own has the default ones). `brush.libraries` lists them (`id`, `name`, `category`: `builtIn`, `user` or `loaded`, `count`) and `brush.library {library}` returns one's brushes (`name`, `type`; `library` is an id or a name). diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index ef83de54ad..d61eac876d 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1104,9 +1104,10 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Expand of symbol instances:** Object › Expand turns selected symbol instances (without effects, not in perspective, in groups or placed documents too) into their art as Break Link to Symbol places it, one level deep, as one undo step; the Expand dialog's Fill and Stroke reach that art (`object.expand`, `crates/engine/src/tests/expand_symbols.rs`; estimated, score unchanged). - **Reset Transformation** ([Transform symbols](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/transform-symbols.html), [Symbols panel options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbols-panel-options.html)): the Symbols panel menu's Reset Transformation and the Control bar's Reset, shown while symbol instances are selected, give the selected instances their symbol's own scale again, without rotation or shear, as one undo step (`symbol.instance.resetTransform`); an instance in perspective is left as it is. VectorCraft's own rules: each instance keeps the center of its bounding box in place, reflection is removed too, and the menu item and the button are enabled only while a selected instance would change. Tests: `tests::brushsym::reset_transformation_restores_the_symbols_scale_and_keeps_the_center`, `reset_transformation_keeps_the_center_of_art_away_from_the_origin`, `reset_transformation_ignores_a_stored_size_that_is_not_positive`, `reset_transformation_leaves_unchanged_instances_and_refuses_bad_ids`, `panels::symbols::tests::reset_transformation_is_enabled_for_a_transformed_instance_and_resets_it`. - **Expand of dimensions:** Object › Expand, Expand Appearance, Create Outlines and Outline Stroke turn a dimension whose art they change into a plain group of that art, which stays as it is through later moves, scales and edits of what it measured; undo gives the live dimension back (`crates/engine/tests/it/dimensions.rs`; VectorCraft's own rule; estimated, score unchanged). - - **Brush libraries** ([public source](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/create-new-brush-libraries.html), [import](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/import-brushes-from-brush-libraries-or-other-files.html), [Brushes panel](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/brushes-panel-overview.html)): Window › Brush Libraries, the Brushes panel's Brush Libraries Menu and its menu's Open Brush Library open each library in a library panel of its own, as swatch, graphic style and symbol libraries do. The built-in libraries (Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media, Tech Circuit) are original brushes generated in code (`crates/engine/src/cmd/brushlib.rs`); Striped Ribbon's art is filled with the library's own pattern and Sparkles scatters the library's own symbol; Ink and Wash adds ink and wash brushes (the [help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html) lists an Ink brush library of strokes with varied thickness and texture; the names, shapes and opacities are VectorCraft's own): Tapered Ink, an art brush broad near its start that thins to a fine tip; Brush Pen, a calligraphic brush whose size follows the pen pressure; and Soft Wash and Pooling Wash, art brushes of translucent gray layers that take the stroke color as tints; Game Trails adds motion art brushes (Speed Line, Dash Trail, Burst Ray, Zigzag); Energy Beams adds laser and plasma art brushes (Laser Bolt, Plasma Arc, Charge Wave, Spark Trail); Dry Media adds grainy art brushes (Chalk Grain, Graphite Pencil, Wax Crayon, Charcoal Dust). A click on a brush adds it to the document's Brushes as one undo step with every resource its art uses (patterns, symbols, swatches, graphic styles, images), makes it the current brush and, with paths selected, applies it to them in the same step; a brush the document already has is not added again and a different brush of the same name comes in numbered ("Wave 2"). Shift/Cmd-clicks select brushes for Add to Brushes; a brush dragged onto a path is added and applied to it, and one dragged onto the Brushes panel is added. Save Brushes… / the Brushes panel's Save Brush Library… write the document's brushes (or the selected ones) as a `.vectorcraft` library into the `Brushes` folder next to the preferences, listed under User Defined, or to a file; Other Library… reads the brushes of any document VectorCraft opens. Thumbnails, in the library panels, the Brushes panel and Brush Options, render brush art with the patterns and symbols it uses. Copying brushed art now carries the patterns and symbols its brush's art uses too. Tests: `crates/engine/src/tests/brushlib.rs`, `crates/ui-egui/src/panels/tests_brush_libraries.rs`, `panels::brushes::tests::library_brush_previews_show_the_patterns_their_art_uses`, `canvas::tests::a_library_brush_dropped_on_a_path_is_added_and_applied_in_one_step`. + - **Brush libraries** ([public source](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/create-new-brush-libraries.html), [import](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/import-brushes-from-brush-libraries-or-other-files.html), [Brushes panel](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/brushes-panel-overview.html)): Window › Brush Libraries, the Brushes panel's Brush Libraries Menu and its menu's Open Brush Library open each library in a library panel of its own, as swatch, graphic style and symbol libraries do. The built-in libraries (Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media, Tech Circuit, Artistic) are original brushes generated in code (`crates/engine/src/cmd/brushlib.rs`); Striped Ribbon's art is filled with the library's own pattern and Sparkles scatters the library's own symbol; Ink and Wash adds ink and wash brushes (the [help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html) lists an Ink brush library of strokes with varied thickness and texture; the names, shapes and opacities are VectorCraft's own): Tapered Ink, an art brush broad near its start that thins to a fine tip; Brush Pen, a calligraphic brush whose size follows the pen pressure; and Soft Wash and Pooling Wash, art brushes of translucent gray layers that take the stroke color as tints; Game Trails adds motion art brushes (Speed Line, Dash Trail, Burst Ray, Zigzag); Energy Beams adds laser and plasma art brushes (Laser Bolt, Plasma Arc, Charge Wave, Spark Trail); Dry Media adds grainy art brushes (Chalk Grain, Graphite Pencil, Wax Crayon, Charcoal Dust). A click on a brush adds it to the document's Brushes as one undo step with every resource its art uses (patterns, symbols, swatches, graphic styles, images), makes it the current brush and, with paths selected, applies it to them in the same step; a brush the document already has is not added again and a different brush of the same name comes in numbered ("Wave 2"). Shift/Cmd-clicks select brushes for Add to Brushes; a brush dragged onto a path is added and applied to it, and one dragged onto the Brushes panel is added. Save Brushes… / the Brushes panel's Save Brush Library… write the document's brushes (or the selected ones) as a `.vectorcraft` library into the `Brushes` folder next to the preferences, listed under User Defined, or to a file; Other Library… reads the brushes of any document VectorCraft opens. Thumbnails, in the library panels, the Brushes panel and Brush Options, render brush art with the patterns and symbols it uses. Copying brushed art now carries the patterns and symbols its brush's art uses too. Tests: `crates/engine/src/tests/brushlib.rs`, `crates/ui-egui/src/panels/tests_brush_libraries.rs`, `panels::brushes::tests::library_brush_previews_show_the_patterns_their_art_uses`, `canvas::tests::a_library_brush_dropped_on_a_path_is_added_and_applied_in_one_step`. - **Bristle Brushes library** ([What's new](https://helpx.adobe.com/illustrator/desktop/new-features/whats-new.html), [About brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html)): Window › Brush Libraries › Bristle Brushes holds ten bristle brushes, one for each tip shape (Fine Liner, Pointed Flat, Stubby Round, Dry Scrub, Soft Dome, Filbert, Angled Round, Angled Flat, Fan Blender, Grass Fan). The brushes, their names and their values are VectorCraft's own, and every value lies inside the range the bristle brush keeps (`brush.libraries`, `brush.addFromLibrary`; `the_bristle_brushes_library_covers_every_tip_shape_within_the_bristle_ranges`). - **Tech Circuit library:** Circuit Trace is a chamfered art brush with 45-degree elbows and terminal pads; Bus Lines repeats three parallel conductor lanes; Terminal Nodes repeats solder pads, circular test points and connecting leads. Original vector geometry generated in code, with Tints colorization and continuous pattern tile edges. Evidence: `the_tech_circuit_library_constructs_adds_and_applies_each_brush` in `crates/engine/src/tests/brushlib.rs` covers listing, finite geometry on straight, curved, short and closed paths, add/apply, undo/redo, deduplication and saved-library round trips. G5 remaining estimate 3–13 h (estimated); area scores unchanged. + - **Artistic brush library** ([About brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html)): Window › Brush Libraries › Artistic offers Orbit Lines, Petal Garland, Lattice Braid and Facet Sweep. Each is original, editable vector artwork stretched along a path by an art brush and tinted by the stroke color. The public page names the category but does not specify its presets. Evidence: `artistic_library_strokes_are_editable_and_reopen_from_a_saved_library` in `crates/engine/src/tests/brushlib.rs` covers drawing on short and long paths, add/apply, undo and saving; `the_window_menu_and_the_brushes_panel_open_brush_libraries` covers the menu and panel. - **Dry Media library** ([help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html)): Window › Brush Libraries › Dry Media holds four art brushes with textured strokes like dry drawing materials, each 100 pt long: Chalk Grain (about 8 pt high), Graphite Pencil (about 2.3 pt), Wax Crayon (about 5.5 pt) and Charcoal Dust (about 7 pt). The brushes, their names, sizes and art are VectorCraft's own: each is filled vector paths from a fixed seed, at most 80 paths and 500 anchors, stretched along the path with Tints colorization, and the chalk and crayon art has even-odd gaps where the paper shows (`brush.libraries`, `brush.addFromLibrary`; `the_dry_media_library_holds_grainy_art_brushes_with_bounded_art`). - **Brush names in library panels**: a built-in brush library's panel shows its brushes' names in the UI language, in its list rows and tooltips, and its Find field matches the name shown or the English name. This is VectorCraft's own rule. A User Defined or Other Library… library's brushes, and the document's Brushes panel, show names as they are stored. A click, a drag, Add to Brushes and `brush.addFromLibrary` still use the English name, so the brush comes into the document under that name (`built_in_library_brushes_are_listed_in_the_ui_language`, `built_in_library_brush_names_are_in_complete_catalogs`). - A canvas context menu: right-click selects the object under the pointer and lists what applies to the selection (Undo/Redo, clipboard, group, isolation, join, Remove Anchor Points when anchors are selected, masks, compound paths, guides, Transform, Arrange, Select, Export Selection, and on type Bullets and Numbering and Spelling › Auto Spell Check, checked while it is on), or the view commands on empty canvas. From 177236f4016a2806c94b879c78cb45839c0b8889 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 15:32:07 -0800 Subject: [PATCH 16/55] Brushes: Localize Artistic library name distinctly --- crates/engine/src/cmd/brushlib.rs | 8 ++++---- crates/engine/src/tests/brushlib.rs | 3 +++ 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/panels/tests_brush_libraries.rs | 6 +++++- docs/mcp.md | 5 +++-- docs/target-app-parity.md | 4 ++-- 33 files changed, 45 insertions(+), 9 deletions(-) diff --git a/crates/engine/src/cmd/brushlib.rs b/crates/engine/src/cmd/brushlib.rs index 629701fa11..3c4767cfa5 100644 --- a/crates/engine/src/cmd/brushlib.rs +++ b/crates/engine/src/cmd/brushlib.rs @@ -179,7 +179,7 @@ pub const BUILTIN: &[BuiltinBrushLibrary] = &[ BuiltinBrushLibrary { id: "energy-beams", name: "Energy Beams", make: energy_beams }, BuiltinBrushLibrary { id: "dry-media", name: "Dry Media", make: dry_media }, BuiltinBrushLibrary { id: "tech-circuit", name: "Tech Circuit", make: tech_circuit }, - BuiltinBrushLibrary { id: "artistic", name: "Artistic", make: artistic }, + BuiltinBrushLibrary { id: "artistic", name: "Artistic Brushes", make: artistic }, ]; /// Built-in library `id`, made once. @@ -258,7 +258,7 @@ fn artistic() -> BrushLibrary { facets.push(black(polygon(&[(x, -high), (x + 11.0, -high / 2.0), (x + 12.5, 0.0), (x + 11.0, high / 2.0), (x, high)]))); } built( - "Artistic", + "Artistic Brushes", Document::new(100.0, 100.0), vec![ art("Orbit Lines", orbit, Colorization::Tints), @@ -822,8 +822,8 @@ pub fn library(s: &Session, key: &str) -> Option<(LibraryInfo, Arc if let Some(found) = concealed_library_id(s, key).and_then(|id| s.brush_libraries.get(&id)) { return Some(found); } - if let Some(b) = BUILTIN.iter().find(|b| b.id == key) { - return Some((builtin_info(b), builtin_library(key)?)); + if let Some(b) = BUILTIN.iter().find(|b| b.id == key || (b.id == "artistic" && key.eq_ignore_ascii_case("Artistic"))) { + return Some((builtin_info(b), builtin_library(b.id)?)); } let id = libraries(s).into_iter().find(|l| l.name.eq_ignore_ascii_case(key))?.id; library(s, &id) diff --git a/crates/engine/src/tests/brushlib.rs b/crates/engine/src/tests/brushlib.rs index 19ca14a3f0..f38204b85d 100644 --- a/crates/engine/src/tests/brushlib.rs +++ b/crates/engine/src/tests/brushlib.rs @@ -196,6 +196,9 @@ fn the_builtin_libraries_are_original_brushes_generated_in_code() { fn artistic_library_strokes_are_editable_and_reopen_from_a_saved_library() { let mut s = session(); let (_, lib) = cmd::brushlib::library(&s, "artistic").unwrap(); + let (_, alias) = cmd::brushlib::library(&s, "Artistic").unwrap(); + assert_eq!(alias.brushes, lib.brushes); + assert_eq!(run(&mut s, "brush.library", json!({"library": "Artistic"}))["id"], "artistic"); let names = ["Orbit Lines", "Petal Garland", "Lattice Braid", "Facet Sweep"]; assert_eq!(lib.brushes.iter().map(|b| b.name.as_str()).collect::>(), names); let line = run(&mut s, "shape.line", json!({"x1": 10, "y1": 50, "x2": 190, "y2": 50}))["id"].as_u64().unwrap(); diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 3cbbddaa1d..5595539b1b 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -7241,3 +7241,4 @@ breakText Glyphs Глифи Petal Garland Гирлянд от венчелистчета Lattice Braid Решетъчна плетка Facet Sweep Фасетен щрих + Artistic Brushes Художествени четки diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index ce8d8a4ab1..280b7393a3 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -7295,3 +7295,4 @@ shape Open Otvoren Petal Garland Vijenac od latica Lattice Braid Rešetkasti preplet Facet Sweep Fasetni potez + Artistic Brushes Umjetničke četke diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index f1cffbafe9..918743dc97 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -8130,3 +8130,4 @@ breakText Glyphs Glifs Petal Garland Garlanda de pètals Lattice Braid Trena reticular Facet Sweep Traç facetat + Artistic Brushes Pinzells artístics diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 4c7f75f26e..97d0b54527 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -9921,3 +9921,4 @@ breakText Glyphs Glyfy Petal Garland Okvětní girlanda Lattice Braid Mřížkový cop Facet Sweep Fazetový tah + Artistic Brushes Umělecké štětce diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 525afef49c..04731cb1a6 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -10029,3 +10029,4 @@ breakText Glyphs Glyffer Petal Garland Kronbladsguirlande Lattice Braid Gitterfletning Facet Sweep Facetteret strøg + Artistic Brushes Kunstneriske pensler diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 6697f76f1d..afd1a4b1d8 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -9520,3 +9520,4 @@ breakText Glyphs Glyphen Petal Garland Blütengirlande Lattice Braid Gittergeflecht Facet Sweep Facettenstrich + Artistic Brushes Künstlerische Pinsel diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 63445bf761..f6f33cd590 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -8104,3 +8104,4 @@ breakText Glyphs Γλύφοι Petal Garland Γιρλάντα πετάλων Lattice Braid Πλεξούδα πλέγματος Facet Sweep Πολυεδρική πινελιά + Artistic Brushes Καλλιτεχνικά πινέλα diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 9ebf373510..ddcceaf867 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -8091,3 +8091,4 @@ breakText Glyphs Glifos Petal Garland Guirnalda de pétalos Lattice Braid Trenza reticular Facet Sweep Trazo facetado + Artistic Brushes Pinceles artísticos diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 728e5fd50f..ace4e320fc 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -8187,3 +8187,4 @@ breakText Glyphs Merkit Petal Garland Terälehtiköynnös Lattice Braid Ristikkopunos Facet Sweep Särmikäs veto + Artistic Brushes Taidesiveltimet diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 3501d9d831..75acf0d7c8 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -9906,3 +9906,4 @@ breakText Glyphs Glyphes Petal Garland Guirlande de pétales Lattice Braid Tresse en treillis Facet Sweep Trait à facettes + Artistic Brushes Pinceaux artistiques diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index c220068e1d..538e29b870 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -4991,3 +4991,4 @@ swatch [Registration] [રજિસ્ટ્રેશન] Petal Garland પાંખડીઓની માળા Lattice Braid જાળી વેણી Facet Sweep પાસાદાર રેખા + Artistic Brushes કલાત્મક બ્રશ diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 853faccbf8..e2eb49c8dc 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -9528,3 +9528,4 @@ theme Appearance अपीयरेंस Petal Garland पंखुड़ी माला Lattice Braid जाली चोटी Facet Sweep पहलूदार स्ट्रोक + Artistic Brushes कलात्मक ब्रश diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 2ebba74ca4..0f54351dcf 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -9909,3 +9909,4 @@ breakText Glyphs Glifák Petal Garland Sziromfüzér Lattice Braid Rácsfonat Facet Sweep Fazettás vonás + Artistic Brushes Művészi ecsetek diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index a26e217a71..df78a33a13 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -7256,3 +7256,4 @@ breakText Glyphs Glif Petal Garland Rangkaian Kelopak Lattice Braid Anyaman Kisi Facet Sweep Sapuan Berfaset + Artistic Brushes Kuas Artistik diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 048b51cdfb..885f4af387 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -9554,3 +9554,4 @@ breakText Glyphs Glifi Petal Garland Ghirlanda di petali Lattice Braid Intreccio a reticolo Facet Sweep Tratto sfaccettato + Artistic Brushes Pennelli artistici diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index a942a98e0e..3dbce04560 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -9621,3 +9621,4 @@ breakText Glyphs 字形 Petal Garland 花びらのガーランド Lattice Braid 格子編み Facet Sweep 多面体のストローク + Artistic Brushes アートブラシ diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 20f8c08415..42d7034155 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -10289,3 +10289,4 @@ font-script Japanese იაპონური Petal Garland ფურცლების გირლანდა Lattice Braid ბადის ნაწნავი Facet Sweep წახნაგოვანი მონასმი + Artistic Brushes მხატვრული ფუნჯები diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 7376c3321a..d760fbfccd 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -9518,3 +9518,4 @@ breakText Glyphs 글리프 Petal Garland 꽃잎 화환 Lattice Braid 격자 땋기 Facet Sweep 면 분할 붓질 + Artistic Brushes 예술 브러시 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index b1f9cf82cd..6752bfc08e 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -9957,3 +9957,4 @@ breakText Glyphs Glyphs Petal Garland Bloemblaadjesslinger Lattice Braid Rastervlecht Facet Sweep Gefacetteerde streek + Artistic Brushes Artistieke penselen diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 0a7463b817..9c4ecb5817 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -9774,3 +9774,4 @@ breakText Glyphs Glify Petal Garland Girlanda płatków Lattice Braid Plecionka kratowa Facet Sweep Fasetowane pociągnięcie + Artistic Brushes Pędzle artystyczne diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 5278240f2c..993e2b42c1 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -9992,3 +9992,4 @@ swatch Yellow Green Verde-amarelado Petal Garland Guirlanda de pétalas Lattice Braid Trança em grade Facet Sweep Traço facetado + Artistic Brushes Pincéis artísticos diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index e27905223e..e5c295c660 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -10015,3 +10015,4 @@ shape Open Открытый Petal Garland Гирлянда лепестков Lattice Braid Решётчатое плетение Facet Sweep Гранёный мазок + Artistic Brushes Художественные кисти diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 9ac219ec4d..4dabbb457d 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -9605,3 +9605,4 @@ digits Hindi Hindi Petal Garland Kronbladsgirlang Lattice Braid Gallerfläta Facet Sweep Fasetterat drag + Artistic Brushes Konstnärliga penslar diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 1ec43640be..4fc7996c39 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -9879,3 +9879,4 @@ breakText Glyphs Glifler Petal Garland Taç Yaprağı Çelengi Lattice Braid Kafes Örgü Facet Sweep Fasetli Darbe + Artistic Brushes Sanatsal Fırçalar diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 51c66702ad..70b1ef5749 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -9530,3 +9530,4 @@ breakText Glyphs Гліфи Petal Garland Гірлянда пелюсток Lattice Braid Ґратчасте плетіння Facet Sweep Гранований мазок + Artistic Brushes Художні пензлі diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 935710a096..1584130345 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -7763,3 +7763,4 @@ breakText Glyphs Glyph Petal Garland Vòng hoa cánh Lattice Braid Bện lưới Facet Sweep Nét đa diện + Artistic Brushes Cọ nghệ thuật diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 411d5357f1..78d1fc3508 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -9762,3 +9762,4 @@ breakText Glyphs 字形 Petal Garland 花瓣花环 Lattice Braid 格纹编织 Facet Sweep 切面笔触 + Artistic Brushes 艺术画笔 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 8c2fd76802..e338396ee4 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -9572,3 +9572,4 @@ breakText Glyphs 字符 Petal Garland 花瓣花環 Lattice Braid 格紋編織 Facet Sweep 切面筆觸 + Artistic Brushes 藝術筆刷 diff --git a/crates/ui-egui/src/panels/tests_brush_libraries.rs b/crates/ui-egui/src/panels/tests_brush_libraries.rs index 7343068348..88cf2f8be8 100644 --- a/crates/ui-egui/src/panels/tests_brush_libraries.rs +++ b/crates/ui-egui/src/panels/tests_brush_libraries.rs @@ -233,8 +233,12 @@ fn the_window_menu_and_the_brushes_panel_open_brush_libraries() { click(&mut app, &ctx, "Circuit Trace", Modifiers::NONE, 2.0); assert!(has(&app, "Circuit Trace") && !has(&app, "Bus Lines")); assert_eq!(undo_len(&app), undo + 1); - let r = app.run("window.brushLibrary", json!({"library": "Artistic"})).unwrap(); + let r = app.run("window.brushLibrary", json!({"library": "Artistic Brushes"})).unwrap(); assert_eq!((r["open"].as_str(), r["count"].as_u64()), (Some("artistic"), Some(4))); + let previous = crate::i18n::current(); + crate::i18n::set_current(crate::i18n::Lang::from_code("de").unwrap()); + assert_eq!(crate::menus::display_label(&app, "window.brushLibrary", "Artistic Brushes"), "Künstlerische Pinsel"); + crate::i18n::set_current(previous); let undo = undo_len(&app); click(&mut app, &ctx, "Orbit Lines", Modifiers::NONE, 3.0); assert!(has(&app, "Orbit Lines") && !has(&app, "Facet Sweep")); diff --git a/docs/mcp.md b/docs/mcp.md index 425badc8e5..6ad039ff2f 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5053,10 +5053,11 @@ error. Brush libraries are read-only sets of brushes: eleven generated in code (Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes with one bristle brush for each tip shape, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, and Dry Media with the Chalk Grain, Graphite Pencil, Wax Crayon and -Charcoal Dust art brushes, id `dry-media`, and Tech Circuit with Circuit Trace (art), Bus Lines and Terminal Nodes (pattern), id `tech-circuit`, and Artistic with four original vector art brushes, id `artistic`), the `.vectorcraft` files in the user library folder of the desktop app (User +Charcoal Dust art brushes, id `dry-media`, and Tech Circuit with Circuit Trace (art), Bus Lines and Terminal Nodes (pattern), id `tech-circuit`, and Artistic Brushes with four original vector art brushes, id `artistic`), the `.vectorcraft` files in the user library folder of the desktop app (User Defined) and the brushes of any document loaded with `brush.loadLibrary` (a document without brushes of its own has the default ones). `brush.libraries` lists them (`id`, `name`, `category`: `builtIn`, `user` or `loaded`, `count`) and -`brush.library {library}` returns one's brushes (`name`, `type`; `library` is an id or a name). +`brush.library {library}` returns one's brushes (`name`, `type`; `library` is an id or a name). The +built-in Artistic Brushes library also accepts `Artistic` as a lookup name. `brush.addFromLibrary {library, name? | names?}` copies brushes into the document's Brushes as one undo step (no names: the whole library), with the resources their art uses: patterns, symbols, swatches (`swatchConflict` as for `edit.paste`), graphic styles and images. Brushes the document already has (same name and definition) are reported diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index d61eac876d..d65b7cc148 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1104,10 +1104,10 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Expand of symbol instances:** Object › Expand turns selected symbol instances (without effects, not in perspective, in groups or placed documents too) into their art as Break Link to Symbol places it, one level deep, as one undo step; the Expand dialog's Fill and Stroke reach that art (`object.expand`, `crates/engine/src/tests/expand_symbols.rs`; estimated, score unchanged). - **Reset Transformation** ([Transform symbols](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/transform-symbols.html), [Symbols panel options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbols-panel-options.html)): the Symbols panel menu's Reset Transformation and the Control bar's Reset, shown while symbol instances are selected, give the selected instances their symbol's own scale again, without rotation or shear, as one undo step (`symbol.instance.resetTransform`); an instance in perspective is left as it is. VectorCraft's own rules: each instance keeps the center of its bounding box in place, reflection is removed too, and the menu item and the button are enabled only while a selected instance would change. Tests: `tests::brushsym::reset_transformation_restores_the_symbols_scale_and_keeps_the_center`, `reset_transformation_keeps_the_center_of_art_away_from_the_origin`, `reset_transformation_ignores_a_stored_size_that_is_not_positive`, `reset_transformation_leaves_unchanged_instances_and_refuses_bad_ids`, `panels::symbols::tests::reset_transformation_is_enabled_for_a_transformed_instance_and_resets_it`. - **Expand of dimensions:** Object › Expand, Expand Appearance, Create Outlines and Outline Stroke turn a dimension whose art they change into a plain group of that art, which stays as it is through later moves, scales and edits of what it measured; undo gives the live dimension back (`crates/engine/tests/it/dimensions.rs`; VectorCraft's own rule; estimated, score unchanged). - - **Brush libraries** ([public source](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/create-new-brush-libraries.html), [import](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/import-brushes-from-brush-libraries-or-other-files.html), [Brushes panel](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/brushes-panel-overview.html)): Window › Brush Libraries, the Brushes panel's Brush Libraries Menu and its menu's Open Brush Library open each library in a library panel of its own, as swatch, graphic style and symbol libraries do. The built-in libraries (Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media, Tech Circuit, Artistic) are original brushes generated in code (`crates/engine/src/cmd/brushlib.rs`); Striped Ribbon's art is filled with the library's own pattern and Sparkles scatters the library's own symbol; Ink and Wash adds ink and wash brushes (the [help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html) lists an Ink brush library of strokes with varied thickness and texture; the names, shapes and opacities are VectorCraft's own): Tapered Ink, an art brush broad near its start that thins to a fine tip; Brush Pen, a calligraphic brush whose size follows the pen pressure; and Soft Wash and Pooling Wash, art brushes of translucent gray layers that take the stroke color as tints; Game Trails adds motion art brushes (Speed Line, Dash Trail, Burst Ray, Zigzag); Energy Beams adds laser and plasma art brushes (Laser Bolt, Plasma Arc, Charge Wave, Spark Trail); Dry Media adds grainy art brushes (Chalk Grain, Graphite Pencil, Wax Crayon, Charcoal Dust). A click on a brush adds it to the document's Brushes as one undo step with every resource its art uses (patterns, symbols, swatches, graphic styles, images), makes it the current brush and, with paths selected, applies it to them in the same step; a brush the document already has is not added again and a different brush of the same name comes in numbered ("Wave 2"). Shift/Cmd-clicks select brushes for Add to Brushes; a brush dragged onto a path is added and applied to it, and one dragged onto the Brushes panel is added. Save Brushes… / the Brushes panel's Save Brush Library… write the document's brushes (or the selected ones) as a `.vectorcraft` library into the `Brushes` folder next to the preferences, listed under User Defined, or to a file; Other Library… reads the brushes of any document VectorCraft opens. Thumbnails, in the library panels, the Brushes panel and Brush Options, render brush art with the patterns and symbols it uses. Copying brushed art now carries the patterns and symbols its brush's art uses too. Tests: `crates/engine/src/tests/brushlib.rs`, `crates/ui-egui/src/panels/tests_brush_libraries.rs`, `panels::brushes::tests::library_brush_previews_show_the_patterns_their_art_uses`, `canvas::tests::a_library_brush_dropped_on_a_path_is_added_and_applied_in_one_step`. + - **Brush libraries** ([public source](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/create-new-brush-libraries.html), [import](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/import-brushes-from-brush-libraries-or-other-files.html), [Brushes panel](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/brushes-panel-overview.html)): Window › Brush Libraries, the Brushes panel's Brush Libraries Menu and its menu's Open Brush Library open each library in a library panel of its own, as swatch, graphic style and symbol libraries do. The built-in libraries (Art Ribbons, Ink and Wash, Calligraphic Nibs, Bristle Brushes, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media, Tech Circuit, Artistic Brushes) are original brushes generated in code (`crates/engine/src/cmd/brushlib.rs`); Striped Ribbon's art is filled with the library's own pattern and Sparkles scatters the library's own symbol; Ink and Wash adds ink and wash brushes (the [help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html) lists an Ink brush library of strokes with varied thickness and texture; the names, shapes and opacities are VectorCraft's own): Tapered Ink, an art brush broad near its start that thins to a fine tip; Brush Pen, a calligraphic brush whose size follows the pen pressure; and Soft Wash and Pooling Wash, art brushes of translucent gray layers that take the stroke color as tints; Game Trails adds motion art brushes (Speed Line, Dash Trail, Burst Ray, Zigzag); Energy Beams adds laser and plasma art brushes (Laser Bolt, Plasma Arc, Charge Wave, Spark Trail); Dry Media adds grainy art brushes (Chalk Grain, Graphite Pencil, Wax Crayon, Charcoal Dust). A click on a brush adds it to the document's Brushes as one undo step with every resource its art uses (patterns, symbols, swatches, graphic styles, images), makes it the current brush and, with paths selected, applies it to them in the same step; a brush the document already has is not added again and a different brush of the same name comes in numbered ("Wave 2"). Shift/Cmd-clicks select brushes for Add to Brushes; a brush dragged onto a path is added and applied to it, and one dragged onto the Brushes panel is added. Save Brushes… / the Brushes panel's Save Brush Library… write the document's brushes (or the selected ones) as a `.vectorcraft` library into the `Brushes` folder next to the preferences, listed under User Defined, or to a file; Other Library… reads the brushes of any document VectorCraft opens. Thumbnails, in the library panels, the Brushes panel and Brush Options, render brush art with the patterns and symbols it uses. Copying brushed art now carries the patterns and symbols its brush's art uses too. Tests: `crates/engine/src/tests/brushlib.rs`, `crates/ui-egui/src/panels/tests_brush_libraries.rs`, `panels::brushes::tests::library_brush_previews_show_the_patterns_their_art_uses`, `canvas::tests::a_library_brush_dropped_on_a_path_is_added_and_applied_in_one_step`. - **Bristle Brushes library** ([What's new](https://helpx.adobe.com/illustrator/desktop/new-features/whats-new.html), [About brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html)): Window › Brush Libraries › Bristle Brushes holds ten bristle brushes, one for each tip shape (Fine Liner, Pointed Flat, Stubby Round, Dry Scrub, Soft Dome, Filbert, Angled Round, Angled Flat, Fan Blender, Grass Fan). The brushes, their names and their values are VectorCraft's own, and every value lies inside the range the bristle brush keeps (`brush.libraries`, `brush.addFromLibrary`; `the_bristle_brushes_library_covers_every_tip_shape_within_the_bristle_ranges`). - **Tech Circuit library:** Circuit Trace is a chamfered art brush with 45-degree elbows and terminal pads; Bus Lines repeats three parallel conductor lanes; Terminal Nodes repeats solder pads, circular test points and connecting leads. Original vector geometry generated in code, with Tints colorization and continuous pattern tile edges. Evidence: `the_tech_circuit_library_constructs_adds_and_applies_each_brush` in `crates/engine/src/tests/brushlib.rs` covers listing, finite geometry on straight, curved, short and closed paths, add/apply, undo/redo, deduplication and saved-library round trips. G5 remaining estimate 3–13 h (estimated); area scores unchanged. - - **Artistic brush library** ([About brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html)): Window › Brush Libraries › Artistic offers Orbit Lines, Petal Garland, Lattice Braid and Facet Sweep. Each is original, editable vector artwork stretched along a path by an art brush and tinted by the stroke color. The public page names the category but does not specify its presets. Evidence: `artistic_library_strokes_are_editable_and_reopen_from_a_saved_library` in `crates/engine/src/tests/brushlib.rs` covers drawing on short and long paths, add/apply, undo and saving; `the_window_menu_and_the_brushes_panel_open_brush_libraries` covers the menu and panel. + - **Artistic Brushes library** ([About brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html)): Window › Brush Libraries › Artistic Brushes offers Orbit Lines, Petal Garland, Lattice Braid and Facet Sweep; commands also accept Artistic as a lookup name. Each is original, editable vector artwork stretched along a path by an art brush and tinted by the stroke color. The public page names the category but does not specify its presets. Evidence: `artistic_library_strokes_are_editable_and_reopen_from_a_saved_library` in `crates/engine/src/tests/brushlib.rs` covers drawing on short and long paths, add/apply, undo and saving; `the_window_menu_and_the_brushes_panel_open_brush_libraries` covers the menu and panel. - **Dry Media library** ([help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html)): Window › Brush Libraries › Dry Media holds four art brushes with textured strokes like dry drawing materials, each 100 pt long: Chalk Grain (about 8 pt high), Graphite Pencil (about 2.3 pt), Wax Crayon (about 5.5 pt) and Charcoal Dust (about 7 pt). The brushes, their names, sizes and art are VectorCraft's own: each is filled vector paths from a fixed seed, at most 80 paths and 500 anchors, stretched along the path with Tints colorization, and the chalk and crayon art has even-odd gaps where the paper shows (`brush.libraries`, `brush.addFromLibrary`; `the_dry_media_library_holds_grainy_art_brushes_with_bounded_art`). - **Brush names in library panels**: a built-in brush library's panel shows its brushes' names in the UI language, in its list rows and tooltips, and its Find field matches the name shown or the English name. This is VectorCraft's own rule. A User Defined or Other Library… library's brushes, and the document's Brushes panel, show names as they are stored. A click, a drag, Add to Brushes and `brush.addFromLibrary` still use the English name, so the brush comes into the document under that name (`built_in_library_brushes_are_listed_in_the_ui_language`, `built_in_library_brush_names_are_in_complete_catalogs`). - A canvas context menu: right-click selects the object under the pointer and lists what applies to the selection (Undo/Redo, clipboard, group, isolation, join, Remove Anchor Points when anchors are selected, masks, compound paths, guides, Transform, Arrange, Select, Export Selection, and on type Bullets and Numbering and Spelling › Auto Spell Check, checked while it is on), or the view commands on empty canvas. From ae77d8186a81c0d9d0c00736afd1473165f6ba51 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 16:32:09 -0800 Subject: [PATCH 17/55] Rerun CI From e4edb7a3f371b58f9dc99712c45612988a294311 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 17:23:27 -0800 Subject: [PATCH 18/55] Rerun CI From ad00ab8c8fb817e8c1bceb294cfb6a07e0b38e7b Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 17:51:15 -0800 Subject: [PATCH 19/55] Preserve loaded Artistic library name before built-in alias --- crates/engine/src/cmd/brushlib.rs | 10 +++++++--- crates/engine/src/tests/brushlib.rs | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/cmd/brushlib.rs b/crates/engine/src/cmd/brushlib.rs index 3c4767cfa5..524443a48c 100644 --- a/crates/engine/src/cmd/brushlib.rs +++ b/crates/engine/src/cmd/brushlib.rs @@ -822,11 +822,15 @@ pub fn library(s: &Session, key: &str) -> Option<(LibraryInfo, Arc if let Some(found) = concealed_library_id(s, key).and_then(|id| s.brush_libraries.get(&id)) { return Some(found); } - if let Some(b) = BUILTIN.iter().find(|b| b.id == key || (b.id == "artistic" && key.eq_ignore_ascii_case("Artistic"))) { + if let Some(b) = BUILTIN.iter().find(|b| b.id == key) { return Some((builtin_info(b), builtin_library(b.id)?)); } - let id = libraries(s).into_iter().find(|l| l.name.eq_ignore_ascii_case(key))?.id; - library(s, &id) + if let Some(id) = libraries(s).into_iter().find(|l| l.name.eq_ignore_ascii_case(key)).map(|l| l.id) { + return library(s, &id); + } + // Keep the short built-in alias, but let a user or loaded library own its display name. + let b = key.eq_ignore_ascii_case("Artistic").then(|| BUILTIN.iter().find(|b| b.id == "artistic")).flatten()?; + Some((builtin_info(b), builtin_library(b.id)?)) } fn library_param(s: &Session, p: &Value, cmd: &str) -> Result<(LibraryInfo, Arc)> { diff --git a/crates/engine/src/tests/brushlib.rs b/crates/engine/src/tests/brushlib.rs index f38204b85d..d23d2905af 100644 --- a/crates/engine/src/tests/brushlib.rs +++ b/crates/engine/src/tests/brushlib.rs @@ -220,6 +220,20 @@ fn artistic_library_strokes_are_editable_and_reopen_from_a_saved_library() { assert_eq!(vectorcraft_brush::library(&reopened), lib.brushes); } +#[test] +fn a_loaded_library_named_artistic_keeps_its_name_ahead_of_the_builtin_alias() { + let mut file = vectorcraft_doc::Document::new(100.0, 100.0); + vectorcraft_brush::store(&mut file, &[vectorcraft_brush::defaults()[0].clone()]); + let b64 = vectorcraft_format::base64_encode(&vectorcraft_format::save_file(&file)); + let mut s = session(); + let loaded = run(&mut s, "brush.loadLibrary", json!({"dataBase64": b64, "name": "Artistic.vectorcraft"})); + assert_eq!(loaded["name"], "Artistic"); + let id = loaded["library"].as_str().unwrap(); + assert_eq!(run(&mut s, "brush.library", json!({"library": "Artistic"}))["id"], id); + assert_eq!(run(&mut s, "brush.library", json!({"library": "ARTISTIC"}))["id"], id); + assert_eq!(run(&mut s, "brush.library", json!({"library": "artistic"}))["id"], "artistic", "exact built-in id still works"); +} + /// Every path of brush art `n`: (anchors, opacity). fn art_paths(n: &vectorcraft_doc::Node) -> Vec<(usize, f32)> { let mut out = vec![]; From fecf69fc580d785090c086cda982d021381e8361 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 17 Nov 2026 18:12:55 -0800 Subject: [PATCH 20/55] Symbols: symbol.adjust collects instances in linear time symbol.adjust checked each symbol instance in the selection against every instance it had already collected, so I instances cost about I^2/2 comparisons on every call, and the symbolism tools call it on every drag frame. It now keeps a HashSet of the ids it has pushed. The list is unchanged: the same ids in the same walk order, each kept where it is first reached. A unit test checks the result for nested groups, a group listed twice and members listed before and after their group, and compares it with a copy of the old collector. --- crates/engine/src/cmd/brushsym/symbols.rs | 71 ++++++++++++++++++----- 1 file changed, 57 insertions(+), 14 deletions(-) diff --git a/crates/engine/src/cmd/brushsym/symbols.rs b/crates/engine/src/cmd/brushsym/symbols.rs index 8852cc9bc5..cd0be378f8 100644 --- a/crates/engine/src/cmd/brushsym/symbols.rs +++ b/crates/engine/src/cmd/brushsym/symbols.rs @@ -118,6 +118,20 @@ fn instances_of(d: &Document, name: Option<&str>) -> Vec { v } +/// The symbol instances in `nodes` and inside them, each once, in the order a walk of each node in +/// turn first reaches them. +fn instances_in<'a>(nodes: impl IntoIterator) -> Vec { + let (mut v, mut seen) = (vec![], std::collections::HashSet::new()); + for n in nodes { + n.walk(&mut |c| { + if matches!(c.kind, NodeKind::SymbolInstance { .. }) && seen.insert(c.id) { + v.push(c.id); + } + }); + } + v +} + /// The symbols an instance in `n` (its opacity masks included) places, pushed onto `out`. fn art_symbols(n: &Node, out: &mut Vec) { vectorcraft_doc::swatches::walk_with_masks(n, &mut |m| { @@ -1091,20 +1105,8 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result { let style_paint = style_paint(&st.doc, p); let candidates: Vec = { let d = &st.doc; - let mut v = vec![]; - if st.selection.is_empty() { - v = instances_of(d, None); - } else { - for id in &st.selection.objects { - if let Some(n) = d.node(*id) { - n.walk(&mut |c| { - if matches!(c.kind, NodeKind::SymbolInstance { .. }) && !v.contains(&c.id) { - v.push(c.id); - } - }); - } - } - } + let mut v = + if st.selection.is_empty() { instances_of(d, None) } else { instances_in(st.selection.objects.iter().filter_map(|id| d.node(*id))) }; let editable = d.editable(); v.retain(|id| editable(*id)); v @@ -1363,3 +1365,44 @@ fn restack(d: &mut Document, ids: &std::collections::HashSet, back: bool } Ok(moved) } + +#[cfg(test)] +mod tests { + use super::*; + + fn instance(id: u64) -> Arc { + Arc::new(Node::new(NodeId(id), NodeKind::SymbolInstance { symbol: "Dot".into(), xf: Affine::IDENTITY })) + } + + /// The instances come out in the order a search of the list built so far gives: nested + /// groups, a group listed twice, a member listed after its group and one listed before it. + #[test] + fn instances_in_matches_searching_the_list_so_far() { + let groups: Vec = (0..40u64) + .map(|g| { + let base = g * 100; + let mut children: Vec> = (0..40).map(|i| instance(base + i)).collect(); + let inner = (40..50).map(|i| instance(base + i)).collect(); + children.insert(20, Arc::new(Node::group(NodeId(base + 90), inner))); + children.push(Arc::new(Node::group(NodeId(base + 91), vec![]))); + Node::group(NodeId(base + 99), children) + }) + .collect(); + let early = Node::new(NodeId(1_245), NodeKind::SymbolInstance { symbol: "Dot".into(), xf: Affine::IDENTITY }); + let late = Node::new(NodeId(305), NodeKind::SymbolInstance { symbol: "Dot".into(), xf: Affine::IDENTITY }); + let nodes: Vec<&Node> = std::iter::once(&early).chain(&groups).chain([&groups[0], &late, &groups[7]]).collect(); + let mut searched = vec![]; + for n in &nodes { + n.walk(&mut |c| { + if matches!(c.kind, NodeKind::SymbolInstance { .. }) && !searched.contains(&c.id) { + searched.push(c.id); + } + }); + } + let found = instances_in(nodes.iter().copied()); + assert_eq!(found, searched); + assert_eq!(found.len(), 2_000); + assert_eq!(found[0], NodeId(1_245)); + assert!(instances_in([]).is_empty()); + } +} From 863994ac633ac96f0dcd6008c9dd749cf83f0076 Mon Sep 17 00:00:00 2001 From: yoriswind Date: Mon, 16 Nov 2026 06:31:05 -0800 Subject: [PATCH 21/55] M1: mirror Direct Selection handles during dragging (#7842) --- crates/doc/src/text/object.rs | 10 + crates/engine/src/cmd/live/blend.rs | 5 + crates/engine/src/cmd/live/commands.rs | 2 +- crates/engine/src/cmd/path.rs | 8 +- crates/engine/src/cmd/typecmd.rs | 5 +- crates/engine/tests/direct_handle_mirror.rs | 437 ++++++++++++++++++++ crates/tools/src/direct.rs | 29 +- docs/gaps.md | 2 + docs/ui-parity.md | 2 +- 9 files changed, 487 insertions(+), 13 deletions(-) create mode 100644 crates/engine/tests/direct_handle_mirror.rs diff --git a/crates/doc/src/text/object.rs b/crates/doc/src/text/object.rs index 746c0b69d5..1671bb591e 100644 --- a/crates/doc/src/text/object.rs +++ b/crates/doc/src/text/object.rs @@ -451,12 +451,22 @@ impl TextObject { /// fractions of the path. False, changing nothing, for other type, when the anchor doesn't /// exist, a degenerate `xf` or a path that would not be finite. pub fn set_path_handle(&mut self, (si, ai): (usize, usize), out: bool, pos: Point, independent: bool) -> bool { + self.set_path_handle_with_symmetry((si, ai), out, pos, independent, false) + } + /// [`Self::set_path_handle`] with an optional mirror of the opposite handle about the anchor + /// in document space, preserving the anchor kind. `independent` takes precedence. Both handles + /// are edited in one reshape, using the same validated document-to-text map. + pub fn set_path_handle_with_symmetry(&mut self, (si, ai): (usize, usize), out: bool, pos: Point, independent: bool, symmetric: bool) -> bool { let xf = self.xf; matches!(self.kind, TextKind::OnPath { .. }) && self.reshape_local(|path, to_text| { let Some(a) = path.anchor_mut(si, ai) else { return false }; let mut drawn = a.transform(xf); drawn.set_handle(out, pos, independent); + if symmetric && !independent { + let opposite = drawn.p - (pos - drawn.p); + if out { drawn.h_in = opposite } else { drawn.h_out = opposite } + } *a = drawn.transform(to_text); true }) diff --git a/crates/engine/src/cmd/live/blend.rs b/crates/engine/src/cmd/live/blend.rs index a2cb0e3f91..dcbb2c7188 100644 --- a/crates/engine/src/cmd/live/blend.rs +++ b/crates/engine/src/cmd/live/blend.rs @@ -225,6 +225,7 @@ pub(super) fn spine_move_anchor(s: &mut Session, p: &Value) -> Result { Some(_) => return Err(bad(C, "handle must be in or out")), }; let independent = switch_or(p, "independent", false, C)?; + let symmetric = switch_or(p, "symmetric", false, C)? && !independent; let with = spine_points_param(p, C)?; // Any `with`, even an empty list, asks to move points, which a handle drag doesn't. if handle.is_some() && p.get("with").is_some_and(|v| !v.is_null()) { @@ -234,6 +235,10 @@ pub(super) fn spine_move_anchor(s: &mut Session, p: &Value) -> Result { let a = sp.anchors.get_mut(index).ok_or_else(|| bad(C, "no such spine point"))?; if let Some(out) = handle { a.set_handle(out, q, independent); + if symmetric { + let opposite = a.p - (q - a.p); + if out { a.h_in = opposite } else { a.h_out = opposite } + } return Ok(()); } let delta = q - a.p; diff --git a/crates/engine/src/cmd/live/commands.rs b/crates/engine/src/cmd/live/commands.rs index 79b2915aa0..76d1fee968 100644 --- a/crates/engine/src/cmd/live/commands.rs +++ b/crates/engine/src/cmd/live/commands.rs @@ -99,7 +99,7 @@ pub fn specs() -> Vec { "Move Spine Point", [], None, - "{id? (default: the selected blend), anchor: index, x, y, with?: [index…], handle?: in|out, independent?: bool} move a point of the blend's spine (its handles along), and the points `with` names by as much, or with `handle` place that handle's end at (x, y) (a smooth point keeps the other handle in line unless `independent`). A key object sitting on a moved point moves with it. The first edit turns the straight spine into a path", + "{id? (default: the selected blend), anchor: index, x, y, with?: [index…], handle?: in|out, independent?: bool, symmetric?: bool} move a point of the blend's spine (its handles along), and the points `with` names by as much, or with `handle` place that handle's end at (x, y) (a smooth point keeps the other handle in line unless `independent`; `symmetric` mirrors the opposite handle about the anchor without changing its kind, ignored with `independent`; both default false). A key object sitting on a moved point moves with it. The first edit turns the straight spine into a path", has_doc, spine_move_anchor ), diff --git a/crates/engine/src/cmd/path.rs b/crates/engine/src/cmd/path.rs index 0960e5ca28..5038c1efa8 100644 --- a/crates/engine/src/cmd/path.rs +++ b/crates/engine/src/cmd/path.rs @@ -50,7 +50,7 @@ pub fn specs() -> Vec { "Move Direction Handle", [], None, - "{id, subpath?, anchor, which: \"in\"|\"out\", x, y, independent?: bool}", + "{id, subpath?, anchor, which: \"in\"|\"out\", x, y, independent?: bool, symmetric?: bool} move a direction handle; independent moves only that side and makes the anchor a corner; symmetric mirrors the other handle about the anchor without changing its kind (independent takes precedence); both default false", has_doc, set_handle ), @@ -458,12 +458,14 @@ fn set_handle(s: &mut Session, p: &Value) -> Result { let out = str_param(p, "which") != Some("in"); let pos = Point::new(f64_req(p, "x", "path.setHandle")?, f64_req(p, "y", "path.setHandle")?); let independent = switch_or(p, "independent", false, "path.setHandle")?; + let symmetric = switch_or(p, "symmetric", false, "path.setHandle")? && !independent; // A handle already there, on an anchor already of the kind it would get, changes nothing and // records no undo step. The handle is compared directly: `set_handle` would recompute the // other handle of a smooth anchor, which need not give back the same value. if let Some(a) = anchor_of(s, id, si, ai)? && (if out { a.h_out } else { a.h_in }) == pos && !(independent && a.kind != AnchorKind::Corner) + && (!symmetric || (if out { a.h_in } else { a.h_out }) == a.p - (pos - a.p)) { return ok(); } @@ -471,6 +473,10 @@ fn set_handle(s: &mut Session, p: &Value) -> Result { let path = path_mut(d, id)?; let a = path.anchor_mut(si, ai).ok_or_else(|| EngineError::Other("no such anchor".into()))?; a.set_handle(out, pos, independent); + if symmetric { + let opposite = a.p - (pos - a.p); + if out { a.h_in = opposite } else { a.h_out = opposite } + } Ok(()) })?; ok() diff --git a/crates/engine/src/cmd/typecmd.rs b/crates/engine/src/cmd/typecmd.rs index f50a2c7364..436433f7fd 100644 --- a/crates/engine/src/cmd/typecmd.rs +++ b/crates/engine/src/cmd/typecmd.rs @@ -122,7 +122,7 @@ pub fn specs() -> Vec { "Move Type Path Handle", [], None, - "{id, subpath?, anchor, which: \"in\"|\"out\", x, y, independent?: bool} move a direction handle of an anchor of type on a path's path to (x, y), as path.setHandle moves a path's (independent: that side only, the anchor becomes a corner); the start and end brackets keep their fractions of the path and the text reflows along it (what Direct Selection does dragging a handle of the path); no undo step when the handle is already there and the path does not change", + "{id, subpath?, anchor, which: \"in\"|\"out\", x, y, independent?: bool, symmetric?: bool} move a direction handle of an anchor of type on a path's path to (x, y), as path.setHandle moves a path's (independent: that side only, the anchor becomes a corner; symmetric: mirror the other handle about the anchor without changing its kind, independent takes precedence; both default false); the start and end brackets keep their fractions of the path and the text reflows along it (what Direct Selection does dragging a handle of the path); no undo step when the handle is already there and the path does not change", has_doc, set_path_handle ), @@ -1449,6 +1449,7 @@ fn set_path_handle(s: &mut Session, p: &Value) -> Result { let out = super::object::choice(p, C, "which", &["in", "out"])? != Some("in"); let pos = vectorcraft_geom::Point::new(f64_req(p, "x", C)?, f64_req(p, "y", C)?); let independent = switch_or(p, "independent", false, C)?; + let symmetric = switch_or(p, "symmetric", false, C)?; let node = s.doc()?.doc.node(id); let on_path = matches!(node.map(|n| &n.kind), Some(NodeKind::Text(t)) if matches!(t.kind, vectorcraft_doc::TextKind::OnPath { .. })); if !on_path || node.is_some_and(|n| n.extras().perspective.is_some()) { @@ -1461,7 +1462,7 @@ fn set_path_handle(s: &mut Session, p: &Value) -> Result { let within = |t: &TextObject| { t.type_path().and_then(|p| p.bounds()).is_some_and(|b| [b.x0, b.y0, b.x1, b.y1].iter().all(|v| v.abs() <= crate::MAX_COORD)) }; - if !(t.set_path_handle((si, ai), out, pos, independent) && within(t)) { + if !(t.set_path_handle_with_symmetry((si, ai), out, pos, independent, symmetric) && within(t)) { t.kind = before; return Err(bad(C, "no such path anchor, or the path would reach past the canvas")); } diff --git a/crates/engine/tests/direct_handle_mirror.rs b/crates/engine/tests/direct_handle_mirror.rs new file mode 100644 index 0000000000..9fa6f26927 --- /dev/null +++ b/crates/engine/tests/direct_handle_mirror.rs @@ -0,0 +1,437 @@ +//! Temporary Cmd/Control symmetry while Direct Selection drags an existing handle. +#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)] + +use serde_json::{Value, json}; +use vectorcraft_doc::{Node, NodeId}; +use vectorcraft_engine::{Session, ViewInfo}; +use vectorcraft_geom::{Anchor, AnchorKind, Point}; +use vectorcraft_tools::{Mods, PointerEvent, PointerKind}; + +fn run(s: &mut Session, command: &str, params: Value) -> Value { + s.execute(command, ¶ms).unwrap() +} + +fn view() -> ViewInfo { + ViewInfo { + smart_guides: false, + guides: false, + snap_to_point: false, + snap_to_grid: false, + snap_to_pixel: false, + snap_to_glyph: false, + corner_widgets: false, + show_bbox: false, + ..ViewInfo::default() + } +} + +fn session() -> Session { + let mut s = Session::new(); + run(&mut s, "file.new", json!({"width": 900, "height": 700})); + for (key, value) in [("constrainAngle", json!(0)), ("showHandlesMultipleAnchors", json!(true)), ("realTimeDrawing", json!(true))] { + run(&mut s, "prefs.set", json!({"key": key, "value": value})); + } + s +} + +fn node(s: &Session, id: NodeId) -> Node { + s.doc().unwrap().doc.node(id).unwrap().clone() +} + +fn curve(s: &mut Session, incoming: Point) -> NodeId { + let id = run( + s, + "path.create", + json!({"anchors": [ + {"x": 20, "y": 220}, + {"x": 100, "y": 100, "in": [incoming.x, incoming.y], "out": [180, 100]}, + {"x": 320, "y": 220} + ]}), + ); + let id = NodeId(id["id"].as_u64().unwrap()); + s.select_tool("directSelection", view()).unwrap(); + id +} + +fn anchor(s: &Session, id: NodeId) -> Anchor { + node(s, id).path_data().unwrap().subpaths[0].anchors[1] +} + +fn pointer(s: &mut Session, kind: PointerKind, at: Point, mods: Mods) { + s.pointer(&PointerEvent::new(kind, at.x, at.y).with_mods(mods), view()).unwrap(); +} + +fn press_handle(s: &mut Session, at: Point) { + pointer(s, PointerKind::Down, at, Mods::default()); + assert_eq!(s.tool_id(), "directSelection"); + assert!(s.in_interaction(), "the visible handle press begins Reshape"); +} + +fn near(actual: Point, expected: Point) { + assert!(actual.distance(expected) < 1e-6, "point {actual:?}, expected {expected:?}"); +} + +fn handles(a: Anchor, incoming: Point, outgoing: Point, kind: AnchorKind) { + near(a.h_in, incoming); + near(a.h_out, outgoing); + assert_eq!(a.kind, kind); +} + +fn assert_other_geometry(s: &Session, id: NodeId, before: &Node) { + let after = node(s, id); + let (old, new) = (before.path_data().unwrap(), after.path_data().unwrap()); + assert_eq!(new.subpaths.len(), old.subpaths.len()); + assert_eq!(new.subpaths[0].closed, old.subpaths[0].closed); + assert_eq!(new.subpaths[0].anchors.len(), 3); + assert_eq!(new.subpaths[0].anchors[0], old.subpaths[0].anchors[0]); + assert_eq!(new.subpaths[0].anchors[2], old.subpaths[0].anchors[2]); + assert_eq!(new.subpaths[0].anchors[1].p, old.subpaths[0].anchors[1].p); + assert_eq!(after.appearance, before.appearance); +} + +#[test] +fn direct_handle_baseline_ordinary_smooth_keeps_the_opposite_length() { + let mut s = session(); + let id = curve(&mut s, Point::new(50.0, 100.0)); + let before = node(&s, id); + assert_eq!(anchor(&s, id).kind, AnchorKind::Smooth); + let selection = json!(s.doc().unwrap().selection); + let undo = s.doc().unwrap().history.undo.len(); + press_handle(&mut s, Point::new(180.0, 100.0)); + let q = Point::new(180.0, 160.0); + pointer(&mut s, PointerKind::Drag, q, Mods::default()); + handles(anchor(&s, id), Point::new(60.0, 70.0), q, AnchorKind::Smooth); + assert_other_geometry(&s, id, &before); + pointer(&mut s, PointerKind::Up, q, Mods::default()); + assert_eq!(s.doc().unwrap().history.undo.len(), undo + 1); + assert_eq!(json!(s.doc().unwrap().selection), selection); +} + +#[test] +fn direct_handle_baseline_cmd_added_mid_drag_mirrors_the_opposite() { + let mut s = session(); + let id = curve(&mut s, Point::new(50.0, 100.0)); + let before = node(&s, id); + press_handle(&mut s, Point::new(180.0, 100.0)); + let q = Point::new(180.0, 160.0); + pointer(&mut s, PointerKind::Drag, q, Mods::default()); + handles(anchor(&s, id), Point::new(60.0, 70.0), q, AnchorKind::Smooth); + pointer(&mut s, PointerKind::Drag, q, Mods { cmd: true, ..Mods::default() }); + handles(anchor(&s, id), Point::new(20.0, 40.0), q, AnchorKind::Smooth); + assert_other_geometry(&s, id, &before); + pointer(&mut s, PointerKind::Up, q, Mods { cmd: true, ..Mods::default() }); +} + +#[derive(Debug, PartialEq)] +struct Snapshot { + document: Value, + selection: Value, + undo: usize, + redo: usize, +} + +fn snapshot(s: &Session) -> Snapshot { + let st = s.doc().unwrap(); + Snapshot { document: json!(st.doc), selection: json!(st.selection), undo: st.history.undo.len(), redo: st.history.redo.len() } +} + +fn assert_content(s: &Session, expected: &Snapshot) { + let got = snapshot(s); + assert_eq!(got.document, expected.document); + assert_eq!(got.selection, expected.selection); +} + +fn cmd() -> Mods { + Mods { cmd: true, ..Mods::default() } +} + +fn reflected(a: Point, q: Point) -> Point { + a - (q - a) +} + +fn constrained(a: Point, q: Point) -> Point { + a + vectorcraft_geom::constrain_angle_from(q - a, 45.0, 0.0) +} + +fn assert_mirrored(a: Anchor, q: Point, kind: AnchorKind) { + handles(a, reflected(a.p, q), q, kind); +} + +#[test] +fn direct_handle_stationary_cmd_release_repress_commit_and_next_gesture() { + let mut s = session(); + let id = curve(&mut s, Point::new(50.0, 100.0)); + let before = snapshot(&s); + press_handle(&mut s, Point::new(180.0, 100.0)); + let q = Point::new(180.0, 160.0); + for (mods, opposite) in [(cmd(), Point::new(20.0, 40.0)), (Mods::default(), Point::new(60.0, 70.0)), (cmd(), Point::new(20.0, 40.0))] { + pointer(&mut s, PointerKind::Drag, q, mods); + handles(anchor(&s, id), opposite, q, AnchorKind::Smooth); + assert_eq!(s.doc().unwrap().history.undo.len(), before.undo, "previews are not separate edits"); + } + pointer(&mut s, PointerKind::Up, q, cmd()); + let committed = snapshot(&s); + assert_eq!(committed.undo, before.undo + 1); + assert_eq!(committed.selection, before.selection); + run(&mut s, "edit.undo", json!({})); + assert_content(&s, &before); + run(&mut s, "edit.redo", json!({})); + assert_content(&s, &committed); + // Cmd did not install a persistent coupling mode: a later ordinary Smooth drag keeps + // the opposite handle's committed length, rather than matching the newly dragged length. + press_handle(&mut s, q); + let next = Point::new(180.0, 200.0); + pointer(&mut s, PointerKind::Drag, next, Mods::default()); + let a = anchor(&s, id); + near(a.h_out, next); + assert_eq!(a.kind, AnchorKind::Smooth); + assert!((a.h_in.distance(a.p) - 100.0).abs() < 1e-6); + assert!((a.h_in.distance(a.p) - a.h_out.distance(a.p)).abs() > 20.0); + assert!(((a.h_in - a.p).cross(a.h_out - a.p)).abs() < 1e-6); + pointer(&mut s, PointerKind::Up, next, Mods::default()); + assert_eq!(s.doc().unwrap().history.undo.len(), before.undo + 2); +} + +#[test] +fn direct_handle_shift_constrains_before_mirroring_and_alt_takes_priority() { + let mut s = session(); + let id = curve(&mut s, Point::new(50.0, 100.0)); + let p = anchor(&s, id).p; + press_handle(&mut s, Point::new(180.0, 100.0)); + let raw = Point::new(180.0, 150.0); + let q = constrained(p, raw); + let shifted = Mods { shift: true, ..cmd() }; + pointer(&mut s, PointerKind::Drag, raw, shifted); + assert_mirrored(anchor(&s, id), q, AnchorKind::Smooth); + pointer(&mut s, PointerKind::Drag, raw, Mods { alt: true, ..shifted }); + handles(anchor(&s, id), Point::new(50.0, 100.0), q, AnchorKind::Corner); + // Removing Alt rebuilds from the original Smooth anchor, not the Corner preview. + pointer(&mut s, PointerKind::Drag, raw, shifted); + assert_mirrored(anchor(&s, id), q, AnchorKind::Smooth); + pointer(&mut s, PointerKind::Drag, raw, Mods { alt: true, ..cmd() }); + handles(anchor(&s, id), Point::new(50.0, 100.0), raw, AnchorKind::Corner); + pointer(&mut s, PointerKind::Up, raw, Mods { alt: true, ..cmd() }); +} + +#[test] +fn direct_handle_corner_with_collapsed_partner_is_reversible_without_changing_kind() { + let mut s = session(); + let id = curve(&mut s, Point::new(100.0, 100.0)); + let before = snapshot(&s); + assert_eq!(anchor(&s, id).kind, AnchorKind::Corner); + press_handle(&mut s, Point::new(180.0, 100.0)); + let q = Point::new(180.0, 160.0); + pointer(&mut s, PointerKind::Drag, q, cmd()); + assert_mirrored(anchor(&s, id), q, AnchorKind::Corner); + pointer(&mut s, PointerKind::Drag, q, Mods::default()); + handles(anchor(&s, id), Point::new(100.0, 100.0), q, AnchorKind::Corner); + pointer(&mut s, PointerKind::Drag, q, cmd()); + assert_mirrored(anchor(&s, id), q, AnchorKind::Corner); + s.tool_key(vectorcraft_tools::ToolKey::Escape, Mods::default(), view()).unwrap(); + assert_eq!(snapshot(&s), before); +} + +#[test] +fn direct_handle_stationary_drag_still_mirrors_unequal_partner_but_equal_is_noop() { + for (incoming, changes) in [(Point::new(50.0, 100.0), true), (Point::new(20.0, 100.0), false)] { + let mut s = session(); + let id = curve(&mut s, incoming); + let before = snapshot(&s); + let q = Point::new(180.0, 100.0); + press_handle(&mut s, q); + pointer(&mut s, PointerKind::Drag, q, cmd()); + assert_mirrored(anchor(&s, id), q, AnchorKind::Smooth); + pointer(&mut s, PointerKind::Up, q, cmd()); + if changes { + assert_eq!(s.doc().unwrap().history.undo.len(), before.undo + 1); + run(&mut s, "edit.undo", json!({})); + assert_content(&s, &before); + } else { + assert_eq!(snapshot(&s), before, "an already reflected pair records no edit"); + } + } +} + +#[test] +fn direct_handle_escape_restores_document_selection_and_existing_redo() { + let mut s = session(); + let id = curve(&mut s, Point::new(50.0, 100.0)); + run(&mut s, "shape.rectangle", json!({"x": 500, "y": 400, "width": 25, "height": 30})); + let redo_document = snapshot(&s).document; + run(&mut s, "edit.undo", json!({})); + run(&mut s, "select.set", json!({"ids": [id.0]})); + let before = snapshot(&s); + assert_eq!(before.redo, 1, "a real existing Redo is the cancellation control"); + press_handle(&mut s, Point::new(180.0, 100.0)); + let q = Point::new(180.0, 160.0); + pointer(&mut s, PointerKind::Drag, q, cmd()); + assert_mirrored(anchor(&s, id), q, AnchorKind::Smooth); + s.tool_key(vectorcraft_tools::ToolKey::Escape, Mods::default(), view()).unwrap(); + assert!(!s.in_interaction()); + assert_eq!(snapshot(&s), before); + pointer(&mut s, PointerKind::Up, q, Mods::default()); + assert_eq!(snapshot(&s), before, "a later release does not commit the canceled preview"); + run(&mut s, "edit.redo", json!({})); + assert_eq!(snapshot(&s).document, redo_document, "the prior Redo still restores its actual content"); +} + +#[test] +fn direct_handle_cmd_before_press_still_lends_selection_and_returns_direct() { + let mut s = session(); + let id = curve(&mut s, Point::new(50.0, 100.0)); + let before = snapshot(&s); + let a = anchor(&s, id); + pointer(&mut s, PointerKind::Down, a.p, cmd()); + assert_eq!(s.tool_id(), "selection", "Cmd before Down keeps the existing Selection loan"); + pointer(&mut s, PointerKind::Up, a.p, cmd()); + assert_eq!(s.tool_id(), "directSelection"); + assert_eq!(anchor(&s, id), a); + assert_eq!(snapshot(&s).document, before.document); + assert_eq!(s.doc().unwrap().history.undo.len(), before.undo); +} + +fn text_anchor(s: &Session, id: NodeId) -> Anchor { + let n = node(s, id); + let vectorcraft_doc::NodeKind::Text(t) = n.kind else { panic!("text on a path") }; + t.type_path().unwrap().subpaths[0].anchors[1] +} + +fn text_properties(s: &Session, id: NodeId) -> Value { + let n = node(s, id); + let vectorcraft_doc::NodeKind::Text(t) = n.kind else { panic!("text on a path") }; + let vectorcraft_doc::TextKind::OnPath { start, end, .. } = &t.kind else { panic!("path text") }; + json!({"runs": t.runs, "para": t.para, "paras": t.paras, "xf": t.xf, "start": start, "end": end, + "effect": t.path_effect, "align": t.path_align, "spacing": t.path_spacing, "appearance": n.appearance}) +} + +fn path_text(s: &mut Session) -> NodeId { + let path = curve(s, Point::new(50.0, 100.0)); + let made = run( + s, + "text.createInPath", + json!({"path": path.0, "mode": "onPath", "text": "Along the original curve", "font": "Source Sans 3", "size": 12}), + ); + let id = NodeId(made["id"].as_u64().unwrap()); + run(s, "type.pathOptions", json!({"id": id.0, "start": 0.15, "end": 0.85})); + run(s, "object.transform", json!({"ids": [id.0], "matrix": [1.5, 0.4, 0.25, 0.9, 250, 80]})); + s.select_tool("directSelection", view()).unwrap(); + id +} + +#[test] +fn direct_handle_affine_path_text_mirrors_in_drawn_space_and_keeps_brackets() { + let mut s = session(); + let id = path_text(&mut s); + let before = snapshot(&s); + let properties = text_properties(&s, id); + assert_eq!(properties["start"], json!(0.15)); + assert_eq!(properties["end"], json!(0.85)); + let a = text_anchor(&s, id); + assert_eq!(a.kind, AnchorKind::Smooth); + near(a.p, Point::new(425.0, 210.0)); + near(a.h_out, Point::new(545.0, 242.0)); + assert!((a.h_in.distance(a.p) - a.h_out.distance(a.p)).abs() > 40.0); + press_handle(&mut s, a.h_out); + let raw = a.p + vectorcraft_geom::Vec2::new(80.0, 60.0); + pointer(&mut s, PointerKind::Drag, raw, cmd()); + assert_mirrored(text_anchor(&s, id), raw, AnchorKind::Smooth); + assert_eq!(text_properties(&s, id), properties); + let shifted = Mods { shift: true, ..cmd() }; + pointer(&mut s, PointerKind::Drag, raw, shifted); + assert_mirrored(text_anchor(&s, id), constrained(a.p, raw), AnchorKind::Smooth); + assert_eq!(text_properties(&s, id), properties); + pointer(&mut s, PointerKind::Up, raw, shifted); + let after = snapshot(&s); + assert_eq!(after.undo, before.undo + 1); + run(&mut s, "edit.undo", json!({})); + assert_content(&s, &before); + run(&mut s, "edit.redo", json!({})); + assert_content(&s, &after); +} + +fn blend_state(s: &Session, id: NodeId) -> (Anchor, Value, Vec) { + let n = node(s, id); + let vectorcraft_doc::NodeKind::Blend { children, spec } = n.kind else { panic!("blend") }; + assert!(spec.spine.is_some(), "the fixture uses an already pinned spine"); + let path = vectorcraft_doc::live::blend_spine(&children, &spec).unwrap().0; + (path.subpaths[0].anchors[1], json!(children), spec.key_anchors.clone()) +} + +fn blend(s: &mut Session) -> NodeId { + let a = run(s, "shape.rectangle", json!({"x": 15, "y": 95, "width": 10, "height": 10}))["id"].as_u64().unwrap(); + let b = run(s, "shape.rectangle", json!({"x": 295, "y": 95, "width": 10, "height": 10}))["id"].as_u64().unwrap(); + let made = run(s, "object.blend.make", json!({"ids": [a, b], "steps": 2})); + let id = NodeId(made["id"].as_u64().unwrap()); + let added = run(s, "object.blend.spine.addAnchor", json!({"id": id.0, "x": 100, "y": 100})); + assert_eq!(added["anchor"], json!(1)); + run(s, "object.blend.spine.convertAnchor", json!({"id": id.0, "anchor": 1, "to": "smooth", "x": 180, "y": 100})); + run(s, "object.blend.spine.moveAnchor", json!({"id": id.0, "anchor": 1, "handle": "in", "x": 50, "y": 100})); + run(s, "select.set", json!({"ids": [id.0]})); + s.select_tool("directSelection", view()).unwrap(); + let (middle, _, keys) = blend_state(s, id); + near(middle.p, Point::new(100.0, 100.0)); + handles(middle, Point::new(50.0, 100.0), Point::new(180.0, 100.0), AnchorKind::Smooth); + assert_eq!(keys, [0, 2]); + // An actual spine-point click makes its handles visible to Direct Selection. + pointer(s, PointerKind::Down, middle.p, Mods::default()); + pointer(s, PointerKind::Up, middle.p, Mods::default()); + assert!(!s.in_interaction()); + id +} + +#[test] +fn direct_handle_pinned_blend_spine_cmd_shift_preserves_keys_and_mapping() { + let mut s = session(); + let id = blend(&mut s); + let before = snapshot(&s); + let (a, keys, mapping) = blend_state(&s, id); + press_handle(&mut s, a.h_out); + let q = Point::new(180.0, 160.0); + pointer(&mut s, PointerKind::Drag, q, cmd()); + assert_mirrored(blend_state(&s, id).0, q, AnchorKind::Smooth); + let raw = Point::new(180.0, 150.0); + let shifted = Mods { shift: true, ..cmd() }; + pointer(&mut s, PointerKind::Drag, raw, shifted); + assert_mirrored(blend_state(&s, id).0, constrained(a.p, raw), AnchorKind::Smooth); + // The existing spine Shift-only path is deliberately unconstrained; Cmd's new rule + // must not leak into that old branch after the modifier is released. + pointer(&mut s, PointerKind::Drag, raw, Mods { shift: true, ..Mods::default() }); + near(blend_state(&s, id).0.h_out, raw); + pointer(&mut s, PointerKind::Drag, raw, shifted); + let (after_anchor, after_keys, after_mapping) = blend_state(&s, id); + assert_mirrored(after_anchor, constrained(a.p, raw), AnchorKind::Smooth); + assert_eq!(after_keys, keys, "handle edits leave the actual key art unchanged"); + assert_eq!(after_mapping, mapping); + pointer(&mut s, PointerKind::Up, raw, shifted); + let after = snapshot(&s); + assert_eq!(after.undo, before.undo + 1); + assert_eq!(after.selection, before.selection); + run(&mut s, "edit.undo", json!({})); + assert_content(&s, &before); + run(&mut s, "edit.redo", json!({})); + assert_content(&s, &after); +} + +#[test] +fn direct_handle_incoming_drag_mirrors_outgoing_and_release_restores_ordinary_length() { + let mut s = session(); + let id = curve(&mut s, Point::new(50.0, 100.0)); + let before = snapshot(&s); + let original = node(&s, id); + press_handle(&mut s, Point::new(50.0, 100.0)); + let q = Point::new(40.0, 20.0); + pointer(&mut s, PointerKind::Drag, q, Mods::default()); + handles(anchor(&s, id), q, Point::new(148.0, 164.0), AnchorKind::Smooth); + pointer(&mut s, PointerKind::Drag, q, cmd()); + handles(anchor(&s, id), q, Point::new(160.0, 180.0), AnchorKind::Smooth); + pointer(&mut s, PointerKind::Drag, q, Mods::default()); + handles(anchor(&s, id), q, Point::new(148.0, 164.0), AnchorKind::Smooth); + pointer(&mut s, PointerKind::Drag, q, cmd()); + assert_other_geometry(&s, id, &original); + pointer(&mut s, PointerKind::Up, q, cmd()); + handles(anchor(&s, id), q, Point::new(160.0, 180.0), AnchorKind::Smooth); + assert_eq!(s.doc().unwrap().history.undo.len(), before.undo + 1); + assert_eq!(snapshot(&s).selection, before.selection); + run(&mut s, "edit.undo", json!({})); + assert_content(&s, &before); +} diff --git a/crates/tools/src/direct.rs b/crates/tools/src/direct.rs index 9323bfb20f..6458b2a227 100644 --- a/crates/tools/src/direct.rs +++ b/crates/tools/src/direct.rs @@ -428,6 +428,21 @@ fn spine_anchor(cx: &ToolContext, (id, ai): (NodeId, usize)) -> Option Vec { + let symmetric = ev.mods.cmd && !ev.mods.alt; + let q = if symmetric && ev.mods.shift { + spine_anchor(cx, (id, anchor)).map_or(p, |a| a.p + vectorcraft_geom::constrain_angle_from(p - a.p, 45.0, cx.constrain_angle)) + } else { + p + }; + let mut params = json!({"id": id.0, "anchor": anchor, "handle": if out {"out"} else {"in"}, "x": q.x, "y": q.y, "independent": ev.mods.alt}); + if symmetric { + params["symmetric"] = json!(true); + } + vec![Action::Preview("object.blend.spine.moveAnchor".into(), params)] +} + /// Blend `id`'s spine, built once for callers that look up several of its points. fn spine_path(cx: &ToolContext, id: NodeId) -> Option { match &cx.doc.node(id)?.kind { @@ -983,10 +998,11 @@ impl Tool for DirectSelectionTool { self.snapped = snapped(q.to_vec2(), p.to_vec2(), ev.mods.shift, &guides); self.guides = guides; let cmd = if cx.doc.node(id).is_some_and(is_path_type) { "text.setPathHandle" } else { "path.setHandle" }; - vec![Action::Preview( - cmd.into(), - json!({"id": id.0, "subpath": si, "anchor": ai, "which": if out {"out"} else {"in"}, "x": q.x, "y": q.y, "independent": ev.mods.alt}), - )] + let mut params = json!({"id": id.0, "subpath": si, "anchor": ai, "which": if out {"out"} else {"in"}, "x": q.x, "y": q.y, "independent": ev.mods.alt}); + if ev.mods.cmd && !ev.mods.alt { + params["symmetric"] = json!(true); + } + vec![Action::Preview(cmd.into(), params)] } (PointerKind::Drag, State::SpinePoint { id, anchor, from, start, began }) => { let mut out = vec![]; @@ -1024,10 +1040,7 @@ impl Tool for DirectSelectionTool { )); out } - (PointerKind::Drag, State::SpineHandle { id, anchor, out }) => vec![Action::Preview( - "object.blend.spine.moveAnchor".into(), - json!({"id": id.0, "anchor": anchor, "handle": if out {"out"} else {"in"}, "x": p.x, "y": p.y, "independent": ev.mods.alt}), - )], + (PointerKind::Drag, State::SpineHandle { id, anchor, out }) => drag_spine_handle(cx, ev, (id, anchor, out), p), (PointerKind::Drag, State::Mesh) => self.mesh.drag_to(p).unwrap_or_default(), (PointerKind::Up, State::Mesh) => { self.state = State::Idle; diff --git a/docs/gaps.md b/docs/gaps.md index ea34b655ca..d363f1f1dd 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -125,6 +125,8 @@ from G14 and the budget run of G15: **~170–270 h** one agent, ~50–80 h wall ## G1 Interaction fidelity +- **Temporary handle mirroring (#7842):** with Direct Selection, add Control (Command on macOS) after a direction-handle drag begins to mirror the opposite handle at equal length. This includes ordinary paths, type on a path and blend spines; a missing opposite handle is pulled out while the modifier is held. Letting go returns to the drag's normal handle behavior, Shift constrains before mirroring, and Alt takes independent-handle priority. The existing Control/Command-before-press Selection-tool loan is unchanged. This does not add a persistent coupling mode or change Pen, mesh or warp gestures; the broader G1 scope and estimates remain. + macOS cursor delivery (#2292) is narrowed to a native host adapter using the existing artwork and aligned 1×/2× representations. Headless tests cover visible fallbacks, preparation and ownership; native focus/menu/handback timing, mixed displays, Spotlight and full-screen Spaces remain open validation work (see [hardware parity](hardware-parity.md)). This does not close the interaction-fidelity gap or change its score/estimate. - **Selection fill eligibility (#6625):** Path and compound-path interiors use any enabled non-None fill row (#6625). A lower visible fill remains selectable beneath a top None row in the same object; hidden-only and true-None interiors miss. Zero-opacity fills remain selectable. Original CPU-render and document-hit regressions in `crates/engine/tests/path_fill_hits.rs` cover seven Path and five Compound cases, including stroke edges, geometric outlines, Outline/path-only modes and compound holes. Hidden-fill and no-fill stroked paths must respect butt, round and square caps and bevel, round and miter joins. Focused cap/join CPU regressions passed. Scores and estimates unchanged. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index db8acdeedb..db7b28fe5a 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -238,7 +238,7 @@ tools, never checked side by side) isn't captured row by row. | Drag a curved segment to bend it, a straight one to move its anchors | done | | | Drag by an anchor of a path selected whole moves the whole path; Alt-drag by an anchor or a segment copies it, Alt toggles the copy during the drag, and the copy snaps by the anchor pressed, onto the original too | done | #1104 | | Handles shown are the handles that drag; tolerance from Selection & Anchor Display | done | #494 | -| Drag a handle with Shift (45° about its anchor), Alt (move one handle alone) | done | handles snap to smart guides; handle and anchor drags no longer stall when the pointer leaves and re-enters the window, and a move in the release's frame lands (#834) | +| Drag a handle with Shift (45° about its anchor), Alt (move one handle alone), or Control/Command added mid-drag (mirror the opposite handle) | done | handles snap to smart guides; handle and anchor drags no longer stall when the pointer leaves and re-enters the window, and a move in the release's frame lands (#834); #7842: temporary mirroring covers paths, transformed type on a path and blend spines, preserves the anchor mode and the pre-press selection-tool loan, and keeps Alt independent priority; `crates/engine/tests/direct_handle_mirror.rs` | | Show handles when multiple anchors are selected; Highlight anchors on mouse over; anchor and handle size | done | Preferences › Selection & Anchor Display | | Convert selected anchors to corner/smooth from the Control bar and Properties | done | | | Cut path at selected anchors, Remove Anchor Points, Delete removes segments | done | Open-path anchor Delete removes adjoining segments without bridging the gap; #3380 (deletion only): disconnected survivors of an ordinary contour become independent selected sibling objects, while multi-subpath paths and compound members stay intact; targeted core and full-frame Delete/Backspace regressions pass for survivor selection and Undo/Redo. Explicit Remove Anchor Points keeps its reconnect/refit behavior; #1278: segment Delete preserves neighboring edges and endpoint anchors; a second Delete removes all selected surviving objects; explicit anchor Delete retains its behavior; #1674: Delete removes every selected anchor of a closed path and objects selected whole along with them, and keeps the surviving objects selected; #2241: Remove Anchor Points then selects the next anchor along the path (the one before at an open end), so it can be run again without picking each anchor | From b76c83eaf34383a9b2924b0e6208559723f8650e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 07:47:13 -0800 Subject: [PATCH 22/55] Direct Selection: the Cmd that lends it from the Pen does not mirror handles With the Pen chosen, Cmd/Ctrl lends Direct Selection for one gesture (the Pen's default loan, or the last selection tool chosen). The session takes Cmd off the press only, so the drags after it still carried Cmd and mirrored the opposite handle of every lent handle drag. The session now marks the lent tool, and that press does not mirror while it is held. Letting Cmd go and pressing it again during the drag mirrors, as in Direct Selection itself. path.setHandle, text.setPathHandle and object.blend.spine.moveAnchor refuse `symmetric` together with `independent`, and spine moves refuse `symmetric` without `handle`. At an open end, where no segment leaves the anchor on the other side, `symmetric` does not mirror. docs/mcp.md describes `symmetric` on the three commands. --- crates/doc/src/text/object.rs | 9 +- crates/engine/src/cmd/live/blend.rs | 10 +- crates/engine/src/cmd/live/commands.rs | 2 +- crates/engine/src/cmd/path.rs | 20 ++- crates/engine/src/cmd/typecmd.rs | 5 +- crates/engine/src/tooling.rs | 4 + crates/engine/tests/direct_handle_mirror.rs | 150 ++++++++++++++++++++ crates/geom/src/path.rs | 5 + crates/tools/src/direct.rs | 33 ++++- docs/gaps.md | 4 +- docs/mcp.md | 24 +++- docs/target-app-parity.md | 1 + docs/ui-parity.md | 2 +- 13 files changed, 247 insertions(+), 22 deletions(-) diff --git a/crates/doc/src/text/object.rs b/crates/doc/src/text/object.rs index 1671bb591e..c0e305aeeb 100644 --- a/crates/doc/src/text/object.rs +++ b/crates/doc/src/text/object.rs @@ -454,16 +454,19 @@ impl TextObject { self.set_path_handle_with_symmetry((si, ai), out, pos, independent, false) } /// [`Self::set_path_handle`] with an optional mirror of the opposite handle about the anchor - /// in document space, preserving the anchor kind. `independent` takes precedence. Both handles - /// are edited in one reshape, using the same validated document-to-text map. + /// in document space, preserving the anchor kind. `independent` takes precedence, and at an + /// open end of the path, where no segment leaves the anchor on that side, the handle moves as + /// it would without `symmetric`. Both handles are edited in one reshape, using the same validated + /// document-to-text map. pub fn set_path_handle_with_symmetry(&mut self, (si, ai): (usize, usize), out: bool, pos: Point, independent: bool, symmetric: bool) -> bool { let xf = self.xf; matches!(self.kind, TextKind::OnPath { .. }) && self.reshape_local(|path, to_text| { + let mirror = symmetric && !independent && path.subpaths.get(si).is_some_and(|sp| sp.has_segment(ai, !out)); let Some(a) = path.anchor_mut(si, ai) else { return false }; let mut drawn = a.transform(xf); drawn.set_handle(out, pos, independent); - if symmetric && !independent { + if mirror { let opposite = drawn.p - (pos - drawn.p); if out { drawn.h_in = opposite } else { drawn.h_out = opposite } } diff --git a/crates/engine/src/cmd/live/blend.rs b/crates/engine/src/cmd/live/blend.rs index dcbb2c7188..04ffbe2b9f 100644 --- a/crates/engine/src/cmd/live/blend.rs +++ b/crates/engine/src/cmd/live/blend.rs @@ -225,13 +225,21 @@ pub(super) fn spine_move_anchor(s: &mut Session, p: &Value) -> Result { Some(_) => return Err(bad(C, "handle must be in or out")), }; let independent = switch_or(p, "independent", false, C)?; - let symmetric = switch_or(p, "symmetric", false, C)? && !independent; + let symmetric = switch_or(p, "symmetric", false, C)?; let with = spine_points_param(p, C)?; // Any `with`, even an empty list, asks to move points, which a handle drag doesn't. if handle.is_some() && p.get("with").is_some_and(|v| !v.is_null()) { return Err(bad(C, "`with` moves points, not a handle")); } + if symmetric && independent { + return Err(bad(C, "`independent` and `symmetric` cannot both be true")); + } + if symmetric && handle.is_none() { + return Err(bad(C, "`symmetric` places a handle: give `handle`")); + } edit_spine(s, p, C, "Reshape Spine", |sp, anchors, keys| { + // At an open end of the spine the handle moves as it would without `symmetric`. + let symmetric = symmetric && handle.is_some_and(|out| sp.has_segment(index, !out)); let a = sp.anchors.get_mut(index).ok_or_else(|| bad(C, "no such spine point"))?; if let Some(out) = handle { a.set_handle(out, q, independent); diff --git a/crates/engine/src/cmd/live/commands.rs b/crates/engine/src/cmd/live/commands.rs index 76d1fee968..72fe483b11 100644 --- a/crates/engine/src/cmd/live/commands.rs +++ b/crates/engine/src/cmd/live/commands.rs @@ -99,7 +99,7 @@ pub fn specs() -> Vec { "Move Spine Point", [], None, - "{id? (default: the selected blend), anchor: index, x, y, with?: [index…], handle?: in|out, independent?: bool, symmetric?: bool} move a point of the blend's spine (its handles along), and the points `with` names by as much, or with `handle` place that handle's end at (x, y) (a smooth point keeps the other handle in line unless `independent`; `symmetric` mirrors the opposite handle about the anchor without changing its kind, ignored with `independent`; both default false). A key object sitting on a moved point moves with it. The first edit turns the straight spine into a path", + "{id? (default: the selected blend), anchor: index, x, y, with?: [index…], handle?: in|out, independent?: bool, symmetric?: bool} move a point of the blend's spine (its handles along), and the points `with` names by as much, or with `handle` place that handle's end at (x, y) (a smooth point keeps the other handle in line unless `independent`; `symmetric` mirrors the opposite handle about the anchor without changing its kind, except at an open end of the spine; `symmetric` needs `handle` and cannot go with `independent`; both default false). A key object sitting on a moved point moves with it. The first edit turns the straight spine into a path", has_doc, spine_move_anchor ), diff --git a/crates/engine/src/cmd/path.rs b/crates/engine/src/cmd/path.rs index 5038c1efa8..744b3648ea 100644 --- a/crates/engine/src/cmd/path.rs +++ b/crates/engine/src/cmd/path.rs @@ -50,7 +50,7 @@ pub fn specs() -> Vec { "Move Direction Handle", [], None, - "{id, subpath?, anchor, which: \"in\"|\"out\", x, y, independent?: bool, symmetric?: bool} move a direction handle; independent moves only that side and makes the anchor a corner; symmetric mirrors the other handle about the anchor without changing its kind (independent takes precedence); both default false", + "{id, subpath?, anchor, which: \"in\"|\"out\", x, y, independent?: bool, symmetric?: bool} move a direction handle; independent moves only that side and makes the anchor a corner; symmetric mirrors the other handle about the anchor without changing its kind (not at an open end, where no segment leaves the anchor on that side); independent and symmetric cannot both be true; both default false", has_doc, set_handle ), @@ -458,7 +458,13 @@ fn set_handle(s: &mut Session, p: &Value) -> Result { let out = str_param(p, "which") != Some("in"); let pos = Point::new(f64_req(p, "x", "path.setHandle")?, f64_req(p, "y", "path.setHandle")?); let independent = switch_or(p, "independent", false, "path.setHandle")?; - let symmetric = switch_or(p, "symmetric", false, "path.setHandle")? && !independent; + let symmetric = switch_or(p, "symmetric", false, "path.setHandle")?; + if symmetric && independent { + return Err(bad("path.setHandle", "`independent` and `symmetric` cannot both be true")); + } + // The other handle is mirrored only where a segment leaves the anchor on its side: at an open + // end the handle moves as it would without `symmetric`. + let symmetric = symmetric && has_segment(s, id, si, ai, !out)?; // A handle already there, on an anchor already of the kind it would get, changes nothing and // records no undo step. The handle is compared directly: `set_handle` would recompute the // other handle of a smooth anchor, which need not give back the same value. @@ -520,6 +526,16 @@ fn anchor_of(s: &Session, id: NodeId, si: usize, ai: usize) -> Result Result { + if s.script_running() { + return Err(EngineError::Busy); + } + let d = &s.doc()?.doc; + Ok(d.node(id).and_then(|n| n.path_data()).and_then(|path| path.subpaths.get(si)).is_some_and(|sp| sp.has_segment(ai, out))) +} + fn set_anchors(s: &mut Session, p: &Value) -> Result { let id = object_param(p, "id", "path.setAnchors")?.ok_or_else(|| bad("path.setAnchors", "missing id"))?; let subs = p.get("subpaths").and_then(Value::as_array).ok_or_else(|| bad("path.setAnchors", "missing subpaths"))?; diff --git a/crates/engine/src/cmd/typecmd.rs b/crates/engine/src/cmd/typecmd.rs index 436433f7fd..185baf734f 100644 --- a/crates/engine/src/cmd/typecmd.rs +++ b/crates/engine/src/cmd/typecmd.rs @@ -122,7 +122,7 @@ pub fn specs() -> Vec { "Move Type Path Handle", [], None, - "{id, subpath?, anchor, which: \"in\"|\"out\", x, y, independent?: bool, symmetric?: bool} move a direction handle of an anchor of type on a path's path to (x, y), as path.setHandle moves a path's (independent: that side only, the anchor becomes a corner; symmetric: mirror the other handle about the anchor without changing its kind, independent takes precedence; both default false); the start and end brackets keep their fractions of the path and the text reflows along it (what Direct Selection does dragging a handle of the path); no undo step when the handle is already there and the path does not change", + "{id, subpath?, anchor, which: \"in\"|\"out\", x, y, independent?: bool, symmetric?: bool} move a direction handle of an anchor of type on a path's path to (x, y), as path.setHandle moves a path's (independent: that side only, the anchor becomes a corner; symmetric: mirror the other handle about the anchor without changing its kind, except at an open end of the path; independent and symmetric cannot both be true; both default false); the start and end brackets keep their fractions of the path and the text reflows along it (what Direct Selection does dragging a handle of the path); no undo step when the handle is already there and the path does not change", has_doc, set_path_handle ), @@ -1450,6 +1450,9 @@ fn set_path_handle(s: &mut Session, p: &Value) -> Result { let pos = vectorcraft_geom::Point::new(f64_req(p, "x", C)?, f64_req(p, "y", C)?); let independent = switch_or(p, "independent", false, C)?; let symmetric = switch_or(p, "symmetric", false, C)?; + if symmetric && independent { + return Err(bad(C, "`independent` and `symmetric` cannot both be true")); + } let node = s.doc()?.doc.node(id); let on_path = matches!(node.map(|n| &n.kind), Some(NodeKind::Text(t)) if matches!(t.kind, vectorcraft_doc::TextKind::OnPath { .. })); if !on_path || node.is_some_and(|n| n.extras().perspective.is_some()) { diff --git a/crates/engine/src/tooling.rs b/crates/engine/src/tooling.rs index 794cc7a2a3..46158609a6 100644 --- a/crates/engine/src/tooling.rs +++ b/crates/engine/src/tooling.rs @@ -283,6 +283,10 @@ impl Session { let points = self.tool.options().get("meshPoints").cloned().unwrap_or_else(|| Value::Array(vec![])); lent.set_option("meshPoints", &points); } + // The Cmd/Ctrl held for the loan is not the Cmd/Ctrl that mirrors a dragged handle (#7842). + if id == "directSelection" { + lent.set_option("lentByCmd", &Value::Bool(true)); + } self.selection_at_lend = self.active().map(|d| (d.uid, d.selection.clone())); self.lender = Some(std::mem::replace(&mut self.tool, lent)); Ok((PointerEvent { mods: Mods { cmd: false, ..ev.mods }, ..*ev }, settled)) diff --git a/crates/engine/tests/direct_handle_mirror.rs b/crates/engine/tests/direct_handle_mirror.rs index 9fa6f26927..d7fdfab36f 100644 --- a/crates/engine/tests/direct_handle_mirror.rs +++ b/crates/engine/tests/direct_handle_mirror.rs @@ -290,6 +290,42 @@ fn direct_handle_cmd_before_press_still_lends_selection_and_returns_direct() { assert_eq!(s.doc().unwrap().history.undo.len(), before.undo); } +#[test] +fn direct_handle_cmd_that_lends_direct_selection_from_the_pen_does_not_mirror() { + let mut s = session(); + let id = curve(&mut s, Point::new(50.0, 100.0)); + s.select_tool("pen", view()).unwrap(); + let before = node(&s, id); + let undo = s.doc().unwrap().history.undo.len(); + pointer(&mut s, PointerKind::Down, Point::new(180.0, 100.0), cmd()); + assert_eq!(s.tool_id(), "directSelection", "Cmd lends the Pen the last selection tool"); + let q = Point::new(180.0, 160.0); + pointer(&mut s, PointerKind::Drag, q, cmd()); + handles(anchor(&s, id), Point::new(60.0, 70.0), q, AnchorKind::Smooth); + // Cmd let go and pressed again during the drag mirrors, as it does in Direct Selection itself. + pointer(&mut s, PointerKind::Drag, q, Mods::default()); + handles(anchor(&s, id), Point::new(60.0, 70.0), q, AnchorKind::Smooth); + pointer(&mut s, PointerKind::Drag, q, cmd()); + handles(anchor(&s, id), Point::new(20.0, 40.0), q, AnchorKind::Smooth); + assert_other_geometry(&s, id, &before); + pointer(&mut s, PointerKind::Up, q, cmd()); + assert_eq!(s.tool_id(), "pen"); + assert_eq!(s.doc().unwrap().history.undo.len(), undo + 1); +} + +#[test] +fn direct_handle_cmd_held_through_a_pen_lent_drag_leaves_the_opposite_length() { + let mut s = session(); + let id = curve(&mut s, Point::new(50.0, 100.0)); + s.select_tool("pen", view()).unwrap(); + pointer(&mut s, PointerKind::Down, Point::new(180.0, 100.0), cmd()); + let q = Point::new(180.0, 160.0); + pointer(&mut s, PointerKind::Drag, q, cmd()); + pointer(&mut s, PointerKind::Up, q, cmd()); + assert_eq!(s.tool_id(), "pen"); + handles(anchor(&s, id), Point::new(60.0, 70.0), q, AnchorKind::Smooth); +} + fn text_anchor(s: &Session, id: NodeId) -> Anchor { let n = node(s, id); let vectorcraft_doc::NodeKind::Text(t) = n.kind else { panic!("text on a path") }; @@ -435,3 +471,117 @@ fn direct_handle_incoming_drag_mirrors_outgoing_and_release_restores_ordinary_le run(&mut s, "edit.undo", json!({})); assert_content(&s, &before); } + +/// `command` with `params` is refused with an error containing `message`, and the document, +/// selection and undo history stay as they were. +fn refused(s: &mut Session, command: &str, params: Value, message: &str) { + let before = snapshot(s); + let err = s.execute(command, ¶ms).unwrap_err().to_string(); + assert!(err.contains(message), "{command} {params}: {err}"); + assert_eq!(snapshot(s), before); +} + +#[test] +fn path_set_handle_symmetric_mirrors_refuses_bad_values_and_records_no_step_when_in_place() { + let mut s = session(); + let id = curve(&mut s, Point::new(50.0, 100.0)); + let at = |x: f64, y: f64| json!({"id": id.0, "anchor": 1, "which": "out", "x": x, "y": y}); + for bad in [json!("yes"), json!(1)] { + let mut p = at(180.0, 160.0); + p["symmetric"] = bad; + refused(&mut s, "path.setHandle", p, "`symmetric` must be true or false"); + } + let mut both = at(180.0, 160.0); + both["symmetric"] = json!(true); + both["independent"] = json!(true); + refused(&mut s, "path.setHandle", both, "`independent` and `symmetric` cannot both be true"); + + let undo = s.doc().unwrap().history.undo.len(); + let mut mirror = at(180.0, 160.0); + mirror["symmetric"] = json!(true); + run(&mut s, "path.setHandle", mirror.clone()); + handles(anchor(&s, id), Point::new(20.0, 40.0), Point::new(180.0, 160.0), AnchorKind::Smooth); + assert_eq!(s.doc().unwrap().history.undo.len(), undo + 1); + let placed = snapshot(&s); + run(&mut s, "path.setHandle", mirror); + assert_eq!(snapshot(&s), placed, "both handles already in place record no undo step"); +} + +#[test] +fn symmetric_leaves_the_other_handle_retracted_at_an_open_end() { + let mut s = session(); + let id = curve(&mut s, Point::new(50.0, 100.0)); + let first = |s: &Session| node(s, id).path_data().unwrap().subpaths[0].anchors[0]; + let p = first(&s).p; + run(&mut s, "path.setHandle", json!({"id": id.0, "anchor": 0, "which": "out", "x": 60, "y": 180, "symmetric": true})); + handles(first(&s), p, Point::new(60.0, 180.0), AnchorKind::Corner); + + let mut s = session(); + let blend_id = blend(&mut s); + let end = |s: &Session| { + let n = node(s, blend_id); + let vectorcraft_doc::NodeKind::Blend { children, spec } = n.kind else { panic!("blend") }; + vectorcraft_doc::live::blend_spine(&children, &spec).unwrap().0.subpaths[0].anchors[0] + }; + let start = end(&s); + run(&mut s, "object.blend.spine.moveAnchor", json!({"id": blend_id.0, "anchor": 0, "handle": "out", "x": 60, "y": 60, "symmetric": true})); + near(end(&s).h_out, Point::new(60.0, 60.0)); + near(end(&s).h_in, start.h_in); + near(end(&s).h_in, start.p); +} + +#[test] +fn spine_and_type_path_handles_refuse_bad_symmetric_values() { + let mut s = session(); + let id = blend(&mut s); + let spine = |extra: Value| { + let mut p = json!({"id": id.0, "anchor": 1, "handle": "out", "x": 180, "y": 160}); + p.as_object_mut().unwrap().extend(extra.as_object().unwrap().clone()); + p + }; + refused(&mut s, "object.blend.spine.moveAnchor", spine(json!({"symmetric": "yes"})), "`symmetric` must be true or false"); + refused( + &mut s, + "object.blend.spine.moveAnchor", + spine(json!({"symmetric": true, "independent": true})), + "`independent` and `symmetric` cannot both be true", + ); + refused( + &mut s, + "object.blend.spine.moveAnchor", + json!({"id": id.0, "anchor": 1, "x": 180, "y": 160, "symmetric": true}), + "`symmetric` places a handle", + ); + + let text = path_text(&mut s); + let a = text_anchor(&s, text); + let at = json!({"id": text.0, "anchor": 1, "which": "out", "x": a.h_out.x, "y": a.h_out.y + 20.0}); + let mut bad = at.clone(); + bad["symmetric"] = json!(0); + refused(&mut s, "text.setPathHandle", bad, "`symmetric` must be true or false"); + let mut both = at; + both["symmetric"] = json!(true); + both["independent"] = json!(true); + refused(&mut s, "text.setPathHandle", both, "`independent` and `symmetric` cannot both be true"); +} + +#[test] +fn direct_handle_cmd_that_lends_direct_selection_from_the_pen_does_not_mirror_type_on_a_path() { + let mut s = session(); + let id = path_text(&mut s); + let a = text_anchor(&s, id); + let length = a.h_in.distance(a.p); + s.select_tool("pen", view()).unwrap(); + pointer(&mut s, PointerKind::Down, a.h_out, cmd()); + assert_eq!(s.tool_id(), "directSelection"); + let q = a.p + vectorcraft_geom::Vec2::new(80.0, 60.0); + pointer(&mut s, PointerKind::Drag, q, cmd()); + let held = text_anchor(&s, id); + near(held.h_out, q); + assert!((held.h_in.distance(held.p) - length).abs() < 1e-6, "the other handle keeps its length"); + pointer(&mut s, PointerKind::Drag, q, Mods::default()); + pointer(&mut s, PointerKind::Drag, q, cmd()); + assert_mirrored(text_anchor(&s, id), q, AnchorKind::Smooth); + pointer(&mut s, PointerKind::Up, q, cmd()); + assert_eq!(s.tool_id(), "pen"); +} diff --git a/crates/geom/src/path.rs b/crates/geom/src/path.rs index c5343171ef..c3d9083ab3 100644 --- a/crates/geom/src/path.rs +++ b/crates/geom/src/path.rs @@ -280,6 +280,11 @@ impl SubPath { pub fn polyline(points: &[Point], closed: bool) -> Self { Self { anchors: points.iter().map(|&p| Anchor::corner(p)).collect(), closed } } + /// Whether anchor `ai` has a segment on its outgoing (`out`) or incoming side. + pub fn has_segment(&self, ai: usize, out: bool) -> bool { + let n = self.anchors.len(); + ai < n && n > 1 && (self.closed || if out { ai + 1 < n } else { ai > 0 }) + } /// Number of segments (a closed path has one more, back to the start). pub fn segment_count(&self) -> usize { let n = self.anchors.len(); diff --git a/crates/tools/src/direct.rs b/crates/tools/src/direct.rs index 6458b2a227..91797def71 100644 --- a/crates/tools/src/direct.rs +++ b/crates/tools/src/direct.rs @@ -248,9 +248,27 @@ pub struct DirectSelectionTool { frame_click: Option<(NodeId, AnchorRef)>, /// Where the pointer last hovered: the type on a path bracket under it draws thicker. bracket_hover: Option, + /// The Cmd/Ctrl press that lent this tool for one gesture (`lentByCmd`) is still + /// held: it does not mirror a dragged handle. Once Cmd/Ctrl is let go, pressing it again does. + lent_cmd: bool, } impl DirectSelectionTool { + /// Whether a handle drag with `ev`'s modifiers mirrors the opposite handle: Cmd/Ctrl held + /// without Alt, unless it is still the press that lent this tool for one gesture while another + /// tool, such as the Pen, is chosen. + fn mirrors(&self, ev: &PointerEvent) -> bool { + ev.mods.cmd && !ev.mods.alt && !self.lent_cmd + } + + /// Forget the lending Cmd/Ctrl once an event comes without it. The session takes Cmd/Ctrl off + /// the press it lends the tool for, while the drags after it still carry it. + fn track_lent_cmd(&mut self, ev: &PointerEvent) { + if ev.kind != PointerKind::Down { + self.lent_cmd &= ev.mods.cmd; + } + } + pub fn new(group: bool) -> Self { Self { group, @@ -278,6 +296,7 @@ impl DirectSelectionTool { frame_revision: (0, 0), frame_click: None, bracket_hover: None, + lent_cmd: false, } } @@ -429,8 +448,8 @@ fn spine_anchor(cx: &ToolContext, (id, ai): (NodeId, usize)) -> Option Vec { - let symmetric = ev.mods.cmd && !ev.mods.alt; +/// `symmetric`: the opposite handle mirrors the dragged one ([`DirectSelectionTool::mirrors`]). +fn drag_spine_handle(cx: &ToolContext, ev: &PointerEvent, (id, anchor, out): (NodeId, usize, bool), p: Point, symmetric: bool) -> Vec { let q = if symmetric && ev.mods.shift { spine_anchor(cx, (id, anchor)).map_or(p, |a| a.p + vectorcraft_geom::constrain_angle_from(p - a.p, 45.0, cx.constrain_angle)) } else { @@ -791,10 +810,15 @@ impl Tool for DirectSelectionTool { } /// Direct Selection picks the gradient mesh points the Eyedropper held (`meshPoints`); Group /// Selection, which selects whole objects, does not. + /// The session sets `lentByCmd` on the tool Cmd/Ctrl lends for one gesture + /// ([`DirectSelectionTool::mirrors`]). fn set_option(&mut self, key: &str, value: &Value) { if key == "meshPoints" && !self.group { self.mesh.set_options(value); } + if key == "lentByCmd" { + self.lent_cmd = value.as_bool().unwrap_or(false); + } } /// Escape during a drag (anchors, handles, segments, objects, type areas, blend spines, mesh /// points, corner widgets, the brackets of type on a path, a marquee) cancels it: what it moved @@ -853,6 +877,7 @@ impl Tool for DirectSelectionTool { } fn pointer(&mut self, cx: &ToolContext, ev: &PointerEvent) -> Vec { self.bracket_hover = (ev.kind == PointerKind::Move).then_some(ev.pos); + self.track_lent_cmd(ev); if let Some(out) = self.guide.pointer(cx, ev) { return out; } @@ -999,7 +1024,7 @@ impl Tool for DirectSelectionTool { self.guides = guides; let cmd = if cx.doc.node(id).is_some_and(is_path_type) { "text.setPathHandle" } else { "path.setHandle" }; let mut params = json!({"id": id.0, "subpath": si, "anchor": ai, "which": if out {"out"} else {"in"}, "x": q.x, "y": q.y, "independent": ev.mods.alt}); - if ev.mods.cmd && !ev.mods.alt { + if self.mirrors(ev) { params["symmetric"] = json!(true); } vec![Action::Preview(cmd.into(), params)] @@ -1040,7 +1065,7 @@ impl Tool for DirectSelectionTool { )); out } - (PointerKind::Drag, State::SpineHandle { id, anchor, out }) => drag_spine_handle(cx, ev, (id, anchor, out), p), + (PointerKind::Drag, State::SpineHandle { id, anchor, out }) => drag_spine_handle(cx, ev, (id, anchor, out), p, self.mirrors(ev)), (PointerKind::Drag, State::Mesh) => self.mesh.drag_to(p).unwrap_or_default(), (PointerKind::Up, State::Mesh) => { self.state = State::Idle; diff --git a/docs/gaps.md b/docs/gaps.md index d363f1f1dd..6b48c3bec6 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -125,10 +125,10 @@ from G14 and the budget run of G15: **~170–270 h** one agent, ~50–80 h wall ## G1 Interaction fidelity -- **Temporary handle mirroring (#7842):** with Direct Selection, add Control (Command on macOS) after a direction-handle drag begins to mirror the opposite handle at equal length. This includes ordinary paths, type on a path and blend spines; a missing opposite handle is pulled out while the modifier is held. Letting go returns to the drag's normal handle behavior, Shift constrains before mirroring, and Alt takes independent-handle priority. The existing Control/Command-before-press Selection-tool loan is unchanged. This does not add a persistent coupling mode or change Pen, mesh or warp gestures; the broader G1 scope and estimates remain. - macOS cursor delivery (#2292) is narrowed to a native host adapter using the existing artwork and aligned 1×/2× representations. Headless tests cover visible fallbacks, preparation and ownership; native focus/menu/handback timing, mixed displays, Spotlight and full-screen Spaces remain open validation work (see [hardware parity](hardware-parity.md)). This does not close the interaction-fidelity gap or change its score/estimate. +- **Temporary handle mirroring (#7842):** with Direct Selection, add Control (Command on macOS) after a direction-handle drag begins to mirror the opposite handle at equal length. This includes ordinary paths, type on a path and blend spines; a missing opposite handle is pulled out while the modifier is held. At an open end, where no segment leaves the anchor on the other side, the handle moves as it does without the modifier. Letting go returns to the drag's normal handle behavior, Shift constrains before mirroring, and Alt takes independent-handle priority. The existing Control/Command-before-press Selection-tool loan is unchanged, and the Control/Command press that lends Direct Selection while another tool, such as the Pen, is chosen does not mirror until it is let go and pressed again. This does not add a persistent coupling mode or change Pen, mesh or warp gestures; the broader G1 scope and estimates remain. + - **Selection fill eligibility (#6625):** Path and compound-path interiors use any enabled non-None fill row (#6625). A lower visible fill remains selectable beneath a top None row in the same object; hidden-only and true-None interiors miss. Zero-opacity fills remain selectable. Original CPU-render and document-hit regressions in `crates/engine/tests/path_fill_hits.rs` cover seven Path and five Compound cases, including stroke edges, geometric outlines, Outline/path-only modes and compound holes. Hidden-fill and no-fill stroked paths must respect butt, round and square caps and bevel, round and miter joins. Focused cap/join CPU regressions passed. Scores and estimates unchanged. - **Panel collapse controls (#5925, in part):** The small » in a floating tab-group header moves that group into the side icon rail, reusing the existing rail or creating one. An opened rail panel has the same control to fold its flyout back into the rail, including after a tab switch. Both controls preserve the tab group and its menu; other floating groups and full-width docked headers stay as they were. Pointer regressions in `crates/ui-egui/src/panel_docking/tests.rs` cover grouped tabs, reopening, separate groups, a missing rail, the menu and flyout closure after switching tabs; `native_tests.rs` covers the native-window click and removal of the empty palette. Scores and estimates unchanged. diff --git a/docs/mcp.md b/docs/mcp.md index 8fbc770ca7..b7de8791f7 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2198,7 +2198,7 @@ naming the key, and leave the document and its undo history as they were: `opaci The blend and envelope commands refuse a string, a number or another value that is not true or false with `` `smooth` must be true or false ``, naming the key, and leave the document, its undo history and the options new blends and envelopes start with as they were: `smooth` in `object.blend.make` and `object.blend.options`; -`independent` in `object.blend.spine.moveAnchor`; `perpendicular` in `object.blend.spine.reshapeSegment`; `horizontal` +`independent` and `symmetric` in `object.blend.spine.moveAnchor`; `perpendicular` in `object.blend.spine.reshapeSegment`; `horizontal` in `object.envelope.makeWithWarp`, `resetWithWarp` and `options`, also when an `orientation` is given; `maintainShape` in `object.envelope.resetWithMesh`; `antiAlias`, `distortAppearance`, `distortLinearGradients` and `distortPatternFills` in `object.envelope.options`; and `editing` in `object.envelope.editContents`. A null is read as @@ -6350,6 +6350,13 @@ is not a whole number of 0 or more, such as 1.5, -1 or "1" ("`subpath` must be a an `anchor` or `segment` in the same way. The document does not change and no undo step is recorded. `path.moveAnchor` to the point the anchor is at, and `path.setHandle` to the point the handle is at on an anchor that keeps its kind, leave the document as it is and record no undo step. +`path.setHandle` with `symmetric: true` also places the anchor's other handle opposite the moved one at the same +length, and the anchor keeps its kind. At an open end, where no segment leaves the anchor on the other side, +`symmetric` has no effect and the handle moves as it would without it. Both `symmetric` and `independent` default to false, and a call with both true is +refused with `` `independent` and `symmetric` cannot both be true ``; the document does not change and no undo step +is recorded. Direct Selection sends `symmetric` while Cmd/Ctrl is held during a handle drag, unless that Cmd/Ctrl +press lent Direct Selection for the gesture while another tool, such as the Pen, was chosen and has not been let go +since (#7842). A call that puts both handles where they already are records no undo step. `path.insertAnchor` keeps the direct-selected anchors and selected segments of the path on the same points: those after the new anchor on its subpath are numbered one higher, and a selected segment that the new anchor splits stays selected as its two halves, with the new anchor as an end of both that moves with them. Undo restores the path and @@ -6467,7 +6474,7 @@ Left out or null, `width` is 8 pt. The range is VectorCraft's own value. These commands refuse a string, a number or another value that is not true or false with `` `closed` must be true or false ``, naming the key; the document does not change and no undo step is recorded: -`independent` in `path.close` and `path.setHandle`; `patterns` in `path.moveAnchors`; `closed`, `keepSelected` and +`independent` in `path.close` and `path.setHandle`; `symmetric` in `path.setHandle`; `patterns` in `path.moveAnchors`; `closed`, `keepSelected` and `fill` in `path.freehand` (and in `brush.freehand`); `closed` and the `corner` of a point in `path.curvature`; `corner` in `path.curvatureEdit`; `perpendicular` in `path.reshapeSegment`; and `keepSelected`, `mergeOnlySelection` and `merge` in `path.blob`. A null is read as a key left out. @@ -10198,10 +10205,12 @@ undo step. Object › Transform › Scale, the Scale tool and the Transform pane `text.reshapePath {id, anchors: [[subpath, anchor]…], dx, dy}` does the same for the path of type on a path (Direct Selection dragging one of its anchors): the start and end brackets keep their fractions of the path and the text reflows along it. -`text.setPathHandle {id, subpath?, anchor, which: "in"|"out", x, y, independent?}` moves a direction handle of one -of its anchors, as `path.setHandle` moves a path's (Direct Selection dragging a handle of the path, #3565), in one -undo step. A call of `text.reshapeArea`, `text.reshapePath` or `text.setPathHandle` that changes nothing (`dx` and -`dy` both 0, or a handle moved to where it already is) adds no undo step and keeps redo. +`text.setPathHandle {id, subpath?, anchor, which: "in"|"out", x, y, independent?, symmetric?}` moves a direction handle +of one of its anchors, as `path.setHandle` moves a path's (Direct Selection dragging a handle of the path, #3565), in +one undo step. With `symmetric: true` the other handle goes opposite the moved one at the same length, measured on +the page, as in `path.setHandle`; `symmetric` and `independent` cannot both be true. A call of `text.reshapeArea`, +`text.reshapePath` or `text.setPathHandle` that changes nothing (`dx` and `dy` both 0, or handles left where they +already are) adds no undo step and keeps redo. ```json {"name":"run_command","arguments":{"command":"text.reshapeArea","params":{"id":42,"anchors":[[0,2]],"dx":40,"dy":60}}} @@ -12683,7 +12692,8 @@ the compound path selected), and the next click starts a new path. Choosing any A blend's spine is the straight lines between its key centres until it is edited. `object.blend.info` lists it (`spine.anchors`, `keyAnchors`: the point each key sits on). `object.blend.spine.addAnchor {x, y}` adds a point where the spine passes nearest, `object.blend.spine.moveAnchor {anchor, x, y}` moves a point (a key on it moves along; with -`handle: "in" | "out"` it places that handle), `object.blend.spine.convertAnchor {anchor, to: "smooth" | "corner", x?, y?}` converts a point's handles (a Smooth drag with `x, y` creates opposite handles; Corner retracts both), `object.blend.spine.reshapeSegment {segment, t, dx, dy, perpendicular?}` bends a segment +`handle: "in" | "out"` it places that handle, and with `symmetric: true` also the other handle opposite it at the +same length, as `path.setHandle` does; `symmetric` needs `handle` and cannot go with `independent`), `object.blend.spine.convertAnchor {anchor, to: "smooth" | "corner", x?, y?}` converts a point's handles (a Smooth drag with `x, y` creates opposite handles; Corner retracts both), `object.blend.spine.reshapeSegment {segment, t, dx, dy, perpendicular?}` bends a segment so its point at `t` moves by (dx, dy), turning a straight spine into a curve (`perpendicular` works as in `path.reshapeSegment`), and `object.blend.spine.removeAnchor {anchor}` deletes a point no key sits on; the first edit turns the spine into a path. Moving a key moves its end of the spine. Release (`object.blend.release`) leaves the spine of a blend that has one as a path that paints nothing (`spines` in the result): diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index d6072fd54f..bc8f9b5dd3 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -713,6 +713,7 @@ since 2026-10-01. - **Clipping paths on their outline (G1):** the selection tools (Selection, Direct Selection, Group Selection), Object Highlighting and a right-click take a clipping path on its outline before the art it clips; Select Behind lists the same; the eyedropper, the tools that act on what is drawn and the selection tools' double-clicks, loaded text and guide release take the art. Doc and tool regression tests; score unchanged. - **Link cursor for loaded text:** with text loaded from a port, the Selection tool's pointer adds a link badge over a closed path, area type or type on a path that a click threads the text into, and keeps the loaded text elsewhere; a click on a frame already in a thread or a path inside a compound path makes a new frame instead of a `text.thread.add` error (`select::tests::loaded_text_shows_the_link_cursor_where_a_click_threads_it_into_the_object`, `cursors::tests::loaded_text_link_cursor_is_the_loaded_text_with_a_link_badge`); score unchanged. - **Copy and Cut of anchors picked with a lent Direct Selection (#6123):** with the Pen or the Curvature tool, Cmd/Ctrl held lends Direct Selection for the gesture; the anchors and segments it picks are what Edit › Copy and Cut take once the key is let go, as with Direct Selection chosen, while the last anchor the Pen leaves selected as it draws still makes Copy take the whole path (#2122). A Cmd gesture that leaves the selection as it was (a Shift marquee over nothing) picks nothing. Regression test: `tests::draw2::pen_cmd_selected_anchors_are_what_copy_and_cut_take`. +- **Mirrored handles in a Direct Selection drag (#7842):** Cmd/Ctrl added after a handle drag begins puts the anchor's other handle opposite the dragged one at the same length, on paths, type on a path and blend spines, and the anchor keeps its kind; Shift constrains the dragged handle first, and Alt keeps the handles independent. At an open end, where no segment leaves the anchor on the other side, the handle moves as it does without Cmd/Ctrl. When Cmd/Ctrl lends Direct Selection for the gesture while another tool, such as the Pen, is chosen, that press does not mirror; letting it go and pressing it again during the drag does. This is VectorCraft's own behavior. Regression tests: `crates/engine/tests/direct_handle_mirror.rs`. - **Cut of picked anchors (#6361):** Edit › Cut removes direct-selected anchors from their path and from a compound path's member, with the segments attached to them, as Clear does. Picked segments still lose only those segments. When a path also has a picked segment, Cut removes and copies only its picked segments and ignores its picked anchors, on every contour, as Clear does; an anchor left without a surviving segment is removed with them. Regression tests: `cut_*_anchors_*` and `cut_of_an_anchor_with_a_segment_on_another_contour_leaves_the_source_as_clear_does` in `crates/engine/tests/it/copy_direct_selection.rs`. - **Escape in Selection tool drags:** Escape during a Selection tool move or Alt-drag copy, a bounding-box scale or rotation, a marquee, or a corner widget, pie widget or bracket drag cancels it: the art returns to its state at the press, no copy is left, no undo step is added, the release does nothing, and the tool stays chosen. This is VectorCraft's own behavior. Regression tests: `escape_cancels_*` in `select/tests.rs` and `pie.rs`, and `escape_cancels_a_selection_tool_move_copy_scale_or_rotation` in `tests/selectescape.rs`. - **Large Shift-marquee selections and Select › Inverse:** `select.toggle` and `select.add` with many ids (a Shift-drag marquee sends them together) go through the selection once instead of once per id, and Select › Inverse looks each object up in a set of the selected ones. The resulting selection, its order and the reply are the same as before. With 50,000 objects the selection step of toggling every object off took 528 to 655 ms before and 2.5 to 4.6 ms after in 7 runs, wall clock on a machine that was running other builds (`cargo run --release -p vectorcraft-engine --example selection_bench`). Regression tests: `add_all_does_what_adding_each_does` and `toggle_all_does_what_toggling_each_does` in `crates/doc/src/selection/tests.rs`, and `toggle_and_add_handle_each_listed_id_in_order` in `crates/engine/tests/it/selection_commands.rs`. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index db7b28fe5a..deed54234b 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -238,7 +238,7 @@ tools, never checked side by side) isn't captured row by row. | Drag a curved segment to bend it, a straight one to move its anchors | done | | | Drag by an anchor of a path selected whole moves the whole path; Alt-drag by an anchor or a segment copies it, Alt toggles the copy during the drag, and the copy snaps by the anchor pressed, onto the original too | done | #1104 | | Handles shown are the handles that drag; tolerance from Selection & Anchor Display | done | #494 | -| Drag a handle with Shift (45° about its anchor), Alt (move one handle alone), or Control/Command added mid-drag (mirror the opposite handle) | done | handles snap to smart guides; handle and anchor drags no longer stall when the pointer leaves and re-enters the window, and a move in the release's frame lands (#834); #7842: temporary mirroring covers paths, transformed type on a path and blend spines, preserves the anchor mode and the pre-press selection-tool loan, and keeps Alt independent priority; `crates/engine/tests/direct_handle_mirror.rs` | +| Drag a handle with Shift (45° about its anchor), Alt (move one handle alone), or Control/Command added mid-drag (mirror the opposite handle) | done | handles snap to smart guides; handle and anchor drags no longer stall when the pointer leaves and re-enters the window, and a move in the release's frame lands (#834); #7842: temporary mirroring covers paths, transformed type on a path and blend spines, preserves the anchor mode and the pre-press selection-tool loan, and keeps Alt independent priority; the Control/Command press that lends Direct Selection while another tool, such as the Pen, is chosen does not mirror until it is let go and pressed again; `crates/engine/tests/direct_handle_mirror.rs` | | Show handles when multiple anchors are selected; Highlight anchors on mouse over; anchor and handle size | done | Preferences › Selection & Anchor Display | | Convert selected anchors to corner/smooth from the Control bar and Properties | done | | | Cut path at selected anchors, Remove Anchor Points, Delete removes segments | done | Open-path anchor Delete removes adjoining segments without bridging the gap; #3380 (deletion only): disconnected survivors of an ordinary contour become independent selected sibling objects, while multi-subpath paths and compound members stay intact; targeted core and full-frame Delete/Backspace regressions pass for survivor selection and Undo/Redo. Explicit Remove Anchor Points keeps its reconnect/refit behavior; #1278: segment Delete preserves neighboring edges and endpoint anchors; a second Delete removes all selected surviving objects; explicit anchor Delete retains its behavior; #1674: Delete removes every selected anchor of a closed path and objects selected whole along with them, and keeps the surviving objects selected; #2241: Remove Anchor Points then selects the next anchor along the path (the one before at an open end), so it can be run again without picking each anchor | From 236bafbf7af7f409204fde21e4a36dbf6ea811ba Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 13:43:15 -0800 Subject: [PATCH 23/55] Brushes: keep the library test's frame times increasing The Artistic Brushes click runs frames at 3.0 to 3.5, so the Pressure Sensitive click now starts at 4.0 instead of 3.0. egui panics when a frame's time is earlier than the last one. --- crates/ui-egui/src/panels/tests_brush_libraries.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/panels/tests_brush_libraries.rs b/crates/ui-egui/src/panels/tests_brush_libraries.rs index cdcb726874..4947e33444 100644 --- a/crates/ui-egui/src/panels/tests_brush_libraries.rs +++ b/crates/ui-egui/src/panels/tests_brush_libraries.rs @@ -248,7 +248,7 @@ fn the_window_menu_and_the_brushes_panel_open_brush_libraries() { assert_eq!((r["open"].as_str(), r["count"].as_u64()), (Some("pressure-sensitive"), Some(4))); let path = app.run("shape.line", json!({"x1": 10, "y1": 100, "x2": 180, "y2": 100})).unwrap()["id"].as_u64().unwrap(); let undo = undo_len(&app); - click(&mut app, &ctx, "Flex Ribbon", Modifiers::NONE, 3.0); + click(&mut app, &ctx, "Flex Ribbon", Modifiers::NONE, 4.0); assert!(has(&app, "Flex Ribbon") && !has(&app, "Pulse Stroke")); assert_eq!(undo_len(&app), undo + 1); assert_eq!( From 6865a4d42d86f3fcc28635aded561989398880d6 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 13:45:02 -0800 Subject: [PATCH 24/55] i18n: Polish calls the art kompozycja in the User Interface sentences The Polish row for the UI scaling sentence said grafika for the art on the canvas. The catalog calls art and artwork kompozycja, and polish_rows_call_artwork_kompozycja checks every row for it. --- crates/ui-egui/src/i18n/pl.tsv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index a2b1c3f338..299de789b0 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4572,7 +4572,7 @@ 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. From 44f54c406fadddc0d23c2bfceb3cc15519f75d46 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 14:06:57 -0800 Subject: [PATCH 25/55] i18n: Polish calls the art kompozycja in the Performance sentences The Polish rows for Real-time Drawing and Editing, Render Threads and Use Monitor Profile for Canvas said grafika for the artwork. The catalog calls art and artwork kompozycja, and polish_rows_call_artwork_kompozycja checks every row for it. --- crates/ui-egui/src/i18n/pl.tsv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 299de789b0..14a295984d 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4579,10 +4579,10 @@ font-technology Variable Zmienne 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. 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. Reset all preferences to their defaults? Przywrócić domyślne wartości wszystkich preferencji? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Wartości domyślne zostaną zastosowane po kliknięciu OK w Preferencjach. Anuluj w tym oknie zachowuje bieżące preferencje. Smaller ↔ Larger Mniejszy ↔ większy From 97a2b802a424f95f03c385c6f4d37aefc9cfe802 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 15:02:02 -0800 Subject: [PATCH 26/55] Symbolism: tool.setOption takes every Symbolism option, and OK checks ranges first - The Symbolism tools' check_option accepts usePressure, method, showBrush, the six Sprayer options, proportional and affectsDensity, so tool.setOption and the options dialog's OK save them. - OK runs both of tool.setOption's checks, ranges included, before symbol.setDensity, so a refused diameter leaves the sets' density. - Average skips a stain or style at opacity 0: the Sprayer's mean and the Stainer and Styler take the visible one's paint. - symbol.adjust reads an instance's look only for Average and the Shift recolor, so the Shifter moves an instance whose transform flattens it. - restack collects the parents in a BTreeSet. - The symbol.spray, symbol.setDensity and symbol.adjust texts and docs/mcp.md describe the size base and jitter, the third point value, the starting density, the Random and Alt Styler, and density errors. --- crates/engine/src/cmd/brushsym.rs | 6 +- crates/engine/src/cmd/brushsym/symbolism.rs | 5 +- crates/engine/src/cmd/brushsym/symbols.rs | 45 ++++---- crates/engine/src/tests/symbolism_options.rs | 106 +++++++++++++++++- crates/engine/src/tests/symbolism_shift.rs | 17 ++- crates/tools/src/symbolism.rs | 3 + .../ui-egui/src/dialogs/symbolism_options.rs | 13 ++- docs/mcp.md | 38 ++++--- docs/target-app-parity.md | 2 +- 9 files changed, 188 insertions(+), 47 deletions(-) diff --git a/crates/engine/src/cmd/brushsym.rs b/crates/engine/src/cmd/brushsym.rs index 7e904fd26b..3223ca19e9 100644 --- a/crates/engine/src/cmd/brushsym.rs +++ b/crates/engine/src/cmd/brushsym.rs @@ -362,7 +362,7 @@ pub fn specs() -> Vec { "Symbol Sprayer", [], None, - "{points: [[x,y]…], name?, radius?: 40, density?: 1..10 (5), scale?: 1, alt?: bool (remove instances), attributes?: {scrunch?, size?, spin?, screen?, stain?, style?: average|userDefined (average)}, color? (#rrggbbaa and #rgba are refused), keepModel?: bool (as paint.setFill), style?: name} spray instances into a symbol set → {id, count}. Each of `attributes` says what a new instance takes: average, the mean of the selected set's instances within `radius` of the stroke point (their spacing along the stroke, size, rotation, opacity, and the stain or style of the nearest one that has one at the mean amount), and with none there the symbol's size, no rotation, full opacity and no stain or style; or userDefined: spacing from the symbol's size and `density`, the symbol's size times `scale`, turned the way the stroke runs there (not turned for one point), full opacity, stained in full with `color` (default: the fill color), and the fill of graphic style `style` (default: the first style after the default one) in full. The stain and the style are both the instance's fill, and the style replaces the stain. Another key or value in `attributes` is an error", + "{points: [[x,y]…], name?, radius?: 40, density?: 1..10 (5; a number outside 1..10 is taken as the nearer end), scale?: 1, alt?: bool (remove instances), attributes?: {scrunch?, size?, spin?, screen?, stain?, style?: average|userDefined (average)}, color? (#rrggbbaa and #rgba are refused), keepModel?: bool (as paint.setFill), style?: name} spray instances into a symbol set → {id, count}. A point's third value, when given, must be a number or null; the Sprayer does not use it. Each of `attributes` says what a new instance takes: average, the mean of the selected set's instances within `radius` of the stroke point (their spacing along the stroke, size, rotation, opacity, and the stain or style of the nearest one that has one with an amount above 0, at the mean amount), and with none there the symbol's size times `scale`, no rotation, full opacity and no stain or style; or userDefined: spacing from the symbol's size and `density`, the symbol's size times `scale`, turned the way the stroke runs there (not turned for one point), full opacity, stained in full with `color` (default: the fill color), and the fill of graphic style `style` (default: the first style after the default one) in full. Either size, the mean or the symbol's, is a base that each new instance varies from by up to 10% either way. The stain and the style are both the instance's fill, and the style replaces the stain. Another key or value in `attributes` is an error", has_doc, symbol_spray ), @@ -371,7 +371,7 @@ pub fn specs() -> Vec { "Symbol Set Density", [], None, - "{from: 1..10, to: 1..10, ids?|id?} space the instances of the selected symbol sets (or those in `ids`) as Symbol Set Density `to` packs them, from the density each set was created at or last given (`from` for a set without one, such as one grouped by hand): each instance moves along the line from the middle of its set's instances, to (1.15 − 0.1·to) / (1.15 − 0.1·from) of its distance from it (each factor at least 0.1), as one undo step, and the sets moved then have density `to`; a higher density packs them closer, and a locked or hidden instance stays where it is. No undo step is added when no instance moves (a set already at `to`, or sets of one instance). A `from` or `to` left out, not a number or outside 1..10, an id naming no object, or no symbol set among the objects is an error → {ids: the sets changed, count: the instances moved}", + "{from: 1..10, to: 1..10, ids?|id?} space the instances of the selected symbol sets (or those in `ids`) as Symbol Set Density `to` packs them, from each set's starting density: the density the set was created at or last given, or `from` only for a set without one (such as one grouped by hand). Each instance moves along the line from the middle of its set's instances, to (1.15 − 0.1·to) / (1.15 − 0.1·start) of its distance from it, where start is that starting density (each factor at least 0.1), as one undo step, and the sets moved then have density `to`; a higher density packs them closer, and a locked or hidden instance stays where it is. No undo step is added when no instance moves (a set already at `to`, or sets of one instance). A `from` or `to` left out, not a number or outside 1..10, an id naming no object, or no symbol set among the objects is an error → {ids: the sets changed, count: the instances moved}", has_doc, symbol_set_density ), @@ -380,7 +380,7 @@ pub fn specs() -> Vec { "Symbolism Tool", [], None, - "{tool: shift|scrunch|size|spin|stain|screen|style, points: [[x,y,pressure?]…] (pen pressure 0..1, default 1), radius?: 40, intensity?: 1..10 (5), usePressure?: bool (each point's pressure is the intensity there, in place of `intensity`), method?: userDefined|average|random (userDefined; not used by shift), proportional?: bool (size; true), affectsDensity?: bool (size; false), alt?: bool, shift?: bool (shift, size, stain and style; false), color? (#rrggbbaa and #rgba are refused), keepModel?: bool (as paint.setFill), style?: name (a graphic style's; left out, or naming no style in the document, the first style after the default one)} adjust instances near the points (selection, else all) → {count}. `method` userDefined changes each instance by the tool's amount at its distance from the point; random gives each instance its own share of that amount for the whole stroke, from none to twice it (spin: a turn either way); average moves each instance's value toward the mean of the instances within `radius` of the point (scrunch: its distance from their middle toward their mean distance; size: the geometric mean of their sizes; spin: their mean direction; stain and style: their mean amount; screen: their mean opacity), and `alt` does not reverse it. With `proportional` false a drag resizes along its own direction (a level drag the width, an upright one the height; the first point takes the direction to the second) and one point resizes both; average resizes both whatever `proportional` is. With `affectsDensity` an instance also moves away from the point as it grows and toward it as it shrinks. `shift` is the tool's Shift form: shift brings the instances within `radius` of any point one place forward among their siblings (with `alt`, one place backward), once for the stroke, and does not move them; size keeps the instances where they are, `affectsDensity` included; stain and style keep each instance's amount and move its paint toward `color` or the style (stain by the tool's amount at its distance from the point, style by the brush's strength there), whatever `method` is, and leave an instance without a stain or style as it is, and `alt` has no effect. No undo step is added when no instance changes (none under the brush, average with each already at the mean, or shift with nothing to move or change). A `method` that is none of the three, or a pressure that isn't a number, is an error", + "{tool: shift|scrunch|size|spin|stain|screen|style, points: [[x,y,pressure?]…] (pen pressure 0..1, default 1), radius?: 40, intensity?: 1..10 (5), usePressure?: bool (each point's pressure is the intensity there, in place of `intensity`), method?: userDefined|average|random (userDefined; not used by shift), proportional?: bool (size; true), affectsDensity?: bool (size; false), alt?: bool, shift?: bool (shift, size, stain and style; false), color? (#rrggbbaa and #rgba are refused), keepModel?: bool (as paint.setFill), style?: name (a graphic style's; left out, or naming no style in the document, the first style after the default one)} adjust instances near the points (selection, else all) → {count}. `method` userDefined changes each instance by the tool's amount at its distance from the point; random gives each instance its own share of that amount for the whole stroke, from none to twice it (spin: a turn either way; style without `shift`: from none to the userDefined amount); average moves each instance's value toward the mean of the instances within `radius` of the point (scrunch: its distance from their middle toward their mean distance; size: the geometric mean of their sizes; spin: their mean direction; stain and style: their mean amount; screen: their mean opacity), and `alt` does not reverse it. With `proportional` false a drag resizes along its own direction, the width by the drag's horizontal share and the height by its vertical share (a level drag the width, an upright one the height, a 45° drag both alike; the first point takes the direction to the second) and one point resizes both; average resizes both whatever `proportional` is. With `affectsDensity` an instance also moves away from the point as it grows and toward it as it shrinks. The style goes on by the brush's strength at each sample, and a stroke's samples add up. With `alt` and without `shift`, userDefined and random style remove all of an instance's appearance items under the brush at once, whatever the brush's strength. `shift` is the tool's Shift form: shift brings the instances within `radius` of any point one place forward among their siblings (with `alt`, one place backward), once for the stroke, and does not move them; size keeps the instances where they are, `affectsDensity` included; stain and style keep each instance's amount and move its paint toward `color` or the style (stain by the tool's amount at its distance from the point, style by the brush's strength there), whatever `method` is, and leave an instance without a stain or style as it is, and `alt` has no effect. No undo step is added when no instance changes (none under the brush, average with each already at the mean, or shift with nothing to move or change). A `method` that is none of the three, or a pressure that isn't a number, is an error", has_doc, symbol_adjust ), diff --git a/crates/engine/src/cmd/brushsym/symbolism.rs b/crates/engine/src/cmd/brushsym/symbolism.rs index 0be2ee37f8..0e311d12f8 100644 --- a/crates/engine/src/cmd/brushsym/symbolism.rs +++ b/crates/engine/src/cmd/brushsym/symbolism.rs @@ -204,7 +204,10 @@ pub(super) fn mean(looks: &[&Look], at: Point, gap_cell: Option) -> Option< cos += l.angle.cos(); opacity += l.opacity; middle += l.center.to_vec2(); - if let Some((p, o)) = &l.fill { + // A fill at no opacity shows nothing: it is no stain or style, and its paint is not taken. + if let Some((p, o)) = &l.fill + && *o > 0.0 + { amount += o; let far = l.center.distance(at); if paint.is_none_or(|(_, nearest)| far < nearest) { diff --git a/crates/engine/src/cmd/brushsym/symbols.rs b/crates/engine/src/cmd/brushsym/symbols.rs index 534dbb0f84..d3d4a9b227 100644 --- a/crates/engine/src/cmd/brushsym/symbols.rs +++ b/crates/engine/src/cmd/brushsym/symbols.rs @@ -1,5 +1,5 @@ use super::dynamic::{fit_overrides, type_id, type_param}; -use super::symbolism::{Grid, Mean, Method, look, mean, method_param, record_set_density, spacing, spray_modes, wrap_angle}; +use super::symbolism::{Grid, Look, Mean, Method, look, mean, method_param, record_set_density, spacing, spray_modes, wrap_angle}; use super::{ Affine, AppearanceItem, Arc, CURRENT_SYMBOL, Color, Document, EngineError, FillLayer, HALF, Node, NodeId, NodeKind, Paint, Point, Result, SIZES_KEY, Session, Symbol, SymbolExportType, SymbolNineSlice, SymbolRegistration, Value, Vec2, bad, brush, color_param, ids_json, json, @@ -1205,18 +1205,21 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result { if w <= 0.0 { continue; } - let Some(cur) = d.node(*id).and_then(|n| look(d, n)) else { continue }; + // Average and the Shift forms of the Stainer and the Styler read the instance's look, + // and Average has no mean of instances without one. The other changes need only its + // center, so an instance without a size (one whose transform flattens it) still moves. + let Some(cur) = look_if(d, *id, method == Method::Average || recolor.is_some()) else { continue }; // Shift with the Symbol Stainer or the Symbol Styler: the instance keeps the amount // of its stain or style, and its paint moves toward the color or the style. An // instance without one is left as it is. if let Some((to, step)) = &recolor { - if recolor_keeping_amount(d, *id, cur.fill, to, step * w) { + if recolor_keeping_amount(d, *id, cur.and_then(|l| l.fill), to, step * w) { touched.insert(*id); } continue; } // Average leaves an instance that already has the mean as it is. - let at_mean = target.as_ref().is_some_and(|t| match tool.as_str() { + let at_mean = target.as_ref().zip(cur.as_ref()).is_some_and(|(t, cur)| match tool.as_str() { "scrunch" => { let out = (c - t.middle).hypot(); out <= 1e-9 || (t.reach - out).abs() < 1e-9 @@ -1250,8 +1253,8 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result { n.transform(Affine::translate(v), false); } "size" => { - let k = match &target { - Some(t) => (t.scale / cur.scale).powf(w.min(1.0)), + let k = match target.as_ref().zip(cur.as_ref()) { + Some((t, cur)) => (t.scale / cur.scale).powf(w.min(1.0)), None => (1.0 + 0.08 * w).powf(if alt { -share } else { share }), }; // Without Proportional Resizing a drag resizes along its own direction: a @@ -1273,8 +1276,8 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result { } } "spin" => { - let a = match (&target, method) { - (Some(t), _) => wrap_angle(t.angle - cur.angle) * w.min(1.0), + let a = match (target.as_ref().zip(cur.as_ref()), method) { + (Some((t, cur)), _) => wrap_angle(t.angle - cur.angle) * w.min(1.0), // A turn either way, whichever way the drag runs. (None, Method::Random) => 0.1 * w * (share - 1.0), // Turn towards the drag direction; a click spins a little. @@ -1285,10 +1288,11 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result { } "stain" | "style" => { let paint = if tool == "style" { style_paint.clone().unwrap_or(Paint::solid(color)) } else { Paint::solid(color) }; - let (paint, o) = match &target { - // Toward the mean amount, keeping the stain or style the instance has. - Some(t) => { - let (own, cur) = cur.fill.map_or((None, 0.0), |(p, o)| (Some(p), o)); + let (paint, o) = match target.as_ref().zip(cur) { + // Toward the mean amount, keeping the stain or style the instance has + // (one at no opacity is none). + Some((t, cur)) => { + let (own, cur) = cur.fill.filter(|(_, o)| *o > 0.0).map_or((None, 0.0), |(p, o)| (Some(p), o)); (own.or(t.paint.clone()).unwrap_or(paint), (cur + (t.amount - cur) * w.min(1.0)) as f32) } None => { @@ -1332,6 +1336,15 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result { Ok(json!({ "count": count })) } +/// The [`Look`] of instance `id` for the symbolism tools, or None to leave the instance as it is: +/// one without a look (no size) is left only when `needed`. +fn look_if(d: &Document, id: NodeId, needed: bool) -> Option> { + match d.node(id).and_then(|n| look(d, n)) { + None if needed => None, + cur => Some(cur), + } +} + /// Move the paint of instance `id`'s stain or style (`fill`, its topmost fill with the amount) /// toward `to` by `t`. The fill keeps its amount and everything else it has, and the instance's /// other appearance items stay as they are. A paint with no form between it and `to` (a solid @@ -1360,13 +1373,7 @@ fn recolor_keeping_amount(d: &mut Document, id: NodeId, fill: Option<(Paint, f64 /// so do the clipping path of a clip group and the ruler guides above a layer's art. Returns how /// many moved. fn restack(d: &mut Document, ids: &std::collections::HashSet, back: bool) -> Result { - let mut parents: Vec> = vec![]; - for id in ids { - let par = d.parent_of(*id); - if !parents.contains(&par) { - parents.push(par); - } - } + let parents: std::collections::BTreeSet> = ids.iter().map(|id| d.parent_of(*id)).collect(); let mut moved = 0; for par in parents { let floor = usize::from(par.and_then(|p| d.node(p)).is_some_and(Node::clips)); diff --git a/crates/engine/src/tests/symbolism_options.rs b/crates/engine/src/tests/symbolism_options.rs index bd9d021b31..bc5eb86588 100644 --- a/crates/engine/src/tests/symbolism_options.rs +++ b/crates/engine/src/tests/symbolism_options.rs @@ -271,6 +271,7 @@ fn tool_set_option_refuses_bad_symbolism_options() { ("usePressure", json!("yes"), "`usePressure` must be true or false"), ("diameter", json!("big"), "`diameter` must be a number"), ("style", json!(3), "`style` must be a name or null"), + ("diameter", json!(1), "tool `symbolSizer`: `diameter` must be a number from 2 to 2000"), ] { let r = s.set_tool_option_cmd(&json!({"tool": "symbolSizer", "values": {key: bad}})); assert_eq!(r, Err(want.to_string()), "{key}"); @@ -278,6 +279,16 @@ fn tool_set_option_refuses_bad_symbolism_options() { } let r = s.set_tool_option_cmd(&json!({"tool": "symbolSizer", "values": {"method": "random", "sprayStain": "userDefined"}})).unwrap(); assert_eq!((r["method"].as_str(), r["sprayStain"].as_str()), (Some("random"), Some("userDefined"))); + // Every option the options dialog sends is taken, together. + let all = json!({ + "diameter": 100.0, "intensity": 6.0, "density": 4.0, "usePressure": true, "method": "average", "showBrush": false, + "sprayScrunch": "userDefined", "spraySize": "userDefined", "spraySpin": "userDefined", "sprayScreen": "userDefined", + "sprayStain": "average", "sprayStyle": "userDefined", "proportional": false, "affectsDensity": true, + }); + let r = s.set_tool_option_cmd(&json!({"tool": "symbolSizer", "values": all})).unwrap(); + for (key, v) in all.as_object().unwrap() { + assert_eq!(&r[key], v, "{key}"); + } } /// With `usePressure` each point's pen pressure is the intensity there; without it the pressure is @@ -691,6 +702,97 @@ fn the_styler_applies_the_style_by_the_brushs_strength() { assert!(near(styled(json!({"usePressure": true, "points": [[100, 150, 0.25]]}), 100.0), 0.25)); assert!(near(styled(json!({"usePressure": true, "points": [[100, 150, 1.0]]}), 100.0), 1.0)); assert_eq!(styled(json!({"usePressure": true, "points": [[100, 150, 0.0]]}), 100.0), 0.0, "no pressure, no style"); - let random = styled(json!({"usePressure": true, "points": [[100, 150, 0.25]], "method": "random"}), 100.0); - assert!(random <= 0.25 + 1e-6, "{random}"); + // Random: instances the same distance from the point take different amounts, each from none to + // the User Defined amount there (0.25: pressure 0.5, half way to the brush's edge). + let mut s = session(); + let ring: Vec = (0..6) + .map(|i| { + let a = f64::from(i) * std::f64::consts::TAU / 6.0; + dot(&mut s, 100.0 + 5.0 * a.cos(), 150.0 + 5.0 * a.sin()) + }) + .collect(); + let id = s.execute("shape.rectangle", &json!({"x": 300, "y": 250, "width": 10, "height": 10})).unwrap()["id"].as_u64().unwrap(); + s.execute("paint.setFill", &json!({"color": "#0000ff"})).unwrap(); + s.execute("graphicStyle.new", &json!({"name": "Blue", "id": id})).unwrap(); + s.select(|_, sel| sel.clear()).unwrap(); + adjust(&mut s, json!({"tool": "style", "points": [[100, 150, 0.5]], "radius": 10, "usePressure": true, "method": "random", "style": "Blue"})); + let amounts: Vec = ring.iter().map(|a| node(&s, *a).appearance.fill().map_or(0.0, |f| f.opacity)).collect(); + assert!(amounts.iter().all(|a| *a <= 0.25 + 1e-6), "{amounts:?}"); + assert!(amounts.iter().any(|a| *a > 0.0), "{amounts:?}"); + assert!(amounts.iter().any(|a| (a - amounts[0]).abs() > 1e-6), "{amounts:?}"); +} + +/// A sprayed instance's Average stain is the stain of the nearest instance whose stain shows: one +/// at no opacity is passed over and counts as no stain in the mean amount. +#[test] +fn average_spray_passes_over_a_stain_at_no_opacity() { + use vectorcraft_color::{Color, Paint}; + let mut s = session(); + let set = + NodeId(s.execute("symbol.spray", &json!({"name": "Dot", "points": [[100, 150], [130, 150]], "radius": 4})).unwrap()["id"].as_u64().unwrap()); + let ids = members(&s, set); + assert_eq!(ids.len(), 2); + s.edit("Stains", |d, _| { + for (id, color, amount) in [(ids[0], Color::rgb(1.0, 0.0, 0.0), 0.0), (ids[1], Color::rgb(0.0, 0.0, 1.0), 1.0)] { + let n = d.node_mut(id).unwrap(); + n.appearance.items.retain(|i| !matches!(i, vectorcraft_doc::AppearanceItem::Fill(_))); + let mut f = vectorcraft_doc::FillLayer::new(Paint::solid(color)); + f.opacity = amount; + n.appearance.items.insert(0, vectorcraft_doc::AppearanceItem::Fill(f)); + } + Ok(()) + }) + .unwrap(); + s.execute("symbol.spray", &json!({"name": "Dot", "points": [[100, 150]], "radius": 40})).unwrap(); + let new: Vec = members(&s, set).into_iter().filter(|id| !ids.contains(id)).collect(); + assert_eq!(new.len(), 1); + let f = node(&s, new[0]).appearance.fill().cloned().unwrap(); + assert_eq!(f.paint, Paint::solid(Color::rgb(0.0, 0.0, 1.0))); + assert!((f.opacity - 0.5).abs() < 1e-6, "{}", f.opacity); +} + +/// The Symbol Shifter moves an instance whose transform flattens it (it has no size), as it moves +/// any other, and counts it. +#[test] +fn the_shifter_moves_an_instance_without_a_size() { + let mut s = session(); + let a = dot(&mut s, 200.0, 150.0); + s.edit("Flatten", |d, _| { + if let Some(NodeKind::SymbolInstance { xf, .. }) = d.node_mut(a).map(|n| &mut n.kind) { + *xf = Affine::new([0.0, 0.0, 0.0, 0.0, 200.0, 150.0]); + } + Ok(()) + }) + .unwrap(); + let r = adjust(&mut s, json!({"tool": "shift", "points": [[200, 150], [210, 150]], "radius": 40, "intensity": 10})); + assert_eq!(r["count"], 1); + assert!(center(&s, a).x > 200.0, "{:?}", center(&s, a)); + // Average has no mean of such instances to move toward: it leaves them as they are. + let (before, x) = (state(&s), center(&s, a).x); + let r = adjust(&mut s, json!({"tool": "screen", "method": "average", "points": [[x, 150]], "radius": 40, "intensity": 10})); + assert_eq!(r["count"], 0); + assert!(state(&s) == before); +} + +/// Average Stainer: an instance whose stain is at no opacity has no stain of its own, so it takes +/// the stain the mean picks, not its hidden paint. +#[test] +fn average_stain_replaces_a_stain_at_no_opacity() { + use vectorcraft_color::{Color, Paint}; + let mut s = session(); + let (a, b) = (dot(&mut s, 100.0, 150.0), dot(&mut s, 120.0, 150.0)); + s.edit("Stains", |d, _| { + for (id, color, amount) in [(a, Color::rgb(1.0, 0.0, 0.0), 0.0), (b, Color::rgb(0.0, 0.0, 1.0), 1.0)] { + let n = d.node_mut(id).unwrap(); + let mut f = vectorcraft_doc::FillLayer::new(Paint::solid(color)); + f.opacity = amount; + n.appearance.items.insert(0, vectorcraft_doc::AppearanceItem::Fill(f)); + } + Ok(()) + }) + .unwrap(); + adjust(&mut s, json!({"tool": "stain", "method": "average", "points": [[100, 150]], "radius": 40, "intensity": 10})); + let f = node(&s, a).appearance.fill().cloned().unwrap(); + assert_eq!(f.paint, Paint::solid(Color::rgb(0.0, 0.0, 1.0))); + assert!(f.opacity > 0.0, "{}", f.opacity); } diff --git a/crates/engine/src/tests/symbolism_shift.rs b/crates/engine/src/tests/symbolism_shift.rs index c1c8bdcae0..ca08dc2069 100644 --- a/crates/engine/src/tests/symbolism_shift.rs +++ b/crates/engine/src/tests/symbolism_shift.rs @@ -228,9 +228,11 @@ fn shift_changes_a_paint_that_has_no_form_in_between() { } /// A style name the document has no style for (the Styler's style from another document, or one -/// since renamed or deleted) moves the fill toward the same style as no name. +/// since renamed or deleted) moves the fill toward the document's first style after the default +/// one, as no name does, and the stain's amount stays. #[test] fn the_styler_takes_the_first_style_for_a_name_the_document_lacks() { + use vectorcraft_color::{Color, Paint}; let styled = |style: Option<&str>| { let mut s = session(); let a = dot(&mut s, 100.0, 150.0); @@ -241,10 +243,19 @@ fn the_styler_takes_the_first_style_for_a_name_the_document_lacks() { if let Some(n) = style { p["style"] = json!(n); } + let stained = node(&s, a).appearance.fill().map(|f| f.opacity); adjust(&mut s, p); - fill(&s, a).unwrap() + let f = node(&s, a).appearance.fill().cloned().unwrap(); + assert_eq!(Some(f.opacity), stained, "the amount stays"); + let first = s.doc().unwrap().doc.graphic_styles[1].appearance.fill_paint(); + (f.paint, first) }; - assert_eq!(styled(Some("No Such Style")), styled(None)); + let (missing, first) = styled(Some("No Such Style")); + let (none, _) = styled(None); + assert_eq!(missing, none); + // The paint is the first style's, not the active fill color. + assert_eq!(none, first); + assert_ne!(none, Paint::solid(Color::rgb(0.0, 1.0, 0.0))); } /// A `shift` that is not true, false or null is refused and changes nothing. diff --git a/crates/tools/src/symbolism.rs b/crates/tools/src/symbolism.rs index 5bee8a7afb..4b4aeb5865 100644 --- a/crates/tools/src/symbolism.rs +++ b/crates/tools/src/symbolism.rs @@ -385,6 +385,9 @@ impl Tool for SymbolismTool { "diameter" => c::number(key, v, 2.0, 2000.0), "intensity" | "density" => c::number(key, v, 1.0, 10.0), "symbol" | "style" => c::string_or_null(key, v), + "usePressure" | "showBrush" | "proportional" | "affectsDensity" => c::boolean(key, v), + "method" => c::one_of(key, v, &METHODS), + _ if SPRAY_ATTRIBUTES.iter().any(|(k, _)| *k == key) => c::one_of(key, v, &SPRAY_MODES), _ => Err(c::unknown(key)), } } diff --git a/crates/ui-egui/src/dialogs/symbolism_options.rs b/crates/ui-egui/src/dialogs/symbolism_options.rs index fcbefba113..6028d3d8c3 100644 --- a/crates/ui-egui/src/dialogs/symbolism_options.rs +++ b/crates/ui-egui/src/dialogs/symbolism_options.rs @@ -124,8 +124,8 @@ fn selected_sets(app: &VectorcraftApp) -> Vec { .collect() } -/// OK: set the brush the Symbolism tools share (the tool keeps it within its ranges), after giving -/// a new Symbol Set Density to the selected symbol sets. +/// OK: set the brush the Symbolism tools share, after giving a new Symbol Set Density to the +/// selected symbol sets. A value outside its range is refused and changes nothing. fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> DialogResult { // Each value goes to the check as it is stored, so one of the wrong kind is refused rather than // read as 0 or false. A number stored as text is read as the field reads it, and other text is @@ -137,12 +137,14 @@ fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> DialogResult { let mut values: Map = NUMBERS.iter().filter_map(|k| Some((k.to_string(), stored(k)?))).collect(); values.extend(SWITCHES.iter().filter_map(|k| Some((k.to_string(), d.fields.get(*k)?.clone())))); values.extend(SPRAY.iter().chain(&["method"]).filter(|k| d.fields.contains_key(**k)).map(|k| (k.to_string(), json!(d.str(k))))); - // A tool or a value `tool.setOption` refuses changes no density either. + // A tool or a value `tool.setOption` refuses changes no density either: the values go through + // both of its checks, the kinds and then each option's range, before the density changes. let tool = d.str("tool"); if !SYMBOLISM.contains(&tool.as_str()) { return Err(format!("unknown tool `{tool}`")); } vectorcraft_tools::symbolism::check_options(&tool, &values)?; + vectorcraft_tools::option_check::check_values(&vectorcraft_tools::symbolism::SymbolismTool::new(&tool), &values)?; let (from, to) = (d.f64(DENSITY_WAS, 0.0).clamp(1.0, 10.0), d.f64("density", 0.0).clamp(1.0, 10.0)); let sets = selected_sets(app); if d.fields.contains_key(DENSITY_WAS) && from != to && !sets.is_empty() { @@ -307,8 +309,11 @@ mod tests { assert!(super::super::confirm(&mut app).is_err()); assert_eq!((width(&app), undo(&app)), (was, steps)); assert_eq!(app.session.tool_options_of("symbolSizer")["density"].as_f64(), Some(5.0)); - // So does a checkbox or a number stored as a value of the wrong kind. + // So does a checkbox or a number stored as a value of the wrong kind, or a number outside its + // range. for (k, v) in [ + ("diameter", json!(1)), + ("intensity", json!(11)), ("usePressure", json!("invalid")), ("proportional", json!(1)), ("intensity", json!("strong")), diff --git a/docs/mcp.md b/docs/mcp.md index bc054dddf5..58f5bc04e3 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3783,38 +3783,48 @@ already walks Image Trace. Short agent entry points: `symbol.adjust` takes `method` (`userDefined`, `average` or `random`; not used by `shift`), `usePressure` with `points` as `[x, y, pressure]` (each point's pen pressure, 0..1, is the intensity there), and for `size` `proportional` (true) and `affectsDensity` (false). With `tool: style`, the style goes on by the brush's strength at - each instance, in full only at the brush's center at intensity 10 or full pressure, and a `style` name the document + each instance: one sample applies it in full only at the brush's center at intensity 10 or full pressure, and the + samples of a stroke add up (two samples at the center at intensity 5 apply it in full). With `alt`, `userDefined` + and `random` remove all of an instance's appearance items under the brush at once, whatever the brush's strength. + A `style` name the document has no graphic style for counts as none (the document's first style after the default one). The Symbol Styler sends the style last clicked into the Graphic Styles panel's selection. `tool.setOption` on a symbolism tool refuses a `method` or Symbol Sprayer option that is not one of its names, a non-number `diameter`, `intensity` or `density`, a - non-boolean switch, and a `symbol` or `style` that is neither a name nor null, and sets none of the values. + `diameter` outside 2..2000 or an `intensity` or `density` outside 1..10, a non-boolean switch, and a `symbol` or + `style` that is neither a name nor null, and sets none of the values. The options dialog's OK checks the same way + before it changes any symbol set's density. `symbol.spray` takes `attributes` `{scrunch?, size?, spin?, screen?, stain?, style?}`, each `average` or `userDefined`, with `color`, `keepModel` and `style` for the User Defined stain and style. `symbol.setDensity {from, to, ids?|id?}` gives the selected symbol sets a new Symbol Set Density. VectorCraft's own rules: - `random` gives each instance its own share of the tool's change for the whole stroke, from none of it to twice - it (the Spinner: a turn either way), the same each time the stroke is applied. + it (the Spinner: a turn either way; the Styler without `shift`: from none to the `userDefined` amount), the same + each time the stroke is applied. - `average` moves each instance's value toward the mean of the instances within the brush at that point: the Scruncher its distance from their middle toward their mean distance, the Sizer the geometric mean of their sizes, the Spinner their mean direction, the Stainer and the Styler their mean amount, the Screener their mean opacity. `alt` does not reverse it. An instance already at the mean is left as it is, and no undo step is added when no instance changes. - - With `proportional` false a drag resizes along its own direction (a level drag the width, an upright one the - height) and one point resizes both. With `affectsDensity` an instance also moves away from the point as it grows + - With `proportional` false a drag resizes along its own direction: the width by the drag's horizontal share and + the height by its vertical share (a level drag the width, an upright one the height, a 45° drag both alike), and + one point resizes both. With `affectsDensity` an instance also moves away from the point as it grows and toward it as it shrinks. - A sprayed instance's `average` values are the means of the selected set's instances within `radius` of the - stroke point: their spacing, size, rotation and opacity, and the stain or style of the nearest one that has one, - at the mean amount. With no instance there it has the symbol's size, no rotation, full opacity and no stain or - style. `attributes` left out means `average` for all six. + stroke point: their spacing, size, rotation and opacity, and the stain or style of the nearest one that has one + with an amount above 0, at the mean amount. With no instance there it has the symbol's size times `scale`, no + rotation, full opacity and no stain or style. The size, the mean or the symbol's, is a base: each new instance + varies from it by up to 10% either way. `attributes` left out means `average` for all six. A point's third value, + when given, must be a number or null; the Sprayer does not use it. - `symbol.setDensity` moves each instance of a set along the line from the middle of the set's instances, to - (1.15 − 0.1·`to`) / (1.15 − 0.1·`from`) of its distance from it (each factor at least 0.1), as one undo step, and - adds none when no instance moves. `from` is the density each set was created at or last given (a set - duplicated has its source's, and a pasted set the one its source had at Copy), and the - `from` passed applies only to a set without one (a group named "Symbol Set" by hand); the sets moved then have + (1.15 − 0.1·`to`) / (1.15 − 0.1·start) of its distance from it (each factor at least 0.1), as one undo step, and + adds none when no instance moves. start is the density each set was created at or last given (a set + duplicated has its source's, and a pasted set the one its source had at Copy); the + `from` passed is the start only for a set without one (a group named "Symbol Set" by hand). The sets moved then have density `to`. A locked or hidden instance stays where it is. It returns `{ids, count}`: the sets changed and the instances moved. - - A `method`, an attribute or a density outside these values, a pressure that isn't a number, or no symbol set - among the objects of `symbol.setDensity`, is an error and changes nothing. + - A `method` or an attribute outside these values, a `from` or `to` of `symbol.setDensity` that is not a number + from 1 to 10, a pressure that isn't a number, or no symbol set among the objects of `symbol.setDensity`, is an + error and changes nothing. `symbol.spray` takes a `density` number outside 1..10 as the nearer end. - The symbolism tools with Shift held ([the manual](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=199), [the CS6 reference](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=136)) send `shift: true` with `symbol.adjust`: a Shift-click with the Symbol Shifter brings the instances under the brush diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index e3032af474..06199e1d00 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1176,7 +1176,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **The Symbols panel reads its current symbol from the document:** the Symbols panel and its panel menu read the current symbol on each frame without running `symbol.list`, which counts every symbol's instances by walking the whole document. The current symbol they show and act on is the one `symbol.list` reports, and an idle frame of the panel or its menu runs no command, so on macOS the native menu is not brought up to date on every frame while the panel is open. In a document with 200 symbols and 50,000 objects, the read takes 0.035 µs instead of 48.5 ms in a release build (thread CPU time on Linux, median of 7 runs); in a small document the difference is too small to notice. Tests: `tests::brushsym::current_symbol_is_the_current_symbol_list_answers`, `panels::symbols::tests::current_is_the_current_symbol_list_answers`, `panels::symbols::tests::idle_frames_of_the_panel_and_its_menu_run_no_command`; the timing probe is `panels::symbols::tests::current_symbol_read_timing`. - **Expand of symbol instances:** Object › Expand turns selected symbol instances (without effects, not in perspective, in groups or placed documents too) into their art as Break Link to Symbol places it, one level deep, as one undo step; the Expand dialog's Fill and Stroke reach that art (`object.expand`, `crates/engine/src/tests/expand_symbols.rs`; estimated, score unchanged). - **Reset Transformation** ([Transform symbols](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/transform-symbols.html), [Symbols panel options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbols-panel-options.html)): the Symbols panel menu's Reset Transformation and the Control bar's Reset, shown while symbol instances are selected, give the selected instances their symbol's own scale again, without rotation or shear, as one undo step (`symbol.instance.resetTransform`); an instance in perspective is left as it is. VectorCraft's own rules: each instance keeps the center of its bounding box in place, reflection is removed too, and the menu item and the button are enabled only while a selected instance would change. Tests: `tests::brushsym::reset_transformation_restores_the_symbols_scale_and_keeps_the_center`, `reset_transformation_keeps_the_center_of_art_away_from_the_origin`, `reset_transformation_ignores_a_stored_size_that_is_not_positive`, `reset_transformation_leaves_unchanged_instances_and_refuses_bad_ids`, `panels::symbols::tests::reset_transformation_is_enabled_for_a_transformed_instance_and_resets_it`. - - **Symbolism Tools Options** ([Symbolism tool options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbolism-tool-options.html), [the archived manual](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=118)): the dialog a double-click on a symbolism tool opens has, besides Diameter, Intensity and Symbol Set Density, Use Pressure Pen (a pen's pressure is the intensity), Method (User Defined, Average or Random) for the Scruncher, Sizer, Spinner, Stainer, Screener and Styler, Show Brush Size and Intensity, the Symbol Sprayer's Scrunch, Size, Spin, Screen, Stain and Style (each Average or User Defined), and the Symbol Sizer's Proportional Resizing and Resizing Affects Density; a new Symbol Set Density spaces the instances of the selected symbol sets (`symbol.setDensity`). VectorCraft's own rules: a Tool row lists the eight tools by name and shows the chosen one's options; Random gives each instance its own share of the change for the whole stroke; Average moves each value toward the mean of the instances under the brush; the starting values are Method User Defined, the Sprayer's six options Average, Proportional Resizing on and Resizing Affects Density off, so only a Sprayer stroke over instances of the selected set changes from before (its new instances take their mean values); the brush shows the intensity as a dashed ring. The Symbol Sprayer does not use Intensity or pen pressure. Tests: `crates/engine/src/tests/symbolism_options.rs`, `symbolism::tests` in `crates/tools`, `dialogs::symbolism_options::tests`. + - **Symbolism Tools Options** ([Symbolism tool options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbolism-tool-options.html), [the archived manual](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=118)): the dialog a double-click on a symbolism tool opens has, besides Diameter, Intensity and Symbol Set Density, Use Pressure Pen (a pen's pressure is the intensity), Method (User Defined, Average or Random) for the Scruncher, Sizer, Spinner, Stainer, Screener and Styler, Show Brush Size and Intensity, the Symbol Sprayer's Scrunch, Size, Spin, Screen, Stain and Style (each Average or User Defined), and the Symbol Sizer's Proportional Resizing and Resizing Affects Density; a new Symbol Set Density spaces the instances of the selected symbol sets (`symbol.setDensity`). VectorCraft's own rules: a Tool row lists the eight tools by name and shows the chosen one's options; Random gives each instance its own share of the change for the whole stroke; Average moves each value toward the mean of the instances under the brush; the starting values are Method User Defined, the Sprayer's six options Average, Proportional Resizing on and Resizing Affects Density off; with them, two strokes change from before: a Sprayer stroke over instances of the selected set gives its new instances their mean values, and the Symbol Styler applies the style by the brush's strength, so a click at the brush's center at the default intensity 5 applies it at half opacity instead of in full, and a stroke's samples add up; the brush shows the intensity as a dashed ring. The Symbol Sprayer does not use Intensity or pen pressure. Tests: `crates/engine/src/tests/symbolism_options.rs`, `symbolism::tests` in `crates/tools`, `dialogs::symbolism_options::tests`. - **Symbolism tools with Shift** ([the manual](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=199), [the CS6 reference](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=136)): a Shift-click with the Symbol Shifter brings the instances under the brush forward in the stacking order and Alt+Shift-click sends them backward; the Symbol Sizer with Shift keeps the set's density while it resizes; the Symbol Stainer and the Symbol Styler with Shift keep the amount of stain or style and move the color or style toward the current fill or the selected style (`symbol.adjust {shift}`). VectorCraft's own rules: the Shifter moves each instance one place among its siblings, once per stroke, without moving it on the canvas; the Sizer keeps each instance's center, even with Resizing Affects Density; a stain or style with no form between it and the new paint (a solid color and a pattern) takes the new paint at once; an instance without a stain or style is left as it is, and Alt has no effect on the Stainer or the Styler with Shift. The selected style is the one last clicked into the Graphic Styles panel's selection. Tests: `crates/engine/src/tests/symbolism_shift.rs`, `symbolism::tests::shift_reaches_the_tools_that_have_a_shift_form`, `panels::graphic_styles::tests::shift_click_selects_a_range_and_cmd_click_adds_or_removes_one_style`. - **The Symbols and Properties panels find selected symbol instances once per revision:** whether the selection or its groups hold a symbol instance (Break Link to Symbol), one with appearance changes of its own (Reset Symbol Instance and the Properties panel's Reset), or one Reset Transformation would change is worked out in one walk of the selected objects for each document revision, and later frames reuse it. The buttons and menu items are enabled as before. With one selected group of 300,000 paths, the two panels' reads took a median 5.1 to 5.7 ms of thread CPU time per frame; the first read after a change now takes about 3 ms and later frames about 5 ns (Linux, opt-level 3, median of 7 runs). In a small document the difference is too small to notice. Tests: `panels::symbols::tests::instance_flags_are_found_once_per_revision_and_match_a_walk_of_the_selection`, `properties_and_symbols_panels_walk_the_selection_once_per_revision`. - **Expand of dimensions:** Object › Expand, Expand Appearance, Create Outlines and Outline Stroke turn a dimension whose art they change into a plain group of that art, which stays as it is through later moves, scales and edits of what it measured; undo gives the live dimension back (`crates/engine/tests/it/dimensions.rs`; VectorCraft's own rule; estimated, score unchanged). From 83a1fbbcd896fa93bb5eafbe763ca1e50d305f8c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 15:28:52 -0800 Subject: [PATCH 27/55] Symbolism: the Sprayer's User Defined Style applies the style picked in Graphic Styles A click in the Graphic Styles panel set the style only for the Symbol Styler, so the Sprayer with Style: User Defined sent no style and sprayed the document's first style after the default one. The two tools now share the style option. --- crates/tools/src/settings.rs | 5 +++-- crates/ui-egui/src/panels/graphic_styles.rs | 8 ++++++-- docs/mcp.md | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/crates/tools/src/settings.rs b/crates/tools/src/settings.rs index 635ec8e4a0..51c408261e 100644 --- a/crates/tools/src/settings.rs +++ b/crates/tools/src/settings.rs @@ -44,8 +44,9 @@ const ROWS: &[Row] = &[ "affectsDensity", ], ), - // The graphic style the Symbol Styler applies, set from the Graphic Styles panel. - (&["symbolStyler"], None, &["style"]), + // The graphic style the Symbol Styler and the Symbol Sprayer's User Defined Style apply, set + // from the Graphic Styles panel. + (&["symbolSprayer", "symbolStyler"], Some("symbolismStyle"), &["style"]), (&["mirrorCut"], None, &["axis", "keep"]), (&["puppetWarp"], None, &["showMesh", "expand"]), (&["arc"], None, &["closed", "lengthX", "lengthY", "reference", "baseAlong", "slope", "fillArc"]), diff --git a/crates/ui-egui/src/panels/graphic_styles.rs b/crates/ui-egui/src/panels/graphic_styles.rs index b03e2e0662..7c69333bc6 100644 --- a/crates/ui-egui/src/panels/graphic_styles.rs +++ b/crates/ui-egui/src/panels/graphic_styles.rs @@ -3,7 +3,8 @@ //! shows the shape outlined in black and filled with white, under a red slash. Clicking a style applies it to the //! selection (Alt-click adds it on top); Shift-click adds to the panel's selection every style from //! the last one clicked without Shift through this one; Cmd/Ctrl-click adds or removes one. The -//! style last clicked into the selection is the one the Symbol Styler applies. Double-click opens +//! style last clicked into the selection is the one the Symbol Styler and the Symbol Sprayer's User +//! Defined Style apply. Double-click opens //! Graphic Style Options. Dragging a style moves it in the list (dropped on //! another style with Alt held, replaces that style with its look), applies it //! to the art it is dropped on (`canvas::panel_drop`), or, dropped on New Graphic Style, adds a @@ -553,7 +554,8 @@ fn act(app: &mut VectorcraftApp, ui: &Ui, s: &Shown, ev: Events, picker: bool) { Some(Click::Pick(name, m)) => { let order: Vec<&str> = s.d.graphic_styles.iter().map(|g| g.name.as_str()).collect(); let sel = super::swatches::click_selection(ui, "gs-anchor", selected(ui.ctx(), s.d), &order, &name, m); - // The style clicked into the selection is the one the Symbol Styler applies. + // The style clicked into the selection is the one the Symbol Styler and the Symbol + // Sprayer's User Defined Style apply (the two share it). if sel.contains(&name) { app.run("tool.setOption", json!({"tool": "symbolStyler", "values": {"style": name}})).ok(); } @@ -1709,6 +1711,8 @@ mod tests { assert_eq!(styler(&app).as_ref(), Some(&n[3])); assert_eq!(click(&mut app, 2, egui::Modifiers::COMMAND), [n[0].clone(), n[1].clone(), n[3].clone(), n[2].clone()]); assert_eq!(styler(&app).as_ref(), Some(&n[2])); + // The Symbol Sprayer's User Defined Style applies the same style. + assert_eq!(app.session.tool_options_of("symbolSprayer")["style"].as_str(), Some(n[2].as_str())); // Shift-click extends from the style Cmd/Ctrl-clicked last. click(&mut app, 0, egui::Modifiers::NONE); click(&mut app, 2, egui::Modifiers::COMMAND); diff --git a/docs/mcp.md b/docs/mcp.md index 58f5bc04e3..c839b6aa37 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3787,8 +3787,8 @@ already walks Image Trace. Short agent entry points: samples of a stroke add up (two samples at the center at intensity 5 apply it in full). With `alt`, `userDefined` and `random` remove all of an instance's appearance items under the brush at once, whatever the brush's strength. A `style` name the document - has no graphic style for counts as none (the document's first style after the default one). The Symbol Styler sends - the style last clicked into the Graphic Styles panel's selection. `tool.setOption` on a symbolism tool refuses a `method` or + has no graphic style for counts as none (the document's first style after the default one). The Symbol Styler and the + Symbol Sprayer (its User Defined Style) send the style last clicked into the Graphic Styles panel's selection. `tool.setOption` on a symbolism tool refuses a `method` or Symbol Sprayer option that is not one of its names, a non-number `diameter`, `intensity` or `density`, a `diameter` outside 2..2000 or an `intensity` or `density` outside 1..10, a non-boolean switch, and a `symbol` or `style` that is neither a name nor null, and sets none of the values. The options dialog's OK checks the same way From 1d7f3f6f22f9f484ae6342fb4dac5f84d68c81eb Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 14:56:28 -0800 Subject: [PATCH 28/55] Color Wheel: fix OKLCH and HSL slider review findings - The largest chroma at a hue near a primary color finds the stretch past the first gamut edge, so pure blue at chroma 0.4 stays blue. The C track dims the gap between the two stretches. - Oklab conversions use the signed sRGB transfer curve for channels below 0. - HSL hues wrap before the channel offsets; Color::to_hsl and from_hsl are removed, so callers pass the color settings themselves. - color.convert {to: "oklch"} clips RGB numbers past 0 to 1, as hex does. - A hue on a gray, or a saturation on black or white, leaves a Gray paint unchanged and records no undo step. - Remembered row and wheel components are dropped once the panel shows another color or target. - Hiding or switching the rows during a row drag keeps the preview as one undo step and ends the interaction. - The L and H tracks keep their colors until the other two components change, so a frame does not search the gamut for every track color. - Docs name the document's assigned profile as the RGB space OKLCH Sliders need, and give color.convert's example its color. --- crates/color/src/lib.rs | 24 ++- crates/color/src/libraries.rs | 12 +- crates/color/src/oklab.rs | 102 ++++++++++++- crates/engine/src/cmd/colormgmt.rs | 3 +- crates/engine/src/tests/colormgmt.rs | 15 +- crates/ui-egui/src/panels/color_wheel.rs | 138 ++++++++++++++---- .../ui-egui/src/panels/tests_color_wheel.rs | 73 ++++++++- docs/control-protocol.md | 4 +- docs/mcp.md | 8 +- docs/target-app-parity.md | 2 +- 10 files changed, 319 insertions(+), 62 deletions(-) diff --git a/crates/color/src/lib.rs b/crates/color/src/lib.rs index 8180f1c459..c3d74615ae 100644 --- a/crates/color/src/lib.rs +++ b/crates/color/src/lib.rs @@ -151,15 +151,6 @@ impl Color { let [r, g, b] = hsb_to_rgb([h, s, v]); Color::Rgb { r, g, b } } - /// HSL with hue in degrees 0..360, saturation and lightness 0..1 ([`rgb_to_hsl`] of the - /// display color). - pub fn to_hsl(&self) -> [f32; 3] { - rgb_to_hsl(self.to_rgb()) - } - pub fn from_hsl(h: f32, s: f32, l: f32) -> Self { - let [r, g, b] = hsl_to_rgb([h, s, l]); - Color::Rgb { r, g, b } - } /// `#rrggbb` (display RGB). pub fn to_hex(&self) -> String { let [r, g, b, _] = self.to_rgba8(1.0); @@ -380,10 +371,11 @@ pub fn rgb_to_hsl([r, g, b]: [f32; 3]) -> [f32; 3] { /// RGB numbers 0..1 of HSL `[h, s, l]` (hue in degrees, saturation and lightness 0..1), as CSS /// Color 4 converts HSL to sRGB (): the inverse of -/// [`rgb_to_hsl`]. A hue outside 0..360 wraps into that range, so -120° gives the color of 240°. -/// The specification's sample code uses JavaScript's remainder operator and gives a different -/// color for a negative hue. +/// [`rgb_to_hsl`]. A hue outside 0..360 wraps into that range before the conversion, so -120° +/// gives the color of 240° and a hue of 10,000,000,000° the color of 280°. The specification's +/// sample code uses JavaScript's remainder operator and gives a different color for a negative hue. pub fn hsl_to_rgb([h, s, l]: [f32; 3]) -> [f32; 3] { + let h = h.rem_euclid(360.0); let a = s * l.min(1.0 - l); let f = |n: f32| { let k = (n + h / 30.0).rem_euclid(12.0); @@ -565,11 +557,12 @@ mod tests { ([360.0, 1.0, 0.5], "#ff0000"), ([-120.0, 1.0, 0.5], "#0000ff"), ] { - assert_eq!(Color::from_hsl(hsl[0], hsl[1], hsl[2]).to_hex(), hex, "{hsl:?}"); + let [r, g, b] = hsl_to_rgb(hsl); + assert_eq!(Color::rgb(r, g, b).to_hex(), hex, "{hsl:?}"); } let [h, s, l] = rgb_to_hsl([1.0, 0.5, 0.0]); assert!((h - 30.0).abs() < 1e-4 && (s - 1.0).abs() < 1e-6 && (l - 0.5).abs() < 1e-6, "{h} {s} {l}"); - let [h, s, l] = Color::rgb8(255, 128, 0).to_hsl(); + let [h, s, l] = rgb_to_hsl(Color::rgb8(255, 128, 0).to_rgb_uncalibrated()); assert!((h - 30.0).abs() < 0.2 && (s - 1.0).abs() < 1e-6 && (l - 0.5).abs() < 1e-3, "{h} {s} {l}"); // A gray has no hue: the hue is 0 and the saturation 0, at any lightness. for v in [0.0, 0.25, 0.5, 1.0] { @@ -581,6 +574,9 @@ mod tests { // A color past the gamut that gives a negative saturation turns its hue by 180°. let [h, s, _] = rgb_to_hsl([1.2, 1.5, 1.4]); assert!(s > 0.0 && (h - (160.0 + 180.0)).abs() < 1e-3, "{h} {s}"); + // A huge hue wraps before the channels are worked out: 10,000,000,000° is 280°. + let (huge, wrapped) = (hsl_to_rgb([10_000_000_000.0, 1.0, 0.5]), hsl_to_rgb([280.0, 1.0, 0.5])); + assert!((0..3).all(|i| (huge[i] - wrapped[i]).abs() < 1e-6), "{huge:?} {wrapped:?}"); } /// The 216 web colors go to HSL and back to the same 8-bit color. diff --git a/crates/color/src/libraries.rs b/crates/color/src/libraries.rs index 5fc952a061..9c756256a3 100644 --- a/crates/color/src/libraries.rs +++ b/crates/color/src/libraries.rs @@ -99,7 +99,9 @@ pub fn builtin_library(id: &str) -> Option> { // ---------- colour construction ---------- -/// sRGB (0..=1, gamma encoded) of OKLab `(l, a, b)`, unclamped. +/// sRGB (0..=1, gamma encoded) of OKLab `(l, a, b)`, unclamped. A linear channel below +/// −0.0031308 is encoded with the curve's sign turned, as CSS Color 4's extended sRGB does +/// (). pub(crate) fn oklab_to_srgb(l: f64, a: f64, b: f64) -> [f64; 3] { let l_ = l + 0.396_337_777_4 * a + 0.215_803_757_3 * b; let m_ = l - 0.105_561_345_8 * a - 0.063_854_172_8 * b; @@ -110,7 +112,7 @@ pub(crate) fn oklab_to_srgb(l: f64, a: f64, b: f64) -> [f64; 3] { -1.268_438_004_6 * l3 + 2.609_757_401_1 * m3 - 0.341_319_396_5 * s3, -0.004_196_086_3 * l3 - 0.703_418_614_7 * m3 + 1.707_614_701_0 * s3, ]; - lin.map(|v| if v <= 0.003_130_8 { 12.92 * v } else { 1.055 * v.powf(1.0 / 2.4) - 0.055 }) + lin.map(|v| if v.abs() <= 0.003_130_8 { 12.92 * v } else { v.signum() * (1.055 * v.abs().powf(1.0 / 2.4) - 0.055) }) } /// OKLab `[l, a, b]` of a colour's display RGB. @@ -118,11 +120,13 @@ pub fn to_oklab(c: &Color) -> [f64; 3] { srgb_to_oklab(c.to_rgb_uncalibrated()) } -/// OKLab `[l, a, b]` of sRGB `rgb` (0..=1, gamma encoded). +/// OKLab `[l, a, b]` of sRGB `rgb` (0..=1, gamma encoded). A channel below −0.04045 is decoded +/// with the curve's sign turned, as CSS Color 4's extended sRGB does +/// (). pub(crate) fn srgb_to_oklab(rgb: [f32; 3]) -> [f64; 3] { let [r, g, b] = rgb.map(|v| { let v = f64::from(v); - if v <= 0.040_45 { v / 12.92 } else { ((v + 0.055) / 1.055).powf(2.4) } + if v.abs() <= 0.040_45 { v / 12.92 } else { v.signum() * ((v.abs() + 0.055) / 1.055).powf(2.4) } }); let l = (0.412_221_470_8 * r + 0.536_332_536_3 * g + 0.051_445_992_9 * b).cbrt(); let m = (0.211_903_498_2 * r + 0.680_699_545_1 * g + 0.107_396_956_6 * b).cbrt(); diff --git a/crates/color/src/oklab.rs b/crates/color/src/oklab.rs index 90467fc6c3..018df4526d 100644 --- a/crates/color/src/oklab.rs +++ b/crates/color/src/oklab.rs @@ -38,27 +38,78 @@ pub fn in_srgb(rgb: [f64; 3]) -> bool { /// The largest chroma sRGB holds at lightness `l` and hue `h°`: 0 at or outside black and white. pub fn max_chroma(l: f64, h: f64) -> f64 { + largest_fitting_chroma(l, h, f64::INFINITY) +} + +/// The primary and secondary colors of sRGB: the corners of its cube next to black. +const PRIMARIES: [[f32; 3]; 6] = [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0], [0.0, 1.0, 1.0], [1.0, 0.0, 1.0], [1.0, 1.0, 0.0]]; + +/// The largest chroma no more than `limit` that sRGB holds at lightness `l` and hue `h°`: 0 at or +/// outside black and white. +fn largest_fitting_chroma(l: f64, h: f64, limit: f64) -> f64 { if !(l > 0.0 && l < 1.0) || !h.is_finite() { return 0.0; } - // sRGB holds every chroma from 0 up to its edge along a hue at a given lightness. + let fits = |c: f64| in_srgb(oklch_to_srgb(l, c, h)); + // The edge of the chromas from 0 that sRGB holds without a break. let (mut lo, mut hi) = (0.0, 0.5); for _ in 0..40 { let mid = (lo + hi) / 2.0; - if in_srgb(oklch_to_srgb(l, mid, h)) { lo = mid } else { hi = mid } + if fits(mid) { lo = mid } else { hi = mid } } - lo + // Past that edge the ray can come back into sRGB near a line from black to a primary or + // secondary color. Such a line is straight in Oklab, so it keeps that color's hue and its + // chroma grows with its lightness. At the lightness and hue of blue, for example, the ray leaves + // sRGB at a chroma of about 0.266 and meets blue itself at about 0.313; at L 0.44 and a hue + // 0.01° past blue's, a second stretch runs from about 0.3042 to 0.3048. Each such stretch ends + // at or just below the line's chroma, so the search walks down from there in small steps to the + // first chroma that fits and then finds the stretch's end between it and the step above. + let past = PRIMARIES.iter().filter_map(|rgb| { + let [pl, a, b] = srgb_to_oklab(*rgb); + let edge = l / pl * a.hypot(b); + let off = (h - b.atan2(a).to_degrees()).rem_euclid(360.0); + if l > pl || edge <= lo || off.min(360.0 - off) > NEAR_PRIMARY_HUE { + return None; + } + let start = edge.min(limit); + let mut c = start; + while c > lo && start - c <= PAST_WALK { + if fits(c) { + let (mut inside, mut outside) = (c, (c + PAST_STEP).min(start)); + if outside > inside && !fits(outside) { + for _ in 0..20 { + let mid = (inside + outside) / 2.0; + if fits(mid) { inside = mid } else { outside = mid } + } + } else { + inside = outside; + } + return Some(inside); + } + c -= PAST_STEP; + } + None + }); + past.fold(lo.min(limit), f64::max) } +/// How near a primary or secondary color's hue, in degrees, the ray must pass for +/// [`largest_fitting_chroma`] to look past the first edge. +const NEAR_PRIMARY_HUE: f64 = 2.0; +/// The step of that walk. +const PAST_STEP: f64 = 2e-4; +/// How far below the line's chroma that walk goes. +const PAST_WALK: f64 = 0.06; + /// The sRGB color (gamma encoded, 0..=1) of OKLCH `(l, c, h°)`, and whether its chroma was lowered: -/// a color outside sRGB keeps its lightness and hue and takes the largest chroma that fits. -/// Lightness is clamped to 0..=1 and chroma to 0 or more. +/// a color outside sRGB keeps its lightness and hue and takes the largest chroma below it that +/// fits. Lightness is clamped to 0..=1 and chroma to 0 or more. pub fn from_oklch(l: f64, c: f64, h: f64) -> ([f32; 3], bool) { let l = if l.is_nan() { 0.0 } else { l.clamp(0.0, 1.0) }; let c = if c.is_nan() { 0.0 } else { c.max(0.0) }; let h = if h.is_finite() { h } else { 0.0 }; let exact = oklch_to_srgb(l, c, h); - let (rgb, lowered) = if in_srgb(exact) { (exact, false) } else { (oklch_to_srgb(l, max_chroma(l, h).min(c), h), true) }; + let (rgb, lowered) = if in_srgb(exact) { (exact, false) } else { (oklch_to_srgb(l, largest_fitting_chroma(l, h, c), h), true) }; (rgb.map(|v| v.clamp(0.0, 1.0) as f32), lowered) } @@ -126,6 +177,45 @@ mod tests { assert!(!from_oklch(l, max * 0.5, h).1); } + /// At the lightness and hue of blue the ray leaves sRGB and comes back at blue itself, so the + /// largest chroma is blue's, and a chroma past it gives blue. + #[test] + fn the_largest_chroma_at_blues_hue_is_blues() { + let [l, c, h] = to_oklch([0.0, 0.0, 1.0]); + let max = max_chroma(l, h); + assert!((max - c).abs() < 1e-4 && in_srgb(oklch_to_srgb(l, max, h)), "{max} {c}"); + let (rgb, lowered) = from_oklch(l, CHROMA_FULL, h); + assert_eq!((eight(rgb), lowered), ([0, 0, 255], true)); + // A chroma between the two stretches takes the end of the first one, inside sRGB. + let (rgb, lowered) = from_oklch(l, 0.29, h); + let [_, gc, _] = to_oklch(rgb); + assert!(lowered && gc < 0.27 && in_srgb(oklch_to_srgb(l, gc, h)), "{gc}"); + // A hue just past blue's: a narrow second stretch ends just below the line from black to blue. + let (l, h) = (0.44, 264.06); + let max = max_chroma(l, h); + assert!(max > 0.304 && max < 0.305 && in_srgb(oklch_to_srgb(l, max, h)), "{max}"); + let [_, got, _] = to_oklch(from_oklch(l, 0.35, h).0); + assert!(got > 0.303, "{got}"); + // A darker blue on the line from black to blue. + let [l, c, h] = to_oklch([0.0, 0.0, 0.25]); + assert!((max_chroma(l, h) - c).abs() < 1e-4, "{} {c}", max_chroma(l, h)); + } + + /// sRGB channels below 0 go through the transfer curve with its sign turned, as CSS Color 4's + /// extended sRGB does, in both directions. + #[test] + fn negative_channels_use_the_signed_transfer_curve() { + let linear = -((0.5_f64 + 0.055) / 1.055).powf(2.4); + let [l, c, _] = to_oklch([-0.5; 3]); + assert!((l - linear.cbrt()).abs() < 1e-4 && c <= POWERLESS_CHROMA, "{l} {c}"); + for v in oklch_to_srgb(linear.cbrt(), 0.0, 0.0) { + assert!((v + 0.5).abs() < 1e-4, "{v}"); + } + // Small values near 0 keep the straight part of the curve. + let [l, _, _] = to_oklch([-0.01; 3]); + assert!((l - (-0.01_f64 / 12.92).cbrt()).abs() < 1e-4, "{l}"); + } + #[test] fn black_white_and_bad_numbers_hold_no_chroma() { assert_eq!(max_chroma(0.0, 30.0), 0.0); diff --git a/crates/engine/src/cmd/colormgmt.rs b/crates/engine/src/cmd/colormgmt.rs index 7e27e9a12d..fafff19dfd 100644 --- a/crates/engine/src/cmd/colormgmt.rs +++ b/crates/engine/src/cmd/colormgmt.rs @@ -891,7 +891,8 @@ fn convert_color(_: &mut Session, p: &Value) -> Result { "gray" | "grayscale" => ("gray", json!(values(&c.convert(&col, Model::Gray, intent)))), "lab" => ("lab", json!([lab.l, lab.a, lab.b])), "oklch" => { - let [l, ch, h] = vectorcraft_color::oklab::to_oklch(c.display_rgb(&col)); + // RGB numbers past 0..1 ([2, 2, 2]) display clipped, as `hex` reports them. + let [l, ch, h] = vectorcraft_color::oklab::to_oklch(c.display_rgb(&col).map(|v| v.clamp(0.0, 1.0))); ("oklch", json!([l * 100.0, ch, h])) } other => return Err(bad(C, format!("unknown model `{other}`"))), diff --git a/crates/engine/src/tests/colormgmt.rs b/crates/engine/src/tests/colormgmt.rs index 33bb47103e..8e043cdc84 100644 --- a/crates/engine/src/tests/colormgmt.rs +++ b/crates/engine/src/tests/colormgmt.rs @@ -338,14 +338,23 @@ fn convert_to_oklch_answers_lightness_chroma_and_hue() { let cyan = s.execute("color.convert", &json!({"color": ink, "to": "oklch"})).unwrap(); let shown = vectorcraft_color::oklab::to_oklch(cms::active().display_rgb(&Color::cmyk(1.0, 0.0, 0.0, 0.0))); let naive = vectorcraft_color::oklab::to_oklch([0.0, 1.0, 1.0]); - let l = cyan["values"][0].as_f64().unwrap() / 100.0; - assert!((l - shown[0]).abs() < 1e-9 && (l - naive[0]).abs() > 0.02, "{cyan} {shown:?} {naive:?}"); + let c: Vec = cyan["values"].as_array().unwrap().iter().map(|v| v.as_f64().unwrap()).collect(); + let got = [c[0] / 100.0, c[1], c[2]]; + assert!((0..3).all(|i| (got[i] - shown[i]).abs() < 1e-9) && shown[1] > 0.05, "{cyan} {shown:?}"); + assert!((got[0] - naive[0]).abs() > 0.02, "{cyan} {naive:?}"); // A Lab color outside sRGB answers the OKLCH of its color clipped to sRGB. let vivid = s.execute("color.convert", &json!({"color": {"l": 50.0, "a": 100.0, "b": 0.0}, "to": "oklch"})).unwrap(); let w: Vec = vivid["values"].as_array().unwrap().iter().map(|v| v.as_f64().unwrap()).collect(); - let clipped = vectorcraft_color::oklab::to_oklch(cms::active().display_rgb(&Color::lab(50.0, 100.0, 0.0))); + let shown = cms::active().display_rgb(&Color::lab(50.0, 100.0, 0.0)).map(|v| v.clamp(0.0, 1.0)); + let clipped = vectorcraft_color::oklab::to_oklch(shown); assert!((w[0] / 100.0 - clipped[0]).abs() < 1e-9 && (w[1] - clipped[1]).abs() < 1e-9, "{vivid} {clipped:?}"); + assert!((w[2] - clipped[2]).abs() < 1e-9 && (0.0..360.0).contains(&w[2]), "{vivid} {clipped:?}"); assert!(vectorcraft_color::oklab::in_srgb(vectorcraft_color::oklab::oklch_to_srgb(w[0] / 100.0, w[1], w[2])), "{vivid}"); + // RGB numbers past 0..1 answer the OKLCH of the clipped color `hex` reports: white. + let past = s.execute("color.convert", &json!({"color": [2.0, 2.0, 2.0], "to": "oklch"})).unwrap(); + assert_eq!(past["hex"], "#ffffff"); + let l = past["values"][0].as_f64().unwrap(); + assert!((l - 100.0).abs() < 0.01 && past["values"][1].as_f64().unwrap() < 1e-3, "{past}"); } #[test] diff --git a/crates/ui-egui/src/panels/color_wheel.rs b/crates/ui-egui/src/panels/color_wheel.rs index 0b3549311f..d12e66c668 100644 --- a/crates/ui-egui/src/panels/color_wheel.rs +++ b/crates/ui-egui/src/panels/color_wheel.rs @@ -14,8 +14,9 @@ //! //! Panel menu › OKLCH Sliders shows L, C and H rows under the wheel or the box that edit the color //! by OKLCH lightness, chroma and hue (CSS Color 4: -//! ), while the working RGB space is -//! sRGB. Panel menu › HSL Sliders shows H, S and L rows in their place that edit the color by the +//! ), while the active document's RGB +//! space ([`cms::active`]: the profile assigned to the document, else the working RGB space of the +//! color settings) is sRGB. Panel menu › HSL Sliders shows H, S and L rows in their place that edit the color by the //! hue, saturation and lightness of CSS Color 4's HSL //! (). The choice is kept with the //! preferences too. @@ -139,7 +140,8 @@ pub fn deserialize_settings<'de, D: serde::Deserializer<'de>>(d: D) -> Result Result { set(&mut app.ui.color_wheel, p, &cms::active())?; Ok(json!(app.ui.color_wheel)) @@ -292,7 +294,9 @@ const MEMORY: &str = "color-wheel-hsb"; /// Panel state: the OKLCH the slider rows asked for last, the [`Owner`] of the color they stored /// and its display sRGB. const OKLCH_MEMORY: &str = "color-wheel-oklch"; -/// The message for OKLCH Sliders while the working RGB space is not sRGB. +/// Panel state: the slider rows whose drag previews on an open interaction, until it is released. +const ROWS_LIVE: &str = "color-wheel-rows-live"; +/// The message for OKLCH Sliders while the active document's RGB space is not sRGB. const OKLCH_NEEDS_SRGB: &str = "OKLCH needs sRGB as the working RGB space"; /// Panel state: the HSL the slider rows asked for last, the [`Owner`] of the color they stored and /// its display sRGB. @@ -338,6 +342,28 @@ impl Owner { } } +/// The components remembered under `key` for the target's `color`: the display sRGB the color had +/// when they were stored, and the components. A record whose owner or display color differs from +/// what the panel shows now is dropped, so that it does not come back when the same color returns +/// later. +fn recall( + app: &VectorcraftApp, + ui: &Ui, + key: &str, + tgt: &Target, + color: Option, + cms: &Cms, +) -> Option<([f32; 3], T)> { + let (owner, shown, v) = pstate::>(ui.ctx(), key)?; + match color { + Some(c) if owner == Owner::of(app, tgt, c) && cms.display_rgb(&c) == shown => Some((shown, v)), + _ => { + set_pstate(ui.ctx(), key, None::<(Owner, [f32; 3], T)>); + None + } + } +} + /// The HSB a color shows on the wheel: that of its display sRGB through `cms`. pub(crate) fn display_hsb(cms: &Cms, c: &Color) -> [f32; 3] { rgb_to_hsb(cms.display_rgb(c)) @@ -403,13 +429,15 @@ pub(crate) fn remembered_oklch(cms: &Cms, c: &Color, shown: [f32; 3], lch: [f64; /// The color a track shows at OKLCH `lch`: the color itself inside sRGB, and outside it dimmed. /// A color outside sRGB shows at the largest chroma that fits at its L and H, the color a pick -/// there stores. With `max_chroma` (the C track, whose L and H stay fixed) that chroma is given; -/// without it, it is found for each color. +/// there stores. With `max_chroma` (the C track, whose L and H stay fixed) that chroma is given +/// for the colors past it; without it, or in a gap below it where the ray leaves sRGB and comes +/// back, it is found for each color. pub(crate) fn oklch_track(lch: [f64; 3], max_chroma: Option) -> Color32 { + let exact = oklab::oklch_to_srgb(lch[0], lch[1], lch[2]); let (rgb, outside) = match max_chroma { Some(m) if lch[1] > m => (oklab::oklch_to_srgb(lch[0], m, lch[2]), true), - Some(_) => (oklab::oklch_to_srgb(lch[0], lch[1], lch[2]), false), - None => { + Some(_) if oklab::in_srgb(exact) => (exact, false), + _ => { let (rgb, lowered) = oklab::from_oklch(lch[0], lch[1], lch[2]); (rgb.map(f64::from), lowered) } @@ -434,8 +462,8 @@ pub(crate) fn chroma_tick(max_chroma: f64) -> f32 { pub(crate) fn oklch_rows(app: &VectorcraftApp, ui: &mut Ui, tgt: &Target, color: Option, cms: &Cms) -> Option<([f64; 3], Live)> { let t = Tokens::get(ui.ctx()); let enabled = color.is_some() && cms.rgb_is_srgb(); - let lch = match (color, pstate::>(ui.ctx(), OKLCH_MEMORY)) { - (Some(c), Some((owner, shown, lch))) if owner == Owner::of(app, tgt, c) => remembered_oklch(cms, &c, shown, lch), + let lch = match (color, recall::<[f64; 3]>(app, ui, OKLCH_MEMORY, tgt, color, cms)) { + (Some(c), Some((shown, lch))) => remembered_oklch(cms, &c, shown, lch), (Some(c), _) => oklab::to_oklch(cms.display_rgb(&c)), (None, _) => [0.0; 3], }; @@ -453,6 +481,9 @@ pub(crate) fn oklch_rows(app: &VectorcraftApp, ui: &mut Ui, tgt: &Target, color: out }; let mut out = None; + // The L and H tracks search the gamut for each color outside sRGB, so their colors are kept + // until the other two components change. + let mut tracks = pstate::<[Option<([u64; 3], Vec)>; 3]>(ui.ctx(), OKLCH_TRACKS); ui.add_enabled_ui(enabled, |ui| { let field_w = 48.0; let slider_w = (ui.available_width() - field_w - 12.0 - 3.0 * ui.spacing().item_spacing.x).max(60.0); @@ -463,7 +494,23 @@ pub(crate) fn oklch_rows(app: &VectorcraftApp, ui: &mut Ui, tgt: &Target, color: ui.add_sized(vec2(12.0, 22.0), egui::Label::new(egui::RichText::new(letter).size(12.5).color(t.text))); let v = shown[i].clamp(0.0, max); let at = |x: f32| with(i, f64::from(x) * max); - let track = |x: f32| if enabled { oklch_track(at(x), (i == 1).then_some(max_c)) } else { t.input }; + let mut key = lch.map(f64::to_bits); + key[i] = 0; + let colors = match &tracks[i] { + Some((k, colors)) if i != 1 && enabled && *k == key => colors.clone(), + _ if i != 1 && enabled => { + let last = (TRACK_SAMPLES - 1) as f32; + let colors: Vec = (0..TRACK_SAMPLES).map(|s| oklch_track(at(s as f32 / last), None)).collect(); + tracks[i] = Some((key, colors.clone())); + colors + } + _ => Vec::new(), + }; + let track = |x: f32| match colors.get((x.clamp(0.0, 1.0) * (TRACK_SAMPLES - 1) as f32).round() as usize) { + Some(c) => *c, + None if enabled => oklch_track(at(x), (i == 1).then_some(max_c)), + None => t.input, + }; let value = SliderValue::field(v, 0.0..=max, suffix, 0); let (dragged, phase, keyed) = widgets::color_slider_stepped(ui, ("color-wheel-oklch", i), name, Some(value), (v / max) as f32, slider_w, &track); @@ -489,9 +536,16 @@ pub(crate) fn oklch_rows(app: &VectorcraftApp, ui: &mut Ui, tgt: &Target, color: }); } }); + set_pstate(ui.ctx(), OKLCH_TRACKS, tracks); out.filter(|_| enabled) } +/// Panel state: the colors of the L and H tracks of OKLCH Sliders, each with the OKLCH (its own +/// component left out) they were drawn for. +const OKLCH_TRACKS: &str = "color-wheel-oklch-tracks"; +/// How many colors along a cached track. +const TRACK_SAMPLES: usize = 128; + /// The HSL `[h°, s, l]` the rows show for `c` through `cms` when `hsl` was asked for last and `c` /// then displayed as the sRGB `shown`: `hsl` while `c` still displays as `shown` (the hue of a gray /// and the saturation of black and white stay), else `c`'s own. @@ -512,8 +566,8 @@ fn hsl32(hsl: [f32; 3]) -> Color32 { pub(crate) fn hsl_rows(app: &VectorcraftApp, ui: &mut Ui, tgt: &Target, color: Option, cms: &Cms) -> Option<([f32; 3], Live)> { let t = Tokens::get(ui.ctx()); let enabled = color.is_some(); - let hsl = match (color, pstate::>(ui.ctx(), HSL_MEMORY)) { - (Some(c), Some((owner, shown, hsl))) if owner == Owner::of(app, tgt, c) => remembered_hsl(cms, &c, shown, hsl), + let hsl = match (color, recall::<[f32; 3]>(app, ui, HSL_MEMORY, tgt, color, cms)) { + (Some(c), Some((shown, hsl))) => remembered_hsl(cms, &c, shown, hsl), (Some(c), _) => rgb_to_hsl(cms.display_rgb(&c)), (None, _) => [0.0; 3], }; @@ -567,8 +621,8 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { let cms = cms::active(); // With None, a pattern or a "?" proxy the wheel shows the last solid color without markers, // and a click, an arrow key or a screen reader's action applies the picked color. - let hsb = match (color, pstate::>(ui.ctx(), MEMORY)) { - (Some(c), Some((owner, shown, hsb))) if owner == Owner::of(app, &tgt, c) => remembered_hsb(&cms, &c, shown, hsb), + let hsb = match (color, recall::<[f32; 3]>(app, ui, MEMORY, &tgt, color, &cms)) { + (Some(c), Some((shown, hsb))) => remembered_hsb(&cms, &c, shown, hsb), (c, _) => display_hsb(&cms, &c.unwrap_or(app.session.last_solid)), }; let marked = color.is_some(); @@ -618,22 +672,41 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { picked_hsl = hsl_rows(app, ui, &tgt, color, &cms); } } + // A row drag whose rows were hidden or replaced (`ui.colorWheel {sliders}`) reports no release: + // its preview is kept as one undo step and the interaction ends. + let live = pstate::>(ui.ctx(), ROWS_LIVE); + if live.is_some_and(|rows| rows != app.ui.color_wheel.sliders) { + if app.session.in_interaction() + && let Err(e) = app.session.commit_interaction() + { + app.status(e.to_string()); + } + app.sync_views(); + set_pstate(ui.ctx(), ROWS_LIVE, None::); + } let behind = super::alt_held(ui); let cmyk_doc = app.session.active().is_some_and(|d| d.doc.color_mode == ColorMode::Cmyk); - if let Some((hsl, phase)) = picked_hsl { - let c = stored_srgb(&cms, hsl_to_rgb(hsl), replaced(app, &tgt, behind).as_ref(), cmyk_doc); - apply(app, &tgt, c, phase, behind); - if !behind { - set_pstate(ui.ctx(), HSL_MEMORY, Some((Owner::of(app, &tgt, c), cms.display_rgb(&c), hsl))); + let rows = match (picked_hsl, picked_lch) { + (Some((hsl, phase)), _) => Some((hsl_to_rgb(hsl), phase, HSL_MEMORY, Remembered::Hsl(hsl))), + (_, Some((lch, phase))) => Some((oklab::from_oklch(lch[0], lch[1], lch[2]).0, phase, OKLCH_MEMORY, Remembered::Oklch(lch))), + _ => None, + }; + if let Some((srgb, phase, key, asked)) = rows { + // A hue on a gray, or a saturation on black or white, leaves the displayed color as it is: + // the rows keep what they were given, and the paint (a Gray color too) stays unchanged. + let current = color.filter(|c| { + let d = cms.display_rgb(c); + !behind && live.is_none() && (0..3).all(|i| (d[i] - srgb[i]).abs() <= 1e-5) + }); + if let Some(c) = current { + asked.remember(ui, key, Owner::of(app, &tgt, c), cms.display_rgb(&c)); + return; } - return; - } - if let Some((lch, phase)) = picked_lch { - let (srgb, _) = oklab::from_oklch(lch[0], lch[1], lch[2]); let c = stored_srgb(&cms, srgb, replaced(app, &tgt, behind).as_ref(), cmyk_doc); apply(app, &tgt, c, phase, behind); + set_pstate(ui.ctx(), ROWS_LIVE, (phase == Live::Dragging).then_some(app.ui.color_wheel.sliders)); if !behind { - set_pstate(ui.ctx(), OKLCH_MEMORY, Some((Owner::of(app, &tgt, c), cms.display_rgb(&c), lch))); + asked.remember(ui, key, Owner::of(app, &tgt, c), cms.display_rgb(&c)); } return; } @@ -644,3 +717,18 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { set_pstate(ui.ctx(), MEMORY, Some((Owner::of(app, &tgt, c), cms.display_rgb(&c), hsb))); } } + +/// What a slider row asked for, kept under its memory key. +enum Remembered { + Hsl([f32; 3]), + Oklch([f64; 3]), +} + +impl Remembered { + fn remember(self, ui: &Ui, key: &str, owner: Owner, shown: [f32; 3]) { + match self { + Remembered::Hsl(v) => set_pstate(ui.ctx(), key, Some((owner, shown, v))), + Remembered::Oklch(v) => set_pstate(ui.ctx(), key, Some((owner, shown, v))), + } + } +} diff --git a/crates/ui-egui/src/panels/tests_color_wheel.rs b/crates/ui-egui/src/panels/tests_color_wheel.rs index 7cba14af3a..f13f78e8e2 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel.rs @@ -691,6 +691,15 @@ fn the_oklch_tracks_dim_the_colors_outside_srgb_and_the_tick_marks_the_largest_c let [r, g, b] = stored.map(|v| (f64::from(v).clamp(0.0, 1.0) * 255.0).round() as u8); assert!(lowered); assert_eq!(oklch_track([0.98, 0.2, h], None), egui::Color32::from_rgb(r, g, b).gamma_multiply(0.3)); + // At blue's L and H the ray leaves sRGB below the largest chroma and comes back at blue: the C + // track dims that gap and shows the color a pick there stores. + let [bl, _, bh] = vectorcraft_color::oklab::to_oklch([0.0, 0.0, 1.0]); + let blue_max = vectorcraft_color::oklab::max_chroma(bl, bh); + let (stored, lowered) = vectorcraft_color::oklab::from_oklch(bl, 0.29, bh); + let [r, g, b] = stored.map(|v| (f64::from(v).clamp(0.0, 1.0) * 255.0).round() as u8); + assert!(lowered && blue_max > 0.3); + assert_eq!(oklch_track([bl, 0.29, bh], Some(blue_max)), egui::Color32::from_rgb(r, g, b).gamma_multiply(0.3)); + assert_eq!(oklch_track([bl, blue_max, bh], Some(blue_max)).a(), 255, "blue itself is inside sRGB"); assert!((chroma_tick(max) - (max / 0.4) as f32).abs() < 1e-6 && chroma_tick(max) > 0.1 && chroma_tick(max) < 1.0); assert_eq!((chroma_tick(0.0), chroma_tick(0.5)), (0.0, 1.0)); } @@ -792,16 +801,17 @@ fn oklch_sliders_need_srgb_as_the_working_space() { move |ui, app: &mut VectorcraftApp| { let tgt = super::color::wheel_target(app, ui); let color = tgt.color(); - let _ = oklch_rows(app, ui, &tgt, color, &p3); + let picked = oklch_rows(app, ui, &tgt, color, &p3); + assert!(picked.is_none(), "a gray row picks nothing: {picked:?}"); }, app(json!("#ff0000")), ); h.run_steps(2); assert!(oklch_slider(&h, "Lightness").accesskit_node().is_disabled()); - let undo = undo_len(h.state()); let rail = oklch_slider(&h, "Lightness").rect(); click(&mut h, on_rail(rail, 0.2), Modifiers::NONE); - assert_eq!(undo_len(h.state()), undo, "a gray row picks nothing"); + key(&mut h, egui::Key::ArrowRight, Modifiers::NONE); + set_slider_value(&mut h, "Lightness", 20.0); } /// The rows show what they asked for while the color displays as it did, and the color's own @@ -1024,3 +1034,60 @@ fn ui_color_wheel_sets_and_reads_the_sliders() { assert_eq!(e, "`sliders` must be none, oklch or hsl"); assert_eq!(app.ui.color_wheel.view, crate::panels::color_wheel::View::Box, "an error changes nothing"); } + +/// A hue given to a Gray color does not change how it displays, so its paint stays a Gray color +/// and no undo step is recorded; the hue row keeps the hue. +#[test] +fn a_hue_on_a_gray_color_leaves_its_paint_gray() { + for (rows, hue) in [("hsl", "HSL Hue"), ("oklch", "Hue")] { + let mut app = app(json!({"gray": 0.5})); + app.run("ui.colorWheel", json!({"sliders": rows})).unwrap(); + let mut h = oklch_harness_shown(app); + let (gray, undo) = (fill(h.state()), undo_len(h.state())); + assert!(matches!(gray, Color::Gray { .. }), "{gray:?}"); + set_slider_value(&mut h, hue, 200.0); + assert_eq!(oklch_slider(&h, hue).accesskit_node().numeric_value(), Some(200.0), "{rows}"); + assert_eq!((fill(h.state()), undo_len(h.state())), (gray, undo), "{rows}: the Gray fill stays as it was"); + } +} + +/// The hue given to a gray is dropped once the panel shows another color, so the same gray applied +/// again later shows its own hue, 0°. +#[test] +fn a_remembered_hue_is_dropped_after_the_paint_changes() { + for (rows, hue) in [("hsl", "HSL Hue"), ("oklch", "Hue")] { + let mut app = app(json!("#808080")); + app.run("ui.colorWheel", json!({"sliders": rows})).unwrap(); + let mut h = oklch_harness_shown(app); + set_slider_value(&mut h, hue, 240.0); + assert_eq!(oklch_slider(&h, hue).accesskit_node().numeric_value(), Some(240.0), "{rows}"); + h.state_mut().run("paint.setFill", json!({"color": "#ff0000"})).unwrap(); + h.run_steps(2); + h.state_mut().run("paint.setFill", json!({"color": "#808080"})).unwrap(); + h.run_steps(2); + assert_eq!(oklch_slider(&h, hue).accesskit_node().numeric_value(), Some(0.0), "{rows}: the gray's own hue"); + } +} + +/// Hiding the rows, or showing the other rows, during a drag on a row keeps the color the drag +/// previewed as one undo step and leaves no interaction open. +#[test] +fn hiding_the_rows_during_a_drag_keeps_its_color_as_one_undo_step() { + for rows in ["none", "oklch"] { + let mut h = hsl_harness(app(json!("#ff8000"))); + let rail = oklch_slider(&h, "HSL Lightness").rect(); + let undo = undo_len(h.state()); + press(&mut h, on_rail(rail, 0.5), true, Modifiers::NONE); + for _ in 0..2 { + h.event(Event::PointerMoved(on_rail(rail, 0.25))); + h.run_steps(1); + } + assert!(h.state().session.in_interaction(), "{rows}: the drag previews"); + let previewed = fill(h.state()); + h.state_mut().run("ui.colorWheel", json!({"sliders": rows})).unwrap(); + h.run_steps(2); + press(&mut h, on_rail(rail, 0.25), false, Modifiers::NONE); + assert!(!h.state().session.in_interaction(), "{rows}: the interaction ended"); + assert_eq!((fill(h.state()), undo_len(h.state())), (previewed, undo + 1), "{rows}"); + } +} diff --git a/docs/control-protocol.md b/docs/control-protocol.md index deefa7751f..8b29059609 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -270,8 +270,8 @@ pick runs the commands the Color panel's sliders run: `paint.setFill` or `paint. `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?, sliders?}` shows the wheel or the box (a color field with a channel strip at its right), picks the box's channel, and shows OKLCH Sliders, HSL -Sliders or neither (`sliders: "oklch"`, `"hsl"` or `"none"`; `"oklch"` is an error while the working RGB space is not -sRGB); it returns the settings, and `ui.inspect` reports them as `ui.color_wheel`. +Sliders or neither (`sliders: "oklch"`, `"hsl"` or `"none"`; `"oklch"` is an error while the active document's RGB +space, its assigned profile or else the working RGB space, is not sRGB); 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 0d68533e69..36c37613b7 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -677,11 +677,13 @@ the list return an error and change nothing. The command returns `{view, channel kept with the preferences. `ui.colorWheel {"sliders": "oklch"}` shows the Color Wheel panel's OKLCH Sliders (L, C and H rows under the wheel or -the box), and `"none"` hides them; `"oklch"` is an error while the working RGB space is not sRGB. +the box), and `"none"` hides them in any RGB space. `"oklch"` is an error while the active document's RGB space is +not sRGB: the profile assigned to the document when it has one, else the working RGB space of Edit › Color Settings. `ui.colorWheel {"sliders": "hsl"}` shows HSL Sliders in their place: H, S and L rows with the hue (0 to 360°), saturation and lightness (0 to 100 %) of the color's display sRGB, as CSS Color 4's `hsl()` defines them. -`color.convert {"to": "oklch"}` answers the color's OKLCH as `[L %, C, H°]` of its display sRGB. A color outside sRGB -(a Lab or CMYK color, or an RGB color in a wider working RGB space) is clipped to sRGB first. +`color.convert {"color": "#ff0000", "to": "oklch"}` answers the color's OKLCH as `[L %, C, H°]` of its display sRGB. +A color outside sRGB (a Lab or CMYK color, an RGB color in a wider RGB space, or RGB numbers past 0 to 1) is clipped +to sRGB first. 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 e0401e8fe9..43ee1da4de 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1819,7 +1819,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **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. - - **OKLCH Sliders (Color Wheel panel):** as VectorCraft's own addition, the Color Wheel panel's menu item OKLCH Sliders (`ui.colorWheel {sliders: "oklch"}`, kept with the preferences) shows L, C and H rows under the wheel or the box that edit the color by the OKLCH lightness (0 to 100 %), chroma (0 to 100 % of 0.4) and hue (0 to 360°) of its display sRGB, as CSS Color 4 defines them (https://www.w3.org/TR/css-color-4/#specifying-oklab-oklch). Each track dims the colors outside sRGB, and a tick on the C track marks the largest chroma sRGB holds at the row's L and H; a color outside sRGB keeps L and H and takes the largest chroma that fits, and the C row keeps the chroma asked for. The rows take the arrow keys after a click and report their names, values, ranges and adjust actions to screen readers. The item is gray, and `ui.colorWheel` answers an error, while the working RGB space is not sRGB. `color.convert {to: "oklch"}` answers the same L, C and H. Evidence: `crates/color/src/oklab.rs` tests; `convert_to_oklch_answers_lightness_chroma_and_hue` in `crates/engine/src/tests/colormgmt.rs`; the OKLCH tests in `crates/ui-egui/src/panels/tests_color_wheel.rs`, `the_oklch_tracks_dim_the_colors_outside_srgb_and_the_tick_marks_the_largest_chroma` and `oklch_sliders_are_gray_after_the_working_space_changes` among them. Scores and estimates are unchanged. + - **OKLCH Sliders (Color Wheel panel):** as VectorCraft's own addition, the Color Wheel panel's menu item OKLCH Sliders (`ui.colorWheel {sliders: "oklch"}`, kept with the preferences) shows L, C and H rows under the wheel or the box that edit the color by the OKLCH lightness (0 to 100 %), chroma (0 to 100 % of 0.4) and hue (0 to 360°) of its display sRGB, as CSS Color 4 defines them (https://www.w3.org/TR/css-color-4/#specifying-oklab-oklch). Each track dims the colors outside sRGB, and a tick on the C track marks the largest chroma sRGB holds at the row's L and H; a color outside sRGB keeps L and H and takes the largest chroma that fits, and the C row keeps the chroma asked for. The rows take the arrow keys after a click and report their names, values, ranges and adjust actions to screen readers. While the active document's RGB space (its assigned profile, else the working RGB space of Edit › Color Settings) is not sRGB, the unchecked item is gray and `ui.colorWheel {sliders: "oklch"}` answers an error; rows shown before the space changed are gray, and the checked item still hides them. `color.convert {color, to: "oklch"}` answers the same L, C and H. Evidence: `crates/color/src/oklab.rs` tests; `convert_to_oklch_answers_lightness_chroma_and_hue` in `crates/engine/src/tests/colormgmt.rs`; the OKLCH tests in `crates/ui-egui/src/panels/tests_color_wheel.rs`, `the_oklch_tracks_dim_the_colors_outside_srgb_and_the_tick_marks_the_largest_chroma` and `oklch_sliders_are_gray_after_the_working_space_changes` among them. Scores and estimates are unchanged. - **HSL Sliders (Color Wheel panel):** as VectorCraft's own addition, the Color Wheel panel's menu item HSL Sliders (`ui.colorWheel {sliders: "hsl"}`, kept with the preferences) shows H, S and L rows in place of OKLCH Sliders that edit the color by the hue (0 to 360°), saturation and lightness (0 to 100 %) of its display sRGB, as CSS Color 4 defines HSL (https://www.w3.org/TR/css-color-4/#the-hsl-notation). A pick goes from display sRGB into the working RGB space as the wheel's picks do, and the rows keep the hue of a gray. The rows take the arrow keys after a click and report their names, values, ranges and adjust actions to screen readers. Evidence: `hsl_follows_css_color_4` and `hsl_roundtrip` in `crates/color/src/lib.rs`; the HSL tests in `crates/ui-egui/src/panels/tests_color_wheel.rs`, `a_gray_keeps_the_hsl_hue_it_was_given` among them. Scores and estimates are unchanged. - **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"). From b6926e9a316a6c1fb0b03cee4eedaecff8ac09b0 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 15:48:26 -0800 Subject: [PATCH 29/55] Preferences: Low-Latency Drawing and Plug-in Instruction Budget get their descriptions The Performance and Plug-ins & Scratch Disks coverage test failed on the desktop: Low-Latency Drawing and Plug-in Instruction Budget, which main added, had no sentence. Both now have one, with rows in every catalog. --- 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/prefs_dialog/descriptions.rs | 8 ++++++++ 29 files changed, 64 insertions(+) diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 4524eb9498..6f23913011 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -3148,6 +3148,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 приставките в тази папка се зареждат при стартиране и когато щракнете върху ОК с нова папка тук, освен в Безопасен режим; уеб версията не ги зарежда. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. 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. Колко светъл или тъмен е интерфейсът. @@ -3166,6 +3167,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. От следващото стартиране прозорецът показва всеки кадър, без да чака опресняването на дисплея, където графичният драйвер позволява, най-много 240 кадъра в секунда. 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 5adc0c80a2..0b4da60954 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -4609,6 +4609,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. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normalno zadržava vlastita ograničenja svakog dodatka; uz Veliko filter ili naredba dodatka može izvršiti najmanje 250 miliona instrukcija pored onih za svoj ulaz. 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. @@ -4627,6 +4628,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Od sljedećeg pokretanja prozor prikazuje svaki kadar bez čekanja na osvježavanje ekrana gdje grafički drajver to dozvoljava, najviše 240 kadrova u sekundi. 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 8d96c218f9..ecb9b541cc 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -3990,6 +3990,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. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normal manté els límits propis de cada complement; amb Gran, un filtre o una ordre d’un complement pot executar com a mínim 250 milions d’instruccions a més de les de la seva entrada. 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. @@ -4008,6 +4009,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. A partir del pròxim inici, la finestra mostra cada fotograma sense esperar el refresc de la pantalla quan el controlador gràfic ho permet, com a màxim 240 fotogrames per segon. 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 c0b2abcb4e..ac7dace585 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4717,6 +4717,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á. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normální zachová vlastní limity každého zásuvného modulu; s volbou Velké může filtr nebo příkaz zásuvného modulu provést nejméně 250 milionů instrukcí navíc k těm pro svůj vstup. Č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í. @@ -4735,6 +4736,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Od příštího spuštění okno zobrazuje každý snímek bez čekání na obnovení displeje, kde to grafický ovladač dovolí, nejvýše 240 snímků za sekundu. 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 72678e50be..626fe13c1c 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7141,6 +7141,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. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normal beholder hvert plug-ins egne grænser; med Stor kan et plug-in-filter eller en plug-in-kommando køre mindst 250 millioner instruktioner ud over dem til sit input. Tidsgrænsen forbliver 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. @@ -7159,6 +7160,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Fra næste start viser vinduet hvert billede uden at vente på skærmens opdatering, hvor grafikdriveren tillader det, højst 240 billeder i sekundet. 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 a6d9c16b7a..b84b1b5336 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -3212,6 +3212,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. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. „Normal“ behält die eigenen Grenzen jedes Plug-ins; mit „Groß“ darf ein Plug-in-Filter oder -Befehl mindestens 250 Millionen Anweisungen zusätzlich zu denen für seine Eingabe ausführen. 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. @@ -3230,6 +3231,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Ab dem nächsten Start zeigt das Fenster jedes Bild, ohne auf die Bildwiederholung des Bildschirms zu warten, wo der Grafiktreiber es zulässt, höchstens 240 Bilder pro Sekunde. 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 71fd913c7a..0d61f8e196 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -4067,6 +4067,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 δεν τα φορτώνει. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. 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. Πόσο φωτεινό ή σκοτεινό είναι το περιβάλλον χρήστη. @@ -4085,6 +4086,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Από την επόμενη εκκίνηση, το παράθυρο εμφανίζει κάθε καρέ χωρίς να περιμένει την ανανέωση της οθόνης, όπου το επιτρέπει το πρόγραμμα οδήγησης γραφικών, έως 240 καρέ το δευτερόλεπτο. 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 cd06a5a07f..c7514f83ac 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -3249,6 +3249,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. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normal mantiene los límites propios de cada plugin; con Grande, un filtro o un comando de un plugin puede ejecutar al menos 250 millones de instrucciones además de las de su entrada. 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. @@ -3267,6 +3268,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. A partir del próximo inicio, la ventana muestra cada fotograma sin esperar la actualización de la pantalla cuando el controlador gráfico lo permite, con un máximo de 240 fotogramas por segundo. 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 89089cfaf9..f849b11c90 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4632,6 +4632,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ä. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normaali säilyttää kunkin laajennuksen omat rajat; Suuri-asetuksella laajennuksen suodin tai komento voi suorittaa vähintään 250 miljoonaa käskyä syötteensä käskyjen lisäksi. 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. @@ -4650,6 +4651,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Seuraavasta käynnistyksestä alkaen ikkuna näyttää jokaisen kuvan odottamatta näytön virkistystä, kun grafiikkaohjain sallii sen, enintään 240 kuvaa sekunnissa. 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 5989f83d3f..5e639bf6f7 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -3237,6 +3237,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. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normal conserve les limites propres à chaque module externe. Avec Grand, un filtre ou une commande d’un module externe peut exécuter au moins 250 millions d’instructions en plus de celles de son entrée. 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. @@ -3255,6 +3256,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. À partir du prochain démarrage, la fenêtre affiche chaque image sans attendre le rafraîchissement de l’écran lorsque le pilote graphique le permet, au plus 240 images par seconde. 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 f805ba02e9..ba155a8a7b 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -3309,6 +3309,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 પ્લગ-ઇન્સ શરૂઆતમાં અને અહીં નવા ફોલ્ડર સાથે ઠીક પર ક્લિક કરો ત્યારે લોડ થાય છે, સેફ મોડ સિવાય; વેબ સંસ્કરણ તેમને લોડ કરતું નથી. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. 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. ઇન્ટરફેસ કેટલું આછું કે ઘેરું છે. @@ -3327,6 +3328,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. આગલી શરૂઆતથી, જ્યાં ગ્રાફિક્સ ડ્રાઇવર મંજૂરી આપે ત્યાં વિન્ડો ડિસ્પ્લેના રિફ્રેશની રાહ જોયા વિના દરેક ફ્રેમ બતાવે છે, સેકન્ડ દીઠ વધુમાં વધુ 240 ફ્રેમ. 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 a393374aa0..9008d12152 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -4362,6 +4362,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 प्लग-इन शुरू होने पर और यहाँ नया फ़ोल्डर देकर ठीक है पर क्लिक करने पर लोड होते हैं, सुरक्षित मोड को छोड़कर; वेब संस्करण उन्हें लोड नहीं करता। + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. 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. इंटरफ़ेस कितना हल्का या गहरा है। @@ -4380,6 +4381,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. अगली शुरुआत से, जहाँ ग्राफ़िक्स ड्राइवर अनुमति देता है, विंडो डिस्प्ले के रीफ़्रेश की प्रतीक्षा किए बिना हर फ़्रेम दिखाती है, अधिकतम 240 फ़्रेम प्रति सेकंड। 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 9fb1e55d05..7e61422b68 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3830,6 +3830,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. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. A Normál megtartja minden bővítmény saját korlátait; a Nagy beállítással egy bővítményszűrő vagy -parancs legalább 250 millió utasítást futtathat a bemenetéhez tartozókon felül. Az időkorlát nem változik. 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. @@ -3848,6 +3849,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. A következő indítástól az ablak minden képkockát a kijelző frissítésének kivárása nélkül jelenít meg, ahol a grafikus illesztőprogram engedi, legfeljebb másodpercenként 240 képkockát. 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 ce4507c488..4bced5b609 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -4357,6 +4357,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. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normal mempertahankan batas setiap plug-in sendiri; dengan Besar, filter atau perintah plug-in dapat menjalankan setidaknya 250 juta instruksi selain instruksi untuk masukannya. Batas waktu 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. @@ -4375,6 +4376,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Mulai dari peluncuran berikutnya, jendela menampilkan setiap bingkai tanpa menunggu penyegaran layar jika driver grafis mengizinkan, paling banyak 240 bingkai per detik. 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 be2fd8db0b..182c8bed1b 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -3297,6 +3297,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. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normale mantiene i limiti propri di ogni plug-in; con Grande, un filtro o un comando di un plug-in può eseguire almeno 250 milioni di istruzioni oltre a quelle per il suo input. Il limite di tempo resta invariato. 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. @@ -3315,6 +3316,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Dal prossimo avvio, la finestra mostra ogni fotogramma senza attendere l’aggiornamento dello schermo dove il driver grafico lo consente, al massimo 240 fotogrammi al secondo. 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 bb828451be..790d37556a 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -3281,6 +3281,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 版では読み込まれません。 + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. 通常では各プラグイン自身の制限が使われます。大では、プラグインのフィルターやコマンドは入力のための命令に加えて少なくとも 2 億 5000 万命令を実行できます。時間の制限は変わりません。 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. インターフェイスをどの程度明るく、または暗く表示するかです。 @@ -3299,6 +3300,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. 次回の起動から、グラフィックドライバーが許す場合、ウィンドウはディスプレイのリフレッシュを待たずに各フレームを表示します。最大で毎秒 240 フレームです。 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 222bb713ef..77dea1b73c 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6429,6 +6429,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-ს დააწკაპუნებთ, გარდა უსაფრთხო რეჟიმისა; ვებ-ვერსია მათ არ ტვირთავს. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. 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. რამდენად ღია ან მუქია ინტერფეისი. @@ -6447,6 +6448,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. შემდეგი გაშვებიდან ფანჯარა აჩვენებს თითოეულ კადრს ეკრანის განახლების მოლოდინის გარეშე, სადაც გრაფიკული დრაივერი ამის საშუალებას იძლევა, წამში არაუმეტეს 240 კადრისა. 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 455f0ddfd9..139310089f 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3270,6 +3270,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 플러그인이 시작할 때와 여기에 새 폴더를 지정하고 확인을 클릭할 때 로드됩니다(안전 모드 제외). 웹 버전은 로드하지 않습니다. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. 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. 인터페이스를 얼마나 밝게 또는 어둡게 표시할지입니다. @@ -3288,6 +3289,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. 다음 시작부터 그래픽 드라이버가 허용하는 경우 창은 디스플레이 새로 고침을 기다리지 않고 각 프레임을 표시하며, 초당 최대 240프레임입니다. 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 c1e6e5f925..f9f506146b 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -5014,6 +5014,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. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normaal behoudt de eigen limieten van elke plug-in; met Groot mag een filter of opdracht van een plug-in ten minste 250 miljoen instructies uitvoeren naast die voor de invoer. 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. @@ -5032,6 +5033,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Vanaf de volgende start toont het venster elk beeld zonder op de verversing van het beeldscherm te wachten, waar het grafische stuurprogramma dat toestaat, met hoogstens 240 beelden per seconde. 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 14a295984d..a6d0b8d436 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4560,6 +4560,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. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normalny zachowuje własne limity każdej wtyczki; przy ustawieniu Duże filtr lub polecenie wtyczki może wykonać co najmniej 250 milionów instrukcji oprócz tych na swoje dane wejściowe. Limit czasu pozostaje bez zmian. 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. @@ -4578,6 +4579,7 @@ font-technology Variable Zmienne 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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Od następnego uruchomienia okno wyświetla każdą klatkę bez czekania na odświeżenie ekranu, jeśli pozwala na to sterownik grafiki, najwyżej 240 klatek na sekundę. 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 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. diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 1bd57c2d67..8549ba3165 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2734,6 +2734,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. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normal mantém os limites próprios de cada plug-in; com Grande, um filtro ou comando de plug-in pode executar pelo menos 250 milhões de instruções além das de sua entrada. 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. @@ -2752,6 +2753,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. A partir da próxima inicialização, a janela mostra cada quadro sem esperar a atualização da tela quando o driver gráfico permite, no máximo 240 quadros por segundo. 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 dcde4bc9c5..91557357f1 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -3279,6 +3279,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 из этой папки загружаются при запуске и при нажатии ОК с новой папкой здесь, кроме безопасного режима; веб-версия их не загружает. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. 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. Насколько светлый или тёмный интерфейс. @@ -3297,6 +3298,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Со следующего запуска окно показывает каждый кадр, не дожидаясь обновления дисплея, если графический драйвер это позволяет, не более 240 кадров в секунду. 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 f6394936f5..491fbc317b 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -3173,6 +3173,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. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normal behåller varje plugins egna gränser; med Stor får ett pluginfilter eller ett pluginkommando köra minst 250 miljoner instruktioner utöver dem för sin indata. Tidsgränsen förblir 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. @@ -3191,6 +3192,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Från nästa start visar fönstret varje bildruta utan att vänta på skärmens uppdatering där grafikdrivrutinen tillåter det, högst 240 bildrutor per sekund. 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 77b066e546..cff4cc9823 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -3016,6 +3016,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. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normal, her eklentinin kendi sınırlarını korur; Büyük ile bir eklenti filtresi veya komutu, girdisi için olanlara ek olarak en az 250 milyon talimat çalıştırabilir. 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. @@ -3034,6 +3035,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Bir sonraki başlatmadan itibaren pencere, grafik sürücüsünün izin verdiği yerde ekranın yenilenmesini beklemeden her kareyi gösterir; saniyede en fazla 240 kare. 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 59e0c02aca..faf3a797a8 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -3289,6 +3289,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 з цієї папки завантажуються під час запуску і коли ви натискаєте ОК з новою папкою тут, крім безпечного режиму; веб-версія їх не завантажує. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. 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. Наскільки світлим чи темним є інтерфейс. @@ -3307,6 +3308,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. З наступного запуску вікно показує кожен кадр, не чекаючи оновлення дисплея, якщо графічний драйвер це дозволяє, не більше 240 кадрів на секунду. 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 c15557dce1..8f27a5670f 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3605,6 +3605,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. + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Thường giữ giới hạn riêng của từng plug-in; với Lớn, một bộ lọc hoặc lệnh của plug-in có thể chạy ít nhất 250 triệu lệnh ngoài các lệnh cho dữ liệu đầu vào của nó. Giới hạn thời gian vẫn giữ nguyên. 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. @@ -3623,6 +3624,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Từ lần khởi động tới, cửa sổ hiển thị từng khung hình mà không chờ màn hình làm mới khi trình điều khiển đồ họa cho phép, tối đa 240 khung hình mỗi giây. 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 09bebbef59..09b656b486 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -3146,6 +3146,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 版不会载入它们。 + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. 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. 界面的明暗程度。 @@ -3164,6 +3165,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. 从下次启动起,在图形驱动程序允许时,窗口显示每一帧而不等待显示器刷新,最多每秒 240 帧。 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 a459716932..67b667ef8c 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -4495,6 +4495,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 增效模組會在啟動時以及在此指定新資料夾並按一下「確定」時載入,安全模式除外;網頁版不會載入它們。 + Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. 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. 介面的明暗程度。 @@ -4513,6 +4514,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. 從下次啟動起,在圖形驅動程式允許時,視窗顯示每一影格而不等待顯示器重新整理,最多每秒 240 影格。 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 950820d9ef..7a18d87888 100644 --- a/crates/ui-egui/src/prefs_dialog/descriptions.rs +++ b/crates/ui-egui/src/prefs_dialog/descriptions.rs @@ -235,6 +235,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", + "Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. 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 @@ -273,6 +277,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 each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second.", + ), ( "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.", From db71faca9a51bb917e60ffe363a0a9d990cf716b Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 16:03:40 -0800 Subject: [PATCH 30/55] Brushes: test Artistic tints and list the library in the progress docs The Artistic test now draws each brush with a red stroke and checks that every path takes the stroke color. A second check covers a loaded library named Artistic Brushes: the name selects the built-in library, as for every built-in name, and the loaded library's id still selects it. docs/mcp.md now describes that rule, says that the exact id `artistic` selects the built-in library and that `Artistic` selects it only when no library has that name, and counts thirteen built-in libraries. The G5 entry, the UI brush-library row, the M10 row and the area rows list Artistic Brushes with thirteen libraries. --- crates/engine/src/tests/brushlib.rs | 18 ++++++++++++++++++ docs/gaps.md | 6 +++--- docs/mcp.md | 8 +++++--- docs/roadmap.md | 2 +- docs/target-app-parity.md | 8 ++++---- docs/ui-parity.md | 2 +- 6 files changed, 32 insertions(+), 12 deletions(-) diff --git a/crates/engine/src/tests/brushlib.rs b/crates/engine/src/tests/brushlib.rs index c741b1824f..39c48c9b88 100644 --- a/crates/engine/src/tests/brushlib.rs +++ b/crates/engine/src/tests/brushlib.rs @@ -212,12 +212,24 @@ fn artistic_library_strokes_are_editable_and_reopen_from_a_saved_library() { let names = ["Orbit Lines", "Petal Garland", "Lattice Braid", "Facet Sweep"]; assert_eq!(lib.brushes.iter().map(|b| b.name.as_str()).collect::>(), names); let line = run(&mut s, "shape.line", json!({"x1": 10, "y1": 50, "x2": 190, "y2": 50}))["id"].as_u64().unwrap(); + let red = vectorcraft_doc::StrokeLayer::new(vectorcraft_color::Paint::solid(vectorcraft_color::Color::rgb(1.0, 0.0, 0.0)), 1.0); for b in &lib.brushes { let BrushKind::Art(a) = &b.kind else { panic!("{} is not an art brush", b.name) }; assert!(art_paths(&a.art).len() >= 2, "{} has no editable vector art", b.name); for path in [line_to(180.0), line_to(1.0)] { assert!(!vectorcraft_brush::stroke_pieces(&lib.doc, b, &path, &black_stroke()).is_empty(), "{} draws nothing", b.name); } + // The art is black, so with Tints every path takes the stroke color itself. + let mut fills = vec![]; + for piece in vectorcraft_brush::stroke_pieces(&lib.doc, b, &line_to(180.0), &red) { + piece.walk(&mut |n| { + if n.path_data().is_some() { + fills.push(n.appearance.fill_paint().color().map(|c| c.to_rgb())); + } + }); + } + let is_red = |c: &Option<[f32; 3]>| c.is_some_and(|[r, g, b]| (r - 1.0).abs() < 1e-5 && g.abs() < 1e-5 && b.abs() < 1e-5); + assert!(!fills.is_empty() && fills.iter().all(is_red), "{} does not take the stroke color: {fills:?}", b.name); let before = undo_len(&s); let added = run(&mut s, "brush.addFromLibrary", json!({"library": "artistic", "name": b.name, "apply": true, "ids": [line]})); assert_eq!(strs(&added["added"]), [b.name.as_str()]); @@ -242,6 +254,12 @@ fn a_loaded_library_named_artistic_keeps_its_name_ahead_of_the_builtin_alias() { assert_eq!(run(&mut s, "brush.library", json!({"library": "Artistic"}))["id"], id); assert_eq!(run(&mut s, "brush.library", json!({"library": "ARTISTIC"}))["id"], id); assert_eq!(run(&mut s, "brush.library", json!({"library": "artistic"}))["id"], "artistic", "exact built-in id still works"); + // A name a built-in library has selects the built-in, as for every built-in; the loaded one keeps its id. + let full = run(&mut s, "brush.loadLibrary", json!({"dataBase64": b64, "name": "Artistic Brushes.vectorcraft"})); + assert_eq!(full["name"], "Artistic Brushes"); + let full_id = full["library"].as_str().unwrap(); + assert_eq!(run(&mut s, "brush.library", json!({"library": "Artistic Brushes"}))["id"], "artistic"); + assert_eq!(run(&mut s, "brush.library", json!({"library": full_id}))["id"], full_id); } /// Every path of brush art `n`: (anchors, opacity). diff --git a/docs/gaps.md b/docs/gaps.md index a8ba004253..4b94f27013 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -691,8 +691,8 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi libraries ([public source](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/create-new-brush-libraries.html), [import](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/import-brushes-from-brush-libraries-or-other-files.html)): Window › Brush Libraries and the Brushes panel's Brush Libraries Menu open each library in a library panel of - its own (twelve original libraries generated in code: Art Ribbons, Ink and Wash, Calligraphic Nibs, Pressure Sensitive, Bristle Brushes (one - bristle brush for each tip shape), Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media (grainy chalk, pencil, crayon and charcoal art brushes), Tech Circuit (Circuit Trace, Bus Lines and Terminal Nodes) and Arrows (Solid, Open, Double, Chevron and Dashed Arrow); User Defined; Other Library… reads the brushes of any document VectorCraft opens); a + its own (thirteen original libraries generated in code: Art Ribbons, Ink and Wash, Calligraphic Nibs, Pressure Sensitive, Bristle Brushes (one + bristle brush for each tip shape), Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media (grainy chalk, pencil, crayon and charcoal art brushes), Tech Circuit (Circuit Trace, Bus Lines and Terminal Nodes), Arrows (Solid, Open, Double, Chevron and Dashed Arrow) and Artistic Brushes (Orbit Lines, Petal Garland, Lattice Braid and Facet Sweep); User Defined; Other Library… reads the brushes of any document VectorCraft opens); a click adds a brush to the document's Brushes with the patterns, symbols and other resources its art uses, as one undo step (applied to the selected paths in the same step), dragging one onto a path adds and applies it and @@ -714,7 +714,7 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi Fine Grain, Canvas Weave, Burlap Sack, Cracked Glaze, Mosaic Floor, Quilted Squares, Leaded Glass and Damp Paper, painted with the texture effects; User Defined; Other Library…; `graphicStyle.libraries`, `graphicStyle.addFromLibrary`). -- **Missing:** more built-in brush libraries beyond the eleven shipped (and further graphic-style libraries beyond the eleven shipped, and further symbol libraries beyond Basic +- **Missing:** more built-in brush libraries beyond the thirteen shipped (and further graphic-style libraries beyond the eleven shipped, and further symbol libraries beyond Basic Shapes, UI Frames, Map Markers, Inventory Icons, Skill Icons and Weather Icons; original, generated in code, never Adobe's); dynamic symbols' `.ai` read and write. - **Estimate:** 3–13 h (estimated). diff --git a/docs/mcp.md b/docs/mcp.md index 7e2008a1cb..34eb007dbc 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5478,13 +5478,15 @@ error. ## Brush libraries -Brush libraries are read-only sets of brushes: twelve generated in code (Art Ribbons, Ink and Wash, Calligraphic Nibs, Pressure Sensitive with Flex Ribbon, Pulse Stroke, Round Flow and Chisel Flow, Bristle +Brush libraries are read-only sets of brushes: thirteen generated in code (Art Ribbons, Ink and Wash, Calligraphic Nibs, Pressure Sensitive with Flex Ribbon, Pulse Stroke, Round Flow and Chisel Flow, Bristle Brushes with one bristle brush for each tip shape, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, and Dry Media with the Chalk Grain, Graphite Pencil, Wax Crayon and Charcoal Dust art brushes, id `dry-media`, Tech Circuit with Circuit Trace (art), Bus Lines and Terminal Nodes (pattern), id `tech-circuit`, Arrows with Solid, Open, Double, Chevron and Dashed Arrow art brushes, id `arrows`, and Artistic Brushes with four original vector art brushes, id `artistic`), the `.vectorcraft` files in the user library folder of the desktop app (User Defined) and the brushes of any document loaded with `brush.loadLibrary` (a document without brushes of its own has the default ones). `brush.libraries` lists them (`id`, `name`, `category`: `builtIn`, `user` or `loaded`, `count`) and -`brush.library {library}` returns one's brushes (`name`, `type`; `library` is an id or a name). The -built-in Artistic Brushes library also accepts `Artistic` as a lookup name. +`brush.library {library}` returns one's brushes (`name`, `type`; `library` is an id or a name). A name +that a built-in library and a User Defined or loaded library share selects the built-in one; select the other by its +`user/…` or `loaded/…` id. The exact id `artistic` selects the built-in Artistic Brushes library, and `Artistic` +selects it too when no library is named `Artistic`. `brush.addFromLibrary {library, name? | names?}` copies brushes into the document's Brushes as one undo step (no names: the whole library), with the resources their art uses: patterns, symbols, swatches (`swatchConflict` as for `edit.paste`), graphic styles and images. Brushes the document already has (same name and definition) are reported diff --git a/docs/roadmap.md b/docs/roadmap.md index 4e23db3070..55b10d7565 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -176,7 +176,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | 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 | | M9 | Live effects (+ 3D & Materials) | 🟡 2D effects done incl. Effect → Pathfinder, Color Adjustments and Document Raster Effects Settings; PDF export warns when the pixel cap lowers raster-effect resolution; Artistic › Colored Pencil, Cutout, Dry Brush, Film Grain, Fresco, Neon Glow, Paint Daubs, Palette Knife, Poster Edges, Rough Pastels, Smudge Stick, Sponge, Underpainting and Watercolor and Sketch › Halftone Pattern, Bas Relief, Charcoal, Conté Crayon, Photocopy, Stamp, Torn Edges and Water Paper done (57/57 Photoshop filters); Revolve with automatic smooth vector shading, default-on circular caps and continuous rims, Extrude & Bevel, Inflate and Rotate with one to ten colored directional lights and four original lighting presets; SVG Filters, remaining raster effects and 3D materials and shadows pending | 81–130 | -| M10 | Brushes, symbols, patterns, Repeat | 🟡 pattern swatches (5 tile types, Pattern Options, editing mode, SVG ``/PDF export) and live Repeat (radial/grid/mirror) done; interactive selected mirror axis implemented (focused and native checks passed; full CI blocked by an unrelated text test); symbol libraries done (Window › Symbol Libraries, six generated libraries (Basic Shapes, UI Frames, Map Markers, Inventory Icons, Skill Icons, Weather Icons), User Defined, Other Library…, Save Symbols); brush libraries done (Window › Brush Libraries, twelve generated libraries including Tech Circuit, Arrows, Pressure Sensitive, Ink and Wash, Bristle Brushes and Dry Media, User Defined, Other Library…, Save Brushes); symbol editing shows draggable 9-slice guides (#5280), with guides outside the artwork still unsupported; brushes/symbols in progress | 23–37 | +| M10 | Brushes, symbols, patterns, Repeat | 🟡 pattern swatches (5 tile types, Pattern Options, editing mode, SVG ``/PDF export) and live Repeat (radial/grid/mirror) done; interactive selected mirror axis implemented (focused and native checks passed; full CI blocked by an unrelated text test); symbol libraries done (Window › Symbol Libraries, six generated libraries (Basic Shapes, UI Frames, Map Markers, Inventory Icons, Skill Icons, Weather Icons), User Defined, Other Library…, Save Symbols); brush libraries done (Window › Brush Libraries, thirteen generated libraries including Tech Circuit, Arrows, Artistic Brushes, Pressure Sensitive, Ink and Wash, Bristle Brushes and Dry Media, User Defined, Other Library…, Save Brushes); symbol editing shows draggable 9-slice guides (#5280), with guides outside the artwork still unsupported; brushes/symbols in progress | 23–37 | | M11 | Artboards & views (selected-set deletion shared by Artboards menu, trash and Properties, retaining artboard 1 when all are selected; Artboard deletion keys keep the first of an all-selected set and protect artwork; history prunes invalid indices while preserving valid multiselection (history tests and full workspace CI pass); click-to-fit objects with the Artboard tool (#1227), artboard escape routing and document setup modal handoff done; artboard panel/tool with Move Artwork for X/Y fields and Artboard Options, Trim View, middle-button pan, print tiling and the status bar's artboard navigator with synchronized Artboard tool selection done; Window › Arrange › Tile and Consolidate All Windows done; multiple windows, presentation polish) (cached canvas reprojection preserves scale during resize, rotation and DPI changes; regression-tested and contributor-confirmed 2026-10-19; estimates unchanged) (cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission; regression-tested; estimates unchanged); status-bar pointer coordinates follow the active ruler origin and General units | 🟡; Artboard Options shares existing presets and orientation controls and can fit artwork without moving it; artwork fitting includes all drawn document art across artboards and off-board; artwork bounds are cached by active document and revision, and selection uses the shared bounds cache across artboards | 15–25 | | M12 | Advanced color & art (CMYK/ICC, separations, Gradient Mesh, Live Paint, Image Trace, Graphs) | 🟡 Gradient Mesh, Live Paint, Image Trace (junction-returning pieces retain their positioned boundaries; a simpler contour walk with identical output; an edge's sub-pixel shift is the same from either side; notches read only their own piece; collapsed loops keep few segments; large images trace with a warning; Auto Color keeps rare distinct colours; quick presets trace at once and the Image Trace button opens the adjustment controls; Properties reopens them; tiny fitted contours retain islands and holes; Create Strokes: exact crop EDT, Guo–Hall thinning and maximal-disc graph simplification; 15 presets, the 14 documented ones each with an enhanced version; Ignore Color, Shapes, Auto Grouping and Gradients options; measured in `image-trace-quality.md`; closed outlines retain their interior after straightening; the Flat Logo mode places edges to a fraction of a pixel, restores sharp corners, snaps lines and circles, and refuses gradients; live trace result bounds and selection highlights exclude the retained bitmap except in source-image views), Recolor Artwork, colour management (ICC, soft proofing, separations preview), Graphs (all 9 tools, Graph Data/Type, group-selected series colours persist through regenerate/save/open) done; Graph Design and Marker designs, Transpose and Switch x/y, `\|` label line breaks, the pie options, drop shadows, the legend across the top, overlapping widths, First Row/Column in Front, filled lines, kept label formatting and the Graph Data worksheet done; graph Column designs pending; Vector Halftone Preview keeps the selection box without drawing dot selection marks (#6369); Live Paint Bucket fills faces crossed in one drag (#6373) | 6–10 | | M13 | Automation (Actions ✅ record/playback, persisted; variables, scripting, batch) | 🟡 MCP `add_text` exposes existing vertical point, area and path type; `script.run` and File › Scripts › Other Script… run JavaScript files, and Window › Script Console shows their output; the script document model and batch work remain | 18–27 | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 1d8737d55f..b6a216b636 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -267,7 +267,7 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de | 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; 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 | | 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 (twelve generated libraries including Tech Circuit, Arrows, 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) | +| Strokes, brushes, width profiles | 5 | 88% | Shift-double-click adjoining adjustment is implemented; brush libraries are done (thirteen generated libraries including Tech Circuit, Arrows, Artistic Brushes, 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) | | Appearance, transparency, graphic styles, masks | 5 | 97% | raster effect reach in preview bounds | 1–2 | estimated; Transform typing, sliders, preview, and undo are covered in `crates/ui-egui/src/panels/tests_appearance.rs` | | 3D and Materials (and Turntable) | 4 | ~25% | live Revolve with automatic smooth vector shading and default-on continuous circular caps, Extrude & Bevel (twist, taper, caps, five bevel shapes), Inflate and Rotate with Position presets (colored Inflate uses smooth membrane lighting; white-light Inflate retains its existing shading; Extrude & Bevel and Rotate retain planar shading; one to ten colored lights, shared neutral ambient, painter visibility); materials, light presets, shadows, ray tracing, the rest of 3D Classic (Map Art), Turntable views, textures, map art and shading in 3D export | 30–55 | estimated (Extrude & Bevel, Inflate and Rotate added 2026-10-12); every 3D seam has round joins (2026-11-12, [three-d.md](three-d.md#seams)), score, gaps and hours unchanged | | Type core | 9 | 80% | Auto-leading style resets are implemented; Hyphenation… and Justification… options are done (#2310, #2755), and a paragraph's Auto Leading also sets the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; remaining: Optical Margin Alignment, Middle Eastern features beyond bidi layout (the Middle Eastern & South Asian and Standard composers are done per paragraph, #4935; `.ai`/EPS/PDF files carry no composer), optional group font-size preservation; transformed character controls fixed (#1034), see [type-parity.md](type-parity.md) | 14–19 | estimated; eleven-language pattern hyphenation in both composers, with grapheme and shaping-cluster protection (#4947, `hyphen::tests` and `layout::wrapping_tests`); Sanskrit patterns pending an allowlisted source; recent-font groups in font pickers (#3515); full-name font matches regression-tested (#1258); mixed paragraph alignment indication implemented; headless regressions, full integration CI and visual review pass; localized legacy family-name fallback with loaded/catalog regressions (#2208); Fractional Widths per type object regression-tested; color emoji fonts with bitmap glyphs (`sbix`, `CBDT`) draw and export; threading ports: every selected area type and type on a path shows its in and out ports (empty, arrow, red "+"), and the Selection tool threads from either, the in port into a frame before it, and a double-click on a threaded port breaks the thread there (`threads::tests::break_splits_the_thread_and_the_story_flows_into_the_first_part`, `select::tests::a_double_click_on_a_threaded_port_breaks_the_thread`, `canvas::tests::a_double_click_on_a_threaded_out_port_breaks_the_thread`) (#2572; `select::tests::a_click_on_the_in_port_threads_into_a_frame_before_it`, `text::tests::selected_type_shows_its_ports_in_each_state`, `threads::tests::add_before_threads_the_story_from_the_new_frame_into_the_clicked_one`, live screenshot); the Glyphs panel highlights and scrolls to the character selected with the Type tool (#4908, `panels::glyphs` tests); the OpenType panel lists only `ss01`–`ss20` sets present in the selected font and uses its custom names when supplied; Type-range desktop Copy publishes styled art and keeps font family, size and color on canvas Paste after editing (#5636); paint-only Arabic harakat keep joining with conditional GDEF-mark ownership and Insert Kashidas base-letter paint (`tests::harakat`) | @@ -539,7 +539,7 @@ about 1–1.5 agent-hours each, so the other rows (estimated on the older scale) | Drawing tools | 7 | 86% | Eraser preserves fill when cutting fill-only open paths with fixed or varied tips or Alt-drag marquees; painted-stroke paths retain main behavior and clipping masks keep their remaining contours or empty geometry, with reproducible evaluated gradient placement preserved on ordinary paths, compounds, groups and layers (#6582); replacement-art effects, plug-ins/Rasterize, along/across strokes and placements that cannot be reproduced retain fitting; rough-square Shaper recognition and orientation steps corrected; editable Shaper Groups landed; Pencil: Alt key toggles to Smooth Tool (#2001); remaining: Shaper construction widget/gesture refinements, pencil and the remaining pen modifier nuances, Blob Brush Merge Only with Selection, Touch Type, Live Corners' Relative rounding | 7–12 | | Path operations, Pathfinder, Shape Builder, Live Paint | 5 | 86% | Live Paint gap options, Shape Builder gap detection, options (Tool Options dialog, clicking a stroke in merge mode) and Shift-drag marquee | 3–6 | | Colour, swatches, gradients, patterns, mesh, recolor | 7 | 96% | Picker Lab entry, picker libraries and Assign-row menus complete the deferred #4028 UI paths (#8031); scores and estimates unchanged; Library panels' lists (swatch, Color Book, brush, symbol and graphic style libraries) fill 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); freeform gradients in SVG/PDF and mixed spot/process gradients in SVG (exported as stops; PDF export keeps the spot inks in a DeviceN shading, except next to RGB or Lab stops; dithered fills and Perceptual gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve are written as images in process colors), pattern fills in Expand | 2–4; Eyedropper source reads regression-tested (#1251) | -| Strokes, brushes, width profiles | 5 | 90% | more built-in brush libraries (twelve generated in code including Tech Circuit, Arrows, Pressure Sensitive, Ink and Wash, Bristle Brushes, Game Trails, Energy Beams and Dry Media are done; Art brush Overlap and Pattern brush auto corners are done), pen pressure on macOS (the windowing layer reports none there), Stylus Wheel, tilt, bearing and rotation for Art, Pattern and Bristle brushes and on native Wayland and the web | 8–15 | +| Strokes, brushes, width profiles | 5 | 90% | more built-in brush libraries (thirteen generated in code including Tech Circuit, Arrows, Artistic Brushes, Pressure Sensitive, Ink and Wash, Bristle Brushes, Game Trails, Energy Beams and Dry Media are done; Art brush Overlap and Pattern brush auto corners are done), pen pressure on macOS (the windowing layer reports none there), Stylus Wheel, tilt, bearing and rotation for Art, Pattern and Bristle brushes and on native Wayland and the web | 8–15 | | Appearance, transparency, graphic styles, masks | 5 | 98% | Graphic Styles list fills a taller panel above its footer (#2992; scores and estimates unchanged); raster effect reach in preview bounds (flattener presets apply in PDF, EPS and print) | 1–2 | | Live vector effects | 5 | 85% | Outline Object, Pathfinder Hard/Soft Mix and Trap (since done: #3061, #3063, #3785), SVG Filters, Transform Patterns and Scale Strokes & Effects on a fill's or stroke's own Transform effect | 6–10 | | 3D and Materials | 4 | ~25% | Initial Revolve, Extrude & Bevel, Inflate and Rotate, with simple lighting; materials, light presets, shadows, ray tracing, Rotate (Classic), Map Art and more complete visibility remain | 25–45 | @@ -591,7 +591,7 @@ since 2026-10-01. | **Interaction fidelity:** modifiers, cursors, small behaviours | ~30–40% | The dedicated pass hasn't started, and there has been no side-by-side session with Illustrator yet. A power user notices this first | | **Look & feel** | ~75–80% | Measured against Illustrator 2026 screenshots (2026-10-02); the panels added since haven't been re-measured | | **File interop** | ~85% | SVG/SVGZ, PDF and PDF-compatible `.ai` (and legacy version 7 `.ai` out, keeping layers, groups and type as text), EPS, DXF, EMF/WMF, raster formats, PSD export and PSD/PSB placement (merged image), Place and Links, Package, Print, clipboard flavours. Affinity documents (Affinity 1–3) open natively as editable art, checked against 51 pinned public files (33 current `.af`), with selected saved-thumbnail comparisons and every-board native/SVG/PDF/PSD checks for current files; Affinity export is missing and effects, adjustments and brushes don't import. Affinity isn't an Illustrator feature, so this doesn't raise the parity score. The editing copy inside an Illustrator EPS or `.ai` is read for its structure: layers, groups, names, hidden objects and type, colours, gradients, transparency, images and every artboard (see Out of scope for what it doesn't read yet); DWG has no open spec | -| **Bundled content:** brush, symbol, style and swatch libraries | ~46% | Ours are original and generated in code, and far fewer than Illustrator ships; symbol libraries have six (Basic Shapes, UI Frames with default 9-slice, Map Markers, Inventory Icons, Skill Icons, Weather Icons), graphic style libraries eleven (including Game HUD, Status Effects and Neon & Glow) and brush libraries twelve (Art Ribbons, Ink and Wash, Calligraphic Nibs, Pressure Sensitive, Bristle Brushes, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media, Tech Circuit, Arrows) beside User Defined and Other Library… | +| **Bundled content:** brush, symbol, style and swatch libraries | ~46% | Ours are original and generated in code, and far fewer than Illustrator ships; symbol libraries have six (Basic Shapes, UI Frames with default 9-slice, Map Markers, Inventory Icons, Skill Icons, Weather Icons), graphic style libraries eleven (including Game HUD, Status Effects and Neon & Glow) and brush libraries thirteen (Art Ribbons, Ink and Wash, Calligraphic Nibs, Pressure Sensitive, Bristle Brushes, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media, Tech Circuit, Arrows, Artistic Brushes) beside User Defined and Other Library… | | **Performance** | unverified | Multithreaded, off-thread rendering and caches are in place. The last budget run (2026-10-01, loaded machine) measured 290 ms for a 50k-path fit against a 16 ms budget. Re-run `vectorcraft-cli perf` on an idle machine | | **Robustness** | good, new | ~2,840 tests, property tests, no panics in shipped code (lints, the `guard` safety net, import fuzzing), Data Recovery. Missing: a corpus of real-world files, Windows/Linux/browser QA | | **Platforms and 1.0 polish** | ~60% | The macOS app and the web build work, and Finder opens every readable format with the macOS app (#295, #354); on macOS the menus are in the system menu bar, laid out as a Mac app's, with the in-window menus as a fallback (`--in-window-menus`; verified on Windows and by cross-compilation, not yet by hand on a Mac); hybrid-graphics laptops render on the power-saving GPU by default on Windows and macOS (#306), and Windows starts on Direct3D 12, falling back to OpenGL, and loads no Vulkan driver unless `WGPU_BACKEND` asks for it (#545: Vulkan flickered black on an Intel GPU, DX12 and OpenGL didn't; #806: a faulty Vulkan driver crashed the app before its window appeared; verified by unit tests and the reporter's runs with `WGPU_BACKEND`), and Linux on the GPU the desktop runs on, since a Wayland compositor may refuse frames from the other one; a window that fails on its GPU while starting up starts again on the next one instead of crashing (#502; the dual-GPU Wayland case is verified by unit tests and cross-compilation, not on such hardware); web drops land in the document they were dropped on (#359); desktop drops carry no pointer position (winit 0.30), so a dropped document opens as a tab of its own and a picture or text is placed in the middle of the view, while the web places anything dropped on the canvas and opens what is dropped off it, as Illustrator does (#472); a web page that loses its WebGPU device or WebGL context restarts its graphics with the same documents (#369); on Linux/Wayland the clipboard reads the compositor's own (data-control) and copied image files paste, but files can't be dropped on the window under native Wayland until eframe moves to winit 0.31 (#398; the Wayland side is verified by compilation only), so Preferences › Performance › Linux Display Server › X11 (XWayland) opens the window through XWayland, where drops work (#1151; verified by unit tests and cross-compilation, not on a Wayland desktop); on Linux the Paste menu checks the system clipboard on a background thread, so a clipboard owner that never answers no longer freezes the window, while Windows and macOS keep their quick in-line check (#510; the X11 hang verified by the contributor, here by headless tests); on KDE Plasma 6.3+ under Wayland, pens and pen displays reach the app only under XWayland (`WAYLAND_DISPLAY=`) or with KWin's `KWIN_WAYLAND_EMULATE_TABLET=1`, since winit 0.30 has no Wayland tablet input (#491, not verified on hardware); Windows/Linux packaging and accessibility are pending | @@ -1186,7 +1186,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **Bristle Brushes library** ([What's new](https://helpx.adobe.com/illustrator/desktop/new-features/whats-new.html), [About brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html)): Window › Brush Libraries › Bristle Brushes holds ten bristle brushes, one for each tip shape (Fine Liner, Pointed Flat, Stubby Round, Dry Scrub, Soft Dome, Filbert, Angled Round, Angled Flat, Fan Blender, Grass Fan). The brushes, their names and their values are VectorCraft's own, and every value lies inside the range the bristle brush keeps (`brush.libraries`, `brush.addFromLibrary`; `the_bristle_brushes_library_covers_every_tip_shape_within_the_bristle_ranges`). - **Bristle strokes follow recorded pen input** ([brush documentation](https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=201)): a Bristle brush in VectorCraft widens its strand spread and thickness with pressure along the stroke; pen tilt changes the spread, and bearing and barrel rotation turn it in the path's local frame. Missing pen channels use neutral values, and mouse strokes keep their existing appearance. This is VectorCraft's own rendering model; hardware-specific output has not been verified. `bristle_pen_pressure_changes_its_footprint`, `bristle_pen_pressure_is_sampled_along_the_stroke`, `trimmed_bristle_strands_read_pressure_where_they_begin` and `bristle_pen_orientation_changes_its_footprint` cover the geometry in `crates/brush/src/tests.rs`; `bristle_path_keeps_and_draws_its_pen_pose` covers saving and export in `crates/engine/src/tests/brushsym.rs`; area scores unchanged. - **Tech Circuit library:** Circuit Trace is a chamfered art brush with 45-degree elbows and terminal pads; Bus Lines repeats three parallel conductor lanes; Terminal Nodes repeats solder pads, circular test points and connecting leads. Original vector geometry generated in code, with Tints colorization and continuous pattern tile edges. Evidence: `the_tech_circuit_library_constructs_adds_and_applies_each_brush` in `crates/engine/src/tests/brushlib.rs` covers listing, finite geometry on straight, curved, short and closed paths, add/apply, undo/redo, deduplication and saved-library round trips. G5 remaining estimate 3–13 h (estimated); area scores unchanged. - - **Artistic Brushes library** ([About brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html)): Window › Brush Libraries › Artistic Brushes offers Orbit Lines, Petal Garland, Lattice Braid and Facet Sweep; commands also accept Artistic as a lookup name. Each is original, editable vector artwork stretched along a path by an art brush and tinted by the stroke color. The public page names the category but does not specify its presets. Evidence: `artistic_library_strokes_are_editable_and_reopen_from_a_saved_library` in `crates/engine/src/tests/brushlib.rs` covers drawing on short and long paths, add/apply, undo and saving; `the_window_menu_and_the_brushes_panel_open_brush_libraries` covers the menu and panel. + - **Artistic Brushes library** ([About brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html)): Window › Brush Libraries › Artistic Brushes offers Orbit Lines, Petal Garland, Lattice Braid and Facet Sweep; the exact id `artistic` selects it, and commands accept Artistic as a lookup name for it when no library is named Artistic. Each is original, editable vector artwork stretched along a path by an art brush and tinted by the stroke color. The public page names the category but does not specify its presets. Evidence: `artistic_library_strokes_are_editable_and_reopen_from_a_saved_library` in `crates/engine/src/tests/brushlib.rs` covers drawing on short and long paths, add/apply, undo and saving; `the_window_menu_and_the_brushes_panel_open_brush_libraries` covers the menu and panel. - **Pressure Sensitive library** ([About brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html)): Window › Brush Libraries › Pressure Sensitive offers Flex Ribbon, Pulse Stroke, Round Flow and Chisel Flow. The first two are art brushes whose width follows recorded pen pressure; the other two are calligraphic nibs whose size follows it. They use the engine's existing pressure input where the device and platform deliver it, and a neutral width for a mouse path. These presets and names are VectorCraft's own. Evidence: `pressure_sensitive_brushes_widen_with_pen_pressure_and_survive_a_saved_library` in `crates/engine/src/tests/brushlib.rs` checks light and heavy pressure, short and curved paths, add/apply and saved-library reopening; `the_window_menu_and_the_brushes_panel_open_brush_libraries` covers opening and clicking from the UI. - **Dry Media library** ([help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html)): Window › Brush Libraries › Dry Media holds four art brushes with textured strokes like dry drawing materials, each 100 pt long: Chalk Grain (about 8 pt high), Graphite Pencil (about 2.3 pt), Wax Crayon (about 5.5 pt) and Charcoal Dust (about 7 pt). The brushes, their names, sizes and art are VectorCraft's own: each is filled vector paths from a fixed seed, at most 80 paths and 500 anchors, stretched along the path with Tints colorization, and the chalk and crayon art has even-odd gaps where the paper shows (`brush.libraries`, `brush.addFromLibrary`; `the_dry_media_library_holds_grainy_art_brushes_with_bounded_art`). - **Arrows library:** Window › Brush Libraries › Arrows holds five art brushes, each 100 pt long: Solid Arrow, Open Arrow (an outlined head), Double Arrow (a head at each end), Chevron Arrow (a second chevron on the shaft) and Dashed Arrow (five separate dashes and a head). Each brush stretches only the part between its guides, so the shaft follows the path's length and the heads keep their proportions, with Tints colorization. The brushes, their names and their art are VectorCraft's own, generated in code (`brush.libraries`, `brush.addFromLibrary`; `arrows_library_lists_renders_and_applies_original_brushes`, `dashed_arrow_keeps_separate_dashes_and_survives_library_save`). diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 64e6be0b94..960540bfb2 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -472,7 +472,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po | Info panel follows the tool in use: W and H show the change in x and y, with the distance and the angle, while the selection moves, the Gradient tool draws a vector or a Pen drag pulls out an anchor's handle; the Scale tool's percentages; the center and angles of a Rotate, Reflect or Shear tool drag; the Zoom tool's magnification; the Paintbrush's brush. W and H follow Use Preview Bounds, several selected objects show only the paint and type they share, and Show Options names a tint or a gradient swatch | done | `info.readout`; `Tool::readout`; behavior from the Info panel overview in the [archived user guide](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=76); number formats, the rows shown between drags and the Direct Selection and Group Selection readouts are VectorCraft's own | | Make Compound Path on a group (such as outlined type) keeps its backmost path's paint; compound paths joined into one keep their holes | done | #1537 | | Symbol libraries: Window › Symbol Libraries (Basic Shapes, UI Frames, Map Markers, Inventory Icons, Skill Icons, User Defined, Other Library…, Save Symbols…) and the Symbols panel's Symbol Libraries Menu button and its menu's Open Symbol Library / Save Symbol Library…; a click on a library symbol adds it to the document's Symbols (one undo step, it becomes the current symbol), Shift/Cmd-clicks select for Add to Symbols, and a symbol dragged onto the canvas is added and placed where it is dropped | done | [public source](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/create-or-import-symbol-libraries.html), [Symbols panel options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbols-panel-options.html), [placing from a library](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/create-and-place-symbols.html); `window.symbolLibrary`, `window.symbolLibrary.other`, `ui.saveSymbolLibrary` (dialog `saveSymbolLibrary`), `window.userSymbolLibrary1`…`10`; `panels::tests_symbol_libraries`; five built-in libraries (Basic Shapes, UI Frames with default 9-slice, Map Markers, Inventory Icons, Skill Icons; original, generated in code) | -| Brush libraries: Window › Brush Libraries (Art Ribbons, Ink and Wash, Calligraphic Nibs, Pressure Sensitive, Bristle Brushes, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media, Tech Circuit, Arrows, User Defined, Other Library…, Save Brushes…) and the Brushes panel's Brush Libraries Menu button and its menu's Open Brush Library / Save Brush Library…; a click on a library brush adds it to the document's Brushes (one undo step, it becomes the current brush, and selected paths take it in the same step), Shift/Cmd-clicks select for Add to Brushes, a brush dragged onto a path is added and applied to it and one dragged onto the Brushes panel is added; thumbnails render with the library's patterns and symbols | done | [public source](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/create-new-brush-libraries.html), [import brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/import-brushes-from-brush-libraries-or-other-files.html), [Brushes panel overview](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/brushes-panel-overview.html); `window.brushLibrary`, `window.brushLibrary.other`, `ui.saveBrushLibrary` (dialog `saveBrushLibrary`), `window.userBrushLibrary1`…`10`; `panels::tests_brush_libraries`; twelve built-in libraries (original, generated in code) | +| Brush libraries: Window › Brush Libraries (Art Ribbons, Ink and Wash, Calligraphic Nibs, Pressure Sensitive, Bristle Brushes, Pattern Borders, Scatter Shapes, Game Trails, Energy Beams, Dry Media, Tech Circuit, Arrows, Artistic Brushes, User Defined, Other Library…, Save Brushes…) and the Brushes panel's Brush Libraries Menu button and its menu's Open Brush Library / Save Brush Library…; a click on a library brush adds it to the document's Brushes (one undo step, it becomes the current brush, and selected paths take it in the same step), Shift/Cmd-clicks select for Add to Brushes, a brush dragged onto a path is added and applied to it and one dragged onto the Brushes panel is added; thumbnails render with the library's patterns and symbols | done | [public source](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/create-new-brush-libraries.html), [import brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/import-brushes-from-brush-libraries-or-other-files.html), [Brushes panel overview](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/brushes-panel-overview.html); `window.brushLibrary`, `window.brushLibrary.other`, `ui.saveBrushLibrary` (dialog `saveBrushLibrary`), `window.userBrushLibrary1`…`10`; `panels::tests_brush_libraries`; thirteen built-in libraries (original, generated in code) | | Brushes panel menu › Options of Selected Object…: changes the selected brushed paths' brush settings on those paths only, leaving the brush and its other strokes as they are; the brush type's options dialog opens without the Name row (and without an art brush's scale and direction options or a pattern brush's tiles), and OK sends only the values changed in it | done | [Modify brushes](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/modify-brushes.html), [Brushes panel overview](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/brushes-panel-overview.html); `brush.objectOptions`, `ui.brushObjectOptions`; which fields a path can set is VectorCraft's own choice (calligraphic, scatter, art and pattern brushes; not bristle); `options_of_selected_object_*` tests in `crates/engine/src/tests/brushsym.rs` and `crates/ui-egui/src/dialogs/brush_options/tests.rs`, brush tests in `crates/brush/src/tests.rs` | | Symbols panel: New Symbol opens Symbol Options (Name) before making the symbol; Alt-click skips it | partial | #1560 (#1566); Registration 9-point grid in Symbol Options (`symbol.new` / `symbol.place`); Export Type (Graphic / Movie Clip) and Enable Guides for 9-Slice Scaling (scaled instances keep their corners; in symbol editing mode the guides are drawn over the art and the Selection tool drags them); Symbol Type (Dynamic Symbol / Static Symbol, new symbols dynamic; #4938); Align to Pixel Grid (`alignToPixelGrid` on `symbol.new` / `symbol.options`: the art snaps at the symbol's natural size and instances at that size stay on whole points; [Aligning symbols to pixel grid](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=28)) | | Dynamic symbols: an instance changes the fill, stroke, opacity and blend of objects in its symbol's art and stays linked; Reset in the Properties panel's Quick Actions and the Symbols panel menu (Reset Symbol Instance) | partial | #4938; `symbol.instance.setAppearance` (by child-index path) and `symbol.instance.reset`; redefining keeps the changes, Break Link bakes them; Direct Selection of a path, compound path or type object inside an instance, with the Fill/Stroke controls setting its solid fill or stroke, is on canvas; on-canvas editing beyond a solid fill and stroke, and `.ai` read and write, remain | From 5fe226850d121d75067d466fd2e4284ca4ba6e27 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 16:21:28 -0800 Subject: [PATCH 31/55] Color Wheel: keep the OKLCH chroma search below the asked chroma The first chroma search in largest_fitting_chroma ran from 0 to 0.5 and could land on the line from black to blue above the chroma asked for. The result then fell back to the asked chroma, which lies outside sRGB, and from_oklch clipped it, changing the lightness and hue. The search now stops at the asked chroma, so the chroma it finds always fits. The parity doc now says color.convert's OKLCH matches the rows only for a color inside sRGB, since it clips the display RGB first. --- crates/color/src/oklab.rs | 17 +++++++++++++++-- docs/target-app-parity.md | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/crates/color/src/oklab.rs b/crates/color/src/oklab.rs index 018df4526d..1df3c4b1df 100644 --- a/crates/color/src/oklab.rs +++ b/crates/color/src/oklab.rs @@ -51,8 +51,8 @@ fn largest_fitting_chroma(l: f64, h: f64, limit: f64) -> f64 { return 0.0; } let fits = |c: f64| in_srgb(oklch_to_srgb(l, c, h)); - // The edge of the chromas from 0 that sRGB holds without a break. - let (mut lo, mut hi) = (0.0, 0.5); + // An edge of the chromas sRGB holds, searched no higher than `limit`, so `lo` always fits. + let (mut lo, mut hi) = (0.0, limit.min(0.5)); for _ in 0..40 { let mid = (lo + hi) / 2.0; if fits(mid) { lo = mid } else { hi = mid } @@ -201,6 +201,19 @@ mod tests { assert!((max_chroma(l, h) - c).abs() < 1e-4, "{} {c}", max_chroma(l, h)); } + /// Just below blue's lightness the line from black to blue passes a chroma of 0.3125, where a + /// search from 0 to 0.5 lands first. A chroma asked for below that line still gives a color + /// inside sRGB with the lightness and hue asked for. + #[test] + fn a_chroma_below_the_line_from_black_to_blue_stays_inside_srgb() { + let [bl, bc, h] = to_oklch([0.0, 0.0, 1.0]); + let l = bl * 0.3125 / bc; + let (rgb, lowered) = from_oklch(l, 0.29, h); + let [gl, gc, gh] = to_oklch(rgb); + assert!(lowered && gc < 0.29 && in_srgb(oklch_to_srgb(l, gc, h)), "{gc}"); + assert!((gl - l).abs() < 2e-3 && (gh - h).abs() < 1.0, "{gl} {gh}"); + } + /// sRGB channels below 0 go through the transfer curve with its sign turned, as CSS Color 4's /// extended sRGB does, in both directions. #[test] diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index ec41d91518..4a69666192 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1879,7 +1879,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - **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. - - **OKLCH Sliders (Color Wheel panel):** as VectorCraft's own addition, the Color Wheel panel's menu item OKLCH Sliders (`ui.colorWheel {sliders: "oklch"}`, kept with the preferences) shows L, C and H rows under the wheel or the box that edit the color by the OKLCH lightness (0 to 100 %), chroma (0 to 100 % of 0.4) and hue (0 to 360°) of its display sRGB, as CSS Color 4 defines them (https://www.w3.org/TR/css-color-4/#specifying-oklab-oklch). Each track dims the colors outside sRGB, and a tick on the C track marks the largest chroma sRGB holds at the row's L and H; a color outside sRGB keeps L and H and takes the largest chroma that fits, and the C row keeps the chroma asked for. The rows take the arrow keys after a click and report their names, values, ranges and adjust actions to screen readers. While the active document's RGB space (its assigned profile, else the working RGB space of Edit › Color Settings) is not sRGB, the unchecked item is gray and `ui.colorWheel {sliders: "oklch"}` answers an error; rows shown before the space changed are gray, and the checked item still hides them. `color.convert {color, to: "oklch"}` answers the same L, C and H. Evidence: `crates/color/src/oklab.rs` tests; `convert_to_oklch_answers_lightness_chroma_and_hue` in `crates/engine/src/tests/colormgmt.rs`; the OKLCH tests in `crates/ui-egui/src/panels/tests_color_wheel.rs`, `the_oklch_tracks_dim_the_colors_outside_srgb_and_the_tick_marks_the_largest_chroma` and `oklch_sliders_are_gray_after_the_working_space_changes` among them. Scores and estimates are unchanged. + - **OKLCH Sliders (Color Wheel panel):** as VectorCraft's own addition, the Color Wheel panel's menu item OKLCH Sliders (`ui.colorWheel {sliders: "oklch"}`, kept with the preferences) shows L, C and H rows under the wheel or the box that edit the color by the OKLCH lightness (0 to 100 %), chroma (0 to 100 % of 0.4) and hue (0 to 360°) of its display sRGB, as CSS Color 4 defines them (https://www.w3.org/TR/css-color-4/#specifying-oklab-oklch). Each track dims the colors outside sRGB, and a tick on the C track marks the largest chroma sRGB holds at the row's L and H; a color outside sRGB keeps L and H and takes the largest chroma that fits, and the C row keeps the chroma asked for. The rows take the arrow keys after a click and report their names, values, ranges and adjust actions to screen readers. While the active document's RGB space (its assigned profile, else the working RGB space of Edit › Color Settings) is not sRGB, the unchecked item is gray and `ui.colorWheel {sliders: "oklch"}` answers an error; rows shown before the space changed are gray, and the checked item still hides them. `color.convert {color, to: "oklch"}` answers the same L, C and H for a color inside sRGB. For a color outside sRGB, it clips the display RGB to 0 to 1 first, so its L, C and H can differ from the rows' values. Evidence: `crates/color/src/oklab.rs` tests; `convert_to_oklch_answers_lightness_chroma_and_hue` in `crates/engine/src/tests/colormgmt.rs`; the OKLCH tests in `crates/ui-egui/src/panels/tests_color_wheel.rs`, `the_oklch_tracks_dim_the_colors_outside_srgb_and_the_tick_marks_the_largest_chroma` and `oklch_sliders_are_gray_after_the_working_space_changes` among them. Scores and estimates are unchanged. - **HSL Sliders (Color Wheel panel):** as VectorCraft's own addition, the Color Wheel panel's menu item HSL Sliders (`ui.colorWheel {sliders: "hsl"}`, kept with the preferences) shows H, S and L rows in place of OKLCH Sliders that edit the color by the hue (0 to 360°), saturation and lightness (0 to 100 %) of its display sRGB, as CSS Color 4 defines HSL (https://www.w3.org/TR/css-color-4/#the-hsl-notation). A pick goes from display sRGB into the working RGB space as the wheel's picks do, and the rows keep the hue of a gray. The rows take the arrow keys after a click and report their names, values, ranges and adjust actions to screen readers. Evidence: `hsl_follows_css_color_4` and `hsl_roundtrip` in `crates/color/src/lib.rs`; the HSL tests in `crates/ui-egui/src/panels/tests_color_wheel.rs`, `a_gray_keeps_the_hsl_hue_it_was_given` among them. Scores and estimates are unchanged. - **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}`). From 6f3f373cd53002558580fb95efdfc6e2efa55b0f Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 16:43:12 -0800 Subject: [PATCH 32/55] Preferences: the Performance hover test covers Low-Latency Drawing On the desktop, the test now also hovers the Low-Latency Drawing row and checks that it shows its own sentence and no other row's. --- crates/ui-egui/src/prefs_dialog/tests.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/prefs_dialog/tests.rs b/crates/ui-egui/src/prefs_dialog/tests.rs index 92bc3a1ad1..41be96104e 100644 --- a/crates/ui-egui/src/prefs_dialog/tests.rs +++ b/crates/ui-egui/src/prefs_dialog/tests.rs @@ -2433,14 +2433,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")); } From 85d1dfc94b57cc1d03118906358990ce8f4ab00e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 17:02:26 -0800 Subject: [PATCH 33/55] Preferences: Default Language and Graphics Processor descriptions match the behavior Default Language now says it applies only while [Normal Character Style] sets no language. Graphics Processor now says the canvas is shown through the chosen processor while the artwork is drawn on the CPU, and that Automatic prefers the integrated one on Windows and macOS. The rows in all 28 catalogs follow. --- 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/gu.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/prefs_dialog/descriptions.rs | 4 ++-- 29 files changed, 58 insertions(+), 58 deletions(-) diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 6f23913011..dd151c4bb2 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -3145,7 +3145,7 @@ digits Malayalam Малаялам Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Прилепва края на линеен сегмент така, че да среща близък прав сегмент под прав ъгъл. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Показва номера на всяка отрязана част в каре в горния ѝ ляв ъгъл върху платното; когато е изключено, контурите на отрязаните части остават видими. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Цветът на контурите на потребителските и обектните отрязани части и на каретата с номерата им; автоматичните отрязани части използват по-блед нюанс на този цвят. - New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Новият текст получава този език, докато езикът в Настройка на документ е Английски: САЩ; текстът, който вече е в документа, запазва своя език. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 приставките в тази папка се зареждат при стартиране и когато щракнете върху ОК с нова папка тук, освен в Безопасен режим; уеб версията не ги зарежда. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. „Нормално“ запазва собствените ограничения на всеки плъгин; с „Голям“ филтър или команда на плъгин може да изпълни поне 250 милиона инструкции освен тези за входните си данни. Ограничението по време остава същото. @@ -3166,7 +3166,7 @@ digits Malayalam Малаялам The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. Езикът на интерфейса; Автоматично използва езика на системата. Диалоговият прозорец сменя езика веднага щом изберете някой. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. От следващото стартиране настолната версия показва платното чрез този вид графичен процесор; графиката винаги се рисува от централния процесор. „Автоматично“ предпочита интегрирания под Windows и macOS. Уеб версията не го използва. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. От следващото стартиране прозорецът показва всеки кадър, без да чака опресняването на дисплея, където графичният драйвер позволява, най-много 240 кадъра в секунда. 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. Показва как рисунката се променя, докато плъзгате; изключено, контурите следват плъзгането, а рисунката се променя, когато отпуснете. Помощна линия от линийката винаги се движи, докато плъзгате. diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 0b4da60954..3b7b1d5987 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -4606,7 +4606,7 @@ font-technology Variable Varijabilni Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Hvata kraj segmenta linije tako da pod pravim uglom susreće obližnji ravni segment. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Prikazuje broj svakog isječka u okviru u njegovom gornjem lijevom uglu na platnu; kada je isključeno, obrisi isječaka i dalje se prikazuju. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Boja obrisa korisničkih i objektnih isječaka i okvira s njihovim brojevima; automatski isječci koriste blijeđu nijansu te boje. - 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. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; type already in a document keeps its own language. Novi tekst dobija ovaj jezik dok je jezik u Postavkama dokumenta Engleski: SAD i [Normalni stil znakova] ne zadaje jezik; 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. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normalno zadržava vlastita ograničenja svakog dodatka; uz Veliko filter ili naredba dodatka može izvršiti najmanje 250 miliona instrukcija pored onih za svoj ulaz. Vremensko ograničenje ostaje isto. @@ -4627,7 +4627,7 @@ font-technology Variable Varijabilni The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. Jezik interfejsa; Automatski koristi jezik sistema. Dijalog mijenja jezik čim ga odaberete. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. Od sljedećeg pokretanja desktop verzija prikazuje platno preko ove vrste grafičkog procesora; crtež se u svakom slučaju iscrtava na CPU-u. Automatski daje prednost integrisanom na Windowsu i macOS-u. Web verzija ga ne koristi. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Od sljedećeg pokretanja prozor prikazuje svaki kadar bez čekanja na osvježavanje ekrana gdje grafički drajver to dozvoljava, najviše 240 kadrova u sekundi. 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. diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index ecb9b541cc..ae3c351be5 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -3987,7 +3987,7 @@ digits Malayalam Malaiàlam Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Ajusta l’extrem d’un segment de línia perquè trobi un segment recte proper en angle recte. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Mostra al llenç el número de cada tall en un requadre a la seva cantonada superior esquerra; si està desactivat, els contorns dels talls continuen visibles. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. El color dels contorns dels talls d’usuari i d’objecte i dels requadres amb el seu número; els talls automàtics fan servir un to més apagat d’aquest color. - 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. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 i [Estil de caràcter normal] no en defineixi cap; 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. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normal manté els límits propis de cada complement; amb Gran, un filtre o una ordre d’un complement pot executar com a mínim 250 milions d’instruccions a més de les de la seva entrada. El límit de temps no canvia. @@ -4008,7 +4008,7 @@ digits Malayalam Malaiàlam The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. La llengua de la interfície; Automàtic fa servir la llengua del sistema. El diàleg canvia de llengua tan bon punt en trieu una. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. A partir del pròxim inici, la versió d’escriptori mostra el llenç a través d’aquest tipus de processador gràfic; la il·lustració sempre es dibuixa a la CPU. Automàtic prefereix l’integrat a Windows i macOS. La versió web no l’utilitza. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. A partir del pròxim inici, la finestra mostra cada fotograma sense esperar el refresc de la pantalla quan el controlador gràfic ho permet, com a màxim 240 fotogrames per segon. 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. diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index ac7dace585..66a7c75a48 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4714,7 +4714,7 @@ font-technology Variable Variabilní Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Přichytí konec úsečky tak, aby se s blízkým rovným segmentem setkal v pravém úhlu. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Zobrazí na plátně číslo každého řezu v rámečku v jeho levém horním rohu; když je vypnuto, obrysy řezů zůstanou zobrazené. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Barva obrysů uživatelských a objektových řezů a rámečků s jejich čísly; automatické řezy používají tlumenější odstín této barvy. - 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. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; type already in a document keeps its own language. Nový text dostane tento jazyk, dokud je jazyk v Nastavení dokumentu Angličtina: USA a [Normální styl znaků] žádný jazyk neurčuje; 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á. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normální zachová vlastní limity každého zásuvného modulu; s volbou Velké může filtr nebo příkaz zásuvného modulu provést nejméně 250 milionů instrukcí navíc k těm pro svůj vstup. Časový limit zůstává stejný. @@ -4735,7 +4735,7 @@ font-technology Variable Variabilní The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. Jazyk rozhraní; Automaticky použije jazyk systému. Dialog přepne jazyk, jakmile nějaký zvolíte. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. Od příštího spuštění zobrazuje desktopová verze plátno přes tento druh grafického procesoru; kresba se v každém případě vykresluje na CPU. Automaticky dává ve Windows a macOS přednost integrovanému. Webová verze ho nepoužívá. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Od příštího spuštění okno zobrazuje každý snímek bez čekání na obnovení displeje, kde to grafický ovladač dovolí, nejvýše 240 snímků za sekundu. 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. diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 626fe13c1c..9948d479dd 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7138,7 +7138,7 @@ font-technology Variable Variable Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Fastgør enden af et linjesegment, så det møder et nærliggende lige segment i en ret vinkel. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Viser hvert udsnits nummer i en boks i dets øverste venstre hjørne på lærredet; når den er slået fra, vises udsnittenes konturer stadig. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Farven på konturerne af bruger- og objektudsnit og på boksene med deres numre; automatiske udsnit bruger en svagere nuance af den. - 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. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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, og [Normal tegnstil] ikke angiver et sprog; 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. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normal beholder hvert plug-ins egne grænser; med Stor kan et plug-in-filter eller en plug-in-kommando køre mindst 250 millioner instruktioner ud over dem til sit input. Tidsgrænsen forbliver den samme. @@ -7159,7 +7159,7 @@ font-technology Variable Variable The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. Brugergrænsefladens sprog; Auto bruger systemets sprog. Dialogen skifter sprog, så snart du vælger et. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. Fra næste start viser desktopversionen lærredet gennem denne type grafikprocessor; illustrationen tegnes altid på CPU'en. Automatisk foretrækker den integrerede på Windows og macOS. Webversionen bruger den ikke. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Fra næste start viser vinduet hvert billede uden at vente på skærmens opdatering, hvor grafikdriveren tillader det, højst 240 billeder i sekundet. 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. diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index b84b1b5336..a27d34cd74 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -3209,7 +3209,7 @@ digits Malayalam Malayalam Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Richtet das Ende eines Liniensegments so aus, dass es ein nahes gerades Segment im rechten Winkel trifft. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Zeigt auf der Arbeitsfläche die Nummer jedes Slices in einem Kästchen oben links im Slice; ist die Option aus, werden die Slice-Umrisse weiterhin angezeigt. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Die Farbe der Umrisse von Benutzer- und Objekt-Slices und ihrer Nummernkästchen; automatische Slices verwenden einen blasseren Ton davon. - 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. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; type already in a document keeps its own language. Neuer Text erhält diese Sprache, solange die Sprache unter „Dokument einrichten“ Englisch: USA ist und [Normales Zeichenformat] keine Sprache festlegt; 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. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. „Normal“ behält die eigenen Grenzen jedes Plug-ins; mit „Groß“ darf ein Plug-in-Filter oder -Befehl mindestens 250 Millionen Anweisungen zusätzlich zu denen für seine Eingabe ausführen. Das Zeitlimit bleibt gleich. @@ -3230,7 +3230,7 @@ digits Malayalam Malayalam The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. Die Sprache der Benutzeroberfläche; „Auto“ verwendet die Sprache des Systems. Der Dialog wechselt die Sprache, sobald Sie eine wählen. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. Ab dem nächsten Start zeigt die Desktop-Version die Zeichenfläche über diese Art von Grafikprozessor an; das Bildmaterial wird in jedem Fall auf der CPU gezeichnet. „Automatisch“ bevorzugt unter Windows und macOS den integrierten. Die Webversion verwendet sie nicht. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Ab dem nächsten Start zeigt das Fenster jedes Bild, ohne auf die Bildwiederholung des Bildschirms zu warten, wo der Grafiktreiber es zulässt, höchstens 240 Bilder pro Sekunde. 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. diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 0d61f8e196..d8b445e9ca 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -4064,7 +4064,7 @@ digits Malayalam Μαλαγιάλαμ Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Προσκολλά το άκρο ενός ευθύγραμμου τμήματος ώστε να συναντά ένα κοντινό ευθύ τμήμα σε ορθή γωνία. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Εμφανίζει στον καμβά τον αριθμό κάθε τομής σε ένα πλαίσιο πάνω αριστερά της· όταν είναι απενεργοποιημένο, τα περιγράμματα των τομών εξακολουθούν να εμφανίζονται. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Το χρώμα των περιγραμμάτων των τομών χρήστη και αντικειμένου και των πλαισίων με τους αριθμούς τους· οι αυτόματες τομές χρησιμοποιούν μια πιο αχνή απόχρωσή του. - New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Το νέο κείμενο παίρνει αυτήν τη γλώσσα όσο η γλώσσα στη Ρύθμιση εγγράφου είναι Αγγλικά: ΗΠΑ· το κείμενο που υπάρχει ήδη σε ένα έγγραφο κρατά τη δική του γλώσσα. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 δεν τα φορτώνει. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Το Κανονική διατηρεί τα δικά όρια κάθε επέκτασης· με το Μεγάλο, ένα φίλτρο ή μια εντολή επέκτασης μπορεί να εκτελέσει τουλάχιστον 250 εκατομμύρια εντολές επιπλέον εκείνων για την είσοδό του. Το χρονικό όριο μένει το ίδιο. @@ -4085,7 +4085,7 @@ digits Malayalam Μαλαγιάλαμ The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. Η γλώσσα του περιβάλλοντος χρήστη· το Αυτόματα χρησιμοποιεί τη γλώσσα του συστήματος. Ο διάλογος αλλάζει γλώσσα μόλις επιλέξετε μία. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. Από την επόμενη εκκίνηση, η έκδοση για υπολογιστή εμφανίζει τον καμβά μέσω αυτού του είδους επεξεργαστή γραφικών· το έργο σχεδιάζεται πάντα στη CPU. Το Αυτόματο προτιμά τον ενσωματωμένο σε Windows και macOS. Η έκδοση web δεν το χρησιμοποιεί. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Από την επόμενη εκκίνηση, το παράθυρο εμφανίζει κάθε καρέ χωρίς να περιμένει την ανανέωση της οθόνης, όπου το επιτρέπει το πρόγραμμα οδήγησης γραφικών, έως 240 καρέ το δευτερόλεπτο. 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. Δείχνει το έργο να αλλάζει όσο σύρετε· όταν είναι ανενεργό, περιγράμματα ακολουθούν τη μεταφορά και το έργο αλλάζει όταν αφήσετε. Ένας οδηγός χάρακα κινείται πάντα όσο σύρετε. diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index c7514f83ac..b577d2bdac 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -3246,7 +3246,7 @@ digits Malayalam Malayálam Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Ajusta el extremo de un segmento de línea para que encuentre un segmento recto cercano en ángulo recto. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Muestra en el lienzo el número de cada sector en un recuadro en su esquina superior izquierda; si está desactivado, los contornos de los sectores siguen visibles. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. El color de los contornos de los sectores de usuario y de objeto y de los recuadros con su número; los sectores automáticos usan un tono más apagado de ese color. - 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. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 y [Estilo de carácter normal] no defina ninguno; 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. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normal mantiene los límites propios de cada plugin; con Grande, un filtro o un comando de un plugin puede ejecutar al menos 250 millones de instrucciones además de las de su entrada. El límite de tiempo no cambia. @@ -3267,7 +3267,7 @@ digits Malayalam Malayálam The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. El idioma de la interfaz; Auto usa el idioma del sistema. El cuadro de diálogo cambia de idioma en cuanto elige uno. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. A partir del próximo inicio, la versión de escritorio muestra el lienzo a través de este tipo de procesador gráfico; la ilustración siempre se dibuja en la CPU. Automático prefiere el integrado en Windows y macOS. La versión web no lo usa. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. A partir del próximo inicio, la ventana muestra cada fotograma sin esperar la actualización de la pantalla cuando el controlador gráfico lo permite, con un máximo de 240 fotogramas por segundo. 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. diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index f849b11c90..157e1d9a5b 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4629,7 +4629,7 @@ font-technology Variable Muuttuvat Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Kohdistaa janan pään niin, että se kohtaa lähellä olevan suoran segmentin suorassa kulmassa. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Näyttää piirtopinnalla kunkin viipaleen numeron ruudussa sen vasemmassa yläkulmassa; kun asetus on pois päältä, viipaleiden ääriviivat näkyvät edelleen. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Käyttäjä- ja objektiviipaleiden ääriviivojen ja niiden numeroruutujen väri; automaattiset viipaleet käyttävät siitä himmeämpää sävyä. - 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ä. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; type already in a document keeps its own language. Uusi teksti saa tämän kielen, kun Asiakirjan asetusten kieli on Englanti: USA eikä [Normaali merkkityyli] määritä kieltä; 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ä. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normaali säilyttää kunkin laajennuksen omat rajat; Suuri-asetuksella laajennuksen suodin tai komento voi suorittaa vähintään 250 miljoonaa käskyä syötteensä käskyjen lisäksi. Aikaraja pysyy samana. @@ -4650,7 +4650,7 @@ font-technology Variable Muuttuvat The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. Käyttöliittymän kieli; Automaattinen käyttää järjestelmän kieltä. Valintaikkuna vaihtaa kielen heti, kun valitset sellaisen. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. Seuraavasta käynnistyksestä alkaen työpöytäversio näyttää piirtoalueen tämän tyyppisen grafiikkasuorittimen kautta; kuvitus piirretään joka tapauksessa suorittimella. Automaattinen suosii integroitua Windowsissa ja macOS:ssä. Verkkoversio ei käytä sitä. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Seuraavasta käynnistyksestä alkaen ikkuna näyttää jokaisen kuvan odottamatta näytön virkistystä, kun grafiikkaohjain sallii sen, enintään 240 kuvaa sekunnissa. 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. diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 5e639bf6f7..682219ee73 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -3234,7 +3234,7 @@ digits Malayalam Malayalam Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Aimante l’extrémité d’un segment de droite pour qu’il rencontre un segment droit proche à angle droit. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Affiche sur la zone de travail le numéro de chaque tranche dans un cadre en haut à gauche de la tranche. Désactivée, les contours des tranches restent affichés. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. La couleur des contours des tranches utilisateur et objet et de leurs cadres de numéro. Les tranches automatiques utilisent une nuance plus terne de cette couleur. - 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. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 et que [Style de caractère normal] n’en définit aucune. 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. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normal conserve les limites propres à chaque module externe. Avec Grand, un filtre ou une commande d’un module externe peut exécuter au moins 250 millions d’instructions en plus de celles de son entrée. La limite de temps reste la même. @@ -3255,7 +3255,7 @@ digits Malayalam Malayalam The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. La langue de l’interface. Auto utilise la langue du système. La boîte de dialogue change de langue dès que vous en choisissez une. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. À partir du prochain démarrage, la version de bureau affiche le canevas par ce type de processeur graphique. L’illustration est toujours dessinée par le processeur central. Automatique préfère le processeur intégré sous Windows et macOS. La version web ne l’utilise pas. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. À partir du prochain démarrage, la fenêtre affiche chaque image sans attendre le rafraîchissement de l’écran lorsque le pilote graphique le permet, au plus 240 images par seconde. 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. diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index ba155a8a7b..1c712e6433 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -3306,7 +3306,7 @@ Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. લાઇન સેગમેન્ટના છેડાને એ રીતે સ્નેપ કરે છે કે તે નજીકના સીધા સેગમેન્ટને કાટખૂણે મળે. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. કેનવાસ પર દરેક સ્લાઇસનો નંબર તેના ઉપરના ડાબા ખૂણે એક બૉક્સમાં બતાવે છે; બંધ હોય ત્યારે પણ સ્લાઇસની રૂપરેખાઓ દેખાય છે. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. યુઝર અને ઑબ્જેક્ટ સ્લાઇસની રૂપરેખાઓ અને તેમના નંબર બૉક્સનો રંગ; ઑટો સ્લાઇસ તેની ઝાંખી છાયા વાપરે છે. - New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. દસ્તાવેજ સેટઅપની ભાષા અંગ્રેજી: USA હોય ત્યાં સુધી નવા ટેક્સ્ટને આ ભાષા મળે છે; દસ્તાવેજમાં પહેલેથી રહેલું ટેક્સ્ટ પોતાની ભાષા રાખે છે. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 પ્લગ-ઇન્સ શરૂઆતમાં અને અહીં નવા ફોલ્ડર સાથે ઠીક પર ક્લિક કરો ત્યારે લોડ થાય છે, સેફ મોડ સિવાય; વેબ સંસ્કરણ તેમને લોડ કરતું નથી. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. સામાન્ય દરેક પ્લગ-ઇનની પોતાની મર્યાદાઓ રાખે છે; મોટું સાથે, પ્લગ-ઇન ફિલ્ટર અથવા આદેશ તેના ઇનપુટ માટેની સૂચનાઓ ઉપરાંત ઓછામાં ઓછી 250 મિલિયન સૂચનાઓ ચલાવી શકે છે. સમય મર્યાદા એ જ રહે છે. @@ -3327,7 +3327,7 @@ The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. ઇન્ટરફેસની ભાષા; ઑટો સિસ્ટમની ભાષા વાપરે છે. તમે ભાષા પસંદ કરો કે તરત જ ડાયલોગ તે ભાષામાં બદલાય છે. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. આગલી શરૂઆતથી, ડેસ્કટોપ સંસ્કરણ આ પ્રકારના ગ્રાફિક્સ પ્રોસેસર દ્વારા કેનવાસ બતાવે છે; આર્ટવર્ક હંમેશાં CPU પર દોરાય છે. સ્વચાલિત Windows અને macOS પર સંકલિત પ્રોસેસરને પસંદ કરે છે. વેબ સંસ્કરણ તેનો ઉપયોગ કરતું નથી. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. આગલી શરૂઆતથી, જ્યાં ગ્રાફિક્સ ડ્રાઇવર મંજૂરી આપે ત્યાં વિન્ડો ડિસ્પ્લેના રિફ્રેશની રાહ જોયા વિના દરેક ફ્રેમ બતાવે છે, સેકન્ડ દીઠ વધુમાં વધુ 240 ફ્રેમ. 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. તમે ખેંચો ત્યારે આર્ટ બદલાતી બતાવે છે; બંધ હોય ત્યારે, રૂપરેખાઓ ખેંચાણને અનુસરે છે અને તમે છોડો ત્યારે આર્ટ બદલાય છે. રૂલરની માર્ગદર્શિકા ખેંચતી વખતે હંમેશા ખસે છે. diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 9008d12152..15a09f26fb 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -4359,7 +4359,7 @@ antiAlias Sharp शार्प Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. लाइन सेगमेंट के सिरे को इस तरह स्नैप करता है कि वह पास के सीधे सेगमेंट से समकोण पर मिले। Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. कैनवास पर हर स्लाइस का नंबर उसके ऊपरी बाएँ कोने में एक बॉक्स में दिखाता है; बंद होने पर भी स्लाइस की आउटलाइन दिखती रहती हैं। The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. यूज़र और ऑब्जेक्ट स्लाइस की आउटलाइन और उनके नंबर बॉक्स का रंग; ऑटो स्लाइस इसकी हल्की छाया इस्तेमाल करते हैं। - New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. जब तक डॉक्यूमेंट सेटअप की भाषा अंग्रेज़ी: USA है, नए टेक्स्ट को यह भाषा मिलती है; डॉक्यूमेंट में पहले से मौजूद टेक्स्ट अपनी भाषा रखता है। + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 प्लग-इन शुरू होने पर और यहाँ नया फ़ोल्डर देकर ठीक है पर क्लिक करने पर लोड होते हैं, सुरक्षित मोड को छोड़कर; वेब संस्करण उन्हें लोड नहीं करता। Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. सामान्य हर प्लग-इन की अपनी सीमाएँ रखता है; बड़ा के साथ, प्लग-इन फ़िल्टर या कमांड अपने इनपुट के निर्देशों के अलावा कम से कम 250 मिलियन निर्देश चला सकता है। समय सीमा वही रहती है। @@ -4380,7 +4380,7 @@ antiAlias Sharp शार्प The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. इंटरफ़ेस की भाषा; स्वचालित सिस्टम की भाषा इस्तेमाल करता है। आप कोई भाषा चुनते ही डायलॉग उस भाषा में बदल जाता है। 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. अगली शुरुआत से, डेस्कटॉप संस्करण इस प्रकार के ग्राफ़िक्स प्रोसेसर के ज़रिए कैनवास दिखाता है; आर्टवर्क हमेशा CPU पर बनता है। स्वचालित Windows और macOS पर इंटीग्रेटेड प्रोसेसर को प्राथमिकता देता है। वेब संस्करण इसका उपयोग नहीं करता। From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. अगली शुरुआत से, जहाँ ग्राफ़िक्स ड्राइवर अनुमति देता है, विंडो डिस्प्ले के रीफ़्रेश की प्रतीक्षा किए बिना हर फ़्रेम दिखाती है, अधिकतम 240 फ़्रेम प्रति सेकंड। 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. खींचते समय आर्टवर्क को बदलते हुए दिखाता है; बंद होने पर, रूपरेखाएँ खींचने के साथ चलती हैं और छोड़ने पर आर्टवर्क बदलता है। रूलर गाइड खींचते समय हमेशा चलती है। diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 7e61422b68..fb367636b0 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3827,7 +3827,7 @@ mark-style Japanese Japán Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Egy szakasz végét úgy illeszti, hogy derékszögben találkozzon egy közeli egyenes szakasszal. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. A vásznon minden szelet számát egy keretben mutatja a szelet bal felső sarkában; kikapcsolva a szeletek körvonalai továbbra is látszanak. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. A felhasználói és objektumszeletek körvonalainak és számkereteinek színe; az automatikus szeletek ennek egy halványabb árnyalatát használják. - 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. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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, és a [Normál karakterstílus] nem ad meg nyelvet; 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. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. A Normál megtartja minden bővítmény saját korlátait; a Nagy beállítással egy bővítményszűrő vagy -parancs legalább 250 millió utasítást futtathat a bemenetéhez tartozókon felül. Az időkorlát nem változik. @@ -3848,7 +3848,7 @@ mark-style Japanese Japán The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. A felület nyelve; az Automatikus a rendszer nyelvét használja. A párbeszédablak azonnal nyelvet vált, amint választ egyet. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. A következő indítástól az asztali változat ilyen típusú grafikus processzoron keresztül jeleníti meg a vásznat; a grafikát minden esetben a CPU rajzolja. Az Automatikus Windowson és macOS-en az integráltat részesíti előnyben. A webes változat nem használja. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. A következő indítástól az ablak minden képkockát a kijelző frissítésének kivárása nélkül jelenít meg, ahol a grafikus illesztőprogram engedi, legfeljebb másodpercenként 240 képkockát. 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. diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 4bced5b609..3d32cb3dc9 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -4354,7 +4354,7 @@ font-technology Variable Variabel Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Menjepretkan ujung segmen garis agar bertemu segmen lurus di dekatnya pada sudut siku-siku. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Menampilkan nomor setiap irisan dalam kotak di sudut kiri atasnya di kanvas; saat nonaktif, garis tepi irisan tetap ditampilkan. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Warna garis tepi irisan pengguna dan objek serta kotak nomornya; irisan otomatis memakai nuansa yang lebih redup dari warna ini. - 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. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; type already in a document keeps its own language. Teks baru mendapat bahasa ini selama bahasa di Pengaturan dokumen adalah Inggris: USA dan [Gaya karakter normal] tidak menetapkan bahasa; 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. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normal mempertahankan batas setiap plug-in sendiri; dengan Besar, filter atau perintah plug-in dapat menjalankan setidaknya 250 juta instruksi selain instruksi untuk masukannya. Batas waktu tetap sama. @@ -4375,7 +4375,7 @@ font-technology Variable Variabel The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. Bahasa antarmuka; Otomatis menggunakan bahasa sistem. Dialog berganti bahasa begitu Anda memilih salah satunya. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. Mulai dari peluncuran berikutnya, versi desktop menampilkan kanvas melalui jenis prosesor grafis ini; karya seni selalu digambar di CPU. Otomatis mengutamakan prosesor terintegrasi di Windows dan macOS. Versi web tidak menggunakannya. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Mulai dari peluncuran berikutnya, jendela menampilkan setiap bingkai tanpa menunggu penyegaran layar jika driver grafis mengizinkan, paling banyak 240 bingkai per detik. 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. diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 182c8bed1b..56c65dcf2e 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -3294,7 +3294,7 @@ digits Malayalam Malayalam Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Aggancia l’estremità di un segmento di linea in modo che incontri un segmento rettilineo vicino ad angolo retto. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Mostra sull’area di lavoro il numero di ogni sezione in un riquadro nel suo angolo in alto a sinistra; se è disattivata, i contorni delle sezioni restano visibili. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Il colore dei contorni delle sezioni utente e oggetto e dei riquadri con il loro numero; le sezioni automatiche usano una tonalità più tenue di questo colore. - 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. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; type already in a document keeps its own language. Il nuovo testo prende questa lingua finché la lingua di Imposta documento è Inglese: Stati Uniti e [Stile carattere normale] non ne imposta una; 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. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normale mantiene i limiti propri di ogni plug-in; con Grande, un filtro o un comando di un plug-in può eseguire almeno 250 milioni di istruzioni oltre a quelle per il suo input. Il limite di tempo resta invariato. @@ -3315,7 +3315,7 @@ digits Malayalam Malayalam The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. La lingua dell'interfaccia; Auto usa la lingua del sistema. La finestra di dialogo cambia lingua appena ne scegli una. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. Dal prossimo avvio, la versione desktop mostra la tela tramite questo tipo di processore grafico; la grafica viene sempre disegnata sulla CPU. Automatico preferisce quello integrato su Windows e macOS. La versione web non lo usa. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Dal prossimo avvio, la finestra mostra ogni fotogramma senza attendere l’aggiornamento dello schermo dove il driver grafico lo consente, al massimo 240 fotogrammi al secondo. 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. diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 790d37556a..ff46a03e4f 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -3278,7 +3278,7 @@ mark-style Japanese 日本式 Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. 直線セグメントの端を、近くの直線セグメントと直角に交わるようにスナップします。 Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. カンバス上で、各スライスの番号をスライスの左上のボックスに表示します。オフでもスライスの輪郭は表示されます。 The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. ユーザースライスとオブジェクトスライスの輪郭、およびその番号のボックスの色です。自動スライスにはこの色の淡い色合いが使われます。 - New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. ドキュメント設定の言語が英語 (米国) の間は、新しいテキストにこの言語が設定されます。ドキュメント内の既存のテキストは自身の言語を保ちます。 + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 版では読み込まれません。 Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. 通常では各プラグイン自身の制限が使われます。大では、プラグインのフィルターやコマンドは入力のための命令に加えて少なくとも 2 億 5000 万命令を実行できます。時間の制限は変わりません。 @@ -3299,7 +3299,7 @@ mark-style Japanese 日本式 The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. インターフェイスの言語です。自動ではシステムの言語を使います。言語を選ぶとすぐにダイアログの表示が切り替わります。 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. 次回の起動から、デスクトップ版はこの種類のグラフィックプロセッサーを通してカンバスを表示します。アートワーク自体は常に CPU で描画されます。自動では Windows と macOS で内蔵のものが優先されます。Web 版では使われません。 From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. 次回の起動から、グラフィックドライバーが許す場合、ウィンドウはディスプレイのリフレッシュを待たずに各フレームを表示します。最大で毎秒 240 フレームです。 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. ドラッグ中にアートワークが変わる様子を表示します。オフの場合、ドラッグ中はアウトラインが動き、ボタンを離すとアートワークが変わります。定規ガイドはドラッグ中も常に動きます。 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 77dea1b73c..f5f963a94e 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6426,7 +6426,7 @@ font-technology Variable ცვლადი Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. ხაზის სეგმენტის ბოლოს ისე აბამს, რომ ახლომდებარე სწორ სეგმენტს მართი კუთხით შეხვდეს. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. ტილოზე თითოეული ნაჭრის ნომერს აჩვენებს ჩარჩოში მის ზედა მარცხენა კუთხეში; გამორთულისას ნაჭრების კონტურები კვლავ ჩანს. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. მომხმარებლისა და ობიექტის ნაჭრების კონტურებისა და მათი ნომრების ჩარჩოების ფერი; ავტომატური ნაჭრები ამ ფერის უფრო მკრთალ ელფერს იყენებს. - New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. ახალი ტექსტი იღებს ამ ენას, სანამ დოკუმენტის პარამეტრების ენაა ინგლისური: აშშ; დოკუმენტში უკვე არსებული ტექსტი ინარჩუნებს თავის ენას. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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-ს დააწკაპუნებთ, გარდა უსაფრთხო რეჟიმისა; ვებ-ვერსია მათ არ ტვირთავს. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. ჩვეულებრივი ინარჩუნებს თითოეული პლაგინის საკუთარ ლიმიტებს; დიდით პლაგინის ფილტრს ან ბრძანებას შეუძლია შეასრულოს მინიმუმ 250 მილიონი ინსტრუქცია მისი შეყვანისთვის საჭირო ინსტრუქციების გარდა. დროის ლიმიტი იგივე რჩება. @@ -6447,7 +6447,7 @@ font-technology Variable ცვლადი The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. ინტერფეისის ენა; ავტომატური სისტემის ენას იყენებს. დიალოგი ენას იცვლის, როგორც კი რომელიმეს აირჩევთ. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. შემდეგი გაშვებიდან დესკტოპის ვერსია ტილოს აჩვენებს ამ ტიპის გრაფიკული პროცესორით; ნამუშევარი ყოველთვის CPU-ზე იხატება. ავტომატური Windows-სა და macOS-ზე ინტეგრირებულს ანიჭებს უპირატესობას. ვებ-ვერსია მას არ იყენებს. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. შემდეგი გაშვებიდან ფანჯარა აჩვენებს თითოეულ კადრს ეკრანის განახლების მოლოდინის გარეშე, სადაც გრაფიკული დრაივერი ამის საშუალებას იძლევა, წამში არაუმეტეს 240 კადრისა. 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. აჩვენებს, როგორ იცვლება ნახატი გადათრევისას; გამორთულისას კონტურები მისდევს გადათრევას, ნახატი კი ხელის აშვებისას იცვლება. სახაზავის დამხმარე ხაზი გადათრევისას ყოველთვის მოძრაობს. diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 139310089f..cf360f0631 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3267,7 +3267,7 @@ mark-style Japanese 일본식 Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. 선 세그먼트의 끝을 가까운 직선 세그먼트와 직각으로 만나도록 스냅합니다. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. 캔버스에서 각 슬라이스의 번호를 왼쪽 위의 상자에 표시합니다. 끄더라도 슬라이스 윤곽선은 계속 표시됩니다. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. 사용자 슬라이스와 개체 슬라이스의 윤곽선 및 번호 상자의 색상입니다. 자동 슬라이스에는 이 색상의 더 흐린 색조가 사용됩니다. - New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. 문서 설정의 언어가 영어: 미국인 동안 새 텍스트는 이 언어를 받습니다. 문서에 이미 있는 텍스트는 자체 언어를 유지합니다. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 플러그인이 시작할 때와 여기에 새 폴더를 지정하고 확인을 클릭할 때 로드됩니다(안전 모드 제외). 웹 버전은 로드하지 않습니다. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. 표준은 각 플러그인 자체의 제한을 유지합니다. 크게에서는 플러그인 필터나 명령이 입력에 필요한 명령어 외에 최소 2억 5천만 개의 명령어를 실행할 수 있습니다. 시간 제한은 그대로입니다. @@ -3288,7 +3288,7 @@ mark-style Japanese 일본식 The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. 인터페이스의 언어입니다. 자동은 시스템 언어를 사용합니다. 언어를 고르면 대화 상자가 바로 그 언어로 바뀝니다. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. 다음 시작부터 데스크톱 버전은 이 종류의 그래픽 프로세서를 통해 캔버스를 표시합니다. 아트워크는 항상 CPU에서 그려집니다. 자동은 Windows와 macOS에서 내장 프로세서를 우선합니다. 웹 버전은 사용하지 않습니다. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. 다음 시작부터 그래픽 드라이버가 허용하는 경우 창은 디스플레이 새로 고침을 기다리지 않고 각 프레임을 표시하며, 초당 최대 240프레임입니다. 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. 드래그하는 동안 아트가 바뀌는 모습을 보여 줍니다. 끄면 윤곽선이 드래그를 따라가고 놓을 때 아트가 바뀝니다. 눈금자 안내선은 드래그하는 동안 항상 움직입니다. diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index f9f506146b..d9d1908571 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -5011,7 +5011,7 @@ font-technology Variable Variabel Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Lijnt het einde van een lijnsegment zo uit dat het een recht segment in de buurt onder een rechte hoek raakt. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Toont op het canvas het nummer van elke slice in een vakje linksboven in de slice; staat dit uit, dan blijven de omtrekken van de slices zichtbaar. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. De kleur van de omtrekken van gebruikers- en objectslices en van hun nummervakjes; automatische slices gebruiken een vagere tint ervan. - 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. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; type already in a document keeps its own language. Nieuwe tekst krijgt deze taal zolang de taal in Documentinstellingen Engels: VS is en [Normale tekenstijl] geen taal instelt; 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. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normaal behoudt de eigen limieten van elke plug-in; met Groot mag een filter of opdracht van een plug-in ten minste 250 miljoen instructies uitvoeren naast die voor de invoer. De tijdslimiet blijft gelijk. @@ -5032,7 +5032,7 @@ font-technology Variable Variabel The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. De taal van de gebruikersinterface; Automatisch gebruikt de taal van het systeem. Het dialoogvenster wisselt van taal zodra u er een kiest. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. Vanaf de volgende start toont de desktopversie het canvas via dit soort grafische processor; de illustratie wordt hoe dan ook op de CPU getekend. Automatisch kiest op Windows en macOS bij voorkeur de geïntegreerde. De webversie gebruikt het niet. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Vanaf de volgende start toont het venster elk beeld zonder op de verversing van het beeldscherm te wachten, waar het grafische stuurprogramma dat toestaat, met hoogstens 240 beelden per seconde. 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. diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index a6d0b8d436..29fd4521bc 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4557,7 +4557,7 @@ font-technology Variable Zmienne Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Przyciąga koniec odcinka tak, aby spotykał pobliski prosty segment pod kątem prostym. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Pokazuje na obszarze roboczym numer każdego plasterka w ramce w jego lewym górnym rogu; po wyłączeniu kontury plasterków nadal są widoczne. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Kolor konturów plasterków użytkownika i obiektów oraz ramek z ich numerami; plasterki automatyczne używają bledszego odcienia tego koloru. - 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. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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, a [Normalny styl znakowy] nie określa języka; 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. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normalny zachowuje własne limity każdej wtyczki; przy ustawieniu Duże filtr lub polecenie wtyczki może wykonać co najmniej 250 milionów instrukcji oprócz tych na swoje dane wejściowe. Limit czasu pozostaje bez zmian. @@ -4578,7 +4578,7 @@ font-technology Variable Zmienne 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. Od następnego uruchomienia wersja na komputer wyświetla obszar roboczy przez ten rodzaj procesora graficznego; kompozycja jest zawsze rysowana na CPU. Automatycznie w systemach Windows i macOS wybiera najpierw zintegrowany. Wersja internetowa go nie używa. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Od następnego uruchomienia okno wyświetla każdą klatkę bez czekania na odświeżenie ekranu, jeśli pozwala na to sterownik grafiki, najwyżej 240 klatek na sekundę. 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 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. diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 8549ba3165..2a335f5965 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2731,7 +2731,7 @@ digits Malayalam Malaiala Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Ajusta a extremidade de um segmento de linha para que encontre um segmento reto próximo em ângulo reto. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Mostra na tela o número de cada fatia em uma caixa no canto superior esquerdo dela; quando desativado, os contornos das fatias continuam visíveis. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. A cor dos contornos das fatias de usuário e de objeto e das caixas com seus números; as fatias automáticas usam um tom mais apagado dessa cor. - 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. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 e o [Estilo de Caractere Normal] não definir nenhum; 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. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normal mantém os limites próprios de cada plug-in; com Grande, um filtro ou comando de plug-in pode executar pelo menos 250 milhões de instruções além das de sua entrada. O limite de tempo continua o mesmo. @@ -2752,7 +2752,7 @@ digits Malayalam Malaiala The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. O idioma da interface; Automático usa o idioma do sistema. A caixa de diálogo troca de idioma assim que você escolhe um. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. A partir da próxima inicialização, a versão para desktop mostra a área de desenho por meio deste tipo de processador gráfico; a arte é sempre desenhada na CPU. Automático prefere o integrado no Windows e no macOS. A versão web não o usa. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. A partir da próxima inicialização, a janela mostra cada quadro sem esperar a atualização da tela quando o driver gráfico permite, no máximo 240 quadros por segundo. 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. diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 91557357f1..03f985d0cd 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -3276,7 +3276,7 @@ digits Malayalam Малаялам Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Привязывает конец отрезка так, чтобы он встречал ближайший прямой сегмент под прямым углом. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Показывает на холсте номер каждого фрагмента в рамке в его левом верхнем углу; если параметр выключен, контуры фрагментов по-прежнему видны. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Цвет контуров пользовательских и объектных фрагментов и рамок с их номерами; автоматические фрагменты используют более бледный оттенок этого цвета. - New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Новый текст получает этот язык, пока в «Параметрах документа» выбран язык Английский: США; текст, который уже есть в документе, сохраняет свой язык. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 из этой папки загружаются при запуске и при нажатии ОК с новой папкой здесь, кроме безопасного режима; веб-версия их не загружает. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. «Обычный» сохраняет собственные ограничения каждого модуля; с «Большой» фильтр или команда модуля может выполнить не менее 250 миллионов инструкций сверх тех, что нужны для её входных данных. Ограничение по времени не меняется. @@ -3297,7 +3297,7 @@ digits Malayalam Малаялам The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. Язык интерфейса; «Авто» использует язык системы. Диалог переключает язык, как только вы выбираете один из них. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. Со следующего запуска настольная версия выводит холст через этот тип графического процессора; сама графика всегда рисуется на ЦП. «Автоматически» в Windows и macOS предпочитает встроенный. Веб-версия его не использует. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Со следующего запуска окно показывает каждый кадр, не дожидаясь обновления дисплея, если графический драйвер это позволяет, не более 240 кадров в секунду. 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. Показывает, как меняется графика, пока вы тянете; если выключено, за перетаскиванием следуют контуры, а графика меняется, когда вы отпускаете. Направляющая с линейки всегда движется при перетаскивании. diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 491fbc317b..0fdeb55c49 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -3170,7 +3170,7 @@ digits Malayalam Malayalam Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Fäster änden av ett linjesegment så att det möter ett närliggande rakt segment i rät vinkel. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Visar varje skivas nummer i en ruta i dess övre vänstra hörn på arbetsytan; när det är avstängt visas skivornas konturer fortfarande. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Färgen på konturerna för användar- och objektskivor och på deras nummerrutor; automatiska skivor använder en blekare nyans av den. - 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. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 och [Normal teckenstil] inte anger något språk; 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. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normal behåller varje plugins egna gränser; med Stor får ett pluginfilter eller ett pluginkommando köra minst 250 miljoner instruktioner utöver dem för sin indata. Tidsgränsen förblir densamma. @@ -3191,7 +3191,7 @@ digits Malayalam Malayalam The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. Gränssnittets språk; Auto använder systemets språk. Dialogrutan byter språk så fort du väljer ett. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. Från nästa start visar skrivbordsversionen arbetsytan genom den här typen av grafikprocessor; teckningen ritas alltid på processorn (CPU). Automatisk föredrar den integrerade på Windows och macOS. Webbversionen använder den inte. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Från nästa start visar fönstret varje bildruta utan att vänta på skärmens uppdatering där grafikdrivrutinen tillåter det, högst 240 bildrutor per sekund. 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. diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index cff4cc9823..99b6a5d54e 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -3013,7 +3013,7 @@ digits Malayalam Malayalam Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Bir çizgi parçasının ucunu yakındaki düz bir parçayla dik açıyla buluşacak şekilde yaslar. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Tuvalde her dilimin numarasını sol üst köşesindeki bir kutuda gösterir; kapalıyken dilimlerin dış çizgileri görünmeye devam eder. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Kullanıcı ve nesne dilimlerinin dış çizgilerinin ve numara kutularının rengi; otomatik dilimler bu rengin daha soluk bir tonunu kullanır. - 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. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; type already in a document keeps its own language. Belge Kurulumu'nun dili İngilizce: ABD olduğu ve [Normal Karakter Stili] bir dil belirlemediği 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. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normal, her eklentinin kendi sınırlarını korur; Büyük ile bir eklenti filtresi veya komutu, girdisi için olanlara ek olarak en az 250 milyon talimat çalıştırabilir. Süre sınırı aynı kalır. @@ -3034,7 +3034,7 @@ digits Malayalam Malayalam The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. Arayüzün dili; Otomatik, sistemin dilini kullanır. İletişim kutusu, bir dil seçer seçmez o dile geçer. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. Bir sonraki başlatmadan itibaren masaüstü sürümü tuvali bu tür grafik işlemci üzerinden gösterir; çizim her durumda CPU'da yapılır. Otomatik, Windows ve macOS'ta tümleşik işlemciyi tercih eder. Web sürümü bunu kullanmaz. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Bir sonraki başlatmadan itibaren pencere, grafik sürücüsünün izin verdiği yerde ekranın yenilenmesini beklemeden her kareyi gösterir; saniyede en fazla 240 kare. 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. diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index faf3a797a8..68b499b60f 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -3286,7 +3286,7 @@ digits Malayalam Малаялам Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Прив’язує кінець відрізка так, щоб він зустрічав найближчий прямий сегмент під прямим кутом. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Показує на полотні номер кожного фрагмента в рамці в його лівому верхньому куті; коли параметр вимкнено, контури фрагментів і далі видно. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Колір контурів користувацьких і об’єктних фрагментів та рамок з їхніми номерами; автоматичні фрагменти використовують блідіший відтінок цього кольору. - New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. Новий текст отримує цю мову, доки в «Параметрах документа» вибрано мову Англійська: США; текст, який уже є в документі, зберігає свою мову. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 з цієї папки завантажуються під час запуску і коли ви натискаєте ОК з новою папкою тут, крім безпечного режиму; веб-версія їх не завантажує. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. «Звичайний» зберігає власні обмеження кожного модуля; з «Великий» фільтр або команда модуля може виконати щонайменше 250 мільйонів інструкцій понад ті, що потрібні для її вхідних даних. Обмеження часу не змінюється. @@ -3307,7 +3307,7 @@ digits Malayalam Малаялам The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. Мова інтерфейсу; «Авто» використовує мову системи. Діалог перемикає мову, щойно ви її виберете. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. З наступного запуску настільна версія показує полотно через цей тип графічного процесора; саму графіку завжди малює центральний процесор. «Автоматично» у Windows і macOS надає перевагу вбудованому. Веб-версія його не використовує. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. З наступного запуску вікно показує кожен кадр, не чекаючи оновлення дисплея, якщо графічний драйвер це дозволяє, не більше 240 кадрів на секунду. 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. Показує, як змінюється графіка, поки ви тягнете; якщо вимкнено, за перетягуванням стежать контури, а графіка змінюється, коли ви відпускаєте. Напрямна з лінійки завжди рухається під час перетягування. diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 8f27a5670f..9f94411aff 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3602,7 +3602,7 @@ mark-style Japanese Kiểu Nhật Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. Hút đầu mút của đoạn thẳng để nó gặp một đoạn thẳng ở gần theo góc vuông. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Hiển thị trên khung vẽ số của mỗi lát cắt trong một ô ở góc trên bên trái của nó; khi tắt, đường viền của các lát cắt vẫn hiện. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Màu của đường viền lát cắt người dùng và lát cắt đối tượng cùng các ô số của chúng; lát cắt tự động dùng một sắc độ nhạt hơn của màu này. - 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ó. + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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à [Kiểu ký tự thường] không đặt ngôn ngữ nào; 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. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Thường giữ giới hạn riêng của từng plug-in; với Lớn, một bộ lọc hoặc lệnh của plug-in có thể chạy ít nhất 250 triệu lệnh ngoài các lệnh cho dữ liệu đầu vào của nó. Giới hạn thời gian vẫn giữ nguyên. @@ -3623,7 +3623,7 @@ mark-style Japanese Kiểu Nhật The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. Ngôn ngữ của giao diện; Tự động dùng ngôn ngữ của hệ thống. Hộp thoại đổi ngôn ngữ ngay khi bạn chọn một ngôn ngữ. 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. Từ lần khởi động tới, phiên bản máy tính hiển thị khung vẽ qua loại bộ xử lý đồ họa này; tác phẩm luôn được vẽ trên CPU. Tự động ưu tiên bộ xử lý tích hợp trên Windows và macOS. Phiên bản web không dùng nó. From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. Từ lần khởi động tới, cửa sổ hiển thị từng khung hình mà không chờ màn hình làm mới khi trình điều khiển đồ họa cho phép, tối đa 240 khung hình mỗi giây. 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. diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 09b656b486..552755a857 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -3143,7 +3143,7 @@ digits Malayalam 马拉雅拉姆数字 Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. 吸附线段的端点,使其与附近的直线段成直角相交。 Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. 在画布上于每个切片左上角的方框中显示其编号;关闭时,切片轮廓仍会显示。 The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. 用户切片和对象切片的轮廓及其编号方框的颜色;自动切片使用此颜色较淡的色调。 - New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. 当文档设置的语言为英语:美国时,新文字使用此语言;文档中已有的文字保留自己的语言。 + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 版不会载入它们。 Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. “正常”保留每个增效工具自身的限制;选择“大”时,增效工具的滤镜或命令除处理其输入所需的指令外,至少可运行 2.5 亿条指令。时间限制不变。 @@ -3164,7 +3164,7 @@ digits Malayalam 马拉雅拉姆数字 The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. 界面的语言;“自动”使用系统的语言。选择一种语言后,对话框会立即切换到该语言。 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. 从下次启动起,桌面版通过这类图形处理器显示画布;图稿始终在 CPU 上绘制。“自动”在 Windows 和 macOS 上优先使用集成图形处理器。Web 版不使用此项。 From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. 从下次启动起,在图形驱动程序允许时,窗口显示每一帧而不等待显示器刷新,最多每秒 240 帧。 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. 拖动时显示图稿的变化;关闭此项后,由轮廓跟随拖动,松开后图稿才改变。标尺参考线在拖动时总是跟着移动。 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 67b667ef8c..d5152b9452 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -4492,7 +4492,7 @@ digits Malayalam 馬來亞拉姆數字 Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. 靠齊線段的端點,使其與附近的直線段成直角相交。 Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. 在畫布上於每個切片左上角的方框中顯示其編號;關閉時,切片輪廓仍會顯示。 The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. 使用者切片和物件切片的輪廓及其編號方框的顏色;自動切片使用此顏色較淡的色調。 - New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language. 當文件設定的語言為英文:美國時,新文字使用此語言;文件中已有的文字保留自己的語言。 + New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 增效模組會在啟動時以及在此指定新資料夾並按一下「確定」時載入,安全模式除外;網頁版不會載入它們。 Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. 「正常」保留每個增效模組自身的限制;選擇「大」時,增效模組的濾鏡或命令除處理其輸入所需的指令外,至少可執行 2.5 億條指令。時間限制不變。 @@ -4513,7 +4513,7 @@ digits Malayalam 馬來亞拉姆數字 The language of the interface; Auto uses the system's language. The dialog switches language as soon as you choose one. 介面的語言;「自動」使用系統的語言。選擇一種語言後,對話方塊會立即切換為該語言。 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 desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it. 從下次啟動起,桌面版透過這類圖形處理器顯示畫布;圖稿一律在 CPU 上繪製。「自動」在 Windows 和 macOS 上優先使用內建圖形處理器。網頁版不使用此選項。 From the next start, the window shows each frame without waiting for the display's refresh where the graphics driver allows, at most 240 frames a second. 從下次啟動起,在圖形驅動程式允許時,視窗顯示每一影格而不等待顯示器重新整理,最多每秒 240 影格。 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. 拖曳時顯示圖稿的變化;關閉此選項時,由外框跟隨拖曳,放開後圖稿才改變。尺標參考線在拖曳時總是跟著移動。 diff --git a/crates/ui-egui/src/prefs_dialog/descriptions.rs b/crates/ui-egui/src/prefs_dialog/descriptions.rs index 7a18d87888..8098b4237a 100644 --- a/crates/ui-egui/src/prefs_dialog/descriptions.rs +++ b/crates/ui-egui/src/prefs_dialog/descriptions.rs @@ -224,7 +224,7 @@ pub(crate) const DESCRIPTIONS: &[(&str, &str)] = &[ // Hyphenation ( "hyphenationLanguage", - "New type takes this language while Document Setup's language is English: USA; type already in a document keeps its own language.", + "New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; type already in a document keeps its own language.", ), ( "hyphenationExceptions", @@ -275,7 +275,7 @@ 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.", + "From the next start, the desktop version shows the canvas through this kind of graphics processor; the artwork is drawn on the CPU either way. Automatic prefers the integrated one on Windows and macOS. The web version does not use it.", ), ( "lowLatencyDrawing", From 9ff55c19c63b4125655840b9081e6e56c3d19821 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 22:52:01 -0800 Subject: [PATCH 34/55] Part of #5941: drop-down lists show every option when the window has room A drop-down list stopped at the room on one side of its field, so a window with room for the whole list still cut it short: the Export As Format list showed 18 of its 20 formats at 1280x900 and 17 at 1000x856. The list now opens in a popup of its own. It opens below its field when it fits there, above it when it fits there instead, and otherwise moves up from below into the window, over its field. A list taller than the window scrolls, and the current option still opens in view. The field is drawn in the same look, with the same tooltip for a value cut short and the same role for screen readers. --- crates/ui-egui/src/dialogs/tests_export.rs | 113 ++++++++++++++-- crates/ui-egui/src/widgets.rs | 2 + crates/ui-egui/src/widgets/dropdowns.rs | 150 ++++++++++++++++++--- crates/ui-egui/src/widgets/look_tests.rs | 87 +++++++++++- 4 files changed, 316 insertions(+), 36 deletions(-) diff --git a/crates/ui-egui/src/dialogs/tests_export.rs b/crates/ui-egui/src/dialogs/tests_export.rs index c0eccbc56d..51258fbfa9 100644 --- a/crates/ui-egui/src/dialogs/tests_export.rs +++ b/crates/ui-egui/src/dialogs/tests_export.rs @@ -259,11 +259,12 @@ fn the_format_list_shows_its_scroll_bar_at_rest_and_opens_with_the_chosen_format _ => {} } } - let labels: Vec<&str> = export_as::formats().iter().map(|f| f.label).collect(); // A built-in format six from the end of the built-in ones: out of view when the list opens at // its top, and far enough from the end that a plug-in format another test adds after the - // built-in ones does not move the rows shown around it. + // built-in ones does not move the rows shown around it. The window is short enough that the + // list centered on it stops short of its end. let built_in: Vec<_> = fileio::FORMATS.iter().filter(|f| f.write && !matches!(f.id, "vectorcraft" | "ai")).collect(); + let labels: Vec<&str> = built_in.iter().map(|f| f.label).collect(); let chosen = built_in.len().checked_sub(6).and_then(|i| built_in.get(i)).copied().expect("Export As lists formats"); let (mut app, _) = app(1); app.run("file.exportAs", json!({"format": chosen.id})).unwrap(); @@ -272,31 +273,38 @@ fn the_format_list_shows_its_scroll_bar_at_rest_and_opens_with_the_chosen_format theme::apply(&ctx, Default::default()); // Every scroll area takes the bar at rest from the theme, whatever style the list sets itself. assert_eq!(ctx.global_style().spacing.scroll, crate::widgets::list_scroll_style()); - let screen_rect = Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1024.0, 480.0))); + let screen_rect = Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1024.0, 280.0))); let mut time = 0.0; + let popup = std::cell::RefCell::new(vec![]); + // The texts and bars painted on the open list (without the dialog under it), and every text. let mut run = |app: &mut VectorcraftApp, events: Vec| { time += 0.25; - let mut out = ctx.run_ui(egui::RawInput { screen_rect, events, time: Some(time), ..Default::default() }, |ui| show(app, ui.ctx())); + let mut out = ctx.run_ui(egui::RawInput { screen_rect, events, time: Some(time), ..Default::default() }, |ui| { + show(app, ui.ctx()); + popup.replace(crate::widgets::top_popup_shapes(ui.ctx())); + }); out.textures_delta.clear(); - let (mut texts, mut bars) = (vec![], vec![]); - out.shapes.iter().for_each(|c| walk(&c.shape, c.clip_rect, &mut texts, &mut bars)); - (texts, bars) + let (mut texts, mut bars, mut all) = (vec![], vec![], vec![]); + popup.take().iter().for_each(|c| walk(&c.shape, c.clip_rect, &mut texts, &mut bars)); + out.shapes.iter().for_each(|c| walk(&c.shape, c.clip_rect, &mut all, &mut vec![])); + (texts, bars, all) }; let away = egui::Event::PointerMoved(egui::pos2(1.0, 1.0)); run(&mut app, vec![away.clone()]); - let (texts, _) = run(&mut app, vec![]); + let (_, _, texts) = run(&mut app, vec![]); let field = texts.iter().find(|(s, ..)| s == chosen.label).map(|(_, r, _)| r.center()).expect("the Format field shows the chosen format"); let click_at = |pos, pressed| egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; // Opens the list, moves the pointer away and returns the list's rect, the format names drawn in // it with their clip rects, and the bars drawn. - type Run<'r> = dyn FnMut(&mut VectorcraftApp, Vec) -> (Vec<(String, egui::Rect, egui::Rect)>, Vec) + 'r; + type Texts = Vec<(String, egui::Rect, egui::Rect)>; + type Run<'r> = dyn FnMut(&mut VectorcraftApp, Vec) -> (Texts, Vec, Texts) + 'r; let open = |run: &mut Run<'_>, app: &mut VectorcraftApp| { run(app, vec![egui::Event::PointerMoved(field), click_at(field, true)]); run(app, vec![click_at(field, false)]); run(app, vec![away.clone()]); let (mut texts, mut bars) = (vec![], vec![]); for _ in 0..4 { - (texts, bars) = run(app, vec![]); + (texts, bars, _) = run(app, vec![]); } let list = ctx .memory(|m| { @@ -334,11 +342,13 @@ fn the_format_list_shows_its_scroll_bar_at_rest_and_opens_with_the_chosen_format run(&mut app, vec![wheel]); let mut scrolled = vec![]; for _ in 0..4 { - (scrolled, _) = run(&mut app, vec![]); + (scrolled, ..) = run(&mut app, vec![]); } let scrolled: Vec<_> = scrolled.into_iter().filter(|(s, r, _)| labels.contains(&s.as_str()) && list.contains_rect(*r)).collect(); - run(&mut app, vec![egui::Event::PointerMoved(field), click_at(field, true)]); - run(&mut app, vec![click_at(field, false)]); + // Escape closes it: a list taller than the room beside its field covers the field. + let escape = |pressed| egui::Event::Key { key: egui::Key::Escape, physical_key: None, pressed, repeat: false, modifiers: Default::default() }; + run(&mut app, vec![escape(true)]); + run(&mut app, vec![escape(false)]); let (_, reopened, _) = open(&mut run, &mut app); if rows.len() < labels.len() { assert_ne!(tops(&scrolled), tops(&rows), "the wheel scrolled the list"); @@ -347,6 +357,83 @@ fn the_format_list_shows_its_scroll_bar_at_rest_and_opens_with_the_chosen_format assert!(whole(&reopened, chosen.label), "the chosen format shows whole: {:?}", tops(&reopened)); } +/// #5941: the Format list stopped at the room on one side of its field, so a window with room for +/// every format still cut the list short. In windows of 1280×900 and 1000×856 the list shows every +/// built-in format whole, the greyed-out DWG row after them included, inside the window, without a +/// scroll bar. A plug-in format that another test adds or removes meanwhile is not counted. +#[test] +fn the_format_list_shows_every_format_when_the_window_has_room() { + fn walk(shape: &egui::Shape, clip: egui::Rect, texts: &mut Vec<(String, egui::Rect, egui::Rect)>, bars: &mut Vec) { + match shape { + egui::Shape::Text(t) => texts.push((t.galley.text().into(), t.visual_bounding_rect(), clip)), + egui::Shape::Rect(r) if r.fill.a() > 0 && r.rect.width() <= 8.0 && r.rect.height() > 40.0 => bars.push(r.rect), + egui::Shape::Vec(v) => v.iter().for_each(|s| walk(s, clip, texts, bars)), + _ => {} + } + } + let labels: Vec<&str> = + fileio::FORMATS.iter().filter(|f| f.write && !matches!(f.id, "vectorcraft" | "ai")).map(|f| f.label).chain(["DWG (use DXF)"]).collect(); + for (width, height) in [(1280.0, 900.0), (1000.0, 856.0)] { + let case = format!("{width}×{height}"); + let (mut app, _) = app(1); + app.run("file.exportAs", json!({"format": "png"})).unwrap(); + let ctx = egui::Context::default(); + theme::install_fonts(&ctx); + theme::apply(&ctx, Default::default()); + let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(width, height)); + let mut time = 0.0; + let popup = std::cell::RefCell::new(vec![]); + // The texts and bars painted on the open list (without the dialog under it), and every text. + let mut run = |app: &mut VectorcraftApp, events: Vec| { + time += 0.25; + let mut out = ctx.run_ui(egui::RawInput { screen_rect: Some(screen), events, time: Some(time), ..Default::default() }, |ui| { + show(app, ui.ctx()); + popup.replace(crate::widgets::top_popup_shapes(ui.ctx())); + }); + out.textures_delta.clear(); + let (mut texts, mut bars, mut all) = (vec![], vec![], vec![]); + popup.take().iter().for_each(|c| walk(&c.shape, c.clip_rect, &mut texts, &mut bars)); + out.shapes.iter().for_each(|c| walk(&c.shape, c.clip_rect, &mut all, &mut vec![])); + (texts, bars, all) + }; + let away = egui::Event::PointerMoved(egui::pos2(1.0, 1.0)); + run(&mut app, vec![away.clone()]); + let (_, _, all) = run(&mut app, vec![]); + let field = all.iter().find(|(s, ..)| s == "PNG").map(|(_, r, _)| r.center()).expect("the Format field shows PNG"); + let click = |pressed| egui::Event::PointerButton { pos: field, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + run(&mut app, vec![egui::Event::PointerMoved(field), click(true)]); + run(&mut app, vec![click(false)]); + run(&mut app, vec![away.clone()]); + let list_rect = || { + ctx.memory(|m| { + m.layer_ids().filter(|l| l.order == egui::Order::Foreground && m.areas().is_visible(l)).last().and_then(|l| m.area_rect(l.id)) + }) + }; + // A plug-in format that another test installs or removes changes the list's height, and the + // list is placed for its new height on the pass after. Read it once it keeps its rect. + let (mut texts, mut bars, mut list) = (vec![], vec![], None); + for _ in 0..12 { + (texts, bars, _) = run(&mut app, vec![]); + let now = list_rect(); + if now.is_some() && now == list { + break; + } + list = now; + } + let list = list.expect("the Format list is open"); + assert!(screen.contains_rect(list), "{case}: the list {list:?} is inside the window"); + let whole: Vec<&str> = labels + .iter() + .copied() + .filter(|name| { + texts.iter().any(|(s, r, clip)| s == name && list.contains_rect(*r) && r.top() >= clip.top() && r.bottom() <= clip.bottom()) + }) + .collect(); + assert_eq!(whole, labels, "{case}: every format shows whole in {list:?}"); + assert!(bars.is_empty(), "{case}: a list that shows every format draws no scroll bar: {bars:?}"); + } +} + #[test] fn svg_continues_in_svg_options() { let (mut app, written) = app(2); diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index d6a0f7c50e..0187050f75 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -49,6 +49,8 @@ pub use drag::{ }; #[cfg(test)] use dropdowns::combo_button_id; +#[cfg(test)] +pub(crate) use dropdowns::top_popup_shapes; pub(crate) use dropdowns::{combo, combo_menu, combo_menu_field_named, combo_named, field_focused_in, menu_min_width, popover_is_open}; pub use dropdowns::{ dropdown, dropdown_icon_names, dropdown_icon_names_sized, dropdown_named, dropdown_names, dropdown_names_named, dropdown_with, diff --git a/crates/ui-egui/src/widgets/dropdowns.rs b/crates/ui-egui/src/widgets/dropdowns.rs index 50d99b81f8..2ea0f48276 100644 --- a/crates/ui-egui/src/widgets/dropdowns.rs +++ b/crates/ui-egui/src/widgets/dropdowns.rs @@ -149,9 +149,10 @@ fn option_row<'a>(ui: &mut Ui, enabled: bool, selected: bool, atoms: impl egui:: response } -/// The id [`craft_ui::ComboBox::from_id_salt`] gives its button in this `Ui`: `from_id_salt` -/// stores `IdSalt::new(salt)` and hashes it once more with the scope, so the app must hash `id` -/// the same way to read the button's focus and open state before it is drawn. +/// The id of the button of [`combo_atoms_named`] in this `Ui`, the one +/// [`craft_ui::ComboBox::from_id_salt`] gives its button: `from_id_salt` stores +/// `IdSalt::new(salt)` and hashes it once more with the scope. The app reads the button's focus and +/// open state with it before the button is drawn. pub(super) fn combo_button_id(ui: &Ui, id: &impl std::hash::Hash) -> egui::Id { ui.make_persistent_id(egui::IdSalt::new(HashOnly(id))) } @@ -206,9 +207,8 @@ fn combo_atoms_named<'a, R>( if opening { ui.data_mut(|d| d.insert_temp(opened_key, pass)); } - // The menu measures itself against the whole screen on the pass it opens and takes - // the room beside its field on the next one, so the current option is scrolled into - // view on both. + // The list is laid out unseen to measure it on the pass it opens and placed on the + // next one, so the current option is scrolled into view on both. let settling = ui.data(|d| d.get_temp::(opened_key)).is_some_and(|p| pass <= p + 1); // A list drawn inside this one's rows finds its own record, and this one's comes back after it. let outer = if settling { OPENING.replace(Some(Opening::default())) } else { OPENING.take() }; @@ -238,22 +238,14 @@ fn combo_atoms_named<'a, R>( chosen }; let enter_for_combo = ui.memory(|m| m.has_focus(button_id)) || craft_ui::ComboBox::is_open(ui.ctx(), button_id); - let max_height = (ui.ctx().content_rect().height() - MENU_GAP).max(ui.spacing().combo_height); - let response = craft_ui::ComboBox::from_id_salt(HashOnly(&id)) - .selected_text(current) - .width(width - 4.0) - .height(max_height) - .popup_style(egui::style::StyleModifier::new(|style| { - egui::containers::menu::menu_style(style); - style.spacing.scroll = list_scroll_style(); - })) - .show_ui(ui, list); + let response = combo_button(ui, button_id, current, width - 4.0); + let shown = combo_list(ui, &response, list); // The button or open list handles Enter before the modal can accept it. if enter_for_combo { ui.input_mut(|i| i.consume_key(egui::Modifiers::NONE, egui::Key::Enter)); } - let _ = name_field(label_field(response.response.clone(), label), name); - let chosen = response.inner.flatten(); + let _ = name_field(label_field(response, label), name); + let chosen = shown.flatten(); // egui closes the list on a click of the pointer only: an option picked with Space or // Enter closes it here, and the combo gives the keyboard back, so that Enter reaches the // dialog's OK (#2789). @@ -266,6 +258,128 @@ fn combo_atoms_named<'a, R>( .inner } +/// The button of [`combo_atoms_named`] with the id `button_id`, at least `width` wide, showing +/// `current`: [`craft_ui::ComboBox`]'s button, with its look, its tooltip for a value cut short and +/// its role for screen readers. It is drawn here so that its list opens in [`combo_list`]. +fn combo_button<'a>(ui: &mut Ui, button_id: egui::Id, current: impl egui::IntoAtoms<'a>, width: f32) -> Response { + use egui::class::HasClasses as _; + use egui::{AtomExt as _, NumExt as _}; + let open = egui::Popup::is_id_open(ui.ctx(), button_id.with("popup")); + let mut classes = egui::class::Classes::default(); + classes.add_class(craft_ui::ComboBox::CLASS); + classes.set_class(craft_ui::ComboBox::CLASS_OPEN, open); + let egui::widget_style::ButtonStyle { atom_layout } = ui.widget_style(button_id, &classes); + let visuals = if open { + ui.visuals().widgets.open + } else if let Some(response) = ui.ctx().read_response(button_id) { + *ui.style().interact(&response) + } else { + ui.visuals().widgets.inactive + }; + let min_size = vec2(width, 0.0).at_least(atom_layout.min_size); + let current = current.into_atoms(); + let text = current.text().map(String::from).unwrap_or_default(); + let rtl = ui.style().right_to_left; + // The combo box's arrow: a downward triangle. + let arrow = egui::Atom::paint(Vec2::splat(ui.spacing().icon_width), move |ui, args| { + let rect = args.rect.expand(visuals.expansion); + let rect = Rect::from_center_size(rect.center(), vec2(rect.width() * 0.7, rect.height() * 0.45)); + ui.painter().add(egui::Shape::rotated_triangle(rect, 0.0, visuals.fg_stroke.color)); + }) + .atom_grow(true) + .atom_align(if rtl { egui::Align2::LEFT_CENTER } else { egui::Align2::RIGHT_CENTER }); + let button = atom_layout + .apply( + egui::WidgetAtom::new((current, arrow)) + .id(button_id) + .sense(Sense::click()) + .fallback_font(egui::TextStyle::Button) + .wrap_mode(ui.wrap_mode()) + .direction(if rtl { egui::Direction::RightToLeft } else { egui::Direction::LeftToRight }), + ) + .min_size(min_size) + .measure(ui, ui.available_size()); + let elided = button.container.iter_texts().any(|galley| galley.elided); + let response = button.allocate(ui).paint(ui).response; + // A value cut short shows in full on hover, as a truncated `Label`'s does. + let response = if elided { + response.on_hover_ui(|ui| { + ui.set_max_width(ui.spacing().tooltip_width); + ui.add(egui::Label::new(text.as_str()).wrap()); + }) + } else { + response + }; + response.widget_info(|| egui::WidgetInfo { + enabled: ui.is_enabled(), + current_text_value: Some(text.clone()), + ..egui::WidgetInfo::new(egui::Role::ComboBox) + }); + response +} + +/// The list of [`combo_atoms_named`] while it is open, drawn by `list` in a popup of its own that +/// opens from `button` and takes the whole list whenever the window has room for it (#5941): below +/// the button when it fits there, above it when it fits there instead, and otherwise shifted from +/// below into the window, over the button. A list taller than the window scrolls. Returns what +/// `list` returned, or `None` while the list is closed. +fn combo_list(ui: &Ui, button: &Response, list: impl FnOnce(&mut Ui) -> R) -> Option { + let ctx = ui.ctx(); + let id = button.id.with("popup"); + let style = egui::style::StyleModifier::new(|style| { + egui::containers::menu::menu_style(style); + style.spacing.scroll = list_scroll_style(); + }); + let popup = + egui::Popup::menu(button).id(id).width(button.rect.width()).style(style.clone()).close_behavior(egui::PopupCloseBehavior::CloseOnClick); + let screen = ctx.content_rect(); + // The room on each side of the rect the popup opens from: the part of the button in view. + let anchor = popup.get_anchor_rect().unwrap_or(button.rect); + let below = screen.bottom() - anchor.bottom(); + let above = anchor.top() - screen.top(); + // The list's size from its last pass: egui lays a popup out unseen on the pass it opens, so the + // list is measured before it is placed. A right-to-left layout lines the list up with the + // button's right edge, as egui's menus do. + let rtl = ctx.global_style().right_to_left; + let align = match popup.get_expected_size() { + Some(size) if size.y > below && size.y <= above => { + if rtl { + egui::RectAlign::TOP_END + } else { + egui::RectAlign::TOP_START + } + } + // egui keeps a popup inside the window, so a list too tall for either side moves up. + _ if rtl => egui::RectAlign::BOTTOM_END, + _ => egui::RectAlign::BOTTOM_START, + }; + let mut popup_style = (*ctx.global_style()).clone(); + style.apply(&mut popup_style); + let frame = egui::Frame::popup(&popup_style).total_margin().sum().y; + let height = (screen.height() - frame).max(ui.spacing().interact_size.y); + let shown = popup.align(align).align_alternatives(&[]).show(|ui| { + ui.set_min_width(ui.available_width()); + // A popup offers its contents the height it had on its last pass; the list is offered the + // window's instead. + ui.set_max_height(height); + // Labels widen a narrow list rather than wrap, as in egui's combo box. + ui.style_mut().wrap_mode = Some(egui::TextWrapMode::Extend); + egui::ScrollArea::vertical().max_height(height).show(ui, list).inner + }); + if shown.is_some() { + ctx.accesskit_node_builder(id, |node| node.set_role(egui::Role::ListBox)); + } + shown.map(|r| r.inner) +} + +/// The shapes painted so far in this pass on the topmost popup that was shown in the last one, such +/// as an open dropdown list, without what lies under it. Read at the end of a test's UI. +#[cfg(test)] +pub(crate) fn top_popup_shapes(ctx: &egui::Context) -> Vec { + let top = ctx.memory(|m| m.layer_ids().filter(|l| l.order == egui::Order::Foreground && m.areas().is_visible(l)).last()); + top.map_or_else(Vec::new, |layer| ctx.graphics(|g| g.get(layer).map(|p| p.all_entries().cloned().collect()).unwrap_or_default())) +} + /// The recessed combo box of [`dropdown`] showing `current`, whose menu keeps a search field and /// filters in place over a list that scrolls (the font menu and the shortcut import's target /// picker, #555). `menu` shows the menu with one of [`craft_ui::combo::Menu`]'s header forms and diff --git a/crates/ui-egui/src/widgets/look_tests.rs b/crates/ui-egui/src/widgets/look_tests.rs index 47d8e41a91..13ee6ebd58 100644 --- a/crates/ui-egui/src/widgets/look_tests.rs +++ b/crates/ui-egui/src/widgets/look_tests.rs @@ -133,10 +133,13 @@ fn a_dropdown_in_a_short_window_opens_with_its_current_option_in_view() { for (height, above, current) in [(260.0, 117.0, 19), (260.0, 117.0, 10), (180.0, 77.0, 10), (180.0, 77.0, 3)] { let ctx = themed(Default::default()); let field = std::cell::Cell::new(Rect::NOTHING); + let popup = std::cell::RefCell::new(vec![]); let mut add = |ui: &mut Ui| { ui.add_space(above); field.set(ui.horizontal(|ui| dropdown_names(ui, "short-list", labels[current], &labels, 160.0)).response.rect); + popup.replace(super::top_popup_shapes(ui.ctx())); }; + // The shapes of the open list, without the field under it. let mut run = |time: f64, events: Vec| { let raw = egui::RawInput { time: Some(time), @@ -146,7 +149,7 @@ fn a_dropdown_in_a_short_window_opens_with_its_current_option_in_view() { }; let mut out = ctx.run_ui(raw, &mut add); out.textures_delta.clear(); - out.shapes + popup.take() }; run(0.0, vec![]); let at = field.get().center(); @@ -206,6 +209,7 @@ fn own_rows_reopen(height: f32, above: f32, wheel: f32, row: &str) { let ctx = themed(Default::default()); let field = std::cell::Cell::new(Rect::NOTHING); let current = std::cell::RefCell::new(String::from("Row 00")); + let popup = std::cell::RefCell::new(vec![]); let mut add = |ui: &mut Ui| { ui.add_space(above); let shown = current.borrow().clone(); @@ -224,8 +228,10 @@ fn own_rows_reopen(height: f32, above: f32, wheel: f32, row: &str) { current.replace(items[i].clone()); } field.set(r.response.rect); + popup.replace(super::top_popup_shapes(ui.ctx())); }; let mut time = 0.0; + // The shapes of the open list, without the field under it. let mut run = |events: Vec| { time += 0.1; let raw = egui::RawInput { @@ -236,7 +242,7 @@ fn own_rows_reopen(height: f32, above: f32, wheel: f32, row: &str) { }; let mut out = ctx.run_ui(raw, &mut add); out.textures_delta.clear(); - out.shapes + popup.take() }; // The rows that show whole, with their tops: inside the open list and the clip they are painted // in. @@ -298,10 +304,12 @@ fn own_rows_reopen(height: f32, above: f32, wheel: f32, row: &str) { } let scrolled = rows(clipped); assert!(has(&scrolled, row), "{case}: the wheel scrolls {row} into view: {scrolled:?}"); - // Closed and opened again twice: each time its rows are where they were when it closed. + // Closed and opened again twice: each time its rows are where they were when it closed. Escape + // closes it: a list taller than the room beside its field covers the field. + let escape = |pressed| egui::Event::Key { key: egui::Key::Escape, physical_key: None, pressed, repeat: false, modifiers: Default::default() }; for time in ["first", "second"] { - run(vec![egui::Event::PointerMoved(at), press(true)]); - run(vec![press(false)]); + run(vec![escape(true)]); + run(vec![escape(false)]); run(vec![]); let reopened = rows(open(&mut run)); assert_eq!(reopened, scrolled, "{case}: the list opens again where it was scrolled, the {time} time"); @@ -894,6 +902,75 @@ fn a_long_dropdown_uses_window_room_and_shows_its_scroll_bar_when_clipped() { assert!(has_scroll_bar, "the overflowing dropdown draws its scroll bar without hover in {popup:?}"); } +// #5941: a drop-down list stopped at the room on one side of its field, so a window with room for +// the whole list still cut it short. The list opens below its field when it fits there, above it +// when it fits there instead, and otherwise moves up from below into the window over its field; +// each time every option shows whole, inside the window. +#[test] +fn a_dropdown_list_shows_every_option_when_the_window_has_room() { + let items: Vec = (0..20).map(|i| format!("Option {i:02}")).collect(); + let labels: Vec<&str> = items.iter().map(String::as_str).collect(); + // (window height, space above the field, where the list goes) + for (height, above, side) in [(700.0, 16.0, "below"), (700.0, 650.0, "above"), (640.0, 300.0, "over")] { + let case = format!("{height} pt window, field {above} pt down"); + let ctx = themed(Default::default()); + let field = std::cell::Cell::new(Rect::NOTHING); + let popup = std::cell::RefCell::new(vec![]); + let mut add = |ui: &mut Ui| { + ui.add_space(above); + field.set(ui.horizontal(|ui| dropdown_names(ui, "fit-list", labels[0], &labels, 160.0)).response.rect); + popup.replace(super::top_popup_shapes(ui.ctx())); + }; + let screen = Rect::from_min_size(Pos2::ZERO, vec2(400.0, height)); + // The shapes of the open list, without the field under it. + let mut run = |time: f64, events: Vec| { + let mut out = ctx.run_ui(egui::RawInput { time: Some(time), screen_rect: Some(screen), events, ..Default::default() }, &mut add); + out.textures_delta.clear(); + popup.take() + }; + run(0.0, vec![]); + let at = field.get().center(); + let press = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + run(0.1, vec![egui::Event::PointerMoved(at), press(true)]); + run(0.2, vec![press(false)]); + run(0.3, vec![egui::Event::PointerMoved(pos2(390.0, 2.0))]); + let mut clipped = vec![]; + for i in 4..10 { + clipped = run(f64::from(i) * 0.1, vec![]); + } + let list = ctx + .memory(|m| { + m.layer_ids().filter(|l| l.order == egui::Order::Foreground && m.areas().is_visible(l)).last().and_then(|l| m.area_rect(l.id)) + }) + .expect("the list is open"); + assert!(screen.contains_rect(list), "{case}: the list {list:?} is inside the window"); + let field = field.get(); + // The list opens from the button, 1 pt inside the field's border. + match side { + "below" => assert!(list.top() >= field.bottom() - 1.5, "{case}: the list {list:?} opens below the field {field:?}"), + "above" => assert!(list.bottom() <= field.top() + 1.5, "{case}: the list {list:?} opens above the field {field:?}"), + _ => assert!(list.top() < field.bottom() && list.bottom() > field.top(), "{case}: the list {list:?} covers the field {field:?}"), + } + let mut texts = vec![]; + fn flat(s: &egui::Shape, clip: Rect, out: &mut Vec<(String, Rect, Rect)>) { + match s { + egui::Shape::Vec(v) => v.iter().for_each(|s| flat(s, clip, out)), + egui::Shape::Text(t) => out.push((t.galley.text().to_owned(), t.visual_bounding_rect(), clip)), + _ => {} + } + } + clipped.iter().for_each(|c| flat(&c.shape, c.clip_rect, &mut texts)); + let whole: Vec<&str> = labels + .iter() + .copied() + .filter(|name| { + texts.iter().any(|(s, r, clip)| s == name && list.contains_rect(*r) && r.top() >= clip.top() && r.bottom() <= clip.bottom()) + }) + .collect(); + assert_eq!(whole, labels, "{case}: every option shows whole in {list:?}"); + } +} + /// Enter on text that reads as no number in a range field refuses it as a unit field does: the /// field flashes and an open dialog is not confirmed with the old value. #[test] From 57b4575bfd856b0372fa75350799ba243ba09831 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 22:56:11 -0800 Subject: [PATCH 35/55] Contextual Task Bar: choose which actions it shows The bar's More Options menu has Bar Actions, which lists the actions and the Fill, Stroke, Recolor Artwork, Lock or Shape Properties chips the bar offers for the current selection or tool, each checked while it is on. A click turns one off or on. An action that is off stays out of the bar and out of More Options wherever the bar would offer it; turning one off changes only the bar. Reset Bar Actions turns every one on again. The type font controls are not in Bar Actions. The choice is kept with the preferences and with the workspace, as the Control bar's option groups are, and ids the bar does not have are dropped when they are read. Both items are commands: window.taskBar.actions {action, visible?} and window.taskBar.resetActions, documented in docs/mcp.md. --- crates/mcp/src/ui_catalog.rs | 12 + crates/ui-egui/src/canvas.rs | 3 +- crates/ui-egui/src/canvas/task_bar.rs | 131 +++++++- 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/menus/run.rs | 20 ++ crates/ui-egui/src/menus/state.rs | 4 + crates/ui-egui/src/menus/ui_commands.rs | 12 + crates/ui-egui/src/state.rs | 5 + crates/ui-egui/src/tests/taskbar.rs | 400 ++++++++++++++++++++++++ crates/ui-egui/src/workspaces.rs | 44 +++ docs/mcp.md | 18 ++ docs/target-app-parity.md | 1 + 39 files changed, 704 insertions(+), 2 deletions(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 88f60fd6c8..bfe50afa36 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -675,6 +675,18 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "{pinned?: bool} keep the Contextual Task Bar where it is instead of following the selection (true), let it follow the selection again from where it is (false) or toggle (omitted), as the bar's More Options menu does; returns the new state", ), ("window.taskBar.reset", "Reset Bar Position", "", "{} unpin the Contextual Task Bar and put it back under the selection"), + ( + "window.taskBar.actions", + "Bar Actions", + "", + "{action: \"imageTrace\"|\"cropImage\"|\"removeBackground\"|\"removeAnchorPoints\"|\"join\"|\"cutPath\"|\"convertToCorner\"|\"convertToSmooth\"|\"group\"|\"makeClippingMask\"|\"unite\"|\"expand\"|\"editClippingPath\"|\"releaseClippingMask\"|\"ungroup\"|\"isolate\"|\"editPath\"|\"releaseCompoundPath\"|\"createOutlines\"|\"convertToPointType\"|\"convertToAreaType\"|\"typeOnPathOptions\"|\"centerOnTop\"|\"centerOnBottom\"|\"dynamicText\"|\"offsetPath\"|\"simplify\"|\"smooth\"|\"duplicate\"|\"drawPencil\"|\"placeImage\"|\"fidelity\"|\"smoothToolOptions\"|\"resizeArtboard\"|\"duplicateArtboards\"|\"rearrangeArtboards\"|\"exportArtboards\"|\"fill\"|\"stroke\"|\"recolor\"|\"lock\"|\"shapeProperties\", visible?: bool} show (true), hide (false) or toggle (omitted) one of the Contextual Task Bar's actions or chips, as the bar's More Options › Bar Actions does; an action that is off stays out of the bar and out of More Options, and turning one off changes only the bar; `join` is both Connect and Join; every action starts on; kept with the preferences and with the workspace; another action, or a `visible` that is not true or false, is an error and changes nothing; returns {action, visible}", + ), + ( + "window.taskBar.resetActions", + "Reset Bar Actions", + "", + "{} show every Contextual Task Bar action and chip that Bar Actions turned off, as the bar's More Options › Reset Bar Actions does; returns the ids shown again", + ), ( "window.dock", "Panels", diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 02833a7c09..316681b493 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -72,8 +72,9 @@ pub(crate) use raster::{KeptFrame, color_image, color_image_owned, render_job}; use raster::{changed_pixels, frame_ppp, pixel_region, upload}; pub use selection_marks::SelectionMarks; use task_bar::task_bar; +pub(crate) use task_bar::{TASK_BAR_ACTIONS, TASK_BAR_CHIPS, is_task_bar_action, read_hidden_task_bar_actions}; #[cfg(test)] -pub(crate) use task_bar::{chip_paints, images_with_other_art}; +pub(crate) use task_bar::{chip_paints, images_with_other_art, task_bar_offered}; pub(crate) use task_bar::{has_colors, task_bar_rect, task_bar_shows_fonts, task_bar_shows_type}; #[cfg(test)] use tool_overlays::{DIAL_RADIUS, HiddenMarks}; diff --git a/crates/ui-egui/src/canvas/task_bar.rs b/crates/ui-egui/src/canvas/task_bar.rs index c133c003f8..7ba9ee4e94 100644 --- a/crates/ui-egui/src/canvas/task_bar.rs +++ b/crates/ui-egui/src/canvas/task_bar.rs @@ -19,6 +19,13 @@ pub(crate) fn task_bar_shows_fonts(ctx: &egui::Context) -> bool { task_bar_rect(ctx).is_some() && ctx.data(|d| d.get_temp::(task_bar_id().with("fonts")).unwrap_or(false)) } +/// The actions the Contextual Task Bar offered when it was last drawn, before Bar Actions left any +/// out: each one's name and its id in [`TASK_BAR_ACTIONS`] (none: Bar Actions cannot turn it off). +#[cfg(test)] +pub(crate) fn task_bar_offered(ctx: &egui::Context) -> Vec<(String, Option<&'static str>)> { + ctx.data(|d| d.get_temp(task_bar_id().with("offered")).unwrap_or_default()) +} + /// Whether the objects `ids` (or anything inside them) are painted with a colour: a solid colour, /// a gradient's stops or a mesh's points, which Recolor Artwork can change. pub(crate) fn has_colors(doc: &vectorcraft_doc::Document, ids: &[vectorcraft_doc::NodeId]) -> bool { @@ -182,7 +189,9 @@ pub(crate) fn task_bar_shows_type(app: &VectorcraftApp) -> bool { /// On a blank canvas, a document with no artwork and a selection tool in use, it sits under the /// active artboard and offers Draw (Pencil) and Place Image. /// Its handle drags it anywhere on the canvas; unpinned it keeps that offset as it follows the -/// selection, pinned it stays put ([`crate::state::TaskBarPlace`]). +/// selection, pinned it stays put ([`crate::state::TaskBarPlace`]). More Options › Bar Actions +/// turns each action and chip the bar offers on or off ([`TASK_BAR_ACTIONS`], [`TASK_BAR_CHIPS`]); +/// the bar leaves out the ones that are off, and Reset Bar Actions shows them all again. pub(super) fn task_bar(app: &mut VectorcraftApp, ui: &mut Ui, xf: &Xf) { let t = Tokens::get(ui.ctx()); let on_artboards = app.session.tool_id() == "artboard"; @@ -351,6 +360,17 @@ pub(super) fn task_bar(app: &mut VectorcraftApp, ui: &mut Ui, xf: &Xf) { let paints = chip_paints(app, ui.ctx()); let colored = has_colors(&st.doc, &st.selection.objects); let doc = st.uid; + // Every action and chip the bar offers here, with its name, for More Options › Bar Actions; + // the ones that are off there are left out of the bar. + let hidden = &app.ui.task_bar_hidden_actions; + #[cfg(test)] + ui.ctx().data_mut(|d| { + let ids: Vec<(String, Option<&'static str>)> = + items.iter().map(|(label, _, cmd, params)| (label.to_string(), action_id(cmd, params))).collect(); + d.insert_temp(task_bar_id().with("offered"), ids); + }); + let mut offered: Vec<(&str, &'static str)> = items.iter().filter_map(|(label, _, cmd, params)| Some((*label, action_id(cmd, params)?))).collect(); + items.retain(|(_, _, cmd, params)| action_id(cmd, params).is_none_or(|a| !hidden.contains(a))); let bounds = xf.rect.shrink(8.0); // The canvas's width less the frame's margins and stroke. let room = bounds.width() - BAR_FRAME; @@ -371,6 +391,10 @@ pub(super) fn task_bar(app: &mut VectorcraftApp, ui: &mut Ui, xf: &Xf) { .into_iter() .filter_map(|(shown, chip)| shown.then_some(chip)) .collect(); + offered.extend(chips.iter().map(|c| (c.label(shape.is_some()), c.id(shape.is_some())))); + let chips: Vec = chips.into_iter().filter(|c| !hidden.contains(c.id(shape.is_some()))).collect(); + let offered: Vec<(&str, &str, bool)> = offered.into_iter().map(|(label, action)| (label, action, !hidden.contains(action))).collect(); + let any_hidden = !hidden.is_empty(); let widths: Vec = items.iter().map(|(label, _, cmd, _)| item_width(ui, label, cmd)).collect(); let fidelity = app.session.tool_options()["fidelity"].as_f64(); let font_w = fonts.then(|| { @@ -498,6 +522,20 @@ pub(super) fn task_bar(app: &mut VectorcraftApp, ui: &mut Ui, xf: &Xf) { run = Some((cmd, json!({}))); } } + // The actions and chips the bar offers for this selection or tool, each + // checked while it shows, which turns it on or off; then Reset Bar + // Actions, which shows every action again. + ui.menu_button(format!(" {}", tl!("Bar Actions")), |ui| { + ui.set_min_width(170.0); + for (label, action, shown) in &offered { + if widgets::menu_item_name(ui, label.trim_end_matches([':', '…']), true, *shown) { + run = Some(("window.taskBar.actions", json!({ "action": action }))); + } + } + }); + if widgets::menu_item(ui, tl!("Reset Bar Actions"), any_hidden, false) { + run = Some(("window.taskBar.resetActions", json!({}))); + } ui.separator(); if widgets::menu_item(ui, tl!("Show Properties Panel"), true, false) { run = Some(("window.panel", json!({"panel": "properties"}))); @@ -579,6 +617,97 @@ impl Chip { Chip::Recolor | Chip::Lock => 30.0, } } + + /// The chip's id in [`TASK_BAR_CHIPS`]; Lock is `shapeProperties` while it shows a basic + /// `shape`'s properties. + fn id(self, shape: bool) -> &'static str { + match self { + Chip::Fill => "fill", + Chip::Stroke => "stroke", + Chip::Recolor => "recolor", + Chip::Lock if shape => "shapeProperties", + Chip::Lock => "lock", + } + } + + /// The chip's name in More Options › Bar Actions, translated. + fn label(self, shape: bool) -> &'static str { + match self { + Chip::Fill => tl!("Fill"), + Chip::Stroke => tl!("Stroke"), + Chip::Recolor => tl!("Recolor Artwork"), + Chip::Lock if shape => tl!("Shape Properties"), + Chip::Lock => tl!("Lock"), + } + } +} + +/// The Contextual Task Bar's actions that More Options › Bar Actions turns on or off +/// (`window.taskBar.actions {action, visible?}`): each action's id, the command its button runs and +/// the `tool` that command names, if any. An action that is off stays out of the bar, and More +/// Options does not list it either; turning one off changes only the bar. Every action starts on. +pub(crate) const TASK_BAR_ACTIONS: [(&str, &str, Option<&str>); 37] = [ + ("imageTrace", TASK_BAR_IMAGE_TRACE, None), + ("cropImage", "ui.cropImage", None), + ("removeBackground", crate::addons::image::REMOVE_BACKGROUND, None), + ("removeAnchorPoints", "path.removeAnchors", None), + ("join", "path.join", None), + ("cutPath", "path.cutAtAnchors", None), + ("convertToCorner", TASK_BAR_TO_CORNER, None), + ("convertToSmooth", TASK_BAR_TO_SMOOTH, None), + ("group", "object.group", None), + ("makeClippingMask", "object.clippingMask.make", None), + ("unite", "object.pathfinder.unite", None), + ("expand", "imageTrace.expand", None), + ("editClippingPath", "object.clippingMask.editMask", None), + ("releaseClippingMask", "object.clippingMask.release", None), + ("ungroup", "object.ungroup", None), + ("isolate", "object.isolate", None), + ("editPath", "tool.select", Some("directSelection")), + ("releaseCompoundPath", "object.compoundPath.release", None), + ("createOutlines", "type.createOutlines", None), + ("convertToPointType", "type.convertToPointType", None), + ("convertToAreaType", "type.convertToAreaType", None), + ("typeOnPathOptions", "type.pathOptions", None), + ("centerOnTop", "type.pathCenter.top", None), + ("centerOnBottom", "type.pathCenter.bottom", None), + ("dynamicText", "type.dynamicText", None), + ("offsetPath", "object.path.offsetPath", None), + ("simplify", "object.path.simplify", None), + ("smooth", "object.path.smooth", None), + ("duplicate", "edit.duplicate", None), + ("drawPencil", "tool.select", Some("pencil")), + ("placeImage", "file.place", None), + ("fidelity", TASK_BAR_FIDELITY, None), + ("smoothToolOptions", "tool.options", Some("smooth")), + ("resizeArtboard", TASK_BAR_ARTBOARD_OPTIONS, None), + ("duplicateArtboards", TASK_BAR_DUPLICATE_ARTBOARDS, None), + ("rearrangeArtboards", TASK_BAR_REARRANGE_ARTBOARDS, None), + ("exportArtboards", "file.exportForScreens", None), +]; + +/// The ids of the Contextual Task Bar's chips that More Options › Bar Actions turns on or off, +/// as [`TASK_BAR_ACTIONS`] are. +pub(crate) const TASK_BAR_CHIPS: [&str; 5] = ["fill", "stroke", "recolor", "lock", "shapeProperties"]; + +/// Whether `id` names one of the Contextual Task Bar's actions or chips. +pub(crate) fn is_task_bar_action(id: &str) -> bool { + TASK_BAR_ACTIONS.iter().any(|a| a.0 == id) || TASK_BAR_CHIPS.contains(&id) +} + +/// The id in [`TASK_BAR_ACTIONS`] of the bar's item that runs `cmd` with `params`. +fn action_id(cmd: &str, params: &serde_json::Value) -> Option<&'static str> { + let tool = params.get("tool").and_then(serde_json::Value::as_str); + TASK_BAR_ACTIONS.iter().find(|(_, c, t)| *c == cmd && *t == tool).map(|a| a.0) +} + +/// Reads the Contextual Task Bar's actions and chips that are off, as kept in the preferences. Ids +/// the bar does not have are dropped, and a value that is not a list of strings reads as none off, +/// so the bar shows every action. +pub(crate) fn read_hidden_task_bar_actions<'de, D: serde::Deserializer<'de>>(d: D) -> Result, D::Error> { + let value = ::deserialize(d)?; + let ids = value.as_array().into_iter().flatten().filter_map(serde_json::Value::as_str); + Ok(ids.filter(|id| is_task_bar_action(id)).map(str::to_string).collect()) } /// What a click on one of the bar's [`Chip`]s does: make the Fill (`true`) or the Stroke active and diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index d371a5f1e4..d1ace795df 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -621,6 +621,8 @@ font-technology Variable Променливи Contextual Task Bar Контекстна лента със задачи Pin Bar Position Закачане на позицията на лентата Reset Bar Position Нулиране на позицията на лентата + Bar Actions Действия на лентата + Reset Bar Actions Нулиране на действията на лентата Resize Преоразмеряване Contrast Контраст Control Контрол diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 00d07d469d..3abddd15e2 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -770,6 +770,8 @@ Contextual Task Bar Kontekstna traka zadataka Pin Bar Position Položaj prikvačene trake Reset Bar Position Vrati položaj trake na početno + Bar Actions Radnje trake + Reset Bar Actions Vrati radnje trake na početno Resize Promijeni veličinu Tools Alati Toolbars Trake s alatima diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 78e5a77c9e..e28998b70c 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -3851,6 +3851,8 @@ digits Malayalam Malaiàlam Reset all Revolve settings to their defaults. Restableix tots els paràmetres de revolució als valors predeterminats. Reset Automation Restableix Automation Reset Bar Position Restableix la posició de la barra + Bar Actions Accions de la barra + Reset Bar Actions Restableix les accions de la barra Reset Bounding Box Restableix el quadre delimitador Rotate Bounding Box Gira el quadre delimitador Rotate Bounding Box… Gira el quadre delimitador… diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index bd3e76ec50..0cc88d36f1 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -784,6 +784,8 @@ Contextual Task Bar Kontextový panel úloh Pin Bar Position Připnout polohu panelu Reset Bar Position Obnovit polohu panelu + Bar Actions Akce panelu + Reset Bar Actions Obnovit akce panelu Resize Změnit velikost Tools Nástroje Toolbars Panely nástrojů diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 3fb128a27a..69444597f8 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -3460,6 +3460,8 @@ liquify-list-end {0}, {1} {0} og {1} Contextual Task Bar Kontekstuel opgavelinje Pin Bar Position Fastgør linjens placering Reset Bar Position Nulstil linjens placering + Bar Actions Linjens handlinger + Reset Bar Actions Nulstil linjens handlinger Tools Værktøjer Toolbars Værktøjslinjer Advanced Avanceret diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 6ad4e3850b..1967a59a56 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -625,6 +625,8 @@ font-technology Variable Variabel Contextual Task Bar Kontextbezogene Taskleiste Pin Bar Position Position der Leiste fixieren Reset Bar Position Position der Leiste zurücksetzen + Bar Actions Aktionen der Leiste + Reset Bar Actions Aktionen der Leiste zurücksetzen Resize Größe ändern Contrast Kontrast Control Steuerung diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 7d2e5b6363..48acabe1c9 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -599,6 +599,8 @@ font-technology Variable Μεταβλητές Contextual Task Bar Γραμμή εργασιών βάσει περιβάλλοντος Pin Bar Position Σταθεροποίηση θέσης γραμμής Reset Bar Position Επαναφορά θέσης γραμμής + Bar Actions Ενέργειες γραμμής + Reset Bar Actions Επαναφορά ενεργειών γραμμής Resize Αλλαγή μεγέθους Contrast Αντίθεση Control Έλεγχος diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 30678f8a13..70bbddbe01 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -645,6 +645,8 @@ font-technology Variable Variables Contextual Task Bar Barra de tareas contextual Pin Bar Position Fijar posición de la barra Reset Bar Position Restablecer posición de la barra + Bar Actions Acciones de la barra + Reset Bar Actions Restablecer acciones de la barra Resize Cambiar tamaño Contrast Contraste Control Control diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 873d339833..a1a70c7203 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -770,6 +770,8 @@ Contextual Task Bar Kontekstuaalinen tehtäväpalkki Pin Bar Position Kiinnitä palkin sijainti Reset Bar Position Palauta palkin sijainti + Bar Actions Palkin toiminnot + Reset Bar Actions Palauta palkin toiminnot Resize Muuta kokoa Tools Työkalut Toolbars Työkalurivit diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 68bcc455b2..189bb24de4 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -646,6 +646,8 @@ font-technology Variable Variables Contextual Task Bar Barre des tâches contextuelle Pin Bar Position Épingler la position de la barre Reset Bar Position Réinitialiser la position de la barre + Bar Actions Actions de la barre + Reset Bar Actions Réinitialiser les actions de la barre Resize Redimensionner Contrast Contraste Control Contrôle diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index d7bb081e02..f364d97341 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -3176,6 +3176,8 @@ Reselect ફરી પસંદ કરો Reset રીસેટ કરો Reset Bar Position બાર સ્થિતિ રીસેટ કરો + Bar Actions બાર ક્રિયાઓ + Reset Bar Actions બાર ક્રિયાઓ રીસેટ કરો Reset Bounding Box બાઉન્ડિંગ બોક્સ રીસેટ કરો Rotate Bounding Box બાઉન્ડિંગ બોક્સ ફેરવો Rotate Bounding Box… બાઉન્ડિંગ બોક્સ ફેરવો… diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 2837a15b67..94b241788b 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -4471,6 +4471,8 @@ antiAlias Sharp शार्प Reset all Revolve settings to their defaults. सभी रिवॉल्व सेटिंग्स डिफ़ॉल्ट पर रीसेट करें। Reset Automation स्वचालन रीसेट करें Reset Bar Position बार स्थिति रीसेट करें + Bar Actions बार क्रियाएँ + Reset Bar Actions बार क्रियाएँ रीसेट करें Reset Bounding Box बाउंडिंग बॉक्स रीसेट करें Rotate Bounding Box बाउंडिंग बॉक्स घुमाएँ Rotate Bounding Box… बाउंडिंग बॉक्स घुमाएँ… diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index fbc2e30bd1..053f0acb61 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3689,6 +3689,8 @@ mark-style Japanese Japán Reset all Revolve settings to their defaults. A tengely körüli forgatás minden beállítását visszaállítja az alapértékre. Reset Automation Automation visszaállítása Reset Bar Position Sáv helyének visszaállítása + Bar Actions Sáv műveletei + Reset Bar Actions Sáv műveleteinek visszaállítása Reset Bounding Box Befoglaló keret visszaállítása Rotate Bounding Box Befoglaló keret elforgatása Rotate Bounding Box… Befoglaló keret elforgatása… diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index ab48475d3d..cbb7589e81 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -724,6 +724,8 @@ Contextual Task Bar Bilah tugas kontekstual Pin Bar Position Sematkan posisi bilah Reset Bar Position Atur ulang posisi bilah + Bar Actions Tindakan bilah + Reset Bar Actions Atur ulang tindakan bilah Tools Alat Toolbars Bilah alat Advanced Lanjutan diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index a3b493cd1d..17865eea45 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -647,6 +647,8 @@ font-technology Variable Variabili Contextual Task Bar Barra attività contestuale Pin Bar Position Fissa posizione barra Reset Bar Position Ripristina posizione barra + Bar Actions Azioni barra + Reset Bar Actions Ripristina azioni barra Resize Ridimensiona Contrast Contrasto Control Controllo diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 5de0cae50c..57825abf41 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -812,6 +812,8 @@ digits Malayalam マラヤーラム数字 Contextual Task Bar コンテキストタスクバー Pin Bar Position バーの位置を固定 Reset Bar Position バーの位置をリセット + Bar Actions バーのアクション + Reset Bar Actions バーのアクションをリセット Resize サイズを変更 Tools ツール Toolbars ツールバー diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 81fc06870d..ca35eff072 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -2894,6 +2894,8 @@ Contextual Task Bar კონტექსტური ამოცანების ზოლი Pin Bar Position ზოლის პოზიციის ჩამაგრება Reset Bar Position ზოლის პოზიციის ჩამოყრა + Bar Actions ზოლის მოქმედებები + Reset Bar Actions ზოლის მოქმედებების ჩამოყრა Tools ხელსაწყოები Toolbars ხელსაწყოთა ზოლები Advanced დამატებითი diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 4a6963bbd2..a4ea3eaed4 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -805,6 +805,8 @@ digits Malayalam 말라얄람어 Contextual Task Bar 상황별 작업 표시줄 Pin Bar Position 표시줄 위치 고정 Reset Bar Position 표시줄 위치 재설정 + Bar Actions 표시줄 동작 + Reset Bar Actions 표시줄 동작 재설정 Resize 크기 조절 Tools 도구 Toolbars 도구 모음 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 894c7096f6..1bc48d5c19 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -1329,6 +1329,8 @@ liquify-list-end {0}, {1} {0} en {1} Contextual Task Bar Contextuele taakbalk Pin Bar Position Balkpositie vastzetten Reset Bar Position Balkpositie herstellen + Bar Actions Balkacties + Reset Bar Actions Balkacties herstellen Tools Gereedschappen Toolbars Werkbalken Advanced Geavanceerd diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index c69ed2cf28..dda7e753d1 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -733,6 +733,8 @@ Contextual Task Bar Kontekstowy pasek zadań Pin Bar Position Przypnij położenie paska Reset Bar Position Resetuj położenie paska + Bar Actions Akcje paska + Reset Bar Actions Resetuj akcje paska Resize Zmień rozmiar Tools Narzędzia Toolbars Paski narzędzi diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 6bae5e26f1..a3eed4d6f3 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -590,6 +590,8 @@ antiAlias Sharp Nítido Contextual Task Bar Barra de Tarefas Contextual Pin Bar Position Fixar Posição da Barra Reset Bar Position Redefinir Posição da Barra + Bar Actions Ações da Barra + Reset Bar Actions Redefinir Ações da Barra Resize Redimensionar Control Controle Convert Converter diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 74156da429..161dca94f7 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -643,6 +643,8 @@ font-technology Variable Вариативные Contextual Task Bar Контекстная панель задач Pin Bar Position Закрепить положение панели Reset Bar Position Сбросить положение панели + Bar Actions Действия панели + Reset Bar Actions Сбросить действия панели Resize Изменить размер Contrast Контраст Control Control diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 4d683cb1ea..4aad71069a 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -628,6 +628,8 @@ font-technology Variable Variabla Contextual Task Bar Kontextuellt aktivitetsfält Pin Bar Position Fäst fältets position Reset Bar Position Återställ fältets position + Bar Actions Fältets åtgärder + Reset Bar Actions Återställ fältets åtgärder Resize Ändra storlek Contrast Kontrast Control Kontroll diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index d0e30b8fdc..d18c09be90 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -625,6 +625,8 @@ font-technology Variable Değişken Contextual Task Bar Bağlamsal Görev Çubuğu Pin Bar Position Pim Çubuğu Konumu Reset Bar Position Çubuk Konumunu Sıfırla + Bar Actions Çubuk Eylemleri + Reset Bar Actions Çubuk Eylemlerini Sıfırla Contrast Kontrast Control Kontrol Convert Dönüştür diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 82ba9af243..709f1b62e2 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -641,6 +641,8 @@ font-technology Variable Варіативні Contextual Task Bar Контекстна панель завдань Pin Bar Position Закріпити положення панелі Reset Bar Position Скинути положення панелі + Bar Actions Дії панелі + Reset Bar Actions Скинути дії панелі Resize Змінити розмір Contrast Контраст Control Панель керування diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 04ebd9992d..6566a17dd3 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3470,6 +3470,8 @@ mark-style Japanese Kiểu Nhật Reset all 3D settings to their defaults. Đặt lại tất cả cài đặt 3D về mặc định. Reset all Revolve settings to their defaults. Đặt lại tất cả cài đặt Revolve về mặc định. Reset Bar Position Đặt lại vị trí thanh + Bar Actions Thao tác của thanh + Reset Bar Actions Đặt lại thao tác của thanh Reset Bounding Box Đặt lại hộp bao Rotate Bounding Box Xoay hộp bao Rotate Bounding Box… Xoay hộp bao… diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index d20ae8d9e8..0da7242432 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -592,6 +592,8 @@ antiAlias Sharp 锐利 Contextual Task Bar 上下文任务栏 Pin Bar Position 固定任务栏位置 Reset Bar Position 重置任务栏位置 + Bar Actions 任务栏操作 + Reset Bar Actions 重置任务栏操作 Resize 调整大小 Contrast 对比 Control 控制栏 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index d5fde762f9..33a784ef89 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -609,6 +609,8 @@ font-technology Variable 可變 Contextual Task Bar 快捷工作列 Pin Bar Position 釘選工作列位置 Reset Bar Position 重設工作列位置 + Bar Actions 工作列動作 + Reset Bar Actions 重設工作列動作 Resize 調整大小 Contrast 對比 Control 控制 diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 909d03b3d2..0fbc656746 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -639,6 +639,26 @@ fn run_ui_part6(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option match (s("action").filter(|a| crate::canvas::is_task_bar_action(a)), opt_bool(p, "visible")) { + (None, _) => { + let ids = crate::canvas::TASK_BAR_ACTIONS.iter().map(|a| a.0).chain(crate::canvas::TASK_BAR_CHIPS); + Err(format!("`action` must be one of {}", ids.collect::>().join(", "))) + } + (_, Err(e)) => Err(e), + (Some(action), Ok(visible)) => { + let hidden = &mut app.ui.task_bar_hidden_actions; + let visible = visible.unwrap_or_else(|| hidden.contains(&action)); + if visible { + hidden.remove(&action); + } else { + hidden.insert(action.clone()); + } + Ok(json!({ "action": action, "visible": visible })) + } + }, + // More Options › Reset Bar Actions: every action and chip shows again. + "window.taskBar.resetActions" => Ok(json!(std::mem::take(&mut app.ui.task_bar_hidden_actions))), "window.dock" => { let ui = &mut app.ui; // The bars the last Tab hid show again, unless the toolbar or the Control bar was shown diff --git a/crates/ui-egui/src/menus/state.rs b/crates/ui-egui/src/menus/state.rs index a424d98714..b9d1a5fa84 100644 --- a/crates/ui-egui/src/menus/state.rs +++ b/crates/ui-egui/src/menus/state.rs @@ -94,6 +94,10 @@ pub fn checked(app: &VectorcraftApp, id: &str, p: &Value) -> Option { "window.taskBar" => app.ui.task_bar, "window.pathfinder.compoundShapes" => app.ui.shape_modes_compound, "window.taskBar.pin" => app.ui.task_bar_place.pinned, + "window.taskBar.actions" => p + .get("action") + .and_then(Value::as_str) + .is_some_and(|a| crate::canvas::is_task_bar_action(a) && !app.ui.task_bar_hidden_actions.contains(a)), "window.learn" => crate::panels::learn::visible(&app.ui), "window.panel" => { let panel = p.get("panel").and_then(Value::as_str).unwrap_or(""); diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index fbfd12b24e..0845f5f08b 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -676,6 +676,18 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "{pinned?: bool} keep the Contextual Task Bar where it is instead of following the selection (true), let it follow the selection again from where it is (false) or toggle (omitted), as the bar's More Options menu does; returns the new state", ), ("window.taskBar.reset", "Reset Bar Position", "", "{} unpin the Contextual Task Bar and put it back under the selection"), + ( + "window.taskBar.actions", + "Bar Actions", + "", + "{action: \"imageTrace\"|\"cropImage\"|\"removeBackground\"|\"removeAnchorPoints\"|\"join\"|\"cutPath\"|\"convertToCorner\"|\"convertToSmooth\"|\"group\"|\"makeClippingMask\"|\"unite\"|\"expand\"|\"editClippingPath\"|\"releaseClippingMask\"|\"ungroup\"|\"isolate\"|\"editPath\"|\"releaseCompoundPath\"|\"createOutlines\"|\"convertToPointType\"|\"convertToAreaType\"|\"typeOnPathOptions\"|\"centerOnTop\"|\"centerOnBottom\"|\"dynamicText\"|\"offsetPath\"|\"simplify\"|\"smooth\"|\"duplicate\"|\"drawPencil\"|\"placeImage\"|\"fidelity\"|\"smoothToolOptions\"|\"resizeArtboard\"|\"duplicateArtboards\"|\"rearrangeArtboards\"|\"exportArtboards\"|\"fill\"|\"stroke\"|\"recolor\"|\"lock\"|\"shapeProperties\", visible?: bool} show (true), hide (false) or toggle (omitted) one of the Contextual Task Bar's actions or chips, as the bar's More Options › Bar Actions does; an action that is off stays out of the bar and out of More Options, and turning one off changes only the bar; `join` is both Connect and Join; every action starts on; kept with the preferences and with the workspace; another action, or a `visible` that is not true or false, is an error and changes nothing; returns {action, visible}", + ), + ( + "window.taskBar.resetActions", + "Reset Bar Actions", + "", + "{} show every Contextual Task Bar action and chip that Bar Actions turned off, as the bar's More Options › Reset Bar Actions does; returns the ids shown again", + ), ( "window.dock", "Panels", diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index d2bc85ba9a..796dadb5c5 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -473,6 +473,10 @@ pub struct UiState { /// starts under the selection at every launch. #[serde(skip)] pub task_bar_place: TaskBarPlace, + /// The Contextual Task Bar's actions (`canvas::TASK_BAR_ACTIONS`) that More Options › Bar + /// Actions has off (`window.taskBar.actions`); none: the bar shows every action it offers. + #[serde(deserialize_with = "crate::canvas::read_hidden_task_bar_actions")] + pub task_bar_hidden_actions: std::collections::BTreeSet, /// The Pathfinder panel's Shape Mode buttons make a compound shape on a click, and give the /// permanent Pathfinder result on Alt-click (off, the default: the other way round). #[serde(default)] @@ -1219,6 +1223,7 @@ impl Default for UiState { toolbar_advanced: false, task_bar: true, task_bar_place: TaskBarPlace::default(), + task_bar_hidden_actions: Default::default(), shape_modes_compound: false, context_locked: None, context_intertwine: None, diff --git a/crates/ui-egui/src/tests/taskbar.rs b/crates/ui-egui/src/tests/taskbar.rs index bc4734db5a..9b5ab37031 100644 --- a/crates/ui-egui/src/tests/taskbar.rs +++ b/crates/ui-egui/src/tests/taskbar.rs @@ -1573,3 +1573,403 @@ fn the_task_bar_follows_edits_and_undo() { assert!(has(&texts, "10 pt") && !has(&texts, "20 pt"), "{texts:?}"); assert!(!locked(&app, rect), "the button doesn't lock the shape"); } + +/// Turns the bar's action or chip `action` on or off (`window.taskBar.actions`). +fn show_action(app: &mut VectorcraftApp, action: &str, visible: bool) { + let r = app.run("window.taskBar.actions", json!({"action": action, "visible": visible})).unwrap(); + assert_eq!(r, json!({"action": action, "visible": visible})); +} + +/// An action turned off in Bar Actions leaves the bar for every selection that offers it, and its +/// Object menu command stays enabled. Toggled, it comes back. +#[test] +fn an_action_turned_off_leaves_the_bar_and_stays_in_its_menu() { + let mut app = app(); + app.run("tool.select", json!({"tool": "selection"})).unwrap(); + let line = id(app.run("shape.line", json!({"x1": 50, "y1": 50, "x2": 200, "y2": 120})).unwrap()); + select(&mut app, &[line]); + let (_, texts) = bar(&mut app); + assert!(has(&texts, "Offset Path") && has(&texts, "Join"), "{texts:?}"); + show_action(&mut app, "offsetPath", false); + assert_eq!(crate::menus::checked(&app, "window.taskBar.actions", &json!({"action": "offsetPath"})), Some(false)); + assert_eq!(crate::menus::checked(&app, "window.taskBar.actions", &json!({"action": "join"})), Some(true)); + let (_, texts) = bar(&mut app); + assert!(!has(&texts, "Offset Path"), "{texts:?}"); + assert!(has(&texts, "Join") && has(&texts, "Simplify") && has(&texts, "Edit Path"), "the other actions stay: {texts:?}"); + assert!(crate::menus::enabled(&app, "object.path.offsetPath"), "Object › Path › Offset Path… still runs"); + + // Another selection that offers the same action leaves it out too: a rectangle. + let rect = id(app.run("shape.rectangle", json!({"x": 220, "y": 40, "width": 80, "height": 60})).unwrap()); + select(&mut app, &[rect]); + let (_, texts) = bar(&mut app); + assert!(!has(&texts, "Offset Path") && has(&texts, "Edit Path"), "{texts:?}"); + + // Toggled (no `visible`), it shows again. + assert_eq!(app.run("window.taskBar.actions", json!({"action": "offsetPath"})).unwrap(), json!({"action": "offsetPath", "visible": true})); + let (_, texts) = bar(&mut app); + assert!(has(&texts, "Offset Path"), "{texts:?}"); +} + +/// The Fill, Stroke, Recolor Artwork, Lock and Shape Properties chips each turn off on their own: +/// Lock off leaves a basic shape's Shape Properties, and Shape Properties off leaves Lock. +#[test] +fn a_chip_turned_off_leaves_the_bar() { + let mut app = app(); + app.run("tool.select", json!({"tool": "selection"})).unwrap(); + let rect = id(app.run("shape.rectangle", json!({"x": 40, "y": 40, "width": 80, "height": 60})).unwrap()); + let line = id(app.run("shape.line", json!({"x1": 50, "y1": 150, "x2": 200, "y2": 220})).unwrap()); + select(&mut app, &[rect]); + let names = |app: &mut VectorcraftApp| buttons(app).1.into_iter().map(|(n, _)| n).collect::>(); + let shown = names(&mut app); + for name in ["Fill", "Stroke", "Shape Properties"] { + assert!(shown.iter().any(|n| n == name), "{name}: {shown:?}"); + } + show_action(&mut app, "fill", false); + show_action(&mut app, "lock", false); + let shown = names(&mut app); + assert!(!shown.iter().any(|n| n == "Fill"), "{shown:?}"); + assert!(shown.iter().any(|n| n == "Stroke") && shown.iter().any(|n| n == "Shape Properties"), "{shown:?}"); + select(&mut app, &[line]); + let shown = names(&mut app); + assert!(!shown.iter().any(|n| n.starts_with("Lock")), "Lock is off: {shown:?}"); + show_action(&mut app, "lock", true); + show_action(&mut app, "shapeProperties", false); + let shown = names(&mut app); + assert!(shown.iter().any(|n| n.starts_with("Lock")), "Lock is on again: {shown:?}"); + select(&mut app, &[rect]); + let shown = names(&mut app); + assert!(!shown.iter().any(|n| n == "Shape Properties"), "{shown:?}"); +} + +/// Reset Bar Actions shows every action and chip again and returns the ids it showed. +#[test] +fn reset_bar_actions_shows_every_action_again() { + let mut app = app(); + app.run("tool.select", json!({"tool": "selection"})).unwrap(); + let line = id(app.run("shape.line", json!({"x1": 50, "y1": 50, "x2": 200, "y2": 120})).unwrap()); + select(&mut app, &[line]); + show_action(&mut app, "simplify", false); + show_action(&mut app, "duplicate", false); + show_action(&mut app, "stroke", false); + let (_, texts) = bar(&mut app); + assert!(!has(&texts, "Simplify") && !has(&texts, "Duplicate"), "{texts:?}"); + assert_eq!(app.run("window.taskBar.resetActions", json!({})).unwrap(), json!(["duplicate", "simplify", "stroke"])); + assert!(app.ui.task_bar_hidden_actions.is_empty()); + let (_, texts) = bar(&mut app); + assert!(has(&texts, "Simplify") && has(&texts, "Duplicate"), "{texts:?}"); + assert_eq!(app.run("window.taskBar.resetActions", json!({})).unwrap(), json!([]), "nothing left to show"); +} + +/// Each of the bar's actions and chips has its own id, and no two actions run the same command +/// with the same tool. +#[test] +fn bar_action_ids_are_distinct() { + let ids: Vec<&str> = canvas::TASK_BAR_ACTIONS.iter().map(|a| a.0).chain(canvas::TASK_BAR_CHIPS).collect(); + let set: std::collections::BTreeSet<&str> = ids.iter().copied().collect(); + assert_eq!(set.len(), ids.len(), "{ids:?}"); + let runs: std::collections::BTreeSet<(&str, Option<&str>)> = canvas::TASK_BAR_ACTIONS.iter().map(|a| (a.1, a.2)).collect(); + assert_eq!(runs.len(), canvas::TASK_BAR_ACTIONS.len()); +} + +/// An action the bar does not have, a missing one, or a `visible` that is not true or false is an +/// error and changes nothing. +#[test] +fn bar_actions_refuse_bad_params() { + let mut app = app(); + show_action(&mut app, "group", false); + for p in [json!({"action": "teleport"}), json!({}), json!({"action": 3}), json!({"action": "unite", "visible": "yes"})] { + assert!(app.run("window.taskBar.actions", p.clone()).is_err(), "{p}"); + } + let err = app.run("window.taskBar.actions", json!({"action": "teleport"})).unwrap_err(); + assert!(err.contains("imageTrace") && err.contains("shapeProperties"), "{err}"); + assert_eq!(app.ui.task_bar_hidden_actions.iter().map(String::as_str).collect::>(), ["group"]); + assert_eq!(crate::menus::checked(&app, "window.taskBar.actions", &json!({"action": "teleport"})), Some(false)); +} + +/// The actions that are off are kept with the preferences. Ids the bar does not have are dropped, +/// a value that is not a list turns none off, and older preferences without it show every action. +#[test] +fn bar_actions_are_kept_with_the_preferences() { + let mut app = app(); + show_action(&mut app, "unite", false); + show_action(&mut app, "recolor", false); + let mut prefs = serde_json::to_value(&app.ui).unwrap(); + let back: crate::state::UiState = serde_json::from_value(prefs.clone()).unwrap(); + let ids = |ui: &crate::state::UiState| ui.task_bar_hidden_actions.iter().cloned().collect::>(); + assert_eq!(ids(&back), ["recolor", "unite"]); + prefs["task_bar_hidden_actions"] = json!(["unite", "teleport", 7, "fill"]); + assert_eq!(ids(&serde_json::from_value(prefs.clone()).unwrap()), ["fill", "unite"], "ids the bar does not have are dropped"); + prefs["task_bar_hidden_actions"] = json!("unite"); + assert!(ids(&serde_json::from_value(prefs.clone()).unwrap()).is_empty(), "a value that is not a list turns none off"); + prefs.as_object_mut().unwrap().remove("task_bar_hidden_actions"); + assert!(ids(&serde_json::from_value(prefs).unwrap()).is_empty(), "older preferences show every action"); + app.run("window.taskBar.resetActions", json!({})).unwrap(); + assert_eq!(serde_json::to_value(&app.ui).unwrap()["task_bar_hidden_actions"], json!([]), "none off"); +} + +/// More Options › Bar Actions lists the actions and chips the bar offers for the selection, each +/// checked while it shows; a click turns one off, it is listed unchecked after that, and a click on +/// Reset Bar Actions shows it again. +#[test] +fn more_options_bar_actions_turns_an_action_off_and_on() { + let mut app = app(); + app.run("tool.select", json!({"tool": "selection"})).unwrap(); + let line = id(app.run("shape.line", json!({"x1": 50, "y1": 50, "x2": 200, "y2": 120})).unwrap()); + select(&mut app, &[line]); + let more = buttons(&mut app).1.into_iter().find(|(n, _)| n == "More Options").expect("More Options").1.center(); + let (ctx, _) = bar(&mut app); + let click_at = |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)]); + frame(app, &ctx, vec![press(true)]); + frame(app, &ctx, vec![press(false)]); + frame(app, &ctx, vec![]) + }; + let texts = click_at(&mut app, more); + let item = at(&texts, " Bar Actions"); + frame(&mut app, &ctx, vec![Event::PointerMoved(item)]); + let texts = frame(&mut app, &ctx, vec![]); + for name in ["✓ Join", "✓ Edit Path", "✓ Offset Path", "✓ Simplify", "✓ Duplicate", "✓ Fill", "✓ Stroke", "✓ Lock"] { + assert!(has(&texts, name), "{name}: {texts:?}"); + } + assert!(has(&texts, " Reset Bar Actions"), "{texts:?}"); + let offset = at(&texts, "✓ Offset Path"); + // Along the submenu's row first, so the pointer stays over the menu on its way. + frame(&mut app, &ctx, vec![Event::PointerMoved(Pos2::new(offset.x, item.y))]); + click_at(&mut app, offset); + assert!(app.ui.task_bar_hidden_actions.contains("offsetPath"), "{:?}", app.ui.task_bar_hidden_actions); + let (_, texts) = bar(&mut app); + assert!(!has(&texts, "Offset Path") && has(&texts, "Simplify"), "{texts:?}"); + + // Opened again, Bar Actions lists it unchecked; Reset Bar Actions turns it on. + let more = buttons(&mut app).1.into_iter().find(|(n, _)| n == "More Options").expect("More Options").1.center(); + let (ctx, _) = bar(&mut app); + let click_at = |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)]); + frame(app, &ctx, vec![press(true)]); + frame(app, &ctx, vec![press(false)]); + frame(app, &ctx, vec![]) + }; + let texts = click_at(&mut app, more); + let item = at(&texts, " Bar Actions"); + let reset = at(&texts, " Reset Bar Actions"); + frame(&mut app, &ctx, vec![Event::PointerMoved(item)]); + let texts = frame(&mut app, &ctx, vec![]); + assert!(has(&texts, " Offset Path") && has(&texts, "✓ Simplify"), "{texts:?}"); + // Back along the menu's column to Reset Bar Actions, closing the submenu on the way. + frame(&mut app, &ctx, vec![Event::PointerMoved(Pos2::new(item.x, reset.y))]); + click_at(&mut app, reset); + assert!(app.ui.task_bar_hidden_actions.is_empty(), "{:?}", app.ui.task_bar_hidden_actions); + let (_, texts) = bar(&mut app); + assert!(has(&texts, "Offset Path"), "{texts:?}"); +} + +/// On a canvas too short for every action, More Options lists the ones that don't fit; an action +/// turned off in Bar Actions is listed neither there nor on the bar, and the others still are. +#[test] +fn an_action_turned_off_is_not_listed_in_more_options() { + let mut app = app(); + app.run("tool.select", json!({"tool": "selection"})).unwrap(); + let a = id(app.run("shape.rectangle", json!({"x": 40, "y": 40, "width": 120, "height": 100})).unwrap()); + let b = id(app.run("shape.ellipse", json!({"x": 70, "y": 60, "width": 50, "height": 50})).unwrap()); + select(&mut app, &[a, b]); + let size = vec2(160.0, 150.0); + // More Options' list, opened on a new context, and what the bar itself shows. + let listed = |app: &mut VectorcraftApp| { + let ctx = egui::Context::default(); + crate::theme::install_fonts(&ctx); + let (on_bar, r, _) = bar_texts_on_screen(app, &ctx, size, 3); + let more = r.min + vec2(9.0 + 4.0 + 6.0 + 15.0, 7.0 + 15.0); + let press = |pressed| Event::PointerButton { pos: more, button: PointerButton::Primary, pressed, modifiers: Default::default() }; + let screen = Rect::from_min_size(Pos2::ZERO, size); + let mut texts = vec![]; + for events in [vec![Event::PointerMoved(more)], vec![press(true)], vec![press(false)], vec![]] { + let mut out = ctx.run_ui(egui::RawInput { screen_rect: Some(screen), events, ..Default::default() }, |ui| canvas::show(app, ui)); + out.textures_delta.clear(); + texts = shapes_text(&out.shapes.iter().map(|c| c.shape.clone()).collect::>()); + } + assert!(texts.iter().any(|(t, _)| t.trim() == "Hide Bar"), "More Options opens: {texts:?}"); + let names = |t: &[(String, Rect)]| t.iter().map(|(t, _)| t.trim().to_string()).collect::>(); + (names(&on_bar), names(&texts)) + }; + let (on_bar, menu) = listed(&mut app); + for label in ["Unite", "Duplicate"] { + assert!(!on_bar.iter().any(|t| t == label) && menu.iter().any(|t| t == label), "{label} in More Options: {menu:?}"); + } + show_action(&mut app, "unite", false); + let (on_bar, menu) = listed(&mut app); + assert!(!on_bar.iter().any(|t| t == "Unite") && !menu.iter().any(|t| t == "Unite"), "{on_bar:?} {menu:?}"); + assert!(on_bar.iter().chain(&menu).any(|t| t == "Duplicate"), "Duplicate is still offered: {on_bar:?} {menu:?}"); +} + +/// Every action the bar offers, for every kind of selection and tool, has an id in Bar Actions, +/// and with all of them turned off the bar shows none of them. That covers Connect and Join (both +/// `join`), the actions matched by the tool they switch to (`editPath`, `drawPencil`, +/// `smoothToolOptions`), the Smooth tool's Fidelity and the Artboard tool's actions. +#[test] +fn every_action_the_bar_offers_can_be_turned_off() { + let dir = crate::tests_folder::Folder::new("ui-taskbar-actions"); + let line = |app: &mut VectorcraftApp| { + id(app.run("path.create", json!({"anchors": [{"x": 50, "y": 200}, {"x": 150, "y": 80}, {"x": 250, "y": 200}]})).unwrap()) + }; + let two = |app: &mut VectorcraftApp| { + let a = id(app.run("shape.rectangle", json!({"x": 40, "y": 40, "width": 120, "height": 100})).unwrap()); + let b = id(app.run("shape.ellipse", json!({"x": 70, "y": 60, "width": 50, "height": 50})).unwrap()); + select(app, &[a, b]); + }; + type Setup<'a> = Box; + let cases: Vec<(&str, Setup, &[&str])> = vec![ + ( + "an open path", + Box::new(|app| { + let l = line(app); + select(app, &[l]); + }), + &["join", "editPath", "offsetPath", "simplify", "duplicate"], + ), + ( + "a path the Direct Selection tool selects whole", + Box::new(|app| { + let l = line(app); + select(app, &[l]); + app.run("tool.select", json!({"tool": "directSelection"})).unwrap(); + }), + &["join", "convertToCorner", "convertToSmooth", "simplify", "smooth", "duplicate"], + ), + ( + "anchors picked out", + Box::new(|app| { + let l = line(app); + app.run("tool.select", json!({"tool": "directSelection"})).unwrap(); + app.run("select.anchors", json!({"id": l, "anchors": [[0, 1]]})).unwrap(); + }), + &["removeAnchorPoints", "join", "cutPath", "convertToCorner", "convertToSmooth"], + ), + ("two paths", Box::new(|app| two(app)), &["group", "unite", "duplicate"]), + ( + "a group", + Box::new(|app| { + two(app); + app.run("object.group", json!({})).unwrap(); + }), + &["ungroup", "isolate", "duplicate"], + ), + ( + "a compound path", + Box::new(|app| { + two(app); + app.run("object.compoundPath.make", json!({})).unwrap(); + }), + &["editPath", "releaseCompoundPath", "duplicate"], + ), + ( + "a clipping group", + Box::new(|app| { + two(app); + let g = id(app.run("object.clippingMask.make", json!({})).unwrap()); + select(app, &[g]); + }), + &["editClippingPath", "releaseClippingMask", "duplicate"], + ), + ( + "point type", + Box::new(|app| { + let t = id(app.run("text.create", json!({"x": 60, "y": 80, "text": "Hello"})).unwrap()); + select(app, &[t]); + }), + &["createOutlines", "convertToAreaType"], + ), + ( + "area type", + Box::new(|app| { + let t = id(app.run("text.create", json!({"x": 60, "y": 80, "text": "Hello"})).unwrap()); + select(app, &[t]); + app.run("type.convertToAreaType", json!({})).unwrap(); + select(app, &[t]); + }), + &["createOutlines", "convertToPointType"], + ), + ( + "type on a closed path", + Box::new(|app| { + let circle = id(app.run("path.create", json!({"d": "M100 300 A100 100 0 1 1 300 300 A100 100 0 1 1 100 300 Z"})).unwrap()); + let t = id(app.run("text.createInPath", json!({"path": circle, "mode": "onPath", "text": "Round", "at": [90, 300]})).unwrap()); + select(app, &[t]); + }), + &["createOutlines", "typeOnPathOptions", "centerOnTop", "centerOnBottom"], + ), + ( + "an image", + Box::new(|app| { + place_image(app, &dir); + }), + &["imageTrace", "cropImage", "removeBackground", "duplicate"], + ), + ( + "an image with a path", + Box::new(|app| { + let img = place_image(app, &dir); + let r = id(app.run("shape.rectangle", json!({"x": 40, "y": 40, "width": 80, "height": 60})).unwrap()); + select(app, &[img, r]); + }), + &["group", "makeClippingMask", "duplicate"], + ), + ( + "a blank canvas", + Box::new(|app| { + let board = app.session.active().unwrap().doc.artboards[0].rect; + bar(app); + let view = app.view_mut().unwrap(); + (view.center, view.zoom) = (board.center(), 0.5); + }), + &["drawPencil", "placeImage"], + ), + ( + "a shape tool after drawing", + Box::new(|app| { + drag_with(app, "rectangle", (60.0, 60.0), (120.0, 120.0)); + }), + &["editPath"], + ), + ( + "the Smooth tool", + Box::new(|app| { + let e = id(app.run("shape.ellipse", json!({"x": 60, "y": 60, "width": 120, "height": 80})).unwrap()); + select(app, &[e]); + app.run("tool.select", json!({"tool": "smooth"})).unwrap(); + }), + &["fidelity", "smoothToolOptions"], + ), + ( + "the Artboard tool", + Box::new(|app| { + app.run("artboard.new", json!({"x": 420, "y": 0, "width": 200, "height": 200})).unwrap(); + app.run("tool.select", json!({"tool": "artboard"})).unwrap(); + }), + &["resizeArtboard", "duplicateArtboards", "rearrangeArtboards", "exportArtboards"], + ), + ]; + for (case, setup, expected) in cases { + let mut app = app(); + app.run("tool.select", json!({"tool": "selection"})).unwrap(); + setup(&mut app); + let (ctx, _) = bar(&mut app); + let offered = canvas::task_bar_offered(&ctx); + assert!(canvas::task_bar_rect(&ctx).is_some() && !offered.is_empty(), "{case}: the bar shows actions"); + for (label, action) in &offered { + assert!(action.is_some(), "{case}: {label} has no id in Bar Actions"); + } + let ids: Vec<&str> = offered.iter().filter_map(|(_, a)| *a).collect(); + for action in expected.iter() { + assert!(ids.contains(action), "{case}: {action} in {ids:?}"); + } + for action in &ids { + show_action(&mut app, action, false); + } + let (_, texts) = bar_texts(&mut app); + for (label, _) in &offered { + assert!(!has(&texts, label), "{case}: {label} is off: {texts:?}"); + } + } +} diff --git a/crates/ui-egui/src/workspaces.rs b/crates/ui-egui/src/workspaces.rs index 886589b5f0..b7f16a1c48 100644 --- a/crates/ui-egui/src/workspaces.rs +++ b/crates/ui-egui/src/workspaces.rs @@ -40,6 +40,10 @@ pub struct Workspace { pub toolbar_double: bool, pub toolbar_advanced: bool, pub task_bar: bool, + /// The Contextual Task Bar's actions and chips its Bar Actions has off (built-in workspaces, and + /// workspaces saved without this field: none). + #[serde(skip_serializing_if = "std::collections::BTreeSet::is_empty", deserialize_with = "crate::canvas::read_hidden_task_bar_actions")] + pub task_bar_hidden_actions: std::collections::BTreeSet, pub dock: bool, pub dock_tab: DockTab, /// The dock's tabbed group is collapsed to icons (built-in workspaces: expanded). @@ -205,6 +209,7 @@ pub fn capture(ui: &UiState, name: &str) -> Workspace { toolbar_double: ui.toolbar_double, toolbar_advanced: ui.toolbar_advanced, task_bar: ui.task_bar, + task_bar_hidden_actions: ui.task_bar_hidden_actions.clone(), dock: ui.dock, dock_tab: ui.dock_tab, dock_collapsed: ui.dock_collapsed, @@ -243,6 +248,7 @@ pub fn apply(ui: &mut UiState, w: &Workspace) { ui.toolbar_double = w.toolbar_double; ui.toolbar_advanced = w.toolbar_advanced; ui.task_bar = w.task_bar; + ui.task_bar_hidden_actions = w.task_bar_hidden_actions.clone(); ui.dock = w.dock; ui.tab_hid = None; ui.dock_tab = w.dock_tab; @@ -905,4 +911,42 @@ mod tests { let read: UiState = serde_json::from_value(prefs).unwrap(); assert!(read.control_bar_hidden_groups.is_empty(), "older preferences show every group"); } + + /// A workspace keeps the Contextual Task Bar's actions its Bar Actions has off: switching + /// brings each workspace's back, Reset turns a built-in workspace's on again, and they survive + /// the preferences' JSON. A workspace saved without them, or with ids the bar does not have, + /// shows every action, or the ones it names that the bar has. + #[test] + fn saved_workspaces_restore_the_task_bar_actions() { + let hidden = |ids: &[&str]| ids.iter().map(|s| s.to_string()).collect::>(); + let mut ui = UiState { task_bar_hidden_actions: hidden(&["duplicate", "fill"]), ..Default::default() }; + save_as(&mut ui, "Lean").unwrap(); + switch(&mut ui, ESSENTIALS).unwrap(); + assert!(ui.task_bar_hidden_actions.is_empty(), "Essentials shows every action"); + ui.task_bar_hidden_actions = hidden(&["simplify"]); + switch(&mut ui, "Lean").unwrap(); + assert_eq!(ui.task_bar_hidden_actions, hidden(&["duplicate", "fill"]), "the saved workspace's actions"); + switch(&mut ui, ESSENTIALS).unwrap(); + assert_eq!(ui.task_bar_hidden_actions, hidden(&["simplify"]), "Essentials as it was left"); + reset(&mut ui); + assert!(ui.task_bar_hidden_actions.is_empty(), "Reset Essentials shows every action again"); + switch(&mut ui, "Lean").unwrap(); + let json = serde_json::to_value(&ui).unwrap(); + assert_eq!(json["custom_workspaces"][0]["taskBarHiddenActions"], serde_json::json!(["duplicate", "fill"])); + let back: UiState = serde_json::from_value(json).unwrap(); + assert_eq!(back.task_bar_hidden_actions, hidden(&["duplicate", "fill"]), "kept in the preferences"); + assert_eq!(back.custom_workspaces[0].task_bar_hidden_actions, hidden(&["duplicate", "fill"]), "kept with the workspace"); + let mut old = serde_json::to_value(&back.custom_workspaces[0]).unwrap(); + assert!(old.as_object_mut().unwrap().remove("taskBarHiddenActions").is_some()); + let old: Workspace = serde_json::from_value(old).unwrap(); + apply(&mut ui, &old); + assert!(ui.task_bar_hidden_actions.is_empty(), "an older workspace shows every action"); + let mut prefs = serde_json::to_value(&back).unwrap(); + prefs["custom_workspaces"][0]["taskBarHiddenActions"] = serde_json::json!(["fill", "teleport", 3]); + let read: UiState = serde_json::from_value(prefs.clone()).unwrap(); + assert_eq!(read.custom_workspaces[0].task_bar_hidden_actions, hidden(&["fill"]), "ids the bar does not have are dropped"); + prefs["custom_workspaces"][0]["taskBarHiddenActions"] = serde_json::json!("fill"); + let read: UiState = serde_json::from_value(prefs).unwrap(); + assert!(read.custom_workspaces[0].task_bar_hidden_actions.is_empty(), "a value that is not a list shows every action"); + } } diff --git a/docs/mcp.md b/docs/mcp.md index 5bc273289c..b7cbb49c0f 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -8176,6 +8176,24 @@ is kept with the preferences and with the workspace; a workspace or preferences and a group id the bar does not have is dropped when they are read. Another `group`, or none, fails with "`group` must be one of …", and a `visible` that is not true or false fails with "`visible` must be true or false"; either leaves every group as it is. The groups and their contents are VectorCraft's own. +`window.taskBar.actions {action, visible?}` (desktop app) turns one of the Contextual Task Bar's actions or chips on +(`visible: true`), off (`false`) or toggles it (omitted), and returns `{action, visible}`. The actions are `imageTrace`, +`cropImage`, `removeBackground`, `removeAnchorPoints`, `join` (Connect and Join), `cutPath`, `convertToCorner`, +`convertToSmooth`, `group`, `makeClippingMask`, `unite`, `expand`, `editClippingPath`, `releaseClippingMask`, +`ungroup`, `isolate`, `editPath`, `releaseCompoundPath`, `createOutlines`, `convertToPointType`, `convertToAreaType`, +`typeOnPathOptions`, `centerOnTop`, `centerOnBottom`, `dynamicText`, `offsetPath`, `simplify`, `smooth`, `duplicate`, +`drawPencil`, `placeImage`, `fidelity` and `smoothToolOptions` (the Smooth tool's), and `resizeArtboard`, +`duplicateArtboards`, `rearrangeArtboards` and `exportArtboards` (the Artboard tool's); the chips are `fill`, `stroke`, +`recolor` (Recolor Artwork), `lock` and `shapeProperties` (a basic shape's Shape Properties, in Lock's place). The bar's +More Options menu has Bar Actions, which lists the actions and chips the bar offers for the current selection or tool, +each checked while it is on, and runs the command for the one clicked. An action or chip that is off stays out of the +bar and out of More Options wherever the bar would offer it; turning one off changes only the bar. Every action starts +on. The type font controls are not in Bar Actions and stay on the bar. Which actions are off is kept with the preferences +and with the workspace; a workspace or preferences saved without them show every action, and an id the bar does not have +is dropped when they are read. Another `action`, or none, fails with "`action` must be one of …", and a +`visible` that is not true or false fails with "`visible` must be true or false"; either leaves every action as it is. +`window.taskBar.resetActions {}` (More Options › Reset Bar Actions) turns every action and chip on again and returns +the ids it turned on. Choosing the bar's actions is VectorCraft's own. ```json {"name":"run_command","arguments":{"command":"file.new","params":{"preset":"A4","orientation":"landscape","artboards":4,"artboardLayout":{"columns":2},"bleed":9}}} diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index b1b68855fb..b1eaefd513 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1038,6 +1038,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - The contextual task bar offers more next steps by selection (): an open path Join and Edit Path (the Direct Selection tool), a closed path Edit Path, a compound path Edit Path and Release Compound Path, a clipping group Edit Clipping Path and Release Clipping Mask instead of Ungroup and Isolate, an image selected with vector art Make Clipping Mask instead of Unite, point or area type Convert To Area Type or Convert To Point Type beside Create Outlines, and type on a path, for which the overview names an item to add an effect and rearrange the text, Type on a Path Options (`type.pathOptions`; its options: ) beside Create Outlines. Evidence: `crates/ui-egui/src/tests/taskbar.rs`. - While a Type tool (Type, Area Type, Type on a Path and their vertical versions) adds or edits type, the contextual task bar shows the font family menu, the font style menu, the Font Size combo and the Fill chip (); the Touch Type tool shows no bar, as the same page describes. Type selected with a selection tool shows the same three font controls beside its Create Outlines, conversion and Type on a Path items (). The controls act as the Character panel's do: on the characters a Type tool selects, else on every selected type object, with the size left blank where the sizes differ. VectorCraft's own rules: a Type tool's bar leaves out the object actions, the Stroke chip, Recolor Artwork and Lock; a Type tool shows no bar before it adds type or with other art selected; type selected with other art shows no font controls; the font controls go on a second row when one row would be wider than the canvas, and narrow to fit a canvas narrower than they are; while a Type tool edits type, the Fill chip shows the edited characters' fill ("?" where it differs). Evidence: `the_type_tools_show_font_and_fill_controls`, `the_type_tools_show_no_bar_without_type`, `selected_type_shows_font_controls_beside_its_actions`, `the_task_bars_font_size_sets_what_the_character_panel_would`, `the_type_tools_fill_chip_activates_the_fill`, `the_type_tools_bar_is_named_and_stays_on_the_canvas`, `selected_types_font_controls_take_a_second_row_on_a_narrow_canvas` and `the_type_tools_fill_chip_shows_the_edited_characters_fill` in `crates/ui-egui/src/tests/taskbar.rs`. - The help page describes the contextual task bar as one horizontal row () and gives no rule for a canvas narrower than that row. VectorCraft's own rule: the bar stays whole on the canvas. When its actions don't fit in one row, they wrap, in order, onto rows under the row with the handle, the chips and More Options; an action wider than any row, or one that would need a row past the canvas's height, is listed in More Options instead; when the chips don't fit beside the handle and More Options, they take rows after the actions; with no row to spare for the font controls, the bar leaves them out; a canvas too small for the handle and More Options shows no bar. Evidence: `a_task_bars_actions_wrap_on_a_narrow_canvas` and `a_task_bar_action_wider_than_the_canvas_goes_in_more_options` in `crates/ui-egui/src/tests/taskbar.rs`. + - The contextual task bar's More Options menu has Bar Actions, which lists the actions and the Fill, Stroke, Recolor Artwork, Lock or Shape Properties chips the bar offers for the current selection or tool, each checked while it is on, and Reset Bar Actions, which turns every one on again (`window.taskBar.actions`, `window.taskBar.resetActions`). An action that is off stays out of the bar and out of More Options wherever the bar would offer it; turning one off changes only the bar. The type font controls are not in Bar Actions. Which actions are off is kept with the preferences and with the workspace. Choosing the bar's actions is VectorCraft's own. Evidence: `an_action_turned_off_leaves_the_bar_and_stays_in_its_menu`, `an_action_turned_off_is_not_listed_in_more_options`, `every_action_the_bar_offers_can_be_turned_off`, `a_chip_turned_off_leaves_the_bar`, `reset_bar_actions_shows_every_action_again`, `bar_actions_are_kept_with_the_preferences` and `more_options_bar_actions_turns_an_action_off_and_on` in `crates/ui-egui/src/tests/taskbar.rs`, and `saved_workspaces_restore_the_task_bar_actions` in `crates/ui-egui/src/workspaces.rs`. - With a live rectangle, rounded rectangle, ellipse or polygon selected with the Selection tool, the contextual task bar shows a Shape Properties button in place of Lock. It opens a popup with the shape's rows from the Transform panel (corner radius, pie angles, or sides, angle, corner and radius), which edit it through `object.setLiveShape`. The overview describes this: when a shape drawn with a shape tool (Rectangle, Star) is selected, the bar offers to change its properties where Lock Object would be ([Contextual Task Bar overview](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/contextual-task-bar-overview.html)). Object › Lock and ⌘2 still lock the shape. Not done: stars, which the app draws as plain paths. Evidence: `a_basic_shape_shows_its_properties_in_place_of_lock`, `the_shape_properties_popup_edits_the_shape` and `other_selections_keep_lock` in `crates/ui-egui/src/tests/taskbar.rs`. - While the Rectangle, Rounded Rectangle, Ellipse, Polygon or Star tool is in use, the contextual task bar offers Edit Path (the Direct Selection tool), the Fill and Stroke chips, and Shape Properties for the shape it draws, as the help page lists for those five tools (). VectorCraft's own rules: the bar shows while one of those tools has one closed path selected whole, as right after it draws one, and not with nothing selected, several objects, a group, an open path, type or picked-out anchors; it shows nothing during the drag that draws the shape; it leaves out the selection tools' Duplicate, Offset Path, Simplify, Recolor Artwork and Lock; the Line Segment tool shows no bar. Not done: Shape Properties for a star, which the app draws as a plain path, and Gen Shape Fill and Generate Vectors, which the app doesn't have. Evidence: `shape_tools_show_edit_path_paint_and_properties_after_drawing`, `shape_tools_have_no_shape_bar_without_a_single_shape` and `shape_tool_bar_retargets_after_another_shape_and_undo` in `crates/ui-egui/src/tests/taskbar.rs`. - While the Smooth tool is in use with a path it can smooth selected (a path with three or more anchors, or two joined by a curve, on its own or inside a selected group), the contextual task bar shows the tool's Fidelity field and Tool Options…, which opens the Smooth tool's options. The overview says the Smooth tool's bar has its tool options (), and the tool's help page names Fidelity as its option (). A value typed or stepped in the field sets the tool's Fidelity through `tool.setOption`, with the same range, unit (screen pixels) and steps as the field in its options. VectorCraft's own rules: with nothing selected, or only straight lines or type selected, the tool shows no bar; the bar leaves out the selection tools' actions, the Fill and Stroke chips, Recolor Artwork and Lock; on a canvas too narrow for the field, More Options lists Fidelity, which opens the tool's options. Evidence: `the_smooth_tool_shows_fidelity_and_tool_options_for_a_path` and `the_smooth_tool_shows_no_bar_without_a_path_to_smooth` in `crates/ui-egui/src/tests/taskbar.rs`. From ccb9cf93f5fdfef123fde5c5ea858be6a8fbddbe Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 00:04:51 -0800 Subject: [PATCH 36/55] Contextual Task Bar: Bar Actions names without a full-width colon, wider coverage test Bar Actions listed the Smooth tool's Fidelity with its colon in Chinese, where the catalogs write a full-width colon, and with a trailing no-break space in French. bar_action_name now trims the colon in either width, the space before it and a final ellipsis. every_action_the_bar_offers_can_be_turned_off now also covers an Image Trace object's Expand, Dynamic Text on point, area and path type, the Type tool's bar and the chips. With every action and chip off, it checks that the bar still shows its handle and More Options, where Bar Actions turns them on again; docs/mcp.md and the progress-doc line say so. --- crates/ui-egui/src/canvas.rs | 2 +- crates/ui-egui/src/canvas/task_bar.rs | 28 ++++++++----- crates/ui-egui/src/tests/taskbar.rs | 57 +++++++++++++++++++++++---- docs/mcp.md | 6 ++- docs/target-app-parity.md | 2 +- 5 files changed, 74 insertions(+), 21 deletions(-) diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 316681b493..1ae7fd0aff 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -74,7 +74,7 @@ pub use selection_marks::SelectionMarks; use task_bar::task_bar; pub(crate) use task_bar::{TASK_BAR_ACTIONS, TASK_BAR_CHIPS, is_task_bar_action, read_hidden_task_bar_actions}; #[cfg(test)] -pub(crate) use task_bar::{chip_paints, images_with_other_art, task_bar_offered}; +pub(crate) use task_bar::{bar_action_name, chip_paints, images_with_other_art, task_bar_offered}; pub(crate) use task_bar::{has_colors, task_bar_rect, task_bar_shows_fonts, task_bar_shows_type}; #[cfg(test)] use tool_overlays::{DIAL_RADIUS, HiddenMarks}; diff --git a/crates/ui-egui/src/canvas/task_bar.rs b/crates/ui-egui/src/canvas/task_bar.rs index 7ba9ee4e94..c539197aff 100644 --- a/crates/ui-egui/src/canvas/task_bar.rs +++ b/crates/ui-egui/src/canvas/task_bar.rs @@ -19,8 +19,9 @@ pub(crate) fn task_bar_shows_fonts(ctx: &egui::Context) -> bool { task_bar_rect(ctx).is_some() && ctx.data(|d| d.get_temp::(task_bar_id().with("fonts")).unwrap_or(false)) } -/// The actions the Contextual Task Bar offered when it was last drawn, before Bar Actions left any -/// out: each one's name and its id in [`TASK_BAR_ACTIONS`] (none: Bar Actions cannot turn it off). +/// The actions and chips the Contextual Task Bar offered when it was last drawn, before Bar Actions +/// left any out: each one's name and its id in [`TASK_BAR_ACTIONS`] or [`TASK_BAR_CHIPS`] (none: +/// Bar Actions cannot turn it off). #[cfg(test)] pub(crate) fn task_bar_offered(ctx: &egui::Context) -> Vec<(String, Option<&'static str>)> { ctx.data(|d| d.get_temp(task_bar_id().with("offered")).unwrap_or_default()) @@ -191,7 +192,8 @@ pub(crate) fn task_bar_shows_type(app: &VectorcraftApp) -> bool { /// Its handle drags it anywhere on the canvas; unpinned it keeps that offset as it follows the /// selection, pinned it stays put ([`crate::state::TaskBarPlace`]). More Options › Bar Actions /// turns each action and chip the bar offers on or off ([`TASK_BAR_ACTIONS`], [`TASK_BAR_CHIPS`]); -/// the bar leaves out the ones that are off, and Reset Bar Actions shows them all again. +/// the bar leaves out the ones that are off, and Reset Bar Actions shows them all again. With every +/// one of them off, the bar still shows its handle and More Options, where they turn back on. pub(super) fn task_bar(app: &mut VectorcraftApp, ui: &mut Ui, xf: &Xf) { let t = Tokens::get(ui.ctx()); let on_artboards = app.session.tool_id() == "artboard"; @@ -364,11 +366,8 @@ pub(super) fn task_bar(app: &mut VectorcraftApp, ui: &mut Ui, xf: &Xf) { // the ones that are off there are left out of the bar. let hidden = &app.ui.task_bar_hidden_actions; #[cfg(test)] - ui.ctx().data_mut(|d| { - let ids: Vec<(String, Option<&'static str>)> = - items.iter().map(|(label, _, cmd, params)| (label.to_string(), action_id(cmd, params))).collect(); - d.insert_temp(task_bar_id().with("offered"), ids); - }); + let mut probe: Vec<(String, Option<&'static str>)> = + items.iter().map(|(label, _, cmd, params)| (label.to_string(), action_id(cmd, params))).collect(); let mut offered: Vec<(&str, &'static str)> = items.iter().filter_map(|(label, _, cmd, params)| Some((*label, action_id(cmd, params)?))).collect(); items.retain(|(_, _, cmd, params)| action_id(cmd, params).is_none_or(|a| !hidden.contains(a))); let bounds = xf.rect.shrink(8.0); @@ -392,6 +391,11 @@ pub(super) fn task_bar(app: &mut VectorcraftApp, ui: &mut Ui, xf: &Xf) { .filter_map(|(shown, chip)| shown.then_some(chip)) .collect(); offered.extend(chips.iter().map(|c| (c.label(shape.is_some()), c.id(shape.is_some())))); + #[cfg(test)] + { + probe.extend(chips.iter().map(|c| (c.label(shape.is_some()).to_string(), Some(c.id(shape.is_some()))))); + ui.ctx().data_mut(|d| d.insert_temp(task_bar_id().with("offered"), probe)); + } let chips: Vec = chips.into_iter().filter(|c| !hidden.contains(c.id(shape.is_some()))).collect(); let offered: Vec<(&str, &str, bool)> = offered.into_iter().map(|(label, action)| (label, action, !hidden.contains(action))).collect(); let any_hidden = !hidden.is_empty(); @@ -528,7 +532,7 @@ pub(super) fn task_bar(app: &mut VectorcraftApp, ui: &mut Ui, xf: &Xf) { ui.menu_button(format!(" {}", tl!("Bar Actions")), |ui| { ui.set_min_width(170.0); for (label, action, shown) in &offered { - if widgets::menu_item_name(ui, label.trim_end_matches([':', '…']), true, *shown) { + if widgets::menu_item_name(ui, bar_action_name(label), true, *shown) { run = Some(("window.taskBar.actions", json!({ "action": action }))); } } @@ -701,6 +705,12 @@ fn action_id(cmd: &str, params: &serde_json::Value) -> Option<&'static str> { TASK_BAR_ACTIONS.iter().find(|(_, c, t)| *c == cmd && *t == tool).map(|a| a.0) } +/// The name More Options › Bar Actions lists for the bar's item `label`: without a field's colon +/// (a full-width one too), the space some languages put before it, or a final ellipsis. +pub(crate) fn bar_action_name(label: &str) -> &str { + label.trim_end().trim_end_matches([':', ':', '…']).trim_end() +} + /// Reads the Contextual Task Bar's actions and chips that are off, as kept in the preferences. Ids /// the bar does not have are dropped, and a value that is not a list of strings reads as none off, /// so the bar shows every action. diff --git a/crates/ui-egui/src/tests/taskbar.rs b/crates/ui-egui/src/tests/taskbar.rs index 9b5ab37031..89ab5d324b 100644 --- a/crates/ui-egui/src/tests/taskbar.rs +++ b/crates/ui-egui/src/tests/taskbar.rs @@ -1803,10 +1803,11 @@ fn an_action_turned_off_is_not_listed_in_more_options() { assert!(on_bar.iter().chain(&menu).any(|t| t == "Duplicate"), "Duplicate is still offered: {on_bar:?} {menu:?}"); } -/// Every action the bar offers, for every kind of selection and tool, has an id in Bar Actions, -/// and with all of them turned off the bar shows none of them. That covers Connect and Join (both -/// `join`), the actions matched by the tool they switch to (`editPath`, `drawPencil`, -/// `smoothToolOptions`), the Smooth tool's Fidelity and the Artboard tool's actions. +/// Every action and chip the bar offers, for every kind of selection and tool, has an id in Bar +/// Actions, and with all of them turned off the bar shows none of them but still shows, with More +/// Options. That covers Connect and Join (both `join`), the actions matched by the tool they switch +/// to (`editPath`, `drawPencil`, `smoothToolOptions`), the Smooth tool's Fidelity, Dynamic Text, +/// an Image Trace object's Expand, the Type tool's Fill and the Artboard tool's actions. #[test] fn every_action_the_bar_offers_can_be_turned_off() { let dir = crate::tests_folder::Folder::new("ui-taskbar-actions"); @@ -1878,7 +1879,16 @@ fn every_action_the_bar_offers_can_be_turned_off() { let t = id(app.run("text.create", json!({"x": 60, "y": 80, "text": "Hello"})).unwrap()); select(app, &[t]); }), - &["createOutlines", "convertToAreaType"], + &["createOutlines", "convertToAreaType", "dynamicText", "fill", "stroke", "lock"], + ), + ( + "the Type tool with type selected", + Box::new(|app| { + let t = id(app.run("text.create", json!({"x": 60, "y": 80, "text": "Hello"})).unwrap()); + select(app, &[t]); + app.run("tool.select", json!({"tool": "type"})).unwrap(); + }), + &["fill"], ), ( "area type", @@ -1888,7 +1898,7 @@ fn every_action_the_bar_offers_can_be_turned_off() { app.run("type.convertToAreaType", json!({})).unwrap(); select(app, &[t]); }), - &["createOutlines", "convertToPointType"], + &["createOutlines", "convertToPointType", "dynamicText"], ), ( "type on a closed path", @@ -1897,7 +1907,15 @@ fn every_action_the_bar_offers_can_be_turned_off() { let t = id(app.run("text.createInPath", json!({"path": circle, "mode": "onPath", "text": "Round", "at": [90, 300]})).unwrap()); select(app, &[t]); }), - &["createOutlines", "typeOnPathOptions", "centerOnTop", "centerOnBottom"], + &["createOutlines", "typeOnPathOptions", "centerOnTop", "centerOnBottom", "dynamicText"], + ), + ( + "an Image Trace object", + Box::new(|app| { + place_image(app, &dir); + app.run("imageTrace.make", json!({"params": {}})).unwrap(); + }), + &["expand", "duplicate"], ), ( "an image", @@ -1967,9 +1985,32 @@ fn every_action_the_bar_offers_can_be_turned_off() { for action in &ids { show_action(&mut app, action, false); } - let (_, texts) = bar_texts(&mut app); + let (ctx, texts) = bar_texts(&mut app); for (label, _) in &offered { assert!(!has(&texts, label), "{case}: {label} is off: {texts:?}"); } + // The bar still shows, with More Options, where Bar Actions turns them back on. + assert!(canvas::task_bar_rect(&ctx).is_some(), "{case}: the bar still shows"); + let names: Vec = buttons(&mut app).1.into_iter().map(|(n, _)| n).collect(); + assert!(names.iter().any(|n| n == "More Options"), "{case}: {names:?}"); + for (label, _) in &offered { + assert!(!names.iter().any(|n| n == label), "{case}: {label} is off: {names:?}"); + } } } + +/// Bar Actions lists a field's name without its colon, as each language writes it, and an item +/// that opens a dialog without its ellipsis. +#[test] +fn bar_actions_list_names_without_a_colon_or_an_ellipsis() { + let lang = |code| crate::i18n::Lang::from_code(code).unwrap(); + for (code, label, name) in + [("en", "Fidelity:", "Fidelity"), ("en", "Tool Options…", "Tool Options"), ("fr", "Fidelity:", "Fidélité"), ("ja", "Fidelity:", "精度")] + .into_iter() + .chain([("zh-hans", "Fidelity:", "精确度"), ("zh-hant", "Fidelity:", "精確度"), ("zh-hans", "Tool Options…", "工具选项")]) + { + let label = crate::i18n::tr(lang(code), label); + assert_eq!(canvas::bar_action_name(label), name, "{code}: {label:?}"); + } + assert_eq!(canvas::bar_action_name("Duplicate"), "Duplicate"); +} diff --git a/docs/mcp.md b/docs/mcp.md index b7cbb49c0f..dd02cbefc1 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -8186,8 +8186,10 @@ every group as it is. The groups and their contents are VectorCraft's own. `duplicateArtboards`, `rearrangeArtboards` and `exportArtboards` (the Artboard tool's); the chips are `fill`, `stroke`, `recolor` (Recolor Artwork), `lock` and `shapeProperties` (a basic shape's Shape Properties, in Lock's place). The bar's More Options menu has Bar Actions, which lists the actions and chips the bar offers for the current selection or tool, -each checked while it is on, and runs the command for the one clicked. An action or chip that is off stays out of the -bar and out of More Options wherever the bar would offer it; turning one off changes only the bar. Every action starts +each checked while it is on and named without a final colon or ellipsis, and runs the command for the one clicked. An +action or chip that is off stays out of the bar and out of More Options wherever the bar would offer it; turning one off +changes only the bar. With every action and chip it would offer off, the bar still shows its handle and More Options, +where Bar Actions turns them on again. Every action starts on. The type font controls are not in Bar Actions and stay on the bar. Which actions are off is kept with the preferences and with the workspace; a workspace or preferences saved without them show every action, and an id the bar does not have is dropped when they are read. Another `action`, or none, fails with "`action` must be one of …", and a diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index b1eaefd513..02d20396ea 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1038,7 +1038,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - The contextual task bar offers more next steps by selection (): an open path Join and Edit Path (the Direct Selection tool), a closed path Edit Path, a compound path Edit Path and Release Compound Path, a clipping group Edit Clipping Path and Release Clipping Mask instead of Ungroup and Isolate, an image selected with vector art Make Clipping Mask instead of Unite, point or area type Convert To Area Type or Convert To Point Type beside Create Outlines, and type on a path, for which the overview names an item to add an effect and rearrange the text, Type on a Path Options (`type.pathOptions`; its options: ) beside Create Outlines. Evidence: `crates/ui-egui/src/tests/taskbar.rs`. - While a Type tool (Type, Area Type, Type on a Path and their vertical versions) adds or edits type, the contextual task bar shows the font family menu, the font style menu, the Font Size combo and the Fill chip (); the Touch Type tool shows no bar, as the same page describes. Type selected with a selection tool shows the same three font controls beside its Create Outlines, conversion and Type on a Path items (). The controls act as the Character panel's do: on the characters a Type tool selects, else on every selected type object, with the size left blank where the sizes differ. VectorCraft's own rules: a Type tool's bar leaves out the object actions, the Stroke chip, Recolor Artwork and Lock; a Type tool shows no bar before it adds type or with other art selected; type selected with other art shows no font controls; the font controls go on a second row when one row would be wider than the canvas, and narrow to fit a canvas narrower than they are; while a Type tool edits type, the Fill chip shows the edited characters' fill ("?" where it differs). Evidence: `the_type_tools_show_font_and_fill_controls`, `the_type_tools_show_no_bar_without_type`, `selected_type_shows_font_controls_beside_its_actions`, `the_task_bars_font_size_sets_what_the_character_panel_would`, `the_type_tools_fill_chip_activates_the_fill`, `the_type_tools_bar_is_named_and_stays_on_the_canvas`, `selected_types_font_controls_take_a_second_row_on_a_narrow_canvas` and `the_type_tools_fill_chip_shows_the_edited_characters_fill` in `crates/ui-egui/src/tests/taskbar.rs`. - The help page describes the contextual task bar as one horizontal row () and gives no rule for a canvas narrower than that row. VectorCraft's own rule: the bar stays whole on the canvas. When its actions don't fit in one row, they wrap, in order, onto rows under the row with the handle, the chips and More Options; an action wider than any row, or one that would need a row past the canvas's height, is listed in More Options instead; when the chips don't fit beside the handle and More Options, they take rows after the actions; with no row to spare for the font controls, the bar leaves them out; a canvas too small for the handle and More Options shows no bar. Evidence: `a_task_bars_actions_wrap_on_a_narrow_canvas` and `a_task_bar_action_wider_than_the_canvas_goes_in_more_options` in `crates/ui-egui/src/tests/taskbar.rs`. - - The contextual task bar's More Options menu has Bar Actions, which lists the actions and the Fill, Stroke, Recolor Artwork, Lock or Shape Properties chips the bar offers for the current selection or tool, each checked while it is on, and Reset Bar Actions, which turns every one on again (`window.taskBar.actions`, `window.taskBar.resetActions`). An action that is off stays out of the bar and out of More Options wherever the bar would offer it; turning one off changes only the bar. The type font controls are not in Bar Actions. Which actions are off is kept with the preferences and with the workspace. Choosing the bar's actions is VectorCraft's own. Evidence: `an_action_turned_off_leaves_the_bar_and_stays_in_its_menu`, `an_action_turned_off_is_not_listed_in_more_options`, `every_action_the_bar_offers_can_be_turned_off`, `a_chip_turned_off_leaves_the_bar`, `reset_bar_actions_shows_every_action_again`, `bar_actions_are_kept_with_the_preferences` and `more_options_bar_actions_turns_an_action_off_and_on` in `crates/ui-egui/src/tests/taskbar.rs`, and `saved_workspaces_restore_the_task_bar_actions` in `crates/ui-egui/src/workspaces.rs`. + - The contextual task bar's More Options menu has Bar Actions, which lists the actions and the Fill, Stroke, Recolor Artwork, Lock or Shape Properties chips the bar offers for the current selection or tool, each checked while it is on, and Reset Bar Actions, which turns every one on again (`window.taskBar.actions`, `window.taskBar.resetActions`). An action that is off stays out of the bar and out of More Options wherever the bar would offer it; turning one off changes only the bar. With all of them off, the bar still shows its handle and More Options. The type font controls are not in Bar Actions. Which actions are off is kept with the preferences and with the workspace. Choosing the bar's actions is VectorCraft's own. Evidence: `an_action_turned_off_leaves_the_bar_and_stays_in_its_menu`, `an_action_turned_off_is_not_listed_in_more_options`, `every_action_the_bar_offers_can_be_turned_off`, `a_chip_turned_off_leaves_the_bar`, `reset_bar_actions_shows_every_action_again`, `bar_actions_are_kept_with_the_preferences`, `bar_actions_list_names_without_a_colon_or_an_ellipsis` and `more_options_bar_actions_turns_an_action_off_and_on` in `crates/ui-egui/src/tests/taskbar.rs`, and `saved_workspaces_restore_the_task_bar_actions` in `crates/ui-egui/src/workspaces.rs`. - With a live rectangle, rounded rectangle, ellipse or polygon selected with the Selection tool, the contextual task bar shows a Shape Properties button in place of Lock. It opens a popup with the shape's rows from the Transform panel (corner radius, pie angles, or sides, angle, corner and radius), which edit it through `object.setLiveShape`. The overview describes this: when a shape drawn with a shape tool (Rectangle, Star) is selected, the bar offers to change its properties where Lock Object would be ([Contextual Task Bar overview](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/contextual-task-bar-overview.html)). Object › Lock and ⌘2 still lock the shape. Not done: stars, which the app draws as plain paths. Evidence: `a_basic_shape_shows_its_properties_in_place_of_lock`, `the_shape_properties_popup_edits_the_shape` and `other_selections_keep_lock` in `crates/ui-egui/src/tests/taskbar.rs`. - While the Rectangle, Rounded Rectangle, Ellipse, Polygon or Star tool is in use, the contextual task bar offers Edit Path (the Direct Selection tool), the Fill and Stroke chips, and Shape Properties for the shape it draws, as the help page lists for those five tools (). VectorCraft's own rules: the bar shows while one of those tools has one closed path selected whole, as right after it draws one, and not with nothing selected, several objects, a group, an open path, type or picked-out anchors; it shows nothing during the drag that draws the shape; it leaves out the selection tools' Duplicate, Offset Path, Simplify, Recolor Artwork and Lock; the Line Segment tool shows no bar. Not done: Shape Properties for a star, which the app draws as a plain path, and Gen Shape Fill and Generate Vectors, which the app doesn't have. Evidence: `shape_tools_show_edit_path_paint_and_properties_after_drawing`, `shape_tools_have_no_shape_bar_without_a_single_shape` and `shape_tool_bar_retargets_after_another_shape_and_undo` in `crates/ui-egui/src/tests/taskbar.rs`. - While the Smooth tool is in use with a path it can smooth selected (a path with three or more anchors, or two joined by a curve, on its own or inside a selected group), the contextual task bar shows the tool's Fidelity field and Tool Options…, which opens the Smooth tool's options. The overview says the Smooth tool's bar has its tool options (), and the tool's help page names Fidelity as its option (). A value typed or stepped in the field sets the tool's Fidelity through `tool.setOption`, with the same range, unit (screen pixels) and steps as the field in its options. VectorCraft's own rules: with nothing selected, or only straight lines or type selected, the tool shows no bar; the bar leaves out the selection tools' actions, the Fill and Stroke chips, Recolor Artwork and Lock; on a canvas too narrow for the field, More Options lists Fidelity, which opens the tool's options. Evidence: `the_smooth_tool_shows_fidelity_and_tool_options_for_a_path` and `the_smooth_tool_shows_no_bar_without_a_path_to_smooth` in `crates/ui-egui/src/tests/taskbar.rs`. From faa95b2eedd1c825940ebda96462aa726f470d6a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 00:45:46 -0800 Subject: [PATCH 37/55] Contextual Task Bar: record the offered actions as the bar's other probes do The bar now stores the actions and chips it offers in its egui memory on every frame, as it stores whether it shows the font controls and its size, instead of only in test builds. The list holds each name and id without copying the names, and Bar Actions reads the same list, so the bar builds it once per frame. task_bar.rs has no test-only code again; the coverage test reads the list through task_bar_id. --- crates/ui-egui/src/canvas.rs | 2 +- crates/ui-egui/src/canvas/task_bar.rs | 34 +++++++++------------------ crates/ui-egui/src/tests/taskbar.rs | 2 +- 3 files changed, 13 insertions(+), 25 deletions(-) diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 1ae7fd0aff..4dfcd0f0eb 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -74,7 +74,7 @@ pub use selection_marks::SelectionMarks; use task_bar::task_bar; pub(crate) use task_bar::{TASK_BAR_ACTIONS, TASK_BAR_CHIPS, is_task_bar_action, read_hidden_task_bar_actions}; #[cfg(test)] -pub(crate) use task_bar::{bar_action_name, chip_paints, images_with_other_art, task_bar_offered}; +pub(crate) use task_bar::{bar_action_name, chip_paints, images_with_other_art, task_bar_id}; pub(crate) use task_bar::{has_colors, task_bar_rect, task_bar_shows_fonts, task_bar_shows_type}; #[cfg(test)] use tool_overlays::{DIAL_RADIUS, HiddenMarks}; diff --git a/crates/ui-egui/src/canvas/task_bar.rs b/crates/ui-egui/src/canvas/task_bar.rs index c539197aff..9731d42a90 100644 --- a/crates/ui-egui/src/canvas/task_bar.rs +++ b/crates/ui-egui/src/canvas/task_bar.rs @@ -3,7 +3,7 @@ use super::{ }; /// The Contextual Task Bar's area. -fn task_bar_id() -> egui::Id { +pub(crate) fn task_bar_id() -> egui::Id { egui::Id::unique("task-bar") } @@ -19,14 +19,6 @@ pub(crate) fn task_bar_shows_fonts(ctx: &egui::Context) -> bool { task_bar_rect(ctx).is_some() && ctx.data(|d| d.get_temp::(task_bar_id().with("fonts")).unwrap_or(false)) } -/// The actions and chips the Contextual Task Bar offered when it was last drawn, before Bar Actions -/// left any out: each one's name and its id in [`TASK_BAR_ACTIONS`] or [`TASK_BAR_CHIPS`] (none: -/// Bar Actions cannot turn it off). -#[cfg(test)] -pub(crate) fn task_bar_offered(ctx: &egui::Context) -> Vec<(String, Option<&'static str>)> { - ctx.data(|d| d.get_temp(task_bar_id().with("offered")).unwrap_or_default()) -} - /// Whether the objects `ids` (or anything inside them) are painted with a colour: a solid colour, /// a gradient's stops or a mesh's points, which Recolor Artwork can change. pub(crate) fn has_colors(doc: &vectorcraft_doc::Document, ids: &[vectorcraft_doc::NodeId]) -> bool { @@ -362,13 +354,12 @@ pub(super) fn task_bar(app: &mut VectorcraftApp, ui: &mut Ui, xf: &Xf) { let paints = chip_paints(app, ui.ctx()); let colored = has_colors(&st.doc, &st.selection.objects); let doc = st.uid; - // Every action and chip the bar offers here, with its name, for More Options › Bar Actions; - // the ones that are off there are left out of the bar. + // Every action and chip the bar offers here, with its name and its id in TASK_BAR_ACTIONS or + // TASK_BAR_CHIPS (none: Bar Actions cannot turn it off), for More Options › Bar Actions; the + // ones that are off there are left out of the bar. let hidden = &app.ui.task_bar_hidden_actions; - #[cfg(test)] - let mut probe: Vec<(String, Option<&'static str>)> = - items.iter().map(|(label, _, cmd, params)| (label.to_string(), action_id(cmd, params))).collect(); - let mut offered: Vec<(&str, &'static str)> = items.iter().filter_map(|(label, _, cmd, params)| Some((*label, action_id(cmd, params)?))).collect(); + let mut offered: Vec<(&'static str, Option<&'static str>)> = + items.iter().map(|(label, _, cmd, params)| (*label, action_id(cmd, params))).collect(); items.retain(|(_, _, cmd, params)| action_id(cmd, params).is_none_or(|a| !hidden.contains(a))); let bounds = xf.rect.shrink(8.0); // The canvas's width less the frame's margins and stroke. @@ -390,14 +381,11 @@ pub(super) fn task_bar(app: &mut VectorcraftApp, ui: &mut Ui, xf: &Xf) { .into_iter() .filter_map(|(shown, chip)| shown.then_some(chip)) .collect(); - offered.extend(chips.iter().map(|c| (c.label(shape.is_some()), c.id(shape.is_some())))); - #[cfg(test)] - { - probe.extend(chips.iter().map(|c| (c.label(shape.is_some()).to_string(), Some(c.id(shape.is_some()))))); - ui.ctx().data_mut(|d| d.insert_temp(task_bar_id().with("offered"), probe)); - } + offered.extend(chips.iter().map(|c| (c.label(shape.is_some()), Some(c.id(shape.is_some()))))); let chips: Vec = chips.into_iter().filter(|c| !hidden.contains(c.id(shape.is_some()))).collect(); - let offered: Vec<(&str, &str, bool)> = offered.into_iter().map(|(label, action)| (label, action, !hidden.contains(action))).collect(); + let bar_actions: Vec<(&str, &str, bool)> = + offered.iter().filter_map(|&(label, action)| action.map(|a| (label, a, !hidden.contains(a)))).collect(); + ui.ctx().data_mut(|d| d.insert_temp(task_bar_id().with("offered"), offered)); let any_hidden = !hidden.is_empty(); let widths: Vec = items.iter().map(|(label, _, cmd, _)| item_width(ui, label, cmd)).collect(); let fidelity = app.session.tool_options()["fidelity"].as_f64(); @@ -531,7 +519,7 @@ pub(super) fn task_bar(app: &mut VectorcraftApp, ui: &mut Ui, xf: &Xf) { // Actions, which shows every action again. ui.menu_button(format!(" {}", tl!("Bar Actions")), |ui| { ui.set_min_width(170.0); - for (label, action, shown) in &offered { + for (label, action, shown) in &bar_actions { if widgets::menu_item_name(ui, bar_action_name(label), true, *shown) { run = Some(("window.taskBar.actions", json!({ "action": action }))); } diff --git a/crates/ui-egui/src/tests/taskbar.rs b/crates/ui-egui/src/tests/taskbar.rs index 89ab5d324b..8717c5dc2b 100644 --- a/crates/ui-egui/src/tests/taskbar.rs +++ b/crates/ui-egui/src/tests/taskbar.rs @@ -1973,7 +1973,7 @@ fn every_action_the_bar_offers_can_be_turned_off() { app.run("tool.select", json!({"tool": "selection"})).unwrap(); setup(&mut app); let (ctx, _) = bar(&mut app); - let offered = canvas::task_bar_offered(&ctx); + let offered: Vec<(&'static str, Option<&'static str>)> = ctx.data(|d| d.get_temp(canvas::task_bar_id().with("offered")).unwrap_or_default()); assert!(canvas::task_bar_rect(&ctx).is_some() && !offered.is_empty(), "{case}: the bar shows actions"); for (label, action) in &offered { assert!(action.is_some(), "{case}: {label} has no id in Bar Actions"); From 8575c41c35926214805f9473bd8c81ede4b549ee Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 00:46:08 -0800 Subject: [PATCH 38/55] Part of #5941: a click on a drop-down list's scroll bar leaves it open A click on the track of an open drop-down list's scroll bar scrolled the list and then closed it, and the list opened again with its current option in view, so an option scrolled into view that way could not be picked. A click that goes to the list's scroll bar now leaves the list open; any other click closes it as before. --- crates/ui-egui/src/widgets/dropdowns.rs | 18 +++-- crates/ui-egui/src/widgets/look_tests.rs | 92 ++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/widgets/dropdowns.rs b/crates/ui-egui/src/widgets/dropdowns.rs index 2ea0f48276..b8e0d17d6f 100644 --- a/crates/ui-egui/src/widgets/dropdowns.rs +++ b/crates/ui-egui/src/widgets/dropdowns.rs @@ -321,8 +321,9 @@ fn combo_button<'a>(ui: &mut Ui, button_id: egui::Id, current: impl egui::IntoAt /// The list of [`combo_atoms_named`] while it is open, drawn by `list` in a popup of its own that /// opens from `button` and takes the whole list whenever the window has room for it (#5941): below /// the button when it fits there, above it when it fits there instead, and otherwise shifted from -/// below into the window, over the button. A list taller than the window scrolls. Returns what -/// `list` returned, or `None` while the list is closed. +/// below into the window, over the button. A list taller than the window scrolls. A click closes +/// the list, except a click on its scroll bar, which scrolls it. Returns what `list` returned, or +/// `None` while the list is closed. fn combo_list(ui: &Ui, button: &Response, list: impl FnOnce(&mut Ui) -> R) -> Option { let ctx = ui.ctx(); let id = button.id.with("popup"); @@ -330,8 +331,13 @@ fn combo_list(ui: &Ui, button: &Response, list: impl FnOnce(&mut Ui) -> R) -> egui::containers::menu::menu_style(style); style.spacing.scroll = list_scroll_style(); }); - let popup = - egui::Popup::menu(button).id(id).width(button.rect.width()).style(style.clone()).close_behavior(egui::PopupCloseBehavior::CloseOnClick); + // The id of the list's scroll area. egui senses its vertical bar under the area's id with the + // axis, 1, and names the widget a click went to at the start of the pass. + let area_key = id.with("scroll-area-id"); + let on_bar = + ctx.data(|d| d.get_temp::(area_key)).is_some_and(|area| ctx.interaction_snapshot(|s| s.clicked == Some(area.with(1_usize)))); + let close = if on_bar { egui::PopupCloseBehavior::IgnoreClicks } else { egui::PopupCloseBehavior::CloseOnClick }; + let popup = egui::Popup::menu(button).id(id).width(button.rect.width()).style(style.clone()).close_behavior(close); let screen = ctx.content_rect(); // The room on each side of the rect the popup opens from: the part of the button in view. let anchor = popup.get_anchor_rect().unwrap_or(button.rect); @@ -364,7 +370,9 @@ fn combo_list(ui: &Ui, button: &Response, list: impl FnOnce(&mut Ui) -> R) -> ui.set_max_height(height); // Labels widen a narrow list rather than wrap, as in egui's combo box. ui.style_mut().wrap_mode = Some(egui::TextWrapMode::Extend); - egui::ScrollArea::vertical().max_height(height).show(ui, list).inner + let shown = egui::ScrollArea::vertical().max_height(height).show(ui, list); + ui.data_mut(|d| d.insert_temp(area_key, shown.id)); + shown.inner }); if shown.is_some() { ctx.accesskit_node_builder(id, |node| node.set_role(egui::Role::ListBox)); diff --git a/crates/ui-egui/src/widgets/look_tests.rs b/crates/ui-egui/src/widgets/look_tests.rs index 13ee6ebd58..24c67e79b4 100644 --- a/crates/ui-egui/src/widgets/look_tests.rs +++ b/crates/ui-egui/src/widgets/look_tests.rs @@ -971,6 +971,98 @@ fn a_dropdown_list_shows_every_option_when_the_window_has_room() { } } +// #5941: a click on the scroll bar's track of an open drop-down list scrolls it and leaves it open, +// so an option it scrolled into view can be picked. A list closed by that click would open again +// with its current option in view. +#[test] +fn a_click_on_a_dropdown_lists_scroll_bar_scrolls_it_and_leaves_it_open() { + let items: Vec = (0..40).map(|i| format!("Option {i:02}")).collect(); + let labels: Vec<&str> = items.iter().map(String::as_str).collect(); + let ctx = themed(Default::default()); + let field = std::cell::Cell::new(Rect::NOTHING); + let picked = std::cell::Cell::new(None); + let popup = std::cell::RefCell::new(vec![]); + let mut add = |ui: &mut Ui| { + ui.add_space(16.0); + let r = ui.horizontal(|ui| dropdown_names(ui, "bar-click", labels[0], &labels, 160.0)); + field.set(r.response.rect); + if let Some(i) = r.inner { + picked.set(Some(i)); + } + popup.replace(super::top_popup_shapes(ui.ctx())); + }; + let screen = Rect::from_min_size(Pos2::ZERO, vec2(400.0, 300.0)); + let mut time = 0.0; + // The options that show whole on the open list, with their rects, and the scroll bar's rects. + let mut run = |events: Vec| { + time += 0.1; + let mut out = ctx.run_ui(egui::RawInput { time: Some(time), screen_rect: Some(screen), events, ..Default::default() }, &mut add); + out.textures_delta.clear(); + let (mut texts, mut bars) = (vec![], vec![]); + fn flat(s: &egui::Shape, clip: Rect, out: &mut Vec<(String, Rect)>, bars: &mut Vec) { + match s { + egui::Shape::Vec(v) => v.iter().for_each(|s| flat(s, clip, out, bars)), + egui::Shape::Text(t) => { + let r = t.visual_bounding_rect(); + if r.top() >= clip.top() && r.bottom() <= clip.bottom() { + out.push((t.galley.text().to_owned(), r)); + } + } + egui::Shape::Rect(r) if r.fill.a() > 0 && r.rect.width() <= 8.0 && r.rect.height() > 40.0 => bars.push(r.rect), + _ => {} + } + } + popup.take().iter().for_each(|c| flat(&c.shape, c.clip_rect, &mut texts, &mut bars)); + (texts, bars) + }; + let list_rect = || { + ctx.memory(|m| m.layer_ids().filter(|l| l.order == egui::Order::Foreground && m.areas().is_visible(l)).last().and_then(|l| m.area_rect(l.id))) + }; + let click = + |at: Pos2, pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + run(vec![]); + let at = field.get().center(); + run(vec![egui::Event::PointerMoved(at), click(at, true)]); + run(vec![click(at, false)]); + let (mut before, mut bars) = (vec![], vec![]); + for _ in 0..4 { + (before, bars) = run(vec![]); + } + assert!(list_rect().is_some(), "the list is open"); + assert!(before.iter().any(|(s, _)| s == "Option 00"), "the list opens at its first option: {before:?}"); + // The track, below the handle: near the bottom of the tallest bar rect drawn (the track). + let bar = bars + .iter() + .copied() + .max_by(|a, b| a.height().total_cmp(&b.height())) + .unwrap_or_else(|| panic!("the list {:?} draws its scroll bar: {before:?}", list_rect())); + let track = pos2(bar.center().x, bar.bottom() - 6.0); + run(vec![egui::Event::PointerMoved(track), click(track, true)]); + run(vec![]); + // The button is let go just past the bar's edge, closer than a drag, and the pointer then moves + // sideways onto the rows, in the same pass. + let let_go = pos2(bar.right() + 1.0, track.y); + let onto_row = before.first().map(|(_, r)| pos2(r.center().x, track.y)).expect("a row shows"); + run(vec![egui::Event::PointerMoved(let_go), click(let_go, false), egui::Event::PointerMoved(onto_row)]); + let mut after = vec![]; + for _ in 0..4 { + (after, _) = run(vec![]); + } + assert!(list_rect().is_some(), "a click on the scroll bar leaves the list open"); + let new = after + .iter() + .find(|(s, _)| !before.iter().any(|(b, _)| b == s)) + .cloned() + .unwrap_or_else(|| panic!("the click scrolled options into view: {after:?}")); + let row = new.1.center(); + run(vec![egui::Event::PointerMoved(row), click(row, true)]); + run(vec![click(row, false)]); + run(vec![]); + let index = labels.iter().position(|l| *l == new.0); + assert_eq!(picked.get(), index, "the option scrolled into view is picked: {}", new.0); + assert!(list_rect().is_none(), "picking an option closes the list"); +} + /// Enter on text that reads as no number in a range field refuses it as a unit field does: the /// field flashes and an open dialog is not confirmed with the old value. #[test] From fe426f9bac7d5593ec9ab56310d3de1430cd9413 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 01:13:07 -0800 Subject: [PATCH 39/55] Contextual Task Bar: Bar Actions reads the offered list, coverage test edits type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The list of actions and chips the bar offers, stored on every frame, now holds whether each one shows, and More Options › Bar Actions reads it through task_bar_offered while its menu is open. The bar no longer builds a second list for the menu on every frame. The coverage test reads the same accessor, and it adds a case for the Type tool while it edits type, whose bar offers the Fill chip. --- crates/ui-egui/src/canvas.rs | 2 +- crates/ui-egui/src/canvas/task_bar.rs | 20 +++++++++++++++----- crates/ui-egui/src/tests/taskbar.rs | 12 ++++++++++-- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 4dfcd0f0eb..1ae7fd0aff 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -74,7 +74,7 @@ pub use selection_marks::SelectionMarks; use task_bar::task_bar; pub(crate) use task_bar::{TASK_BAR_ACTIONS, TASK_BAR_CHIPS, is_task_bar_action, read_hidden_task_bar_actions}; #[cfg(test)] -pub(crate) use task_bar::{bar_action_name, chip_paints, images_with_other_art, task_bar_id}; +pub(crate) use task_bar::{bar_action_name, chip_paints, images_with_other_art, task_bar_offered}; pub(crate) use task_bar::{has_colors, task_bar_rect, task_bar_shows_fonts, task_bar_shows_type}; #[cfg(test)] use tool_overlays::{DIAL_RADIUS, HiddenMarks}; diff --git a/crates/ui-egui/src/canvas/task_bar.rs b/crates/ui-egui/src/canvas/task_bar.rs index 9731d42a90..4ae3821b2c 100644 --- a/crates/ui-egui/src/canvas/task_bar.rs +++ b/crates/ui-egui/src/canvas/task_bar.rs @@ -3,7 +3,7 @@ use super::{ }; /// The Contextual Task Bar's area. -pub(crate) fn task_bar_id() -> egui::Id { +fn task_bar_id() -> egui::Id { egui::Id::unique("task-bar") } @@ -19,6 +19,14 @@ pub(crate) fn task_bar_shows_fonts(ctx: &egui::Context) -> bool { task_bar_rect(ctx).is_some() && ctx.data(|d| d.get_temp::(task_bar_id().with("fonts")).unwrap_or(false)) } +/// The actions and chips the Contextual Task Bar offered where it was last drawn, before Bar +/// Actions left any out, as More Options › Bar Actions lists them: each one's name, its id in +/// [`TASK_BAR_ACTIONS`] or [`TASK_BAR_CHIPS`] (none: Bar Actions cannot turn it off) and whether it +/// shows. +pub(crate) fn task_bar_offered(ctx: &egui::Context) -> Vec<(&'static str, Option<&'static str>, bool)> { + ctx.data(|d| d.get_temp(task_bar_id().with("offered")).unwrap_or_default()) +} + /// Whether the objects `ids` (or anything inside them) are painted with a colour: a solid colour, /// a gradient's stops or a mesh's points, which Recolor Artwork can change. pub(crate) fn has_colors(doc: &vectorcraft_doc::Document, ids: &[vectorcraft_doc::NodeId]) -> bool { @@ -383,8 +391,9 @@ pub(super) fn task_bar(app: &mut VectorcraftApp, ui: &mut Ui, xf: &Xf) { .collect(); offered.extend(chips.iter().map(|c| (c.label(shape.is_some()), Some(c.id(shape.is_some()))))); let chips: Vec = chips.into_iter().filter(|c| !hidden.contains(c.id(shape.is_some()))).collect(); - let bar_actions: Vec<(&str, &str, bool)> = - offered.iter().filter_map(|&(label, action)| action.map(|a| (label, a, !hidden.contains(a)))).collect(); + // Bar Actions reads this list through task_bar_offered while its menu is open. + let offered: Vec<(&'static str, Option<&'static str>, bool)> = + offered.into_iter().map(|(label, action)| (label, action, action.is_none_or(|a| !hidden.contains(a)))).collect(); ui.ctx().data_mut(|d| d.insert_temp(task_bar_id().with("offered"), offered)); let any_hidden = !hidden.is_empty(); let widths: Vec = items.iter().map(|(label, _, cmd, _)| item_width(ui, label, cmd)).collect(); @@ -519,8 +528,9 @@ pub(super) fn task_bar(app: &mut VectorcraftApp, ui: &mut Ui, xf: &Xf) { // Actions, which shows every action again. ui.menu_button(format!(" {}", tl!("Bar Actions")), |ui| { ui.set_min_width(170.0); - for (label, action, shown) in &bar_actions { - if widgets::menu_item_name(ui, bar_action_name(label), true, *shown) { + for (label, action, shown) in task_bar_offered(ui.ctx()) { + let Some(action) = action else { continue }; + if widgets::menu_item_name(ui, bar_action_name(label), true, shown) { run = Some(("window.taskBar.actions", json!({ "action": action }))); } } diff --git a/crates/ui-egui/src/tests/taskbar.rs b/crates/ui-egui/src/tests/taskbar.rs index 8717c5dc2b..5228831202 100644 --- a/crates/ui-egui/src/tests/taskbar.rs +++ b/crates/ui-egui/src/tests/taskbar.rs @@ -1807,7 +1807,8 @@ fn an_action_turned_off_is_not_listed_in_more_options() { /// Actions, and with all of them turned off the bar shows none of them but still shows, with More /// Options. That covers Connect and Join (both `join`), the actions matched by the tool they switch /// to (`editPath`, `drawPencil`, `smoothToolOptions`), the Smooth tool's Fidelity, Dynamic Text, -/// an Image Trace object's Expand, the Type tool's Fill and the Artboard tool's actions. +/// an Image Trace object's Expand, the Type tool's Fill with type selected and while it edits +/// type, and the Artboard tool's actions. #[test] fn every_action_the_bar_offers_can_be_turned_off() { let dir = crate::tests_folder::Folder::new("ui-taskbar-actions"); @@ -1890,6 +1891,13 @@ fn every_action_the_bar_offers_can_be_turned_off() { }), &["fill"], ), + ( + "the Type tool editing type", + Box::new(|app| { + edited_type(app, "type"); + }), + &["fill"], + ), ( "area type", Box::new(|app| { @@ -1973,7 +1981,7 @@ fn every_action_the_bar_offers_can_be_turned_off() { app.run("tool.select", json!({"tool": "selection"})).unwrap(); setup(&mut app); let (ctx, _) = bar(&mut app); - let offered: Vec<(&'static str, Option<&'static str>)> = ctx.data(|d| d.get_temp(canvas::task_bar_id().with("offered")).unwrap_or_default()); + let offered: Vec<(&str, Option<&str>)> = canvas::task_bar_offered(&ctx).into_iter().map(|(label, action, _)| (label, action)).collect(); assert!(canvas::task_bar_rect(&ctx).is_some() && !offered.is_empty(), "{case}: the bar shows actions"); for (label, action) in &offered { assert!(action.is_some(), "{case}: {label} has no id in Bar Actions"); From d15d0e817062793fcc3e2fc901e9cbe17adfdd4c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 01:39:50 -0800 Subject: [PATCH 40/55] Contextual Task Bar: Bar Actions drops a three-period ending, null visible is an error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit More Options › Bar Actions now leaves out a final "..." from an item's name, as it already leaves out a final "…". A name that ends in one period keeps it. window.taskBar.actions now fails on a `visible` of null, as its params text and docs/mcp.md say it does for any value that is not true or false, and leaves every action as it is. An omitted `visible` still toggles the action. --- crates/ui-egui/src/canvas/task_bar.rs | 7 +++++-- crates/ui-egui/src/menus/run.rs | 10 +++++++++- crates/ui-egui/src/tests/taskbar.rs | 10 +++++++++- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/canvas/task_bar.rs b/crates/ui-egui/src/canvas/task_bar.rs index 4ae3821b2c..74f8fa973a 100644 --- a/crates/ui-egui/src/canvas/task_bar.rs +++ b/crates/ui-egui/src/canvas/task_bar.rs @@ -704,9 +704,12 @@ fn action_id(cmd: &str, params: &serde_json::Value) -> Option<&'static str> { } /// The name More Options › Bar Actions lists for the bar's item `label`: without a field's colon -/// (a full-width one too), the space some languages put before it, or a final ellipsis. +/// (a full-width one too), the space some languages put before it, or a final ellipsis (`…` or +/// `...`). pub(crate) fn bar_action_name(label: &str) -> &str { - label.trim_end().trim_end_matches([':', ':', '…']).trim_end() + let label = label.trim_end(); + let label = label.strip_suffix("...").unwrap_or(label); + label.trim_end_matches([':', ':', '…']).trim_end() } /// Reads the Contextual Task Bar's actions and chips that are off, as kept in the preferences. Ids diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 0fbc656746..38c3e50dd3 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -640,7 +640,15 @@ fn run_ui_part6(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option match (s("action").filter(|a| crate::canvas::is_task_bar_action(a)), opt_bool(p, "visible")) { + // A `visible` of null is an error, as any other value that is not true or false is; only + // an omitted one toggles. + "window.taskBar.actions" => match ( + s("action").filter(|a| crate::canvas::is_task_bar_action(a)), + match p.get("visible") { + Some(Value::Null) => Err("`visible` must be true or false".to_string()), + _ => opt_bool(p, "visible"), + }, + ) { (None, _) => { let ids = crate::canvas::TASK_BAR_ACTIONS.iter().map(|a| a.0).chain(crate::canvas::TASK_BAR_CHIPS); Err(format!("`action` must be one of {}", ids.collect::>().join(", "))) diff --git a/crates/ui-egui/src/tests/taskbar.rs b/crates/ui-egui/src/tests/taskbar.rs index 5228831202..c6243adf0c 100644 --- a/crates/ui-egui/src/tests/taskbar.rs +++ b/crates/ui-egui/src/tests/taskbar.rs @@ -1677,7 +1677,13 @@ fn bar_action_ids_are_distinct() { fn bar_actions_refuse_bad_params() { let mut app = app(); show_action(&mut app, "group", false); - for p in [json!({"action": "teleport"}), json!({}), json!({"action": 3}), json!({"action": "unite", "visible": "yes"})] { + for p in [ + json!({"action": "teleport"}), + json!({}), + json!({"action": 3}), + json!({"action": "unite", "visible": "yes"}), + json!({"action": "unite", "visible": null}), + ] { assert!(app.run("window.taskBar.actions", p.clone()).is_err(), "{p}"); } let err = app.run("window.taskBar.actions", json!({"action": "teleport"})).unwrap_err(); @@ -2021,4 +2027,6 @@ fn bar_actions_list_names_without_a_colon_or_an_ellipsis() { assert_eq!(canvas::bar_action_name(label), name, "{code}: {label:?}"); } assert_eq!(canvas::bar_action_name("Duplicate"), "Duplicate"); + assert_eq!(canvas::bar_action_name("Tool Options..."), "Tool Options"); + assert_eq!(canvas::bar_action_name("Offset Path."), "Offset Path."); } From 9fc1a8db3342ff5f95dedb9382786fe7473ad03f Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 02:29:06 -0800 Subject: [PATCH 41/55] Part of #5941: a drop-down list wider than the window keeps its bar in view A drop-down list with an option wider than the window ran past the window's right edge, and its scroll bar with it, out of reach. Once a list measures wider than the window, it stays inside the window until it closes: its names are cut short, with the full name on hover, and it grows back to the width its names need, with the bar's column while it scrolls, when the window widens. The Gradient panel's Presets menu asks for 200 pt rows only as far as the window allows. --- crates/ui-egui/src/panels/gradient.rs | 2 +- crates/ui-egui/src/panels/gradient/tests.rs | 14 ++ crates/ui-egui/src/widgets/dropdowns.rs | 48 ++++++- crates/ui-egui/src/widgets/look_tests.rs | 144 ++++++++++++++++++++ 4 files changed, 203 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/panels/gradient.rs b/crates/ui-egui/src/panels/gradient.rs index 7baaa062ab..adf4dd723f 100644 --- a/crates/ui-egui/src/panels/gradient.rs +++ b/crates/ui-egui/src/panels/gradient.rs @@ -466,7 +466,7 @@ fn presets_row(app: &mut VectorcraftApp, ui: &mut Ui, g: Option<&GradientPaint>) /// the name of the one clicked. fn preset_list(app: &VectorcraftApp, ui: &mut Ui, shown: &str) -> Option { let t = Tokens::get(ui.ctx()); - ui.set_min_width(200.0); + widgets::menu_min_width(ui, 200.0); let mut chosen = None; // The library of the rows drawn last (`Some(None)`: the saved presets). let mut library: Option> = None; diff --git a/crates/ui-egui/src/panels/gradient/tests.rs b/crates/ui-egui/src/panels/gradient/tests.rs index bbf833b1aa..e4871b0886 100644 --- a/crates/ui-egui/src/panels/gradient/tests.rs +++ b/crates/ui-egui/src/panels/gradient/tests.rs @@ -797,6 +797,20 @@ fn text_at(texts: &[(String, Pos2)], s: &str) -> Option { texts.iter().find(|(t, _)| t.trim_start() == s).map(|(_, at)| *at) } +/// #5941: in a window narrower than the Presets menu's 200 pt rows, the menu stays inside the window, +/// so its scroll bar shows. +#[test] +fn the_presets_menu_stays_inside_a_narrow_window() { + let mut app = app(json!({"gradient": {}})); + let paint = current(&app).expect("a gradient fill"); + let mut window = PopupWindow::new(&mut app, 300.0, move |app, ui| presets_row(app, ui, Some(&paint))); + window.resize(&mut app, 190.0); + let label = window.text("Presets:").expect("the Presets row"); + window.click(&mut app, egui::pos2(label.right() + 40.0, label.center().y)); + let popup = window.popup().expect("the menu is open"); + assert!(popup.left() >= 0.0 && popup.right() <= 190.0, "the menu {popup:?} is inside the window"); +} + /// The Presets menu lists the presets by library (theme) and applies the one chosen to the /// gradient behind the active proxy, as one undo step; the menu then shows that preset. #[test] diff --git a/crates/ui-egui/src/widgets/dropdowns.rs b/crates/ui-egui/src/widgets/dropdowns.rs index b8e0d17d6f..e05235b411 100644 --- a/crates/ui-egui/src/widgets/dropdowns.rs +++ b/crates/ui-egui/src/widgets/dropdowns.rs @@ -361,21 +361,61 @@ fn combo_list(ui: &Ui, button: &Response, list: impl FnOnce(&mut Ui) -> R) -> }; let mut popup_style = (*ctx.global_style()).clone(); style.apply(&mut popup_style); - let frame = egui::Frame::popup(&popup_style).total_margin().sum().y; - let height = (screen.height() - frame).max(ui.spacing().interact_size.y); + let margins = egui::Frame::popup(&popup_style).total_margin().sum(); + let height = (screen.height() - margins.y).max(ui.spacing().interact_size.y); + // A list that was wider than the window keeps its scroll bar in view: until it closes, it is no + // wider than it measured or than the window, its names cut short and shown in full on hover. + // Only a size measured while the list is open counts: egui keeps the last one after it closes. + // The width it needs is its rows' width on the last pass before it was narrowed, with its + // margins, and the bar's column while the rows scroll. + let too_wide_key = id.with("too-wide"); + let natural_key = id.with("natural-width"); + let scrolls_key = id.with("scrolls"); + let open_last_pass = ctx.read_response(id).is_some(); + if popup.get_expected_size().is_some_and(|size| open_last_pass && size.x > screen.width()) { + // The first measurement is kept: later ones are of the list already narrowed. + ctx.data_mut(|d| { + if d.get_temp::(too_wide_key).is_none() { + let rows = d.get_temp::(natural_key).unwrap_or(screen.width()); + d.insert_temp(too_wide_key, rows); + } + }); + } + let (measured, scrolls) = ctx.data(|d| (d.get_temp::(too_wide_key), d.get_temp::(scrolls_key).unwrap_or(false))); + let too_wide = measured.is_some(); let shown = popup.align(align).align_alternatives(&[]).show(|ui| { + if let Some(rows) = measured { + let bar = if scrolls { list_scroll_style().allocated_width() } else { 0.0 }; + ui.set_max_width((rows + bar).min(screen.width() - margins.x).max(0.0)); + } ui.set_min_width(ui.available_width()); // A popup offers its contents the height it had on its last pass; the list is offered the // window's instead. ui.set_max_height(height); // Labels widen a narrow list rather than wrap, as in egui's combo box. - ui.style_mut().wrap_mode = Some(egui::TextWrapMode::Extend); + ui.style_mut().wrap_mode = Some(if too_wide { egui::TextWrapMode::Truncate } else { egui::TextWrapMode::Extend }); + let painted = ui.ctx().graphics(|g| g.get(ui.layer_id()).map_or(0, |shapes| shapes.all_entries().len())); let shown = egui::ScrollArea::vertical().max_height(height).show(ui, list); - ui.data_mut(|d| d.insert_temp(area_key, shown.id)); + if too_wide { + show_shortened_rows(ui, painted); + } + ui.data_mut(|d| { + if !too_wide { + d.insert_temp(natural_key, shown.content_size.x); + } + d.insert_temp(scrolls_key, shown.content_size.y > shown.inner_rect.height()); + d.insert_temp(area_key, shown.id); + }); shown.inner }); if shown.is_some() { ctx.accesskit_node_builder(id, |node| node.set_role(egui::Role::ListBox)); + } else { + ctx.data_mut(|d| { + d.remove::(too_wide_key); + d.remove::(natural_key); + d.remove::(scrolls_key); + }); } shown.map(|r| r.inner) } diff --git a/crates/ui-egui/src/widgets/look_tests.rs b/crates/ui-egui/src/widgets/look_tests.rs index 24c67e79b4..77c9af796c 100644 --- a/crates/ui-egui/src/widgets/look_tests.rs +++ b/crates/ui-egui/src/widgets/look_tests.rs @@ -1063,6 +1063,150 @@ fn a_click_on_a_dropdown_lists_scroll_bar_scrolls_it_and_leaves_it_open() { assert!(list_rect().is_none(), "picking an option closes the list"); } +// #5941: a drop-down list with an option wider than the window ran past the window's right edge, +// and its scroll bar with it. The list stays inside the window and its bar shows; the long option's +// name is cut short. +#[test] +fn a_dropdown_list_wider_than_the_window_keeps_its_scroll_bar_in_view() { + let mut items: Vec = (0..40).map(|i| format!("Option {i:02}")).collect(); + items[1] = "Option 01, whose name is much wider than this window".into(); + let labels: Vec<&str> = items.iter().map(String::as_str).collect(); + let short: Vec<&str> = labels.iter().copied().filter(|l| l.len() < 10).collect(); + let two: Vec<&str> = labels[..2].to_vec(); + // Which list the field offers: 0 all, 1 the short names, 2 the first two. + let offered = std::cell::Cell::new(0); + let ctx = themed(Default::default()); + let field = std::cell::Cell::new(Rect::NOTHING); + let popup = std::cell::RefCell::new(vec![]); + let mut add = |ui: &mut Ui| { + ui.add_space(16.0); + let options = [&labels, &short, &two][offered.get()]; + field.set(ui.horizontal(|ui| dropdown_names(ui, "wide-list", options[0], options, 160.0)).response.rect); + popup.replace(super::top_popup_shapes(ui.ctx())); + }; + let screen = Rect::from_min_size(Pos2::ZERO, vec2(220.0, 300.0)); + let window = std::cell::Cell::new(screen); + let mut time = 0.0; + // The texts painted on the open list with their clip rects, and the scroll bar's rects. + let mut run = |events: Vec| { + time += 0.1; + let mut out = ctx.run_ui(egui::RawInput { time: Some(time), screen_rect: Some(window.get()), events, ..Default::default() }, &mut add); + out.textures_delta.clear(); + let (mut texts, mut bars) = (vec![], vec![]); + fn flat(s: &egui::Shape, clip: Rect, texts: &mut Vec<(String, bool)>, bars: &mut Vec) { + match s { + egui::Shape::Vec(v) => v.iter().for_each(|s| flat(s, clip, texts, bars)), + egui::Shape::Text(t) => texts.push((t.galley.text().to_owned(), t.galley.elided)), + egui::Shape::Rect(r) if r.fill.a() > 0 && r.rect.width() <= 8.0 && r.rect.height() > 40.0 => bars.push(r.rect.intersect(clip)), + _ => {} + } + } + popup.take().iter().for_each(|c| flat(&c.shape, c.clip_rect, &mut texts, &mut bars)); + (texts, bars) + }; + run(vec![]); + let at = field.get().center(); + let press = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + run(vec![egui::Event::PointerMoved(at), press(true)]); + run(vec![press(false)]); + run(vec![egui::Event::PointerMoved(pos2(210.0, 290.0))]); + let (mut texts, mut bars) = (vec![], vec![]); + for _ in 0..6 { + (texts, bars) = run(vec![]); + } + let list_rect = || { + ctx.memory(|m| m.layer_ids().filter(|l| l.order == egui::Order::Foreground && m.areas().is_visible(l)).last().and_then(|l| m.area_rect(l.id))) + }; + let list = list_rect().expect("the list is open"); + assert!(screen.contains_rect(list), "the list {list:?} is inside the window"); + assert!( + bars.iter().any(|b| b.width() > 0.0 && screen.contains_rect(*b) && list.contains_rect(*b)), + "the bar shows in the list {list:?}: {bars:?}" + ); + assert!(texts.iter().any(|(s, elided)| *elided && s.starts_with("Option 01")), "the long name is cut short: {texts:?}"); + // The window grows while the list is open: the list grows as wide as its names need, and no + // wider. + window.set(Rect::from_min_size(Pos2::ZERO, vec2(1000.0, 300.0))); + for _ in 0..6 { + (texts, _) = run(vec![]); + } + let grown = list_rect().expect("the list is still open"); + assert!(grown.width() < 500.0, "the list {grown:?} stays as wide as its names need"); + assert!(texts.iter().any(|(s, elided)| !*elided && s == labels[1]), "the long name shows in full: {texts:?}"); + // Narrowed and widened again, it comes back to the same width. + for size in [screen.size(), vec2(1000.0, 300.0)] { + window.set(Rect::from_min_size(Pos2::ZERO, size)); + for _ in 0..6 { + run(vec![]); + } + } + let again = list_rect().expect("the list is still open"); + assert!((again.width() - grown.width()).abs() < 0.5, "the list is as wide as before: {again:?}, {grown:?}"); + // Closed, the window narrowed again and the long option gone: the list opens as narrow as its + // names, not as wide as the window. + let escape = |pressed| egui::Event::Key { key: egui::Key::Escape, physical_key: None, pressed, repeat: false, modifiers: Default::default() }; + run(vec![escape(true)]); + run(vec![escape(false)]); + assert!(list_rect().is_none(), "Escape closes the list"); + window.set(screen); + offered.set(1); + run(vec![]); + let at = field.get().center(); + let press = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + run(vec![egui::Event::PointerMoved(at), press(true)]); + run(vec![press(false)]); + run(vec![egui::Event::PointerMoved(pos2(210.0, 290.0))]); + let mut widths = vec![]; + for _ in 0..4 { + run(vec![]); + widths.push(list_rect().expect("the list is open").width()); + } + assert!(widths.iter().all(|w| *w < 180.0), "the list of short names stays narrow: {widths:?}"); + // Opened in a wide window, narrowed and widened again: it comes back to the width it opened at, + // the long list that scrolls and a list of two that does not. + for (which, count) in [(0, "40"), (2, "2")] { + run(vec![escape(true)]); + run(vec![escape(false)]); + offered.set(which); + window.set(Rect::from_min_size(Pos2::ZERO, vec2(1000.0, 300.0))); + run(vec![]); + run(vec![egui::Event::PointerMoved(at), press(true)]); + run(vec![press(false)]); + run(vec![egui::Event::PointerMoved(pos2(990.0, 290.0))]); + for _ in 0..6 { + run(vec![]); + } + let opened = list_rect().expect("the list is open"); + for size in [screen.size(), vec2(1000.0, 300.0)] { + window.set(Rect::from_min_size(Pos2::ZERO, size)); + for _ in 0..6 { + run(vec![]); + } + } + let restored = list_rect().expect("the list is still open"); + // Within the half point that egui rounds a popup's position to. + assert!((restored.width() - opened.width()).abs() < 0.5, "{count} options: the list is as wide as it opened: {restored:?}, {opened:?}"); + } + // Opened in a narrow window tall enough for every option, then made wide and short: the list + // scrolls now, and its bar's column comes on top of the long name, which shows in full. + run(vec![escape(true)]); + run(vec![escape(false)]); + offered.set(0); + window.set(Rect::from_min_size(Pos2::ZERO, vec2(220.0, 1400.0))); + run(vec![]); + run(vec![egui::Event::PointerMoved(at), press(true)]); + run(vec![press(false)]); + run(vec![egui::Event::PointerMoved(pos2(210.0, 1390.0))]); + for _ in 0..6 { + run(vec![]); + } + window.set(Rect::from_min_size(Pos2::ZERO, vec2(1000.0, 300.0))); + for _ in 0..6 { + (texts, _) = run(vec![]); + } + assert!(texts.iter().any(|(s, elided)| !*elided && s == labels[1]), "the long name shows in full beside the bar: {texts:?}"); +} + /// Enter on text that reads as no number in a range field refuses it as a unit field does: the /// field flashes and an open dialog is not confirmed with the old value. #[test] From e16d59661ce98f91db6e58f1a8884cb235668fed Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 02:16:47 -0800 Subject: [PATCH 42/55] Contextual Task Bar: Bar Actions names drop a colon and an ellipsis in any order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit More Options › Bar Actions now leaves out a final colon and a final ellipsis ("…" or "...") whichever comes last, with or without a space between them, so "Name...:" and "Name: ..." are listed as "Name". window.taskBar.actions treats a `visible` of null as omitted again, so the action toggles, as docs/mcp.md says for every command's params and as window.control.options does. Its params text and docs/mcp.md entry now say that null toggles, and a test covers it. --- crates/mcp/src/ui_catalog.rs | 2 +- crates/ui-egui/src/canvas/task_bar.rs | 14 ++++++++++---- crates/ui-egui/src/menus/run.rs | 10 +--------- crates/ui-egui/src/menus/ui_commands.rs | 2 +- crates/ui-egui/src/tests/taskbar.rs | 23 ++++++++++++++++------- docs/mcp.md | 5 +++-- 6 files changed, 32 insertions(+), 24 deletions(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index bfe50afa36..2f6851e42c 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -679,7 +679,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "window.taskBar.actions", "Bar Actions", "", - "{action: \"imageTrace\"|\"cropImage\"|\"removeBackground\"|\"removeAnchorPoints\"|\"join\"|\"cutPath\"|\"convertToCorner\"|\"convertToSmooth\"|\"group\"|\"makeClippingMask\"|\"unite\"|\"expand\"|\"editClippingPath\"|\"releaseClippingMask\"|\"ungroup\"|\"isolate\"|\"editPath\"|\"releaseCompoundPath\"|\"createOutlines\"|\"convertToPointType\"|\"convertToAreaType\"|\"typeOnPathOptions\"|\"centerOnTop\"|\"centerOnBottom\"|\"dynamicText\"|\"offsetPath\"|\"simplify\"|\"smooth\"|\"duplicate\"|\"drawPencil\"|\"placeImage\"|\"fidelity\"|\"smoothToolOptions\"|\"resizeArtboard\"|\"duplicateArtboards\"|\"rearrangeArtboards\"|\"exportArtboards\"|\"fill\"|\"stroke\"|\"recolor\"|\"lock\"|\"shapeProperties\", visible?: bool} show (true), hide (false) or toggle (omitted) one of the Contextual Task Bar's actions or chips, as the bar's More Options › Bar Actions does; an action that is off stays out of the bar and out of More Options, and turning one off changes only the bar; `join` is both Connect and Join; every action starts on; kept with the preferences and with the workspace; another action, or a `visible` that is not true or false, is an error and changes nothing; returns {action, visible}", + "{action: \"imageTrace\"|\"cropImage\"|\"removeBackground\"|\"removeAnchorPoints\"|\"join\"|\"cutPath\"|\"convertToCorner\"|\"convertToSmooth\"|\"group\"|\"makeClippingMask\"|\"unite\"|\"expand\"|\"editClippingPath\"|\"releaseClippingMask\"|\"ungroup\"|\"isolate\"|\"editPath\"|\"releaseCompoundPath\"|\"createOutlines\"|\"convertToPointType\"|\"convertToAreaType\"|\"typeOnPathOptions\"|\"centerOnTop\"|\"centerOnBottom\"|\"dynamicText\"|\"offsetPath\"|\"simplify\"|\"smooth\"|\"duplicate\"|\"drawPencil\"|\"placeImage\"|\"fidelity\"|\"smoothToolOptions\"|\"resizeArtboard\"|\"duplicateArtboards\"|\"rearrangeArtboards\"|\"exportArtboards\"|\"fill\"|\"stroke\"|\"recolor\"|\"lock\"|\"shapeProperties\", visible?: bool} show (true), hide (false) or toggle (omitted or null) one of the Contextual Task Bar's actions or chips, as the bar's More Options › Bar Actions does; an action that is off stays out of the bar and out of More Options, and turning one off changes only the bar; `join` is both Connect and Join; every action starts on; kept with the preferences and with the workspace; another action, or a `visible` that is not true, false or null, is an error and changes nothing; returns {action, visible}", ), ( "window.taskBar.resetActions", diff --git a/crates/ui-egui/src/canvas/task_bar.rs b/crates/ui-egui/src/canvas/task_bar.rs index 74f8fa973a..03ced4f7c6 100644 --- a/crates/ui-egui/src/canvas/task_bar.rs +++ b/crates/ui-egui/src/canvas/task_bar.rs @@ -705,11 +705,17 @@ fn action_id(cmd: &str, params: &serde_json::Value) -> Option<&'static str> { /// The name More Options › Bar Actions lists for the bar's item `label`: without a field's colon /// (a full-width one too), the space some languages put before it, or a final ellipsis (`…` or -/// `...`). +/// `...`), in whichever order they come. pub(crate) fn bar_action_name(label: &str) -> &str { - let label = label.trim_end(); - let label = label.strip_suffix("...").unwrap_or(label); - label.trim_end_matches([':', ':', '…']).trim_end() + let mut name = label.trim_end(); + loop { + let rest = name.trim_end_matches([':', ':', '…']); + let rest = rest.strip_suffix("...").unwrap_or(rest).trim_end(); + if rest == name { + return name; + } + name = rest; + } } /// Reads the Contextual Task Bar's actions and chips that are off, as kept in the preferences. Ids diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 38c3e50dd3..0fbc656746 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -640,15 +640,7 @@ fn run_ui_part6(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option match ( - s("action").filter(|a| crate::canvas::is_task_bar_action(a)), - match p.get("visible") { - Some(Value::Null) => Err("`visible` must be true or false".to_string()), - _ => opt_bool(p, "visible"), - }, - ) { + "window.taskBar.actions" => match (s("action").filter(|a| crate::canvas::is_task_bar_action(a)), opt_bool(p, "visible")) { (None, _) => { let ids = crate::canvas::TASK_BAR_ACTIONS.iter().map(|a| a.0).chain(crate::canvas::TASK_BAR_CHIPS); Err(format!("`action` must be one of {}", ids.collect::>().join(", "))) diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index 0845f5f08b..03b3a1b62b 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -680,7 +680,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "window.taskBar.actions", "Bar Actions", "", - "{action: \"imageTrace\"|\"cropImage\"|\"removeBackground\"|\"removeAnchorPoints\"|\"join\"|\"cutPath\"|\"convertToCorner\"|\"convertToSmooth\"|\"group\"|\"makeClippingMask\"|\"unite\"|\"expand\"|\"editClippingPath\"|\"releaseClippingMask\"|\"ungroup\"|\"isolate\"|\"editPath\"|\"releaseCompoundPath\"|\"createOutlines\"|\"convertToPointType\"|\"convertToAreaType\"|\"typeOnPathOptions\"|\"centerOnTop\"|\"centerOnBottom\"|\"dynamicText\"|\"offsetPath\"|\"simplify\"|\"smooth\"|\"duplicate\"|\"drawPencil\"|\"placeImage\"|\"fidelity\"|\"smoothToolOptions\"|\"resizeArtboard\"|\"duplicateArtboards\"|\"rearrangeArtboards\"|\"exportArtboards\"|\"fill\"|\"stroke\"|\"recolor\"|\"lock\"|\"shapeProperties\", visible?: bool} show (true), hide (false) or toggle (omitted) one of the Contextual Task Bar's actions or chips, as the bar's More Options › Bar Actions does; an action that is off stays out of the bar and out of More Options, and turning one off changes only the bar; `join` is both Connect and Join; every action starts on; kept with the preferences and with the workspace; another action, or a `visible` that is not true or false, is an error and changes nothing; returns {action, visible}", + "{action: \"imageTrace\"|\"cropImage\"|\"removeBackground\"|\"removeAnchorPoints\"|\"join\"|\"cutPath\"|\"convertToCorner\"|\"convertToSmooth\"|\"group\"|\"makeClippingMask\"|\"unite\"|\"expand\"|\"editClippingPath\"|\"releaseClippingMask\"|\"ungroup\"|\"isolate\"|\"editPath\"|\"releaseCompoundPath\"|\"createOutlines\"|\"convertToPointType\"|\"convertToAreaType\"|\"typeOnPathOptions\"|\"centerOnTop\"|\"centerOnBottom\"|\"dynamicText\"|\"offsetPath\"|\"simplify\"|\"smooth\"|\"duplicate\"|\"drawPencil\"|\"placeImage\"|\"fidelity\"|\"smoothToolOptions\"|\"resizeArtboard\"|\"duplicateArtboards\"|\"rearrangeArtboards\"|\"exportArtboards\"|\"fill\"|\"stroke\"|\"recolor\"|\"lock\"|\"shapeProperties\", visible?: bool} show (true), hide (false) or toggle (omitted or null) one of the Contextual Task Bar's actions or chips, as the bar's More Options › Bar Actions does; an action that is off stays out of the bar and out of More Options, and turning one off changes only the bar; `join` is both Connect and Join; every action starts on; kept with the preferences and with the workspace; another action, or a `visible` that is not true, false or null, is an error and changes nothing; returns {action, visible}", ), ( "window.taskBar.resetActions", diff --git a/crates/ui-egui/src/tests/taskbar.rs b/crates/ui-egui/src/tests/taskbar.rs index c6243adf0c..fc01daa133 100644 --- a/crates/ui-egui/src/tests/taskbar.rs +++ b/crates/ui-egui/src/tests/taskbar.rs @@ -1608,6 +1608,9 @@ fn an_action_turned_off_leaves_the_bar_and_stays_in_its_menu() { assert_eq!(app.run("window.taskBar.actions", json!({"action": "offsetPath"})).unwrap(), json!({"action": "offsetPath", "visible": true})); let (_, texts) = bar(&mut app); assert!(has(&texts, "Offset Path"), "{texts:?}"); + // A `visible` of null counts as omitted and toggles too. + let r = app.run("window.taskBar.actions", json!({"action": "offsetPath", "visible": null})).unwrap(); + assert_eq!(r, json!({"action": "offsetPath", "visible": false})); } /// The Fill, Stroke, Recolor Artwork, Lock and Shape Properties chips each turn off on their own: @@ -1677,13 +1680,7 @@ fn bar_action_ids_are_distinct() { fn bar_actions_refuse_bad_params() { let mut app = app(); show_action(&mut app, "group", false); - for p in [ - json!({"action": "teleport"}), - json!({}), - json!({"action": 3}), - json!({"action": "unite", "visible": "yes"}), - json!({"action": "unite", "visible": null}), - ] { + for p in [json!({"action": "teleport"}), json!({}), json!({"action": 3}), json!({"action": "unite", "visible": "yes"})] { assert!(app.run("window.taskBar.actions", p.clone()).is_err(), "{p}"); } let err = app.run("window.taskBar.actions", json!({"action": "teleport"})).unwrap_err(); @@ -2029,4 +2026,16 @@ fn bar_actions_list_names_without_a_colon_or_an_ellipsis() { assert_eq!(canvas::bar_action_name("Duplicate"), "Duplicate"); assert_eq!(canvas::bar_action_name("Tool Options..."), "Tool Options"); assert_eq!(canvas::bar_action_name("Offset Path."), "Offset Path."); + // The colon and the ellipsis go in either order, with or without a space between them. + for label in [ + "Tool Options...:", + "Tool Options... :", + "Tool Options: ...", + "Tool Options …:", + "Tool Options… :", + "Tool Options…\u{a0}:", + "Tool Options...\u{202f}:", + ] { + assert_eq!(canvas::bar_action_name(label), "Tool Options", "{label:?}"); + } } diff --git a/docs/mcp.md b/docs/mcp.md index dd02cbefc1..3121745656 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -8192,8 +8192,9 @@ changes only the bar. With every action and chip it would offer off, the bar sti where Bar Actions turns them on again. Every action starts on. The type font controls are not in Bar Actions and stay on the bar. Which actions are off is kept with the preferences and with the workspace; a workspace or preferences saved without them show every action, and an id the bar does not have -is dropped when they are read. Another `action`, or none, fails with "`action` must be one of …", and a -`visible` that is not true or false fails with "`visible` must be true or false"; either leaves every action as it is. +is dropped when they are read. A `visible` of null toggles, as an omitted one does. Another `action`, or none, fails +with "`action` must be one of …", and a `visible` that is not true, false or null fails with "`visible` must be true +or false"; either leaves every action as it is. `window.taskBar.resetActions {}` (More Options › Reset Bar Actions) turns every action and chip on again and returns the ids it turned on. Choosing the bar's actions is VectorCraft's own. From 54a964d4fa6c9d0fff8bc384204656a210b392f9 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 05:21:35 -0800 Subject: [PATCH 43/55] Tools: an option set during a press survives the press being dropped A dropped press puts back the persistent options the tool had when the press began. It also put back an option set while the press was held (tool.setOption or the desktop app's setter), and the next store of the tool's options wrote the old value over the new one. A General > Corner Radius change during a Rounded Rectangle press was undone the same way. - Setting an option of the tool that took the press updates the press's saved options with every option the set changed, so the dropped press keeps them. - Setting an option stores all of the tool's options, the drag's changes included, so a dropped press after such a set stores the options it puts back. - A Corner Radius change updates the held Rounded Rectangle press's saved radius. - Both hold when the tool lent a selection tool for the press (a Cmd-drag). --- crates/engine/src/cmd/prefscmds.rs | 7 +++ crates/engine/src/lib.rs | 3 + crates/engine/src/session/documents.rs | 1 + crates/engine/src/tests/toolsettings.rs | 80 +++++++++++++++++++++++++ crates/engine/src/tooling.rs | 69 ++++++++++++++++++--- 5 files changed, 153 insertions(+), 7 deletions(-) diff --git a/crates/engine/src/cmd/prefscmds.rs b/crates/engine/src/cmd/prefscmds.rs index f66322498e..49b6680bde 100644 --- a/crates/engine/src/cmd/prefscmds.rs +++ b/crates/engine/src/cmd/prefscmds.rs @@ -752,6 +752,13 @@ impl Session { t.set_option("cornerRadius", &r); } } + // A press of the tool that is dropped keeps the new radius, also when the tool lent a + // selection tool for the press. + if self.press_taken_by("roundedRectangle") + && let Some((_, saved)) = self.press_options.as_mut() + { + saved.insert("cornerRadius".into(), r); + } } if fonts_folder_changed { let folder = self.prefs.fonts_folder.trim(); diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 8cc6b4084e..6e2d79271a 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -324,6 +324,9 @@ pub struct Session { /// The id and persistent options of the tool when the press under way began, which a dropped /// press puts back ([`Session::drop_tool_press`]). pub(crate) press_options: Option<(String, serde_json::Map)>, + /// An option of the active tool was set during the press under way, which stored all of its + /// options, so a dropped press stores the options it puts back. + pub(crate) press_options_stored: bool, /// The engine saves the selection and active layer before a Type press and restores them if it drops. pub(crate) press_type_selection: Option<(Selection, Option)>, /// The freeform gradient point selected once the tool took the press under way, which a diff --git a/crates/engine/src/session/documents.rs b/crates/engine/src/session/documents.rs index 6ad8ed586e..11d8629a6e 100644 --- a/crates/engine/src/session/documents.rs +++ b/crates/engine/src/session/documents.rs @@ -135,6 +135,7 @@ impl Session { plane_widget_press: false, pointer_held: false, press_options: None, + press_options_stored: false, press_type_selection: None, press_point: None, ruler_guide: None, diff --git a/crates/engine/src/tests/toolsettings.rs b/crates/engine/src/tests/toolsettings.rs index fbde9edca7..69d382f2dc 100644 --- a/crates/engine/src/tests/toolsettings.rs +++ b/crates/engine/src/tests/toolsettings.rs @@ -138,6 +138,86 @@ fn a_dropped_press_does_not_keep_what_its_drag_changed() { assert_eq!(s.prefs.tool_settings["polygon"]["sides"], json!(7), "and stores its sides"); } +/// An option set with `tool.setOption` while a press is held survives the dropped press, in the +/// tool and in the stored options, while what the drag itself changed is put back in both. +#[test] +fn an_option_set_during_a_dropped_press_is_kept() { + let mut s = session(); + select(&mut s, "rectangularGrid"); + let v = ViewInfo { smart_guides: false, ..Default::default() }; + s.pointer(&PointerEvent::new(PointerKind::Down, 100.0, 100.0), v).unwrap(); + s.pointer(&PointerEvent::new(PointerKind::Drag, 200.0, 180.0), v).unwrap(); + s.tool_key(ToolKey::Up, Mods::default(), v).unwrap(); + s.tool_key(ToolKey::Right, Mods::default(), v).unwrap(); + assert_eq!((s.tool_options()["rows"].clone(), s.tool_options()["columns"].clone()), (json!(6), json!(6))); + s.set_tool_option_cmd(&json!({"key": "columns", "value": 9})).unwrap(); + s.drop_tool_press(v).unwrap(); + let o = s.tool_options(); + assert_eq!((o["rows"].clone(), o["columns"].clone()), (json!(5), json!(9)), "the drag's rows go back; the set columns stay"); + let saved = &s.prefs.tool_settings["rectangularGrid"]; + assert_eq!((saved["rows"].clone(), saved["columns"].clone()), (json!(5), json!(9)), "the drag's rows are not stored; the set columns are"); + select(&mut s, "selection"); + select(&mut s, "rectangularGrid"); + let o = s.tool_options(); + assert_eq!((o["rows"].clone(), o["columns"].clone()), (json!(5), json!(9)), "a tool switch keeps the set columns"); + // The same through the desktop app's setter. + s.pointer(&PointerEvent::new(PointerKind::Down, 100.0, 100.0), v).unwrap(); + s.pointer(&PointerEvent::new(PointerKind::Drag, 200.0, 180.0), v).unwrap(); + s.tool_key(ToolKey::Up, Mods::default(), v).unwrap(); + s.set_tool_option("columns", &json!(3)); + s.drop_tool_press(v).unwrap(); + let o = s.tool_options(); + assert_eq!((o["rows"].clone(), o["columns"].clone()), (json!(5), json!(3))); + let saved = &s.prefs.tool_settings["rectangularGrid"]; + assert_eq!((saved["rows"].clone(), saved["columns"].clone()), (json!(5), json!(3))); +} + +/// A Corner Radius preference set while a Rounded Rectangle press is held survives the dropped +/// press, in the tool and in the preference. +#[test] +fn a_corner_radius_set_during_a_dropped_press_is_kept() { + let mut s = session(); + select(&mut s, "roundedRectangle"); + let v = ViewInfo { smart_guides: false, ..Default::default() }; + s.pointer(&PointerEvent::new(PointerKind::Down, 100.0, 100.0), v).unwrap(); + s.pointer(&PointerEvent::new(PointerKind::Drag, 200.0, 180.0), v).unwrap(); + let mut p = s.prefs.clone(); + p.corner_radius = 30.0; + s.apply_prefs(p); + s.drop_tool_press(v).unwrap(); + assert_eq!(s.tool_options()["cornerRadius"].as_f64(), Some(30.0), "the tool keeps the new radius"); + assert_eq!(s.prefs.corner_radius, 30.0, "the preference keeps it"); +} + +/// An option set with `tool.setOption` on a tool that lent a selection tool for a Cmd-drag +/// survives the dropped press, in the tool and in the stored options. So does a Corner Radius +/// preference set while the Rounded Rectangle lends one. +#[test] +fn an_option_set_on_a_lending_tool_during_a_dropped_press_is_kept() { + let mut s = session(); + select(&mut s, "rectangularGrid"); + let v = ViewInfo { smart_guides: false, ..Default::default() }; + let cmd = Mods { cmd: true, ..Default::default() }; + s.pointer(&PointerEvent::new(PointerKind::Down, 100.0, 100.0).with_mods(cmd), v).unwrap(); + s.pointer(&PointerEvent::new(PointerKind::Drag, 200.0, 180.0).with_mods(cmd), v).unwrap(); + assert_eq!(s.lender.as_ref().map(|t| t.id()), Some("rectangularGrid"), "the press lent a selection tool"); + s.set_tool_option_cmd(&json!({"tool": "rectangularGrid", "key": "columns", "value": 9})).unwrap(); + s.drop_tool_press(v).unwrap(); + assert_eq!(s.tool_id(), "rectangularGrid", "the lending tool is back"); + assert_eq!(s.tool_options()["columns"], json!(9), "the tool keeps the set columns"); + assert_eq!(s.prefs.tool_settings["rectangularGrid"]["columns"], json!(9), "and stores them"); + select(&mut s, "roundedRectangle"); + s.pointer(&PointerEvent::new(PointerKind::Down, 100.0, 100.0).with_mods(cmd), v).unwrap(); + s.pointer(&PointerEvent::new(PointerKind::Drag, 200.0, 180.0).with_mods(cmd), v).unwrap(); + assert_eq!(s.lender.as_ref().map(|t| t.id()), Some("roundedRectangle"), "the press lent a selection tool"); + let mut p = s.prefs.clone(); + p.corner_radius = 30.0; + s.apply_prefs(p); + s.drop_tool_press(v).unwrap(); + assert_eq!(s.tool_options()["cornerRadius"].as_f64(), Some(30.0), "the tool keeps the new radius"); + assert_eq!(s.prefs.corner_radius, 30.0, "the preference keeps it"); +} + /// A dropped Pen press drops only the anchor it was placing: the path being drawn goes on with /// the next click. #[test] diff --git a/crates/engine/src/tooling.rs b/crates/engine/src/tooling.rs index 5f36c5a98e..13bda25533 100644 --- a/crates/engine/src/tooling.rs +++ b/crates/engine/src/tooling.rs @@ -611,13 +611,18 @@ impl Session { /// Escape, as during a drag, for most tools), and a release returns the tool to rest. Of what /// the tool asks for along the way, only a cancel and a notify run, so a marquee selects /// nothing and a click opens no size dialog. The tool gets back the persistent options it had - /// when the press began, and none of the press's changes to them are stored. A dropped Type - /// press restores the prior selection. The freeform gradient point selected once the tool - /// took the press is selected again. A press held while the tool computes an edit on another - /// thread has not reached the tool: it is removed from the held input with the pointer events - /// and tool keys held after it, and the tool is left as it is. A perspective plane key held - /// after it stays held, since the plane it picks outlasts a dropped press. Pointer events held - /// after the last held release belong to the press the tool has, and are removed with it. + /// when the press began, and none of the press's changes to them are stored. An option set + /// during the press with [`Self::set_tool_option`] or [`Self::set_tool_options`], or a General › + /// Corner Radius change during a Rounded Rectangle press, keeps its new value, also when the + /// tool lent a selection tool for the press (a Cmd-drag). Setting an option stores all of the + /// tool's options, the press's changes included, so the dropped press then stores the options + /// it puts back. A dropped Type press restores the prior selection. The freeform gradient + /// point selected once the tool took the press is selected again. A press held while the tool + /// computes an edit on another thread has not reached the tool: it is removed from the held + /// input with the pointer events and tool keys held after it, and the tool is left as it is. + /// A perspective plane key held after it stays held, since the plane it picks outlasts a + /// dropped press. Pointer events held after the last held release belong to the press the tool + /// has, and are removed with it. pub fn drop_tool_press(&mut self, view: ViewInfo) -> Result<()> { let (from, held) = self.held_press(); let keep: Vec = (self.held_input.iter().enumerate()) @@ -635,6 +640,7 @@ impl Session { // Nothing to roll back without a document; the tool still drops the press and gets the release. let _ = self.cancel_interaction(); let before = self.press_options.take(); + let stored = std::mem::take(&mut self.press_options_stored); let type_selection = self.press_type_selection.take(); let point = self.press_point.take(); let mut acts = self.with_tool_cx(view, |t, cx| t.drop_press(cx)); @@ -669,6 +675,11 @@ impl Session { self.tool.set_option(k, v); } } + // An option set during the press stored every option the tool had then, the press's + // changes included: those stored values are put back too. + if stored { + self.keep_tool_settings(); + } } r.map(drop) } @@ -706,6 +717,7 @@ impl Session { match ev.kind { PointerKind::Down => { self.press_options = Some((self.tool.id().to_string(), Self::persistent_options(self.tool.as_ref()))); + self.press_options_stored = false; self.press_type_selection = if matches!(self.tool.id(), "type" | "areaType" | "typeOnPath" | "verticalType" | "verticalAreaType" | "verticalTypeOnPath") { self.active().map(|st| (st.selection.clone(), st.active_layer)) @@ -715,6 +727,7 @@ impl Session { } PointerKind::Up => { self.press_options = None; + self.press_options_stored = false; self.press_type_selection = None; } _ => {} @@ -1309,9 +1322,12 @@ impl Session { if key == "queue" && self.tool.id() == "place" { self.note_place_queue_roots(); } + let before_press = self.options_before_press_set(); + let sets_pressed = self.press_taken_by(self.tool.id()); self.tool.set_option(key, v); self.tool_set_since_reset = true; self.keep_tool_settings(); + self.keep_press_set(before_press, |k| sets_pressed && k == key, sets_pressed); } /// Keep the automation roots in force now as those the place cursor's queue, being loaded, @@ -1356,6 +1372,8 @@ impl Session { self.note_place_queue_roots(); } let active = id.is_none_or(|id| id == self.tool.id()); + let before_press = self.options_before_press_set(); + let sets_pressed = self.press_taken_by(id.unwrap_or(self.tool.id())); // The tool that lent a selection tool for a Cmd-drag is the tool chosen, and active again // when the drag ends. let lender = id.is_some_and(|id| self.lender.as_deref().is_some_and(|l| l.id() == id)); @@ -1393,9 +1411,46 @@ impl Session { let set = other.id(); Self::restore_stores(&self.prefs, self.tool.as_mut(), |store| settings::stores(set).any(|(s, _)| s == store)); } + self.keep_press_set(before_press, |k| sets_pressed && values.contains_key(k), sets_pressed); out } + /// The tool that took the press under way: the active tool, or the tool that lent a selection + /// tool for it (a Cmd-drag), which the dropped press gives its options back to. + fn pressed_tool(&self) -> Option<&dyn Tool> { + let (pressed, _) = self.press_options.as_ref()?; + std::iter::once(&self.tool).chain(self.lender.as_ref()).map(|t| t.as_ref()).find(|t| t.id() == pressed) + } + + /// Tool `id` took the press under way ([`Self::pressed_tool`]). + pub(crate) fn press_taken_by(&self, id: &str) -> bool { + self.pressed_tool().is_some_and(|t| t.id() == id) + } + + /// The persistent options of the tool that took the press under way ([`Self::pressed_tool`]) + /// before an option is set: a dropped press puts back the options it began with, except those + /// the set changes ([`Self::keep_press_set`]). + fn options_before_press_set(&self) -> Option> { + self.pressed_tool().map(Self::persistent_options) + } + + /// After an option is set during a held press, the press's saved options take the options of + /// the tool that took the press that the set changed from `before` or named (`named`), so a + /// dropped press keeps them. `stored`: the set stored that tool's options, the press's changes + /// included, so a dropped press stores the options it puts back. + fn keep_press_set(&mut self, before: Option>, named: impl Fn(&str) -> bool, stored: bool) { + let Some(before) = before else { return }; + let Some(now) = self.pressed_tool().map(Self::persistent_options) else { return }; + self.press_options_stored |= stored; + if let Some((_, saved)) = self.press_options.as_mut() { + for (k, v) in now { + if before.get(&k) != Some(&v) || named(&k) { + saved.insert(k, v); + } + } + } + } + /// `tool.setOption {tool?, key?, value?, values?}` (a command of the desktop app and of the /// headless host): set one option (`key`, `value`) or several (`values`) of `tool` (default: /// the tool active when the call arrives, named before the edit in progress is finished) → its From d386d3280f2fed844c1bcbd3c8188150c17e08d5 Mon Sep 17 00:00:00 2001 From: ruchirguitar <113586074+ruchirguitar@users.noreply.github.com> Date: Thu, 19 Nov 2026 18:59:12 +0530 Subject: [PATCH 44/55] Links panel: add row context menu (Relink, Go to Link, Edit Original, Show in Folder) --- crates/ui-egui/src/panels/links.rs | 98 ++++++++++++++++++++---- crates/ui-egui/src/panels/tests_links.rs | 90 ++++++++++++++++++++++ docs/gaps.md | 4 +- docs/target-app-parity.md | 4 +- docs/ui-parity.md | 1 + 5 files changed, 179 insertions(+), 18 deletions(-) diff --git a/crates/ui-egui/src/panels/links.rs b/crates/ui-egui/src/panels/links.rs index cf68e1d5bd..eb60d5aa12 100644 --- a/crates/ui-egui/src/panels/links.rs +++ b/crates/ui-egui/src/panels/links.rs @@ -586,7 +586,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { let Some(st) = app.session.active() else { return }; let doc = st.doc.clone(); let thumbs = super::layers::ThumbSource::of(app, st, &doc); - let selected = selected_links(app, ui.ctx()); + let mut selected = selected_links(app, ui.ctx()); let rows: &[Value] = cache.list["links"].as_array().map_or(&[], Vec::as_slice); let mut clicked: Option<(u64, egui::Modifiers, bool)> = None; widgets::list_box(ui, |ui| { @@ -659,6 +659,14 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { .and_then(|m| doc.node(NodeId(m)).or_else(|| cache.nested_node(m).map(|n| &**n))) .map(|n| super::layers::shown_name(app, n, crate::i18n::current())); let resp = resp.on_hover_text(status_tip(r, mask)); + resp.widget_info(|| egui::WidgetInfo::selected(egui::Role::ListItem, ui.is_enabled(), selected.contains(&id), name)); + if resp.secondary_clicked() && !selected.contains(&id) { + click(app, ui.ctx(), rows, id, egui::Modifiers::NONE); + selected = selected_links(app, ui.ctx()); + } + resp.context_menu(|ui| { + row_context_menu(app, ui, r, id, &cache.list); + }); if resp.double_clicked() { clicked = Some((id, egui::Modifiers::NONE, true)); } else if resp.clicked() { @@ -728,6 +736,78 @@ fn break_link(app: &mut VectorcraftApp, ids: Vec) { }); } +/// Embed images `ids` (`links.embed`). +fn embed_images(app: &mut VectorcraftApp, ids: Vec) { + let r = app.run("links.embed", json!({ "ids": ids })); + report(app, r, |v| { + let missing = v["missing"].as_array().map_or(0, Vec::len); + let n = v["embedded"].as_array().map_or(0, Vec::len); + if missing == 0 { + crate::i18n::msg_n(n as u64, "Embedded {n} image", "Embedded {n} images", &[]) + } else { + crate::i18n::msg_n( + n as u64, + "Embedded {n} image; {missing} missing: relink them first", + "Embedded {n} images; {missing} missing: relink them first", + &[("missing", &missing.to_string())], + ) + } + }); +} + +/// An item's right-click context menu in the Links panel. +fn row_context_menu(app: &mut VectorcraftApp, ui: &mut Ui, r: &Value, id: u64, list: &Value) { + let selected = selected_links(app, ui.ctx()); + let sel = selected_rows(list, &selected); + let linked = ids(&sel, |r| r["linked"] == true); + let embedded: Vec<&Value> = sel.iter().copied().filter(|r| status_is(r, "embedded")).collect(); + let modified = ids(&sel, |r| status_is(r, "modified") || (r["preview"] == true && !status_is(r, "missing"))); + let can_edit = sel.iter().any(|r| r["linked"] == true && !status_is(r, "missing")); + let in_canvas = app.session.active().is_some_and(|st| st.doc.node(NodeId(id)).is_some()) && !nested_row(r); + + if menu_item(ui, tl!("Relink…"), !sel.is_empty() && can_pick(app), false) { + crate::menus::invoke(app, "ui.relinkDialog", json!({ "ids": ids(&sel, |_| true) })); + ui.close(); + } + if menu_item(ui, tl!("Go To Link"), in_canvas, false) { + go_to(app, id); + ui.close(); + } + if menu_item(ui, tl!("Update Link"), !modified.is_empty(), false) { + let r = app.run("links.update", json!({ "ids": modified })); + report(app, r, |v| updated_status(v["updated"].as_array().map_or(0, Vec::len))); + ui.close(); + } + if menu_item(ui, tl!("Edit Original"), can_edit, false) { + let file_arg = if r["linked"] == true && !status_is(r, "missing") { json!({ "id": id }) } else { file_row(&sel) }; + crate::menus::invoke(app, "links.editOriginal", file_arg); + ui.close(); + } + if menu_item(ui, tl!("Show in Folder"), can_edit, false) { + let file_arg = if r["linked"] == true && !status_is(r, "missing") { json!({ "id": id }) } else { file_row(&sel) }; + crate::menus::invoke(app, "links.reveal", file_arg); + ui.close(); + } + ui.separator(); + if status_is(r, "embedded") { + if menu_item(ui, tl!("Unembed…"), can_unembed(app, embedded.len()), false) { + match &embedded[..] { + [r] => { + if let Some(id) = r["id"].as_u64() { + let name = r["name"].as_str().unwrap_or("Image").to_string(); + unembed(app, id, &name); + } + } + rows => unembed_several(app, rows.iter().filter_map(|r| r["id"].as_u64()).collect()), + } + ui.close(); + } + } else if menu_item(ui, tl!("Embed Image"), !linked.is_empty(), false) { + embed_images(app, linked); + ui.close(); + } +} + /// The params of Edit Original and Show in Folder for the selected rows `sel`: the first linked /// row whose file is there (rows outside the layer tree included), else none (the selection's). fn file_row(sel: &[&Value]) -> Value { @@ -854,21 +934,7 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) { } ui.separator(); if menu_item(ui, tl!("Embed Image(s)"), !linked.is_empty(), false) { - let r = app.run("links.embed", json!({ "ids": linked })); - report(app, r, |v| { - let missing = v["missing"].as_array().map_or(0, Vec::len); - let n = v["embedded"].as_array().map_or(0, Vec::len); - if missing == 0 { - crate::i18n::msg_n(n as u64, "Embedded {n} image", "Embedded {n} images", &[]) - } else { - crate::i18n::msg_n( - n as u64, - "Embedded {n} image; {missing} missing: relink them first", - "Embedded {n} images; {missing} missing: relink them first", - &[("missing", &missing.to_string())], - ) - } - }); + embed_images(app, linked); } if menu_item(ui, tl!("Unembed…"), can_unembed(app, embedded.len()), false) { match &embedded[..] { diff --git a/crates/ui-egui/src/panels/tests_links.rs b/crates/ui-egui/src/panels/tests_links.rs index b681fcc5cf..2216c11b42 100644 --- a/crates/ui-egui/src/panels/tests_links.rs +++ b/crates/ui-egui/src/panels/tests_links.rs @@ -584,3 +584,93 @@ fn the_links_menu_items_run_commands() { assert!(ids("Edit").contains("links.editOriginal")); assert!(ids("Window").contains(super::links::ID)); } + +#[test] +fn right_click_context_menu_in_links_panel() { + use egui::vec2; + use egui_kittest::Harness; + use egui_kittest::kittest::{NodeT, Queryable}; + + let dir = Folder::new("context-menu"); + let (mut app, linked, embedded) = app(&dir); + + let revealed: Rc>> = Rc::default(); + let rev = revealed.clone(); + app.services.reveal = Some(Box::new(move |p: &str| { + rev.borrow_mut().push(p.to_string()); + Ok(()) + })); + + // Initially embedded is selected, linked is unselected + assert_eq!(selected(&app), vec![embedded]); + + let mut h = Harness::builder().with_size(vec2(280.0, 500.0)).with_accessibility_check(false).build_ui_state( + |ui, app: &mut VectorcraftApp| { + super::links::show(app, ui); + }, + app, + ); + h.run_steps(2); + + let right_click = |h: &mut Harness<'static, VectorcraftApp>, label: &str| { + let node = h.get_all_by_label(label).find(|n| n.accesskit_node().role() == egui::accesskit::Role::ListItem).unwrap(); + let pos = node.rect().center(); + h.event(egui::Event::PointerMoved(pos)); + h.event(egui::Event::PointerButton { pos, button: egui::PointerButton::Secondary, pressed: true, modifiers: Default::default() }); + h.event(egui::Event::PointerButton { pos, button: egui::PointerButton::Secondary, pressed: false, modifiers: Default::default() }); + h.run_steps(2); + }; + + // 1. Right-click unselected "linked.png": selects it and opens context menu + right_click(&mut h, "linked.png"); + assert_eq!(selected(h.state()), vec![linked], "right-clicking unselected row selects that row first"); + + let relink = h.get_by_label(" Relink…"); + let go_to = h.get_by_label(" Go To Link"); + let update = h.get_by_label(" Update Link"); + let edit_orig = h.get_by_label(" Edit Original"); + let show_folder = h.get_by_label(" Show in Folder"); + let embed_img = h.get_by_label(" Embed Image"); + + // "Relink…" is disabled because app has no pick_open service by default + assert!(relink.accesskit_node().is_disabled()); + // "Go To Link" is enabled because linked node is in canvas document + assert!(!go_to.accesskit_node().is_disabled()); + // "Update Link" is disabled because linked file is not modified + assert!(update.accesskit_node().is_disabled()); + // "Edit Original" and "Show in Folder" are enabled because linked file exists + assert!(!edit_orig.accesskit_node().is_disabled()); + assert!(!show_folder.accesskit_node().is_disabled()); + // "Embed Image" is enabled because it is a linked image + assert!(!embed_img.accesskit_node().is_disabled()); + + // 2. Click "Show in Folder" dispatches links.reveal + show_folder.click(); + h.run_steps(2); + assert_eq!(revealed.borrow().len(), 1); + assert!(revealed.borrow()[0].ends_with("linked.png")); + + // 3. Multi-selection: select both linked and embedded + h.state_mut().run("select.set", json!({"ids": [linked, embedded]})).unwrap(); + assert_eq!(selected(h.state()), vec![linked, embedded]); + + // Right-click "linked.png" while already selected in multi-selection: preserves selection + right_click(&mut h, "linked.png"); + assert_eq!(selected(h.state()), vec![linked, embedded], "right-clicking selected row preserves multi-selection"); + + // 4. Click "Go To Link" focuses the art on canvas via go_to + let go_to_btn = h.get_by_label(" Go To Link"); + assert!(!go_to_btn.accesskit_node().is_disabled()); + go_to_btn.click(); + h.run_steps(2); + assert_eq!(selected(h.state()), vec![linked]); + assert!(h.state().view().unwrap().fitted); + + // 5. Right-click embedded image: displays "Unembed…" while "Edit Original" and "Show in Folder" are disabled + right_click(&mut h, "embedded.png"); + assert_eq!(selected(h.state()), vec![embedded]); + let unembed_btn = h.get_by_label(" Unembed…"); + assert!(!unembed_btn.accesskit_node().is_disabled()); + assert!(h.get_by_label(" Edit Original").accesskit_node().is_disabled()); + assert!(h.get_by_label(" Show in Folder").accesskit_node().is_disabled()); +} diff --git a/docs/gaps.md b/docs/gaps.md index 288296debf..2a78cdd668 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -1,6 +1,6 @@ # Gaps -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-18 · **Change:** minor (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 (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. @@ -557,6 +557,7 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi run hyphenates in its own language (Character panel). English, eleven Indian languages, Bulgarian, Turkish and Russian have break points, and German, Polish, Portuguese and Italian have them in builds that embed their patterns; other languages stay whole apart from the Exceptions list (#394, #4947). +- **Done (2026-11-19):** Links panel row context menu: right-clicking a link row presents an item context menu offering Relink…, Go To Link, Update Link, Edit Original, Show in Folder, and Embed Image / Unembed…; right-clicking an unselected row selects it first, preserving selection if already part of a multi-selection. Tests in `crates/ui-egui/src/panels/tests_links.rs`. - **Done (2026-11-18, #8592):** Layers panel guide and blend spine row context menus: right-clicking a ruler guide row shows Hide / Show, Lock / Unlock, Release Guides, Delete and Locate Object / Locate Layer (selecting an unselected editable guide or preserving a multi-guide selection); right-clicking a blend spine row selects the blend and shows Select, Blend Options…, Reverse Spine, Reverse Front to Back, Expand, Release and Locate Object / Locate Layer. Tests in `crates/ui-egui/src/panels/layers/tests.rs`. - **Done (2026-11-14):** Layers panel row context menu: right-clicking a layer, group, or object row shows a context menu (Options…, Duplicate, Delete, Lock Others / Unlock All, Hide Others / Show All, Locate Object, Collect for Export) with proper selection behavior and Undo/Redo tracking. Tests in `crates/ui-egui/src/panels/layers/tests.rs`. - **Done (2026-11-18):** Layers panel guide row context menu: right-clicking a guide row presents specialized actions (Release Guide, Duplicate, Delete Guide, Lock/Unlock, Hide/Show). Clicking "Release Guide" converts the guide back to a normal unpainted path using `view.guides.release` in one undo step. Tests in `crates/ui-egui/src/panels/layers/tests.rs`. @@ -956,6 +957,7 @@ trap, and the defaults (0.25 pt, 100%, 40%) are VectorCraft's own, the pages giv | Date | Change | Summary | |---|---|---| +| 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. | | 2026-11-18 | minor | G4 type: Retype phase 1 (#4934), `type.retype` for outlined text that exactly matches an available font; near matches, the ranked font list and images remain. Scores and estimates unchanged | | 2026-11-18 | minor | Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged. See [production-preflight.md](production-preflight.md) for scope and limits. | diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 48b66331f3..5fd763a4b6 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-18 · **Change:** minor (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 (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: 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). > @@ -73,6 +73,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard | Date | Change | Summary | |---|---|---| +| 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-19 | minor | PDF import (#8549 follow-up): type filled and stroked after a page of type filled only came in as a filled object and a stroked one: since #8549 lines filled only are kept for a stroke pass too, and the glyphs of the lines finished past the 64 kept were remembered until the next stroke, so `2 Tr (Title) Tj` after more than 64 lines of type filled only took its first stroke for the start of a stroke pass over them, always once more than 4,096 glyphs had been finished so. Those glyphs are now forgotten when anything else is drawn (a path, an image, a Type 3 glyph's art, a change of blend mode or soft mask: nothing is drawn between an operator's fill pass and its stroke pass), and past the first 4,096 glyphs none are remembered instead of every stroke matching. A `TJ` over more lines than are kept still comes in as a filled object and a stroked one for each part, also when it ends where it began, and when a glyph kept as an outline comes before that (the line it starts keeps the glyphs of the lines finished). Remaining: with nothing drawn between them, type filled and stroked at exactly the place, font, size and text of a glyph filled only on a line finished so still comes in as a filled object and a stroked one, as the device can't tell its stroke pass from the start of one over that glyph. Tests: `type_filled_and_stroked_after_a_dense_page_of_filled_type_is_filled_and_stroked`, `type_filled_and_stroked_over_a_finished_glyph_after_a_path_is_filled_and_stroked`, `an_outline_glyph_in_a_tj_over_more_lines_than_are_kept_leaves_fill_and_stroke_apart`; scores and estimates unchanged. | | 2026-11-18 | minor | Layers: a layer whose art was all added to the selection from its target circle shows as targeted, as an object does (#8646). Scores and estimates unchanged. | | 2026-11-18 | minor | G11: SVG export writes physical unit suffixes on the root for documents with physical units (mm, cm, in, pc), preventing drawings from scaling to 75% in external tools and preserving units across round-trips (#864; general unit preference on restart remains open under #864). Tests: export_physical_units_writes_unit_suffixes (crates/svg/tests/it/import_units.rs) and svg_round_trip_preserves_document_units (crates/engine/src/cmd/fileio/tests_svg.rs). G11 estimate 8–15 → 6–13 h. | @@ -1341,6 +1342,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur Polygonal Lasso selects anchor points (and gradient mesh points) inside a straight-edged loop, with the Lasso's rule for which points are inside, and is listed under Object › Plug-ins and under its own heading in All Tools. It has no default shortcut or Basic toolbar slot. Each click sets a vertex. A double-click, Enter or a click on the first vertex closes the loop, Backspace or Delete removes the last vertex, Escape drops the loop, and Shift keeps the next segment to 45° steps. Shift or Alt held at the first click adds to or subtracts from the selection. This is a VectorCraft addition; scores and estimates are unchanged. Select by Artboards (Object › Plug-ins › Selection Tools, a VectorCraft addition: #5525, #5548, #5549) selects the objects overlapping, fully inside or fully outside one or more chosen artboards (`addon.select.byArtboards {artboards, relation}`). Overlapping is All on Active Artboard's test, shared as `select::on_artboard`; Fully inside means within one artboard, edges included; Fully outside means on none. It looks at what Select All takes, so hidden, locked and locked-artboard art stays out. Its dialog lists each artboard's number, name and size in the document's units, filters by name, chooses rows with click, Shift-click and Cmd/Ctrl-click, and fits a row's artboard in the window on double-click (`view.goToArtboard`). Tests: `crates/engine/src/cmd/addons/select/tests.rs`, `crates/ui-egui/src/addons/select/tests.rs`, `crates/engine/tests/command_sweep.rs`. Select by Link Status (Object › Plug-ins › Selection Tools and the Links panel menu, a VectorCraft addition: #5526) selects the image objects and placed documents whose link is linked (its file found unchanged), embedded, missing or modified, as `links.list` reports it (`addon.select.byLinkStatus {status, ids?, add?, zoom?}`); Select Linked, Embedded, Missing and Modified are off when no image has that status and add to the selection with Shift. Objects that are hidden or locked, inside a hidden or locked object or layer, on a template layer, on a locked artboard, or outside the isolated group are left out (the `select::is_selectable` test) and returned with the reason, and the status bar says how many, in plural forms of every catalog. Select by Link Status… lists each image and placed document with its name, status and format, searches by name, filters by status, picks rows with checkboxes and All / None, and zooms to the selection with the existing Zoom to Selection (`addon.arrange.zoomSelection`). Missing-link markers on the canvas are #5547. Tests: `crates/engine/src/cmd/addons/select/tests.rs` (`by_link_status`), `crates/ui-egui/src/addons/select/link_status/tests.rs`, `crates/engine/tests/command_sweep.rs`. + The Links panel provides an item right-click context menu on link rows offering Relink…, Go To Link, Update Link, Edit Original, Show in Folder, Separator, and Embed Image / Unembed…. Right-clicking an unselected row selects that row first; right-clicking a row that is already part of a multi-selection preserves the multi-selection. Tests: `panels::tests_links::right_click_context_menu_in_links_panel`. A marquee selects a clip group, or an object on a layer with a clipping mask, only when it reaches the area inside the clipping path, and it measures the art only within that path's bounds. Within the bounds of a mask that is not a rectangle, it can still select art that the mask hides. Direct Selection's marquee still selects the hidden anchor points inside it (#2345). When a clip group, a layer with a clipping mask or a single object in one is isolated, the Selection, Direct Selection and Group Selection tools also select the art that the mask hides, by a click or a marquee, and a drag from that art moves it (#3748). In isolation mode the canvas Unlock submenu also lists that art when it is locked. Outside isolation mode a click selects clipped art only inside the mask. A marquee selects a Shaper Group only when it reaches the art the group shows, not the original shapes kept under it, and Direct Selection's clicks and marquee do not select those shapes' anchor points. In Construction mode a marquee selects the original shapes, and Direct Selection selects their anchor points. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 6fb7985935..44a5ed852f 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -503,6 +503,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po | Canvas context menu | done | Right-clicking type opens the canvas menu, with Bullets and Numbering and Spelling. Right-clicking a path offers Object › Path › Simplify… and Smooth…, each opening what its menu item opens (#8344). Artboard rows, library groups and items, the rulers and floating toolbar grips have menus too. Gaps: other panels have none | | Layers panel row context menu | done | Right-clicking a layer/group/object row shows a context menu with Options…, Duplicate, Delete, Lock/Hide Others, Locate Object, and Collect for Export; right-clicking a ruler guide row shows Hide/Show, Lock/Unlock, Release Guides, Delete and Locate Object; right-clicking a blend spine row shows Select, Blend Options…, Reverse Spine, Reverse Front to Back, Expand, Release and Locate Object (#8592). | | Swatches item context menu (G12) | done | List and thumbnail items offer Swatch Options…, Duplicate Swatch and Delete Swatch for the clicked item. Right-click selects without applying paint; reserved/missing items disable actions. All 39 Swatches tests pass, including all five views and Undo; the regression fails with the menu hooks removed. Rendered headless menus inspected. Full workspace CI passed on Linux/WSL on the merged branch (all 13 gates), including the test-helper correction for the upstream compile error tracked in #7727; native Windows full CI has two unchanged engine-test failures. | +| Links panel row context menu (G12) | done | Right-clicking a link row presents an item context menu offering Relink…, Go To Link, Update Link, Edit Original, Show in Folder, and Embed Image / Unembed…; right-clicking an unselected row selects it first, preserving selection if already part of a multi-selection. Tests: `panels::tests_links::right_click_context_menu_in_links_panel`. | | SVG Interactivity panel: JavaScript for each object's events and the document's linked JavaScript files, written to SVG and read back as text | done | `svgInteractivity.*`, `ui.javascriptFilesDialog` | | Retype panel | partial | Window › Retype lists the fonts whose glyphs exactly match at least one selected outlined shape, ranked by how many shapes each matches, ten and then five more, with samples in three sizes and the user's own text; a click sets the font on selected live type (`retype.find`, `type.retypeFonts`). Opening it from the Type menu, the context menu and the Properties panel, filtering by font source and favorites, near matches, installed fonts not yet loaded and text in images are missing (#4934) | | Comments, Version History panels | missing | cloud features (out of scope) | From 537d8ce10b0b1854cb219b5704d581d85ec84abc Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 05:38:54 -0800 Subject: [PATCH 45/55] Contextual Task Bar: docs and test comment say a null visible toggles The opening sentence of the window.taskBar.actions entry in docs/mcp.md now says the action toggles when visible is omitted or null, as the params text does. The comment above bar_actions_refuse_bad_params now says a visible that is not true, false or null is an error. --- crates/ui-egui/src/tests/taskbar.rs | 4 ++-- docs/mcp.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/tests/taskbar.rs b/crates/ui-egui/src/tests/taskbar.rs index fc01daa133..1615681f57 100644 --- a/crates/ui-egui/src/tests/taskbar.rs +++ b/crates/ui-egui/src/tests/taskbar.rs @@ -1674,8 +1674,8 @@ fn bar_action_ids_are_distinct() { assert_eq!(runs.len(), canvas::TASK_BAR_ACTIONS.len()); } -/// An action the bar does not have, a missing one, or a `visible` that is not true or false is an -/// error and changes nothing. +/// An action the bar does not have, a missing one, or a `visible` that is not true, false or null is +/// an error and changes nothing. #[test] fn bar_actions_refuse_bad_params() { let mut app = app(); diff --git a/docs/mcp.md b/docs/mcp.md index 3121745656..1e2c93d7d6 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -8177,7 +8177,7 @@ and a group id the bar does not have is dropped when they are read. Another `gro be one of …", and a `visible` that is not true or false fails with "`visible` must be true or false"; either leaves every group as it is. The groups and their contents are VectorCraft's own. `window.taskBar.actions {action, visible?}` (desktop app) turns one of the Contextual Task Bar's actions or chips on -(`visible: true`), off (`false`) or toggles it (omitted), and returns `{action, visible}`. The actions are `imageTrace`, +(`visible: true`), off (`false`) or toggles it (omitted or null), and returns `{action, visible}`. The actions are `imageTrace`, `cropImage`, `removeBackground`, `removeAnchorPoints`, `join` (Connect and Join), `cutPath`, `convertToCorner`, `convertToSmooth`, `group`, `makeClippingMask`, `unite`, `expand`, `editClippingPath`, `releaseClippingMask`, `ungroup`, `isolate`, `editPath`, `releaseCompoundPath`, `createOutlines`, `convertToPointType`, `convertToAreaType`, From 8b289bf6bbf374fec6a2db0c4dd15b553bcb2bd8 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 05:49:14 -0800 Subject: [PATCH 46/55] Direct Selection: Cmd/Ctrl mirrors an ordinary path's handle again The handle drag that keeps Space translation sent path.setHandle without `symmetric`, so Cmd/Ctrl no longer mirrored the opposite handle on an ordinary path. The drag now records the mirror with the handle it accepts and sends it on every preview, so the opposite handle stays mirrored while Space moves the anchor. Alt still takes priority. --- crates/engine/tests/direct_handle_mirror.rs | 23 +++++++++++++++++++++ crates/tools/src/direct.rs | 7 +++++++ 2 files changed, 30 insertions(+) diff --git a/crates/engine/tests/direct_handle_mirror.rs b/crates/engine/tests/direct_handle_mirror.rs index d7fdfab36f..513824df8c 100644 --- a/crates/engine/tests/direct_handle_mirror.rs +++ b/crates/engine/tests/direct_handle_mirror.rs @@ -122,6 +122,29 @@ fn direct_handle_baseline_cmd_added_mid_drag_mirrors_the_opposite() { pointer(&mut s, PointerKind::Up, q, Mods { cmd: true, ..Mods::default() }); } +#[test] +fn direct_handle_cmd_mirror_holds_through_a_space_translation() { + let mut s = session(); + let id = curve(&mut s, Point::new(50.0, 100.0)); + press_handle(&mut s, Point::new(180.0, 100.0)); + let q = Point::new(180.0, 160.0); + pointer(&mut s, PointerKind::Drag, q, cmd()); + handles(anchor(&s, id), Point::new(20.0, 40.0), q, AnchorKind::Smooth); + // Space moves the anchor and both handles; the opposite handle stays mirrored. + let moved = Point::new(200.0, 190.0); + pointer(&mut s, PointerKind::Drag, moved, Mods { space: true, ..cmd() }); + let a = anchor(&s, id); + near(a.p, Point::new(120.0, 130.0)); + handles(a, Point::new(40.0, 70.0), Point::new(200.0, 190.0), AnchorKind::Smooth); + // Releasing Space without moving keeps the translated, mirrored handles. + pointer(&mut s, PointerKind::Drag, moved, cmd()); + handles(anchor(&s, id), Point::new(40.0, 70.0), Point::new(200.0, 190.0), AnchorKind::Smooth); + let next = Point::new(220.0, 190.0); + pointer(&mut s, PointerKind::Drag, next, cmd()); + assert_mirrored(anchor(&s, id), next, AnchorKind::Smooth); + pointer(&mut s, PointerKind::Up, next, cmd()); +} + #[derive(Debug, PartialEq)] struct Snapshot { document: Value, diff --git a/crates/tools/src/direct.rs b/crates/tools/src/direct.rs index 0ea7b79b08..b8394d0472 100644 --- a/crates/tools/src/direct.rs +++ b/crates/tools/src/direct.rs @@ -78,6 +78,8 @@ struct HandleDrag { offset: Vec2, space: bool, independent: bool, + /// The opposite handle mirrors this one ([`DirectSelectionTool::mirrors`]). + symmetric: bool, translated: bool, } @@ -948,6 +950,7 @@ impl Tool for DirectSelectionTool { offset: Vec2::ZERO, space: false, independent: false, + symmetric: false, translated: false, }) } @@ -1607,6 +1610,7 @@ impl DirectSelectionTool { self.guides = guides; drag.handle = q; drag.independent = ev.mods.alt; + drag.symmetric = self.mirrors(ev); } } drag.last = p; @@ -1615,6 +1619,9 @@ impl DirectSelectionTool { "id": id.0, "subpath": si, "anchor": ai, "which": if out { "out" } else { "in" }, "x": drag.handle.x, "y": drag.handle.y, "independent": drag.independent, }); + if drag.symmetric { + params["symmetric"] = json!(true); + } if drag.translated { params["at"] = json!([drag.at.x, drag.at.y]); } From ff0b835509f581622b939323707b719ba230e857 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 05:59:50 -0800 Subject: [PATCH 47/55] Part of #5941: drop-down lists stop above the bottom bars A drop-down list that did not fit on either side of its field was moved up only as far as the window's bottom edge, so it could cover the status bar, the hint bar and a Control bar docked at the bottom. The list now measures the room below its field to those bars, as other menus do (#2086), and a list too tall for either side moves up until it ends at them. Its right-to-left alignment now follows the field's own style. The Gradient panel's Presets menu change is taken out of this branch; the menus that set a fixed minimum width get their own fix. Tests: - a_dropdown_list_stops_above_the_bottom_bars - a_dropdown_option_cut_short_shows_its_full_name_on_hover, which checks the tooltip of an option cut short in a list narrowed to the window --- crates/ui-egui/src/dialogs/tests_export.rs | 2 +- crates/ui-egui/src/panels/gradient.rs | 2 +- crates/ui-egui/src/panels/gradient/tests.rs | 14 --- crates/ui-egui/src/widgets/dropdowns.rs | 32 +++--- crates/ui-egui/src/widgets/look_tests.rs | 116 ++++++++++++++++++++ 5 files changed, 135 insertions(+), 31 deletions(-) diff --git a/crates/ui-egui/src/dialogs/tests_export.rs b/crates/ui-egui/src/dialogs/tests_export.rs index 51258fbfa9..6d388f7950 100644 --- a/crates/ui-egui/src/dialogs/tests_export.rs +++ b/crates/ui-egui/src/dialogs/tests_export.rs @@ -359,7 +359,7 @@ fn the_format_list_shows_its_scroll_bar_at_rest_and_opens_with_the_chosen_format /// #5941: the Format list stopped at the room on one side of its field, so a window with room for /// every format still cut the list short. In windows of 1280×900 and 1000×856 the list shows every -/// built-in format whole, the greyed-out DWG row after them included, inside the window, without a +/// built-in format whole, the grayed-out DWG row after them included, inside the window, without a /// scroll bar. A plug-in format that another test adds or removes meanwhile is not counted. #[test] fn the_format_list_shows_every_format_when_the_window_has_room() { diff --git a/crates/ui-egui/src/panels/gradient.rs b/crates/ui-egui/src/panels/gradient.rs index adf4dd723f..7baaa062ab 100644 --- a/crates/ui-egui/src/panels/gradient.rs +++ b/crates/ui-egui/src/panels/gradient.rs @@ -466,7 +466,7 @@ fn presets_row(app: &mut VectorcraftApp, ui: &mut Ui, g: Option<&GradientPaint>) /// the name of the one clicked. fn preset_list(app: &VectorcraftApp, ui: &mut Ui, shown: &str) -> Option { let t = Tokens::get(ui.ctx()); - widgets::menu_min_width(ui, 200.0); + ui.set_min_width(200.0); let mut chosen = None; // The library of the rows drawn last (`Some(None)`: the saved presets). let mut library: Option> = None; diff --git a/crates/ui-egui/src/panels/gradient/tests.rs b/crates/ui-egui/src/panels/gradient/tests.rs index e4871b0886..bbf833b1aa 100644 --- a/crates/ui-egui/src/panels/gradient/tests.rs +++ b/crates/ui-egui/src/panels/gradient/tests.rs @@ -797,20 +797,6 @@ fn text_at(texts: &[(String, Pos2)], s: &str) -> Option { texts.iter().find(|(t, _)| t.trim_start() == s).map(|(_, at)| *at) } -/// #5941: in a window narrower than the Presets menu's 200 pt rows, the menu stays inside the window, -/// so its scroll bar shows. -#[test] -fn the_presets_menu_stays_inside_a_narrow_window() { - let mut app = app(json!({"gradient": {}})); - let paint = current(&app).expect("a gradient fill"); - let mut window = PopupWindow::new(&mut app, 300.0, move |app, ui| presets_row(app, ui, Some(&paint))); - window.resize(&mut app, 190.0); - let label = window.text("Presets:").expect("the Presets row"); - window.click(&mut app, egui::pos2(label.right() + 40.0, label.center().y)); - let popup = window.popup().expect("the menu is open"); - assert!(popup.left() >= 0.0 && popup.right() <= 190.0, "the menu {popup:?} is inside the window"); -} - /// The Presets menu lists the presets by library (theme) and applies the one chosen to the /// gradient behind the active proxy, as one undo step; the menu then shows that preset. #[test] diff --git a/crates/ui-egui/src/widgets/dropdowns.rs b/crates/ui-egui/src/widgets/dropdowns.rs index e05235b411..b440007a80 100644 --- a/crates/ui-egui/src/widgets/dropdowns.rs +++ b/crates/ui-egui/src/widgets/dropdowns.rs @@ -320,8 +320,9 @@ fn combo_button<'a>(ui: &mut Ui, button_id: egui::Id, current: impl egui::IntoAt /// The list of [`combo_atoms_named`] while it is open, drawn by `list` in a popup of its own that /// opens from `button` and takes the whole list whenever the window has room for it (#5941): below -/// the button when it fits there, above it when it fits there instead, and otherwise shifted from -/// below into the window, over the button. A list taller than the window scrolls. A click closes +/// the button when it fits there, above it when it fits there instead, and otherwise moved up from +/// below, over the button, until it ends at the bottom bars. It stays above the bottom bars +/// ([`menu_floor`]), and a list taller than the room above them scrolls. A click closes /// the list, except a click on its scroll bar, which scrolls it. Returns what `list` returned, or /// `None` while the list is closed. fn combo_list(ui: &Ui, button: &Response, list: impl FnOnce(&mut Ui) -> R) -> Option { @@ -339,30 +340,31 @@ fn combo_list(ui: &Ui, button: &Response, list: impl FnOnce(&mut Ui) -> R) -> let close = if on_bar { egui::PopupCloseBehavior::IgnoreClicks } else { egui::PopupCloseBehavior::CloseOnClick }; let popup = egui::Popup::menu(button).id(id).width(button.rect.width()).style(style.clone()).close_behavior(close); let screen = ctx.content_rect(); + // The list stops above the bottom bars, as other menus do (#2086). + let floor = menu_floor(ctx).min(screen.bottom()); // The room on each side of the rect the popup opens from: the part of the button in view. let anchor = popup.get_anchor_rect().unwrap_or(button.rect); - let below = screen.bottom() - anchor.bottom(); + let below = floor - anchor.bottom(); let above = anchor.top() - screen.top(); // The list's size from its last pass: egui lays a popup out unseen on the pass it opens, so the // list is measured before it is placed. A right-to-left layout lines the list up with the // button's right edge, as egui's menus do. - let rtl = ctx.global_style().right_to_left; - let align = match popup.get_expected_size() { - Some(size) if size.y > below && size.y <= above => { - if rtl { - egui::RectAlign::TOP_END - } else { - egui::RectAlign::TOP_START - } + let rtl = ui.style().right_to_left; + let expected = popup.get_expected_size(); + let (align, popup) = match expected { + Some(size) if size.y > below && size.y <= above => (if rtl { egui::RectAlign::TOP_END } else { egui::RectAlign::TOP_START }, popup), + // A list too tall for either side moves up from below until it ends at the floor. + Some(size) if size.y > below => { + let top = (floor - size.y).max(screen.top()); + let from = Rect::from_min_max(egui::pos2(anchor.left(), top), egui::pos2(anchor.right(), top)); + (if rtl { egui::RectAlign::BOTTOM_END } else { egui::RectAlign::BOTTOM_START }, popup.anchor(from)) } - // egui keeps a popup inside the window, so a list too tall for either side moves up. - _ if rtl => egui::RectAlign::BOTTOM_END, - _ => egui::RectAlign::BOTTOM_START, + _ => (if rtl { egui::RectAlign::BOTTOM_END } else { egui::RectAlign::BOTTOM_START }, popup), }; let mut popup_style = (*ctx.global_style()).clone(); style.apply(&mut popup_style); let margins = egui::Frame::popup(&popup_style).total_margin().sum(); - let height = (screen.height() - margins.y).max(ui.spacing().interact_size.y); + let height = (floor - screen.top() - margins.y).max(ui.spacing().interact_size.y); // A list that was wider than the window keeps its scroll bar in view: until it closes, it is no // wider than it measured or than the window, its names cut short and shown in full on hover. // Only a size measured while the list is open counts: egui keeps the last one after it closes. diff --git a/crates/ui-egui/src/widgets/look_tests.rs b/crates/ui-egui/src/widgets/look_tests.rs index 77c9af796c..286be3f10c 100644 --- a/crates/ui-egui/src/widgets/look_tests.rs +++ b/crates/ui-egui/src/widgets/look_tests.rs @@ -971,6 +971,67 @@ fn a_dropdown_list_shows_every_option_when_the_window_has_room() { } } +// #5941: a drop-down list stops above the bottom bars, as other menus do (#2086). In a 700 pt window +// whose bars start at 640 pt, the list opens below a field near the top, and from a field in the +// middle it moves up over the field until it ends at the bars; each time every option shows whole. +#[test] +fn a_dropdown_list_stops_above_the_bottom_bars() { + let items: Vec = (0..20).map(|i| format!("Option {i:02}")).collect(); + let labels: Vec<&str> = items.iter().map(String::as_str).collect(); + let floor = 640.0; + for above in [16.0, 300.0] { + let case = format!("field {above} pt down"); + let ctx = themed(Default::default()); + let field = std::cell::Cell::new(Rect::NOTHING); + let popup = std::cell::RefCell::new(vec![]); + let mut add = |ui: &mut Ui| { + set_menu_floor(ui.ctx(), floor); + ui.add_space(above); + field.set(ui.horizontal(|ui| dropdown_names(ui, "floor-list", labels[0], &labels, 160.0)).response.rect); + popup.replace(super::top_popup_shapes(ui.ctx())); + }; + let screen = Rect::from_min_size(Pos2::ZERO, vec2(400.0, 700.0)); + let mut run = |time: f64, events: Vec| { + let mut out = ctx.run_ui(egui::RawInput { time: Some(time), screen_rect: Some(screen), events, ..Default::default() }, &mut add); + out.textures_delta.clear(); + popup.take() + }; + run(0.0, vec![]); + let at = field.get().center(); + let press = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + run(0.1, vec![egui::Event::PointerMoved(at), press(true)]); + run(0.2, vec![press(false)]); + run(0.3, vec![egui::Event::PointerMoved(pos2(390.0, 2.0))]); + let mut clipped = vec![]; + for i in 4..10 { + clipped = run(f64::from(i) * 0.1, vec![]); + } + let list = ctx + .memory(|m| { + m.layer_ids().filter(|l| l.order == egui::Order::Foreground && m.areas().is_visible(l)).last().and_then(|l| m.area_rect(l.id)) + }) + .expect("the list is open"); + assert!(list.top() >= 0.0 && list.bottom() <= floor + 0.5, "{case}: the list {list:?} ends above the bars at {floor}"); + let mut texts = vec![]; + fn flat(s: &egui::Shape, clip: Rect, out: &mut Vec<(String, Rect, Rect)>) { + match s { + egui::Shape::Vec(v) => v.iter().for_each(|s| flat(s, clip, out)), + egui::Shape::Text(t) => out.push((t.galley.text().to_owned(), t.visual_bounding_rect(), clip)), + _ => {} + } + } + clipped.iter().for_each(|c| flat(&c.shape, c.clip_rect, &mut texts)); + let whole: Vec<&str> = labels + .iter() + .copied() + .filter(|name| { + texts.iter().any(|(s, r, clip)| s == name && list.contains_rect(*r) && r.top() >= clip.top() && r.bottom() <= clip.bottom()) + }) + .collect(); + assert_eq!(whole, labels, "{case}: every option shows whole in {list:?}"); + } +} + // #5941: a click on the scroll bar's track of an open drop-down list scrolls it and leaves it open, // so an option it scrolled into view can be picked. A list closed by that click would open again // with its current option in view. @@ -1207,6 +1268,61 @@ fn a_dropdown_list_wider_than_the_window_keeps_its_scroll_bar_in_view() { assert!(texts.iter().any(|(s, elided)| !*elided && s == labels[1]), "the long name shows in full beside the bar: {texts:?}"); } +// #5941: in a drop-down list narrowed to the window, an option whose name is cut short shows the +// full name in a tooltip while the pointer rests on it. +#[test] +fn a_dropdown_option_cut_short_shows_its_full_name_on_hover() { + let mut items: Vec = (0..10).map(|i| format!("Option {i:02}")).collect(); + items[1] = "Option 01, whose name is much wider than this window".into(); + let labels: Vec<&str> = items.iter().map(String::as_str).collect(); + let ctx = themed(Default::default()); + let field = std::cell::Cell::new(Rect::NOTHING); + let mut add = |ui: &mut Ui| { + ui.add_space(16.0); + field.set(ui.horizontal(|ui| dropdown_names(ui, "hover-list", labels[0], &labels, 160.0)).response.rect); + }; + let screen = Rect::from_min_size(Pos2::ZERO, vec2(220.0, 300.0)); + let mut time = 0.0; + // Every text painted, on any layer, with its rect and whether it was cut short. + let mut run = |events: Vec| { + time += 0.1; + let mut out = ctx.run_ui(egui::RawInput { time: Some(time), screen_rect: Some(screen), events, ..Default::default() }, &mut add); + out.textures_delta.clear(); + let mut texts = vec![]; + fn flat(s: &egui::Shape, out: &mut Vec<(String, Rect, bool)>) { + match s { + egui::Shape::Vec(v) => v.iter().for_each(|s| flat(s, out)), + egui::Shape::Text(t) => out.push((t.galley.text().to_owned(), t.visual_bounding_rect(), t.galley.elided)), + _ => {} + } + } + out.shapes.iter().for_each(|c| flat(&c.shape, &mut texts)); + texts + }; + run(vec![]); + let at = field.get().center(); + let press = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() }; + run(vec![egui::Event::PointerMoved(at), press(true)]); + run(vec![press(false)]); + run(vec![egui::Event::PointerMoved(pos2(210.0, 290.0))]); + let mut texts = vec![]; + for _ in 0..6 { + texts = run(vec![]); + } + let full = |texts: &[(String, Rect, bool)]| texts.iter().any(|(s, _, elided)| !*elided && s == labels[1]); + assert!(!full(&texts), "the long name is not shown in full before the hover: {texts:?}"); + let row = texts + .iter() + .find(|(s, _, elided)| *elided && s.starts_with("Option 01")) + .map(|(_, r, _)| r.center()) + .unwrap_or_else(|| panic!("the long name is cut short: {texts:?}")); + run(vec![egui::Event::PointerMoved(row)]); + for _ in 0..10 { + texts = run(vec![]); + } + assert!(full(&texts), "the full name shows on hover: {texts:?}"); +} + /// Enter on text that reads as no number in a range field refuses it as a unit field does: the /// field flashes and an open dialog is not confirmed with the old value. #[test] From 507b3d2d68711f58aabb4e06548ece23cd2ec170 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 06:00:40 -0800 Subject: [PATCH 48/55] Color Wheel: end an OKLCH row drag when the working RGB space stops being sRGB The OKLCH rows turn gray when Edit > Color Settings picks a working RGB space other than sRGB, so a drag on one reports no release. The panel now keeps that drag's preview as one undo step and ends the interaction, as it does when the rows are hidden or replaced. The ui.colorWheel tests now expect the harmony, harmonyRule, vision and sliders keys that main and this branch report together. --- crates/ui-egui/src/panels/color_wheel.rs | 7 +-- .../ui-egui/src/panels/tests_color_wheel.rs | 46 ++++++++++++++++++- .../src/panels/tests_color_wheel_vision.rs | 5 +- 3 files changed, 51 insertions(+), 7 deletions(-) diff --git a/crates/ui-egui/src/panels/color_wheel.rs b/crates/ui-egui/src/panels/color_wheel.rs index a2901b6460..6cf8d5dc24 100644 --- a/crates/ui-egui/src/panels/color_wheel.rs +++ b/crates/ui-egui/src/panels/color_wheel.rs @@ -846,10 +846,11 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { picked_hsl = hsl_rows(app, ui, &tgt, color, &cms); } } - // A row drag whose rows were hidden or replaced (`ui.colorWheel {sliders}`) reports no release: - // its preview is kept as one undo step and the interaction ends. + // A row drag whose rows were hidden or replaced (`ui.colorWheel {sliders}`), or turned gray + // (OKLCH rows after the working RGB space stops being sRGB), reports no release: its preview is + // kept as one undo step and the interaction ends. let live = pstate::>(ui.ctx(), ROWS_LIVE); - if live.is_some_and(|rows| rows != app.ui.color_wheel.sliders) { + if live.is_some_and(|rows| rows != app.ui.color_wheel.sliders || (rows == Sliders::Oklch && !cms.rgb_is_srgb())) { if app.session.in_interaction() && let Err(e) = app.session.commit_interaction() { diff --git a/crates/ui-egui/src/panels/tests_color_wheel.rs b/crates/ui-egui/src/panels/tests_color_wheel.rs index f13f78e8e2..e7ac9d84b3 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel.rs @@ -749,6 +749,49 @@ fn oklch_sliders_are_gray_after_the_working_space_changes() { assert!(oklch_slider(&h, "Lightness").accesskit_node().is_disabled()); } +/// A drag on an OKLCH row during which Edit › Color Settings picks a working RGB space other than +/// sRGB keeps the color the drag previewed as one undo step and leaves no interaction open, though +/// the gray rows report no release. +#[test] +fn a_working_space_change_during_an_oklch_drag_keeps_its_color_as_one_undo_step() { + const CHILD: &str = "VECTORCRAFT_TEST_COLOR_WHEEL_P3_DRAG"; + if std::env::var_os(CHILD).is_none() { + // Color settings are process-wide: change them in a separate test process. + let output = std::process::Command::new(std::env::current_exe().unwrap()) + .args([ + "--exact", + "panels::tests_color_wheel::a_working_space_change_during_an_oklch_drag_keeps_its_color_as_one_undo_step", + "--nocapture", + ]) + .env(CHILD, "1") + .output() + .unwrap(); + let stdout = String::from_utf8_lossy(&output.stdout); + assert!( + output.status.success() && stdout.contains("test result: ok. 1 passed; 0 failed;"), + "isolated working space test failed:\n{stdout}\n{}", + String::from_utf8_lossy(&output.stderr), + ); + return; + } + let mut h = oklch_harness(app(json!("#ff8000"))); + let rail = oklch_slider(&h, "Lightness").rect(); + let undo = undo_len(h.state()); + press(&mut h, on_rail(rail, 0.5), true, Modifiers::NONE); + for _ in 0..2 { + h.event(Event::PointerMoved(on_rail(rail, 0.25))); + h.run_steps(1); + } + assert!(h.state().session.in_interaction(), "the drag previews"); + let previewed = fill(h.state()); + h.state_mut().run("edit.colorSettings", json!({"rgb": cms::DISPLAY_P3})).unwrap(); + h.run_steps(2); + assert!(oklch_slider(&h, "Lightness").accesskit_node().is_disabled()); + press(&mut h, on_rail(rail, 0.25), false, Modifiers::NONE); + assert!(!h.state().session.in_interaction(), "the interaction ended"); + assert_eq!((fill(h.state()), undo_len(h.state())), (previewed, undo + 1)); +} + /// A CMYK fill's L, C and H are those of its display color, not of its naive separation. #[test] fn a_cmyk_fills_oklch_is_that_of_its_display_color() { @@ -1029,7 +1072,8 @@ fn ui_color_wheel_sets_and_reads_the_sliders() { assert_eq!(app.run("ui.colorWheel", json!({})).unwrap()["sliders"], json!("none")); assert_eq!(app.run("ui.colorWheel", json!({"sliders": "hwb"})).unwrap_err(), "`sliders` must be none, oklch or hsl"); let got = app.run("ui.colorWheel", json!({"sliders": "oklch"})).unwrap(); - assert_eq!(got, json!({"view": "box", "channel": "red", "sliders": "oklch"})); + let want = json!({"view": "box", "channel": "red", "harmony": false, "harmonyRule": "complementary", "vision": false, "sliders": "oklch"}); + assert_eq!(got, want); let e = app.run("ui.colorWheel", json!({"view": "wheel", "sliders": "hwb"})).unwrap_err(); assert_eq!(e, "`sliders` must be none, oklch or hsl"); assert_eq!(app.ui.color_wheel.view, crate::panels::color_wheel::View::Box, "an error changes nothing"); diff --git a/crates/ui-egui/src/panels/tests_color_wheel_vision.rs b/crates/ui-egui/src/panels/tests_color_wheel_vision.rs index 7c07b71f90..31bb3bc48b 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel_vision.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel_vision.rs @@ -225,8 +225,7 @@ fn the_panel_menu_turns_the_row_on_and_off() { #[test] fn ui_color_wheel_sets_and_reads_the_settings() { let mut app = VectorcraftApp::new(Session::new(), Default::default()); - let settings = - |view: &str, vision: bool| json!({"view": view, "channel": "hue", "harmony": false, "harmonyRule": "complementary", "vision": vision}); + let settings = |view: &str, vision: bool| json!({"view": view, "channel": "hue", "harmony": false, "harmonyRule": "complementary", "vision": vision, "sliders": "none"}); assert_eq!(app.run("ui.colorWheel", json!({})).unwrap(), settings("wheel", false)); assert_eq!(app.run("ui.colorWheel", json!({"vision": true})).unwrap(), settings("wheel", true)); assert_eq!(crate::control::inspect(&app, &egui::Context::default())["ui"]["color_wheel"]["vision"], true); @@ -237,7 +236,7 @@ fn ui_color_wheel_sets_and_reads_the_settings() { assert_eq!(app.run("ui.colorWheel", json!(5)).unwrap_err(), "the params must be an object, not 5"); assert_eq!( app.run("ui.colorWheel", json!({"visoin": false})).unwrap_err(), - "unknown parameter `visoin`; the command takes: view, channel, harmony, harmonyRule, vision" + "unknown parameter `visoin`; the command takes: view, channel, sliders, harmony, harmonyRule, vision" ); assert!(app.ui.color_wheel.vision); assert_eq!(app.run("ui.colorWheel", json!({"vision": null})).unwrap()["vision"], true); From 88cac70e8b53b1c81e372b3277d5e03bb1d75a18 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 06:23:20 -0800 Subject: [PATCH 49/55] Color Wheel: find the largest OKLCH chroma on every stretch of the ray The chromas sRGB holds along a ray of fixed lightness and hue can come in several stretches, and the search looked past the first one only near a primary color's hue. Near black the gamut slack opens stretches at other hues: at L 0.02 and H 242 degrees the ray fits up to about 0.022 but the search stopped near 0.012, so the chroma tick sat too low and a pick past the gamut lost more chroma than it had to. Each linear sRGB channel is a cubic in the chroma, so the search now takes the chromas where a channel meets a gamut bound, between each cubic's turning points, and keeps the largest one that fits. A test compares the result with a scan of the ray at 720 lightness and hue pairs. --- crates/color/src/libraries.rs | 10 ++- crates/color/src/oklab.rs | 121 ++++++++++++++++++++-------------- 2 files changed, 80 insertions(+), 51 deletions(-) diff --git a/crates/color/src/libraries.rs b/crates/color/src/libraries.rs index 9c756256a3..c2946d92a2 100644 --- a/crates/color/src/libraries.rs +++ b/crates/color/src/libraries.rs @@ -103,16 +103,20 @@ pub fn builtin_library(id: &str) -> Option> { /// −0.0031308 is encoded with the curve's sign turned, as CSS Color 4's extended sRGB does /// (). pub(crate) fn oklab_to_srgb(l: f64, a: f64, b: f64) -> [f64; 3] { + oklab_to_linear_srgb(l, a, b).map(|v| if v.abs() <= 0.003_130_8 { 12.92 * v } else { v.signum() * (1.055 * v.abs().powf(1.0 / 2.4) - 0.055) }) +} + +/// Linear sRGB of OKLab `(l, a, b)`, unclamped. +pub(crate) fn oklab_to_linear_srgb(l: f64, a: f64, b: f64) -> [f64; 3] { let l_ = l + 0.396_337_777_4 * a + 0.215_803_757_3 * b; let m_ = l - 0.105_561_345_8 * a - 0.063_854_172_8 * b; let s_ = l - 0.089_484_177_5 * a - 1.291_485_548_0 * b; let (l3, m3, s3) = (l_ * l_ * l_, m_ * m_ * m_, s_ * s_ * s_); - let lin = [ + [ 4.076_741_662_1 * l3 - 3.307_711_591_3 * m3 + 0.230_969_929_2 * s3, -1.268_438_004_6 * l3 + 2.609_757_401_1 * m3 - 0.341_319_396_5 * s3, -0.004_196_086_3 * l3 - 0.703_418_614_7 * m3 + 1.707_614_701_0 * s3, - ]; - lin.map(|v| if v.abs() <= 0.003_130_8 { 12.92 * v } else { v.signum() * (1.055 * v.abs().powf(1.0 / 2.4) - 0.055) }) + ] } /// OKLab `[l, a, b]` of a colour's display RGB. diff --git a/crates/color/src/oklab.rs b/crates/color/src/oklab.rs index 1df3c4b1df..31500d1ac5 100644 --- a/crates/color/src/oklab.rs +++ b/crates/color/src/oklab.rs @@ -3,7 +3,7 @@ //! C (CSS reads 100% as 0.4) and hue H in degrees from the positive `a` axis. The conversions take //! and give gamma-encoded sRGB through the Oklab matrices of [`crate::libraries`]. -use crate::libraries::{oklab_to_srgb, srgb_to_oklab}; +use crate::libraries::{oklab_to_linear_srgb, oklab_to_srgb, srgb_to_oklab}; /// The chroma CSS reads as 100%. pub const CHROMA_FULL: f64 = 0.4; @@ -41,65 +41,75 @@ pub fn max_chroma(l: f64, h: f64) -> f64 { largest_fitting_chroma(l, h, f64::INFINITY) } -/// The primary and secondary colors of sRGB: the corners of its cube next to black. -const PRIMARIES: [[f32; 3]; 6] = [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0], [0.0, 1.0, 1.0], [1.0, 0.0, 1.0], [1.0, 1.0, 0.0]]; - /// The largest chroma no more than `limit` that sRGB holds at lightness `l` and hue `h°`: 0 at or /// outside black and white. +/// +/// The chromas sRGB holds along the ray can come in several stretches: at the lightness and hue of +/// blue the ray leaves sRGB at a chroma of about 0.266 and comes back at blue itself, about 0.313, +/// and near black the gamut slack opens stretches of its own. Each linear sRGB channel is a cubic +/// in the chroma, so every stretch ends where a channel's cubic meets a bound of the gamut. The +/// search finds each such chroma between the cubic's turning points and takes the largest one that +/// fits. fn largest_fitting_chroma(l: f64, h: f64, limit: f64) -> f64 { if !(l > 0.0 && l < 1.0) || !h.is_finite() { return 0.0; } - let fits = |c: f64| in_srgb(oklch_to_srgb(l, c, h)); - // An edge of the chromas sRGB holds, searched no higher than `limit`, so `lo` always fits. - let (mut lo, mut hi) = (0.0, limit.min(0.5)); - for _ in 0..40 { - let mid = (lo + hi) / 2.0; - if fits(mid) { lo = mid } else { hi = mid } + let top = limit.min(0.5); + if top <= 0.0 { + return 0.0; } - // Past that edge the ray can come back into sRGB near a line from black to a primary or - // secondary color. Such a line is straight in Oklab, so it keeps that color's hue and its - // chroma grows with its lightness. At the lightness and hue of blue, for example, the ray leaves - // sRGB at a chroma of about 0.266 and meets blue itself at about 0.313; at L 0.44 and a hue - // 0.01° past blue's, a second stretch runs from about 0.3042 to 0.3048. Each such stretch ends - // at or just below the line's chroma, so the search walks down from there in small steps to the - // first chroma that fits and then finds the stretch's end between it and the step above. - let past = PRIMARIES.iter().filter_map(|rgb| { - let [pl, a, b] = srgb_to_oklab(*rgb); - let edge = l / pl * a.hypot(b); - let off = (h - b.atan2(a).to_degrees()).rem_euclid(360.0); - if l > pl || edge <= lo || off.min(360.0 - off) > NEAR_PRIMARY_HUE { - return None; - } - let start = edge.min(limit); - let mut c = start; - while c > lo && start - c <= PAST_WALK { - if fits(c) { - let (mut inside, mut outside) = (c, (c + PAST_STEP).min(start)); - if outside > inside && !fits(outside) { - for _ in 0..20 { - let mid = (inside + outside) / 2.0; - if fits(mid) { inside = mid } else { outside = mid } - } - } else { - inside = outside; + let fits = |c: f64| in_srgb(oklch_to_srgb(l, c, h)); + if fits(top) { + return top; + } + let (sin, cos) = h.to_radians().sin_cos(); + let lin = |c: f64| oklab_to_linear_srgb(l, c * cos, c * sin); + // The linear channels at chromas 0, s, 2s and 3s give each cubic's coefficients in t = c / s. + let s = top / 3.0; + let y = [lin(0.0), lin(s), lin(2.0 * s), lin(3.0 * s)]; + let bounds = [-GAMUT_SLACK / 12.92, ((1.0 + GAMUT_SLACK + 0.055) / 1.055).powf(2.4)]; + let mut ends = vec![0.0]; + for ch in 0..3 { + let [y0, y1, y2, y3] = [y[0][ch], y[1][ch], y[2][ch], y[3][ch]]; + let (d1, d2, d3) = (y1 - y0, y2 - 2.0 * y1 + y0, y3 - 3.0 * y2 + 3.0 * y1 - y0); + let k = [y0, d1 - d2 / 2.0 + d3 / 3.0, d2 / 2.0 - d3 / 2.0, d3 / 6.0]; + let p = |t: f64| ((k[3] * t + k[2]) * t + k[1]) * t + k[0]; + // The cubic rises or falls on each stretch between its turning points. + let mut cuts = vec![0.0, 3.0]; + cuts.extend(turning_points(3.0 * k[3], 2.0 * k[2], k[1]).into_iter().filter(|t| *t > 0.0 && *t < 3.0)); + cuts.sort_by(f64::total_cmp); + ends.extend(cuts.iter().map(|t| t * s)); + for w in cuts.windows(2) { + for bound in bounds { + let (mut a, mut b) = (w[0], w[1]); + let fa = p(a) - bound; + if fa * (p(b) - bound) > 0.0 { + continue; } - return Some(inside); + for _ in 0..60 { + let mid = (a + b) / 2.0; + if (p(mid) - bound) * fa > 0.0 { a = mid } else { b = mid } + } + ends.extend([a * s, b * s]); } - c -= PAST_STEP; } - None - }); - past.fold(lo.min(limit), f64::max) + } + ends.sort_by(|a, b| b.total_cmp(a)); + ends.into_iter().flat_map(|c| [c, c - 1e-9]).find(|c| (0.0..=top).contains(c) && fits(*c)).unwrap_or(0.0) } -/// How near a primary or secondary color's hue, in degrees, the ray must pass for -/// [`largest_fitting_chroma`] to look past the first edge. -const NEAR_PRIMARY_HUE: f64 = 2.0; -/// The step of that walk. -const PAST_STEP: f64 = 2e-4; -/// How far below the line's chroma that walk goes. -const PAST_WALK: f64 = 0.06; +/// The real roots of `a t² + b t + c`. +fn turning_points(a: f64, b: f64, c: f64) -> Vec { + if a.abs() < 1e-15 { + return if b.abs() < 1e-15 { Vec::new() } else { vec![-c / b] }; + } + let disc = b * b - 4.0 * a * c; + if disc < 0.0 { + return Vec::new(); + } + let r = disc.sqrt(); + vec![(-b - r) / (2.0 * a), (-b + r) / (2.0 * a)] +} /// The sRGB color (gamma encoded, 0..=1) of OKLCH `(l, c, h°)`, and whether its chroma was lowered: /// a color outside sRGB keeps its lightness and hue and takes the largest chroma below it that @@ -229,6 +239,21 @@ mod tests { assert!((l - (-0.01_f64 / 12.92).cbrt()).abs() < 1e-4, "{l}"); } + /// The largest chroma fits and is at least the largest one a scan in steps of 0.0005 finds, at + /// every hue and at lightnesses near black too, where the ray can come back into sRGB away from + /// any primary color's hue (L 0.02 and H 242° fit up to about 0.022 after leaving near 0.012). + #[test] + fn the_largest_chroma_is_never_below_a_scan_of_the_ray() { + let scan = |l: f64, h: f64| (0..=1000).map(|i| f64::from(i) * 0.0005).filter(|c| in_srgb(oklch_to_srgb(l, *c, h))).fold(0.0, f64::max); + assert!(max_chroma(0.02, 242.0) > 0.02, "{}", max_chroma(0.02, 242.0)); + for l in [0.005, 0.02, 0.05, 0.1, 0.3, 0.44, 0.6, 0.8, 0.95, 0.99] { + for h in (0..72).map(|i| f64::from(i) * 5.0 + 2.0) { + let max = max_chroma(l, h); + assert!(in_srgb(oklch_to_srgb(l, max, h)) && max >= scan(l, h), "L {l} H {h}: {max} < {}", scan(l, h)); + } + } + } + #[test] fn black_white_and_bad_numbers_hold_no_chroma() { assert_eq!(max_chroma(0.0, 30.0), 0.0); From c4c1495c044ad24b516e08b02b05c5546534e4b9 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 06:23:27 -0800 Subject: [PATCH 50/55] Direct Selection: Alt and Cmd/Ctrl apply while Space moves a handle A handle drag kept the Alt and Cmd/Ctrl state it had before Space was pressed, so pressing Alt or releasing Cmd/Ctrl during a Space translation changed nothing until Space was released and the pointer moved. Both modifiers are now read on every drag event. The Space translation still keeps the accepted handle position. --- crates/engine/tests/direct_handle_mirror.rs | 20 ++++++++++++++++++++ crates/tools/src/direct.rs | 5 +++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/crates/engine/tests/direct_handle_mirror.rs b/crates/engine/tests/direct_handle_mirror.rs index 513824df8c..30326d8e74 100644 --- a/crates/engine/tests/direct_handle_mirror.rs +++ b/crates/engine/tests/direct_handle_mirror.rs @@ -145,6 +145,26 @@ fn direct_handle_cmd_mirror_holds_through_a_space_translation() { pointer(&mut s, PointerKind::Up, next, cmd()); } +#[test] +fn direct_handle_modifiers_changed_during_a_space_translation_apply_at_once() { + let mut s = session(); + let id = curve(&mut s, Point::new(50.0, 100.0)); + press_handle(&mut s, Point::new(180.0, 100.0)); + pointer(&mut s, PointerKind::Drag, Point::new(180.0, 160.0), cmd()); + let moved = Point::new(200.0, 190.0); + pointer(&mut s, PointerKind::Drag, moved, Mods { space: true, ..cmd() }); + handles(anchor(&s, id), Point::new(40.0, 70.0), moved, AnchorKind::Smooth); + // Releasing Cmd while Space is held gives the opposite handle its own length again. + pointer(&mut s, PointerKind::Drag, moved, Mods { space: true, ..Mods::default() }); + let a = anchor(&s, id); + near(a.p, Point::new(120.0, 130.0)); + handles(a, Point::new(80.0, 100.0), moved, AnchorKind::Smooth); + // Alt while Space is held leaves the opposite handle where the translation put it. + pointer(&mut s, PointerKind::Drag, moved, Mods { space: true, alt: true, ..cmd() }); + handles(anchor(&s, id), Point::new(70.0, 130.0), moved, AnchorKind::Corner); + pointer(&mut s, PointerKind::Up, moved, Mods { alt: true, ..cmd() }); +} + #[derive(Debug, PartialEq)] struct Snapshot { document: Value, diff --git a/crates/tools/src/direct.rs b/crates/tools/src/direct.rs index b8394d0472..c14dfd4c2b 100644 --- a/crates/tools/src/direct.rs +++ b/crates/tools/src/direct.rs @@ -1609,10 +1609,11 @@ impl DirectSelectionTool { self.snapped = snapped(q.to_vec2(), input.to_vec2(), ev.mods.shift, &guides); self.guides = guides; drag.handle = q; - drag.independent = ev.mods.alt; - drag.symmetric = self.mirrors(ev); } } + // Alt and Cmd/Ctrl take effect on every event, while Space is held too. + drag.independent = ev.mods.alt; + drag.symmetric = self.mirrors(ev); drag.last = p; drag.space = ev.mods.space; let mut params = json!({ From e6a4fbc523b1526852afc90ffc17c86f4d989bce Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 06:52:49 -0800 Subject: [PATCH 51/55] Color Wheel: the slider rows show a color outside sRGB clipped to sRGB A fill whose display RGB lies outside 0 to 1 (an RGB fill given as [1.6, 0.2, -0.4], for example) showed in the HSL and OKLCH rows with the components of the unclipped color, so an edit started from a color other than the one the panel shows. The rows now take their values from the display color clipped to sRGB. --- crates/ui-egui/src/panels/color_wheel.rs | 14 ++++++++++---- crates/ui-egui/src/panels/tests_color_wheel.rs | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/panels/color_wheel.rs b/crates/ui-egui/src/panels/color_wheel.rs index 6cf8d5dc24..78f10e0cf6 100644 --- a/crates/ui-egui/src/panels/color_wheel.rs +++ b/crates/ui-egui/src/panels/color_wheel.rs @@ -581,7 +581,13 @@ fn replaced(app: &VectorcraftApp, tgt: &Target, behind: bool) -> Option { /// then displayed as the sRGB `shown`: `lch` while `c` still displays as `shown` (a chroma past the /// gamut and the hue of a gray stay), else `c`'s own. pub(crate) fn remembered_oklch(cms: &Cms, c: &Color, shown: [f32; 3], lch: [f64; 3]) -> [f64; 3] { - if cms.display_rgb(c) == shown { lch } else { oklab::to_oklch(cms.display_rgb(c)) } + if cms.display_rgb(c) == shown { lch } else { oklab::to_oklch(clipped_rgb(cms, c)) } +} + +/// The display sRGB of `c` through `cms` clipped to sRGB: the color the slider rows show and edit +/// for a color outside sRGB. +fn clipped_rgb(cms: &Cms, c: &Color) -> [f32; 3] { + cms.display_rgb(c).map(|v| v.clamp(0.0, 1.0)) } /// The color a track shows at OKLCH `lch`: the color itself inside sRGB, and outside it dimmed. @@ -621,7 +627,7 @@ pub(crate) fn oklch_rows(app: &VectorcraftApp, ui: &mut Ui, tgt: &Target, color: let enabled = color.is_some() && cms.rgb_is_srgb(); let lch = match (color, recall::<[f64; 3]>(app, ui, OKLCH_MEMORY, tgt, color, cms)) { (Some(c), Some((shown, lch))) => remembered_oklch(cms, &c, shown, lch), - (Some(c), _) => oklab::to_oklch(cms.display_rgb(&c)), + (Some(c), _) => oklab::to_oklch(clipped_rgb(cms, &c)), (None, _) => [0.0; 3], }; // Each row: its letter, its screen-reader name, the end of its range and the field's suffix. @@ -707,7 +713,7 @@ const TRACK_SAMPLES: usize = 128; /// then displayed as the sRGB `shown`: `hsl` while `c` still displays as `shown` (the hue of a gray /// and the saturation of black and white stay), else `c`'s own. pub(crate) fn remembered_hsl(cms: &Cms, c: &Color, shown: [f32; 3], hsl: [f32; 3]) -> [f32; 3] { - if cms.display_rgb(c) == shown { hsl } else { rgb_to_hsl(cms.display_rgb(c)) } + if cms.display_rgb(c) == shown { hsl } else { rgb_to_hsl(clipped_rgb(cms, c)) } } /// The color a track shows at HSL `hsl`. @@ -725,7 +731,7 @@ pub(crate) fn hsl_rows(app: &VectorcraftApp, ui: &mut Ui, tgt: &Target, color: O let enabled = color.is_some(); let hsl = match (color, recall::<[f32; 3]>(app, ui, HSL_MEMORY, tgt, color, cms)) { (Some(c), Some((shown, hsl))) => remembered_hsl(cms, &c, shown, hsl), - (Some(c), _) => rgb_to_hsl(cms.display_rgb(&c)), + (Some(c), _) => rgb_to_hsl(clipped_rgb(cms, &c)), (None, _) => [0.0; 3], }; // Each row: its letter, its screen-reader name, the end of its range and the field's suffix. The diff --git a/crates/ui-egui/src/panels/tests_color_wheel.rs b/crates/ui-egui/src/panels/tests_color_wheel.rs index e7ac9d84b3..103e3f4823 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel.rs @@ -1095,6 +1095,24 @@ fn a_hue_on_a_gray_color_leaves_its_paint_gray() { } } +/// For a fill outside sRGB, the HSL and OKLCH rows show the components of its display color +/// clipped to sRGB, the color the panel shows, not of the unclipped one. +#[test] +fn the_rows_show_a_color_outside_srgb_clipped_to_srgb() { + let rgb = json!([1.6, 0.2, -0.4]); + let raw = cms::active().display_rgb(&fill(&app(rgb.clone()))); + let clipped = raw.map(|v| v.clamp(0.0, 1.0)); + assert_ne!(raw, clipped, "the fill lies outside sRGB"); + let want_hsl = (f64::from(vectorcraft_color::rgb_to_hsl(clipped)[2]) * 100.0).round(); + assert_ne!(want_hsl, (f64::from(vectorcraft_color::rgb_to_hsl(raw)[2]) * 100.0).round(), "the unclipped lightness differs"); + let h = hsl_harness(app(rgb.clone())); + assert_eq!(oklch_slider(&h, "HSL Lightness").accesskit_node().numeric_value(), Some(want_hsl)); + let want_l = (vectorcraft_color::oklab::to_oklch(clipped)[0] * 100.0).round(); + assert_ne!(want_l, (vectorcraft_color::oklab::to_oklch(raw)[0] * 100.0).round(), "the unclipped OKLCH lightness differs"); + let h = oklch_harness(app(rgb)); + assert_eq!(oklch_slider(&h, "Lightness").accesskit_node().numeric_value(), Some(want_l)); +} + /// The hue given to a gray is dropped once the panel shows another color, so the same gray applied /// again later shows its own hue, 0°. #[test] From 304d0ed1f7b94185f3123a3fd3a48361195dd5cd Mon Sep 17 00:00:00 2001 From: bflatastic Date: Thu, 19 Nov 2026 22:16:26 +0700 Subject: [PATCH 52/55] i18n: drop the second copies of two rows its merge with main left in the catalogs --- 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 - 28 files changed, 28 deletions(-) diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 2c23636a08..28e61742d0 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -3322,7 +3322,6 @@ digits Malayalam Малаялам Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB and grayscale raster exports and Print as Bitmap; it does not change vector exports, CMYK JPEG, TIFF and PSD, or other printing. „Изход на чисто черно като наситено черно“ рисува чистото CMYK черно като RGB черно в растерните RGB и черно-бели експорти и при „Печат като растерно изображение“; не променя векторните експорти, CMYK JPEG, TIFF и PSD и другия печат. On a touch screen, switches to the Touch workspace; turning this off, or losing the touch screen, goes back to the workspace it switched from. На сензорен екран превключва към работното пространство за докосване; изключването на настройката или изчезването на сензорния екран връща работното пространство отпреди това. A two-finger tap on the canvas undoes, or switches between selection and drawing tools in the Touch workspace, and a three-finger tap redoes; neither works in Presentation Mode. Докосване с два пръста върху платното отменя, а в работното пространство за докосване превключва между инструментите за селекция и за рисуване; докосване с три пръста повтаря. Нито едното не действа в режим на презентация. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 case; Korean words take no hyphen, and Indian-language words do not break inside a character cluster. В абзаците с включено Пренасяне на думи изброената дума се пренася само при въведените в нея тирета или никъде, ако няма такива, независимо от регистъра ѝ; корейските думи не получават тире, а думите на индийски езици не се пренасят вътре в група от знаци. Reset all preferences to their defaults? Да се нулират ли всички настройки до стойностите по подразбиране? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Стойностите по подразбиране се прилагат, когато щракнете върху ОК в Настройки. Отказ там запазва текущите ви настройки. diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 7d4a0e25ff..658f7944a3 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -4756,7 +4756,6 @@ font-technology Variable Varijabilni Edit type set in fonts that aren't available? Urediti tekst u fontovima koji nisu dostupni? Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Prikazuje broj svakog isječka u okviru u njegovom gornjem lijevom uglu na platnu; kada je isključeno, obrisi isječaka i dalje se prikazuju. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Boja obrisa korisničkih i objektnih isječaka i okvira s njihovim brojevima; automatski isječci koriste blijeđu nijansu te boje. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; type already in a document keeps its own language. Novi tekst dobija ovaj jezik dok je jezik u Postavkama dokumenta Engleski: SAD i [Normalni stil znakova] ne zadaje jezik; 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. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normalno zadržava vlastita ograničenja svakog dodatka; uz Veliko filter ili naredba dodatka može izvršiti najmanje 250 miliona instrukcija pored onih za svoj ulaz. Vremensko ograničenje ostaje isto. diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index c08f9901f4..b1081c0ab7 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -4180,7 +4180,6 @@ digits Malayalam Malaiàlam Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB and grayscale raster exports and Print as Bitmap; it does not change vector exports, CMYK JPEG, TIFF and PSD, or other printing. Genera tots els negres com a negre ric dibuixa el negre CMYK pur com a negre RGB a les exportacions ràster RGB i en escala de grisos i amb Imprimeix com a mapa de bits; no canvia les exportacions vectorials, els JPEG, TIFF i PSD CMYK ni la resta d’impressions. On a touch screen, switches to the Touch workspace; turning this off, or losing the touch screen, goes back to the workspace it switched from. En una pantalla tàctil, canvia a l’espai de treball tàctil; si es desactiva o es perd la pantalla tàctil, torna a l’espai de treball d’abans del canvi. A two-finger tap on the canvas undoes, or switches between selection and drawing tools in the Touch workspace, and a three-finger tap redoes; neither works in Presentation Mode. Un toc amb dos dits al llenç desfà o, a l’espai de treball tàctil, alterna entre les eines de selecció i de dibuix, i un toc amb tres dits refà; cap dels dos funciona en el mode de presentació. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 i [Estil de caràcter normal] no en defineixi cap; 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 case; Korean words take no hyphen, and Indian-language words do not break inside a character cluster. 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 l’ús de majúscules; les paraules coreanes no prenen guionet, i les paraules en llengües índies no es parteixen dins d’un grup de caràcters. Reset all preferences to their defaults? Voleu restablir totes les preferències als valors predeterminats? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Els valors predeterminats s’apliquen quan feu clic a D’acord a Preferències. Cancel·la allà conserva les preferències actuals. diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index be177b3a14..4881d3a0fe 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4865,7 +4865,6 @@ font-technology Variable Variabilní Edit type set in fonts that aren't available? Upravit text v písmech, která nejsou k dispozici? Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Zobrazí na plátně číslo každého řezu v rámečku v jeho levém horním rohu; když je vypnuto, obrysy řezů zůstanou zobrazené. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Barva obrysů uživatelských a objektových řezů a rámečků s jejich čísly; automatické řezy používají tlumenější odstín této barvy. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; type already in a document keeps its own language. Nový text dostane tento jazyk, dokud je jazyk v Nastavení dokumentu Angličtina: USA a [Normální styl znaků] žádný jazyk neurčuje; 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á. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normální zachová vlastní limity každého zásuvného modulu; s volbou Velké může filtr nebo příkaz zásuvného modulu provést nejméně 250 milionů instrukcí navíc k těm pro svůj vstup. Časový limit zůstává stejný. diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 1af1779924..3613f9038b 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7308,7 +7308,6 @@ font-technology Variable Variable Edit type set in fonts that aren't available? Rediger tekst i skrifttyper, der ikke er tilgængelige? Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Viser hvert udsnits nummer i en boks i dets øverste venstre hjørne på lærredet; når den er slået fra, vises udsnittenes konturer stadig. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Farven på konturerne af bruger- og objektudsnit og på boksene med deres numre; automatiske udsnit bruger en svagere nuance af den. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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, og [Normal tegnstil] ikke angiver et sprog; 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. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Normal beholder hvert plug-ins egne grænser; med Stor kan et plug-in-filter eller en plug-in-kommando køre mindst 250 millioner instruktioner ud over dem til sit input. Tidsgrænsen forbliver den samme. diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 4edc923a1a..2883e82870 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -3391,7 +3391,6 @@ digits Malayalam Malayalam Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB and grayscale raster exports and Print as Bitmap; it does not change vector exports, CMYK JPEG, TIFF and PSD, or other printing. „Alle Schwarztöne als tiefes Schwarz ausgeben“ zeichnet reines CMYK-Schwarz in RGB- und Graustufen-Rasterexporten und bei „Als Bitmap drucken“ als RGB-Schwarz; Vektorexporte, CMYK-JPEG, -TIFF und -PSD und anderes Drucken ändert es nicht. On a touch screen, switches to the Touch workspace; turning this off, or losing the touch screen, goes back to the workspace it switched from. Auf einem Touchscreen wird zum Touch-Arbeitsbereich gewechselt; beim Ausschalten oder wenn kein Touchscreen mehr erkannt wird, kehrt es zum vorherigen Arbeitsbereich zurück. A two-finger tap on the canvas undoes, or switches between selection and drawing tools in the Touch workspace, and a three-finger tap redoes; neither works in Presentation Mode. Tippen mit zwei Fingern auf die Arbeitsfläche macht rückgängig oder wechselt im Touch-Arbeitsbereich zwischen Auswahl- und Zeichenwerkzeugen, Tippen mit drei Fingern wiederholt; beides wirkt nicht im Präsentationsmodus. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; type already in a document keeps its own language. Neuer Text erhält diese Sprache, solange die Sprache unter „Dokument einrichten“ Englisch: USA ist und [Normales Zeichenformat] keine Sprache festlegt; 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 case; Korean words take no hyphen, and Indian-language words do not break inside a character cluster. In Absätzen mit Silbentrennung wird ein aufgeführtes Wort nur an seinen eingegebenen Bindestrichen getrennt, ohne solche gar nicht, unabhängig von Groß- und Kleinschreibung; koreanische Wörter erhalten keinen Trennstrich, Wörter indischer Sprachen keine Trennung in einer Zeichengruppe. Reset all preferences to their defaults? Alle Voreinstellungen auf ihre Standardwerte zurücksetzen? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Die Standardwerte werden angewendet, wenn Sie in den Voreinstellungen auf OK klicken. Abbrechen dort behält Ihre aktuellen Voreinstellungen. diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index e3c258892a..8f6c359265 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -4244,7 +4244,6 @@ digits Malayalam Μαλαγιάλαμ Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB and grayscale raster exports and Print as Bitmap; it does not change vector exports, CMYK JPEG, TIFF and PSD, or other printing. Η Απόδοση όλων των μαύρων ως πλούσιο μαύρο σχεδιάζει το καθαρό μαύρο CMYK ως μαύρο RGB στις εξαγωγές raster RGB και κλίμακας του γκρι και με την Εκτύπωση ως bitmap· δεν αλλάζει τις διανυσματικές εξαγωγές, τα CMYK JPEG, TIFF και PSD ή την άλλη εκτύπωση. On a touch screen, switches to the Touch workspace; turning this off, or losing the touch screen, goes back to the workspace it switched from. Σε οθόνη αφής μεταβαίνει στον χώρο εργασίας αφής· η απενεργοποίηση ή η απώλεια της οθόνης αφής επαναφέρει τον χώρο εργασίας που υπήρχε πριν. A two-finger tap on the canvas undoes, or switches between selection and drawing tools in the Touch workspace, and a three-finger tap redoes; neither works in Presentation Mode. Το πάτημα με δύο δάχτυλα στον καμβά κάνει αναίρεση ή, στον χώρο εργασίας αφής, εναλλάσσει εργαλεία επιλογής και σχεδίασης, και το πάτημα με τρία δάχτυλα κάνει επανάληψη· κανένα δεν λειτουργεί στη λειτουργία παρουσίασης. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 case; Korean words take no hyphen, and Indian-language words do not break inside a character cluster. Με Συλλαβισμό, μια λέξη της λίστας χωρίζεται μόνο στα ενωτικά της ή πουθενά αν δεν έχει, με πεζά ή κεφαλαία· οι κορεατικές λέξεις δεν παίρνουν ενωτικό, οι λέξεις ινδικών γλωσσών δεν χωρίζονται μέσα σε ομάδα χαρακτήρων. Reset all preferences to their defaults? Επαναφορά όλων των προτιμήσεων στις προεπιλογές τους; The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Οι προεπιλογές εφαρμόζονται όταν κάνετε κλικ στο Εντάξει στις Προτιμήσεις. Το Ακύρωση εκεί διατηρεί τις τρέχουσες προτιμήσεις σας. diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 81c403f8bd..79fb055c7b 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -3428,7 +3428,6 @@ digits Malayalam Malayálam Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB and grayscale raster exports and Print as Bitmap; it does not change vector exports, CMYK JPEG, TIFF and PSD, or other printing. Imprimir todos los negros como negro enriquecido dibuja el negro CMYK puro como negro RGB en las exportaciones ráster RGB y en escala de grises y con Imprimir como mapa de bits; no cambia las exportaciones vectoriales, los JPEG, TIFF y PSD CMYK ni otras impresiones. On a touch screen, switches to the Touch workspace; turning this off, or losing the touch screen, goes back to the workspace it switched from. En una pantalla táctil, cambia al espacio de trabajo táctil; al desactivarlo o dejar de detectarse la pantalla táctil, vuelve al espacio de trabajo anterior al cambio. A two-finger tap on the canvas undoes, or switches between selection and drawing tools in the Touch workspace, and a three-finger tap redoes; neither works in Presentation Mode. Un toque con dos dedos en el lienzo deshace o, en el espacio de trabajo táctil, alterna entre herramientas de selección y de dibujo, y un toque con tres dedos rehace; ninguno funciona en el modo de presentación. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 y [Estilo de carácter normal] no defina ninguno; 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 case; Korean words take no hyphen, and Indian-language words do not break inside a character cluster. 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 uso de mayúsculas; las palabras coreanas no llevan guion, y las palabras en lenguas indias no se dividen dentro de un grupo de caracteres. Reset all preferences to their defaults? ¿Restablecer todas las preferencias a sus valores predeterminados? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Los valores predeterminados se aplican al hacer clic en Aceptar en Preferencias. Cancelar ahí conserva sus preferencias actuales. diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index f098a94c7c..8dbeb15e8a 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4831,7 +4831,6 @@ font-technology Variable Muuttuvat Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB and grayscale raster exports and Print as Bitmap; it does not change vector exports, CMYK JPEG, TIFF and PSD, or other printing. Tulosta kaikki mustat syvämustina piirtää puhtaan CMYK-mustan RGB-mustana RGB- ja harmaasävyrasterivienneissä ja Tulosta bittikarttana -asetuksella; se ei muuta vektorivientejä, CMYK-JPEG-, -TIFF- ja -PSD-tiedostoja eikä muuta tulostusta. On a touch screen, switches to the Touch workspace; turning this off, or losing the touch screen, goes back to the workspace it switched from. Kosketusnäytöllä vaihtaa kosketustyötilaan; asetuksen poistaminen käytöstä tai kosketusnäytön katoaminen palauttaa työtilan, josta vaihdettiin. A two-finger tap on the canvas undoes, or switches between selection and drawing tools in the Touch workspace, and a three-finger tap redoes; neither works in Presentation Mode. Kahden sormen napautus piirtopinnalla kumoaa tai vaihtaa kosketustyötilassa valinta- ja piirtotyökalujen välillä, ja kolmen sormen napautus tekee uudelleen; kumpikaan ei toimi esitystilassa. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; type already in a document keeps its own language. Uusi teksti saa tämän kielen, kun Asiakirjan asetusten kieli on Englanti: USA eikä [Normaali merkkityyli] määritä kieltä; 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 case; Korean words take no hyphen, and Indian-language words do not break inside a character cluster. Kappaleissa, joissa Tavuta on käytössä, luettelon sana tavutetaan vain siihen kirjoitettujen yhdysmerkkien kohdalta tai ei lainkaan, jos niitä ei ole, kirjainkoosta riippumatta; korealaisiin sanoihin ei tule tavuviivaa, eikä intialaisten kielten sanoja tavuteta merkkiryhmän sisältä. Reset all preferences to their defaults? Palautetaanko kaikki asetukset oletuksiin? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Oletukset otetaan käyttöön, kun valitset Asetuksissa OK. Peruuta siellä säilyttää nykyiset asetuksesi. diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index ec5aea8d8c..ae3af34b99 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -3416,7 +3416,6 @@ digits Malayalam Malayalam Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB and grayscale raster exports and Print as Bitmap; it does not change vector exports, CMYK JPEG, TIFF and PSD, or other printing. Reproduire tous les noirs en noir intense dessine le noir CMJN pur en noir RVB dans les exportations matricielles RVB et en niveaux de gris et avec Imprimer en tant que bitmap. Les exportations vectorielles, les JPEG, TIFF et PSD CMJN et les autres impressions ne changent pas. On a touch screen, switches to the Touch workspace; turning this off, or losing the touch screen, goes back to the workspace it switched from. Sur un écran tactile, passe à l’espace de travail tactile. Désactiver l’option ou perdre l’écran tactile ramène à l’espace de travail d’avant ce changement. A two-finger tap on the canvas undoes, or switches between selection and drawing tools in the Touch workspace, and a three-finger tap redoes; neither works in Presentation Mode. Un toucher à deux doigts sur la zone de travail annule ou, dans l’espace de travail tactile, bascule entre outils de sélection et de dessin, et un toucher à trois doigts rétablit. Aucun ne fonctionne en mode Présentation. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 et que [Style de caractère normal] n’en définit aucune. 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 case; Korean words take no hyphen, and Indian-language words do not break inside a character cluster. 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, quelle que soit sa casse. Les mots coréens ne prennent pas de trait d’union, et les mots en langues indiennes ne sont pas coupés à l’intérieur d’un groupe de caractères. Reset all preferences to their defaults? Rétablir toutes les préférences à leur valeur par défaut ? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Les valeurs par défaut sont appliquées lorsque vous cliquez sur OK dans Préférences. Annuler y conserve vos préférences actuelles. diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 7a77da70c3..402b29815b 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -3438,7 +3438,6 @@ arrowhead Feather પીંછું Snaps the end of a line segment so that it meets a nearby straight segment at a right angle. લાઇન સેગમેન્ટના છેડાને એ રીતે સ્નેપ કરે છે કે તે નજીકના સીધા સેગમેન્ટને કાટખૂણે મળે. Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. કેનવાસ પર દરેક સ્લાઇસનો નંબર તેના ઉપરના ડાબા ખૂણે એક બૉક્સમાં બતાવે છે; બંધ હોય ત્યારે પણ સ્લાઇસની રૂપરેખાઓ દેખાય છે. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. યુઝર અને ઑબ્જેક્ટ સ્લાઇસની રૂપરેખાઓ અને તેમના નંબર બૉક્સનો રંગ; ઑટો સ્લાઇસ તેની ઝાંખી છાયા વાપરે છે. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 પ્લગ-ઇન્સ શરૂઆતમાં અને અહીં નવા ફોલ્ડર સાથે ઠીક પર ક્લિક કરો ત્યારે લોડ થાય છે, સેફ મોડ સિવાય; વેબ સંસ્કરણ તેમને લોડ કરતું નથી. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. સામાન્ય દરેક પ્લગ-ઇનની પોતાની મર્યાદાઓ રાખે છે; મોટું સાથે, પ્લગ-ઇન ફિલ્ટર અથવા આદેશ તેના ઇનપુટ માટેની સૂચનાઓ ઉપરાંત ઓછામાં ઓછી 250 મિલિયન સૂચનાઓ ચલાવી શકે છે. સમય મર્યાદા એ જ રહે છે. diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 1712bec64e..1b1459922d 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -4755,7 +4755,6 @@ arrowhead Feather पंख Edit type set in fonts that aren't available? जो फ़ॉन्ट उपलब्ध नहीं हैं, उनमें सेट टेक्स्ट एडिट करें? Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. कैनवास पर हर स्लाइस का नंबर उसके ऊपरी बाएँ कोने में एक बॉक्स में दिखाता है; बंद होने पर भी स्लाइस की आउटलाइन दिखती रहती हैं। The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. यूज़र और ऑब्जेक्ट स्लाइस की आउटलाइन और उनके नंबर बॉक्स का रंग; ऑटो स्लाइस इसकी हल्की छाया इस्तेमाल करते हैं। - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 प्लग-इन शुरू होने पर और यहाँ नया फ़ोल्डर देकर ठीक है पर क्लिक करने पर लोड होते हैं, सुरक्षित मोड को छोड़कर; वेब संस्करण उन्हें लोड नहीं करता। Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. सामान्य हर प्लग-इन की अपनी सीमाएँ रखता है; बड़ा के साथ, प्लग-इन फ़िल्टर या कमांड अपने इनपुट के निर्देशों के अलावा कम से कम 250 मिलियन निर्देश चला सकता है। समय सीमा वही रहती है। diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index c50cb60eb0..b198826b04 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3964,7 +3964,6 @@ mark-style Japanese Japán Edit type set in fonts that aren't available? Szerkeszti a nem elérhető betűtípusokkal szedett szöveget? Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. A vásznon minden szelet számát egy keretben mutatja a szelet bal felső sarkában; kikapcsolva a szeletek körvonalai továbbra is látszanak. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. A felhasználói és objektumszeletek körvonalainak és számkereteinek színe; az automatikus szeletek ennek egy halványabb árnyalatát használják. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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, és a [Normál karakterstílus] nem ad meg nyelvet; 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. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. A Normál megtartja minden bővítmény saját korlátait; a Nagy beállítással egy bővítményszűrő vagy -parancs legalább 250 millió utasítást futtathat a bemenetéhez tartozókon felül. Az időkorlát nem változik. diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 2762ad885d..bd8759c7e1 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -5230,7 +5230,6 @@ font-technology Variable Variabel Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB and grayscale raster exports and Print as Bitmap; it does not change vector exports, CMYK JPEG, TIFF and PSD, or other printing. Keluarkan semua warna hitam sebagai rich black menggambar hitam CMYK murni sebagai hitam RGB dalam ekspor raster RGB dan skala abu-abu serta Cetak sebagai bitmap; opsi ini tidak mengubah ekspor vektor, JPEG, TIFF, dan PSD CMYK, atau pencetakan lain. On a touch screen, switches to the Touch workspace; turning this off, or losing the touch screen, goes back to the workspace it switched from. Pada layar sentuh, beralih ke ruang kerja sentuh; mematikan opsi ini atau hilangnya layar sentuh mengembalikan ruang kerja sebelum peralihan. A two-finger tap on the canvas undoes, or switches between selection and drawing tools in the Touch workspace, and a three-finger tap redoes; neither works in Presentation Mode. Ketukan dua jari di kanvas mengurungkan, atau di ruang kerja sentuh beralih antara alat seleksi dan alat gambar, dan ketukan tiga jari mengulangi; keduanya tidak berfungsi dalam mode presentasi. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; type already in a document keeps its own language. Teks baru mendapat bahasa ini selama bahasa di Pengaturan dokumen adalah Inggris: USA dan [Gaya karakter normal] tidak menetapkan bahasa; 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 case; Korean words take no hyphen, and Indian-language words do not break inside a character cluster. 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 huruf besar-kecilnya; kata Korea tidak diberi tanda hubung, dan kata dalam bahasa India tidak dipenggal di dalam satu gugus karakter. Reset all preferences to their defaults? Atur ulang semua preferensi ke defaultnya? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Nilai default diterapkan saat Anda mengklik OK di Preferensi. Batal di sana mempertahankan preferensi Anda saat ini. diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 84a03719b2..183a296251 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -3476,7 +3476,6 @@ digits Malayalam Malayalam Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB and grayscale raster exports and Print as Bitmap; it does not change vector exports, CMYK JPEG, TIFF and PSD, or other printing. Riproduci tutti i neri come nero ricco disegna il nero CMYK puro come nero RGB nelle esportazioni raster RGB e in scala di grigi e con Stampa come bitmap; non cambia le esportazioni vettoriali, i JPEG, TIFF e PSD CMYK né le altre stampe. On a touch screen, switches to the Touch workspace; turning this off, or losing the touch screen, goes back to the workspace it switched from. Su uno schermo touch passa all'area di lavoro touch; disattivando l'opzione o se lo schermo touch non è più rilevato, torna all'area di lavoro precedente. A two-finger tap on the canvas undoes, or switches between selection and drawing tools in the Touch workspace, and a three-finger tap redoes; neither works in Presentation Mode. Un tocco con due dita sull'area di lavoro annulla o, nell'area di lavoro touch, alterna tra strumenti di selezione e di disegno, e un tocco con tre dita ripete; nessuno dei due funziona in modalità presentazione. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; type already in a document keeps its own language. Il nuovo testo prende questa lingua finché la lingua di Imposta documento è Inglese: Stati Uniti e [Stile carattere normale] non ne imposta una; 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 case; Korean words take no hyphen, and Indian-language words do not break inside a character cluster. 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 l'uso delle maiuscole; le parole coreane non prendono trattino e le parole in lingue indiane non vanno a capo all'interno di un gruppo di caratteri. Reset all preferences to their defaults? Ripristinare tutte le preferenze ai valori predefiniti? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. I valori predefiniti vengono applicati quando fai clic su OK in Preferenze. Annulla lì mantiene le preferenze attuali. diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index f6c136ca87..f824596a79 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -3393,7 +3393,6 @@ mark-style Japanese 日本式 Edit type set in fonts that aren't available? 使用できないフォントのテキストを編集しますか? Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. カンバス上で、各スライスの番号をスライスの左上のボックスに表示します。オフでもスライスの輪郭は表示されます。 The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. ユーザースライスとオブジェクトスライスの輪郭、およびその番号のボックスの色です。自動スライスにはこの色の淡い色合いが使われます。 - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 版では読み込まれません。 Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. 通常では各プラグイン自身の制限が使われます。大では、プラグインのフィルターやコマンドは入力のための命令に加えて少なくとも 2 億 5000 万命令を実行できます。時間の制限は変わりません。 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index d0ff33886e..70392749a7 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6623,7 +6623,6 @@ font-technology Variable ცვლადი Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB and grayscale raster exports and Print as Bitmap; it does not change vector exports, CMYK JPEG, TIFF and PSD, or other printing. ყველა შავის მდიდარ შავად გამოტანა სუფთა CMYK შავს RGB შავად ხატავს RGB და ნაცრისფერი გრადაციების რასტრულ ექსპორტებში და ბიტმაპად ბეჭდვისას; ის არ ცვლის ვექტორულ ექსპორტებს, CMYK JPEG-ს, TIFF-სა და PSD-ს ან სხვა ბეჭდვას. On a touch screen, switches to the Touch workspace; turning this off, or losing the touch screen, goes back to the workspace it switched from. სენსორულ ეკრანზე გადადის სენსორულ სამუშაო სივრცეზე; პარამეტრის გამორთვისას ან სენსორული ეკრანის დაკარგვისას ბრუნდება წინა სამუშაო სივრცეზე. A two-finger tap on the canvas undoes, or switches between selection and drawing tools in the Touch workspace, and a three-finger tap redoes; neither works in Presentation Mode. ტილოზე ორი თითით შეხება აბრუნებს მოქმედებას, სენსორულ სამუშაო სივრცეში კი მონიშვნისა და ხატვის ხელსაწყოებს შორის გადართავს; სამი თითით შეხება ხელახლა ასრულებს. პრეზენტაციის რეჟიმში არცერთი არ მუშაობს. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 case; Korean words take no hyphen, and Indian-language words do not break inside a character cluster. გადატანის ჩართვისას სიის სიტყვა მხოლოდ აკრეფილ დეფისებთან გადაიტანება, ან არსად, თუ არ აქვს, რეგისტრის მიუხედავად; კორეულ სიტყვებს დეფისი არ ემატება, ინდური ენების სიტყვები კი სიმბოლოთა ჯგუფის შიგნით არ გადაიტანება. Reset all preferences to their defaults? დავაბრუნოთ ყველა პარამეტრი ნაგულისხმევ მნიშვნელობებზე? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. ნაგულისხმევი მნიშვნელობები გამოიყენება, როცა პარამეტრებში OK-ს დააჭერთ. იქ გაუქმება ინარჩუნებს თქვენს მიმდინარე პარამეტრებს. diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 13e0d3f30b..dd127f00ce 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -3438,7 +3438,6 @@ mark-style Japanese 일본식 Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB and grayscale raster exports and Print as Bitmap; it does not change vector exports, CMYK JPEG, TIFF and PSD, or other printing. 모든 검정을 리치 블랙으로 출력은 RGB 및 그레이스케일 래스터 내보내기와 비트맵으로 인쇄에서 순수 CMYK 검정을 RGB 검정으로 그리며, 벡터 내보내기, CMYK JPEG, TIFF 및 PSD, 기타 인쇄는 바꾸지 않습니다. On a touch screen, switches to the Touch workspace; turning this off, or losing the touch screen, goes back to the workspace it switched from. 터치 스크린에서는 터치 작업 영역으로 전환합니다. 이 설정을 끄거나 터치 스크린이 사라지면 전환하기 전의 작업 영역으로 돌아갑니다. A two-finger tap on the canvas undoes, or switches between selection and drawing tools in the Touch workspace, and a three-finger tap redoes; neither works in Presentation Mode. 캔버스를 두 손가락으로 탭하면 실행 취소하거나 터치 작업 영역에서 선택 도구와 그리기 도구를 전환하고, 세 손가락으로 탭하면 다시 실행합니다. 프레젠테이션 모드에서는 둘 다 작동하지 않습니다. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 case; Korean words take no hyphen, and Indian-language words do not break inside a character cluster. 하이픈 넣기가 켜진 단락에서는 목록의 단어가 입력한 하이픈 위치에서만 나뉘며, 하이픈이 없으면 나뉘지 않습니다. 대소문자는 상관없습니다. 한국어 단어에는 하이픈이 붙지 않으며, 인도 언어의 단어는 문자 묶음 안에서 나뉘지 않습니다. Reset all preferences to their defaults? 모든 환경 설정을 기본값으로 재설정하시겠습니까? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. 기본값은 환경 설정에서 확인을 클릭하면 적용됩니다. 그곳에서 취소를 누르면 현재 환경 설정이 유지됩니다. diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index cd3ad7a972..aab7bd956c 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -5235,7 +5235,6 @@ font-technology Variable Variabel Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB and grayscale raster exports and Print as Bitmap; it does not change vector exports, CMYK JPEG, TIFF and PSD, or other printing. Alle zwarttinten uitvoeren als rijk zwart tekent zuiver CMYK-zwart als RGB-zwart in RGB- en grijswaarden-rasterexports en met Afdrukken als bitmap; het verandert niets aan vectorexports, CMYK-JPEG, -TIFF en -PSD of ander afdrukken. On a touch screen, switches to the Touch workspace; turning this off, or losing the touch screen, goes back to the workspace it switched from. Op een aanraakscherm wordt naar de Touch-werkruimte gewisseld; uitschakelen of het wegvallen van het aanraakscherm zet de werkruimte van daarvoor terug. A two-finger tap on the canvas undoes, or switches between selection and drawing tools in the Touch workspace, and a three-finger tap redoes; neither works in Presentation Mode. Tikken met twee vingers op het canvas maakt ongedaan of wisselt in de Touch-werkruimte tussen selectie- en tekengereedschap, en tikken met drie vingers voert opnieuw uit; geen van beide werkt in de presentatiemodus. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; type already in a document keeps its own language. Nieuwe tekst krijgt deze taal zolang de taal in Documentinstellingen Engels: VS is en [Normale tekenstijl] geen taal instelt; 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 case; Korean words take no hyphen, and Indian-language words do not break inside a character cluster. 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 hoofdletters; Koreaanse woorden krijgen geen afbreekstreepje, en woorden in Indiase talen worden niet binnen een tekengroep afgebroken. Reset all preferences to their defaults? Alle voorkeuren terugzetten naar de standaardwaarden? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. De standaardwaarden worden toegepast wanneer u in Voorkeuren op OK klikt. Annuleren daar behoudt uw huidige voorkeuren. diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index f246715a60..251aaa381a 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4741,7 +4741,6 @@ font-technology Variable Zmienne 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. From the next start, the desktop version shows frames without waiting for the display's refresh, at most 240 a second; off, the display paces them. Od następnego uruchomienia wersja na komputer wyświetla klatki bez czekania na odświeżenie ekranu, najwyżej 240 na sekundę; po wyłączeniu tempo wyznacza ekran. The larger budget raises each object filter run's base instructions fivefold and keeps the same allowance per input byte; heavy filters, live effects, exporters and importers keep their own limits. Większy budżet pięciokrotnie zwiększa podstawową liczbę instrukcji każdego uruchomienia filtra obiektów i zachowuje ten sam dodatek na bajt danych wejściowych; ciężkie filtry, efekty na żywo, eksportery i importery zachowują własne limity. - 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ą. diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 56b8217d87..da47b7afe1 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2892,7 +2892,6 @@ digits Malayalam Malaiala Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB and grayscale raster exports and Print as Bitmap; it does not change vector exports, CMYK JPEG, TIFF and PSD, or other printing. Gerar Todos os Pretos como Preto Rico desenha o preto CMYK puro como preto RGB nas exportações raster RGB e em escala de cinza e com Imprimir como Bitmap; não altera exportações vetoriais, JPEG, TIFF e PSD CMYK nem outras impressões. On a touch screen, switches to the Touch workspace; turning this off, or losing the touch screen, goes back to the workspace it switched from. Em uma tela sensível ao toque, muda para o espaço de trabalho de toque; desativar a opção ou perder a tela sensível ao toque volta ao espaço de trabalho anterior. A two-finger tap on the canvas undoes, or switches between selection and drawing tools in the Touch workspace, and a three-finger tap redoes; neither works in Presentation Mode. Um toque com dois dedos na tela de desenho desfaz ou, no espaço de trabalho de toque, alterna entre ferramentas de seleção e de desenho, e um toque com três dedos refaz; nenhum funciona no Modo de Apresentação. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 e o [Estilo de Caractere Normal] não definir nenhum; 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 case; Korean words take no hyphen, and Indian-language words do not break inside a character cluster. 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 uso de maiúsculas; palavras coreanas não recebem hífen, e palavras em línguas indianas não são divididas dentro de um grupo de caracteres. Reset all preferences to their defaults? Redefinir todas as preferências para o padrão? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Os padrões são aplicados quando você clica em OK em Preferências. Cancelar ali mantém suas preferências atuais. diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 1ff361eb17..78d7eb1b36 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -3403,7 +3403,6 @@ digits Malayalam Малаялам Edit type set in fonts that aren't available? Редактировать текст, набранный недоступными шрифтами? Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Показывает на холсте номер каждого фрагмента в рамке в его левом верхнем углу; если параметр выключен, контуры фрагментов по-прежнему видны. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Цвет контуров пользовательских и объектных фрагментов и рамок с их номерами; автоматические фрагменты используют более бледный оттенок этого цвета. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 из этой папки загружаются при запуске и при нажатии ОК с новой папкой здесь, кроме безопасного режима; веб-версия их не загружает. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. «Обычный» сохраняет собственные ограничения каждого модуля; с «Большой» фильтр или команда модуля может выполнить не менее 250 миллионов инструкций сверх тех, что нужны для её входных данных. Ограничение по времени не меняется. diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 8118ed59db..cdcc278442 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -3348,7 +3348,6 @@ digits Malayalam Malayalam Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB and grayscale raster exports and Print as Bitmap; it does not change vector exports, CMYK JPEG, TIFF and PSD, or other printing. Återge all svart som djupsvart ritar ren CMYK-svart som RGB-svart i RGB- och gråskale-rasterexporter och med Skriv ut som bitmapp; den ändrar inte vektorexporter, CMYK-JPEG, -TIFF och -PSD eller annan utskrift. On a touch screen, switches to the Touch workspace; turning this off, or losing the touch screen, goes back to the workspace it switched from. På en pekskärm växlar detta till arbetslayouten för pekskärm; när inställningen stängs av eller pekskärmen försvinner återgår den till arbetslayouten från före bytet. A two-finger tap on the canvas undoes, or switches between selection and drawing tools in the Touch workspace, and a three-finger tap redoes; neither works in Presentation Mode. Ett tryck med två fingrar på arbetsytan ångrar eller växlar i arbetslayouten för pekskärm mellan markerings- och ritverktyg, och ett tryck med tre fingrar gör om; inget av dem fungerar i presentationsläge. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 och [Normal teckenstil] inte anger något språk; 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 case; Korean words take no hyphen, and Indian-language words do not break inside a character cluster. 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 skiftläge; koreanska ord får inget avstavningstecken, och ord på indiska språk avstavas inte inuti en teckengrupp. Reset all preferences to their defaults? Återställa alla inställningar till standard? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Standardvärdena verkställs när du klickar på OK i Inställningar. Avbryt där behåller dina nuvarande inställningar. diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 7859749190..de53929490 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -3193,7 +3193,6 @@ digits Malayalam Malayalam Output All Blacks as Rich Black draws pure CMYK black as RGB black in RGB and grayscale raster exports and Print as Bitmap; it does not change vector exports, CMYK JPEG, TIFF and PSD, or other printing. Tüm Siyahların Çıkışını Zengin Siyah Olarak Çıkarın seçeneği, RGB ve gri tonlamalı raster dışa aktarımlarda ve Bitmap olarak yazdır ile saf CMYK siyahını RGB siyahı olarak çizer; vektör dışa aktarımları, CMYK JPEG, TIFF ve PSD dosyalarını veya diğer yazdırmaları değiştirmez. On a touch screen, switches to the Touch workspace; turning this off, or losing the touch screen, goes back to the workspace it switched from. Dokunmatik ekranda dokunmatik çalışma alanına geçer; seçenek kapatıldığında veya dokunmatik ekran algılanmadığında önceki çalışma alanına döner. A two-finger tap on the canvas undoes, or switches between selection and drawing tools in the Touch workspace, and a three-finger tap redoes; neither works in Presentation Mode. Tuvale iki parmakla dokunmak geri alır veya dokunmatik çalışma alanında seçim ve çizim araçları arasında geçiş yapar, üç parmakla dokunmak yineler; Sunum Modu'nda ikisi de çalışmaz. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; type already in a document keeps its own language. Belge Kurulumu'nun dili İngilizce: ABD olduğu ve [Normal Karakter Stili] bir dil belirlemediği 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 case; Korean words take no hyphen, and Indian-language words do not break inside a character cluster. 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; büyük/küçük harf durumu fark etmez, Korece sözcükler tire almaz ve Hint dillerindeki sözcükler bir karakter grubunun içinden bölünmez. Reset all preferences to their defaults? Tüm tercihler varsayılanlarına sıfırlansın mı? The defaults are applied when you click OK in Preferences. Cancel there keeps your current preferences. Varsayılanlar, Tercihler'de Tamam'a tıkladığınızda uygulanır. Oradaki İptal, mevcut tercihlerinizi korur. diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 189f820d99..5ee825e517 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -3412,7 +3412,6 @@ digits Malayalam Малаялам Edit type set in fonts that aren't available? Редагувати текст, набраний недоступними шрифтами? Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Показує на полотні номер кожного фрагмента в рамці в його лівому верхньому куті; коли параметр вимкнено, контури фрагментів і далі видно. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Колір контурів користувацьких і об’єктних фрагментів та рамок з їхніми номерами; автоматичні фрагменти використовують блідіший відтінок цього кольору. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 з цієї папки завантажуються під час запуску і коли ви натискаєте ОК з новою папкою тут, крім безпечного режиму; веб-версія їх не завантажує. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. «Звичайний» зберігає власні обмеження кожного модуля; з «Великий» фільтр або команда модуля може виконати щонайменше 250 мільйонів інструкцій понад ті, що потрібні для її вхідних даних. Обмеження часу не змінюється. diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 787c166727..56969c7da0 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3736,7 +3736,6 @@ mark-style Japanese Kiểu Nhật Edit type set in fonts that aren't available? Chỉnh sửa văn bản dùng phông chữ không có sẵn? Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. Hiển thị trên khung vẽ số của mỗi lát cắt trong một ô ở góc trên bên trái của nó; khi tắt, đường viền của các lát cắt vẫn hiện. The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. Màu của đường viền lát cắt người dùng và lát cắt đối tượng cùng các ô số của chúng; lát cắt tự động dùng một sắc độ nhạt hơn của màu này. - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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à [Kiểu ký tự thường] không đặt ngôn ngữ nào; 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. Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. Thường giữ giới hạn riêng của từng plug-in; với Lớn, một bộ lọc hoặc lệnh của plug-in có thể chạy ít nhất 250 triệu lệnh ngoài các lệnh cho dữ liệu đầu vào của nó. Giới hạn thời gian vẫn giữ nguyên. diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 88399ec07a..e8c0c07614 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -3262,7 +3262,6 @@ digits Malayalam 马拉雅拉姆数字 Edit type set in fonts that aren't available? 要编辑使用了不可用字体的文字吗? Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. 在画布上于每个切片左上角的方框中显示其编号;关闭时,切片轮廓仍会显示。 The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. 用户切片和对象切片的轮廓及其编号方框的颜色;自动切片使用此颜色较淡的色调。 - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 版不会载入它们。 Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. “正常”保留每个增效工具自身的限制;选择“大”时,增效工具的滤镜或命令除处理其输入所需的指令外,至少可运行 2.5 亿条指令。时间限制不变。 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 8e6d18e9ae..70f7ed6df4 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -4699,7 +4699,6 @@ digits Malayalam 馬來亞拉姆數字 Edit type set in fonts that aren't available? 要編輯使用了無法使用之字體的文字嗎? Shows each slice's number in a box at its top left on the canvas; off, the slice outlines still show. 在畫布上於每個切片左上角的方框中顯示其編號;關閉時,切片輪廓仍會顯示。 The color of user and object slice outlines and their number boxes; auto slices use a dimmer shade of it. 使用者切片和物件切片的輪廓及其編號方框的顏色;自動切片使用此顏色較淡的色調。 - New type takes this language while Document Setup's language is English: USA and [Normal Character Style] sets none; 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 增效模組會在啟動時以及在此指定新資料夾並按一下「確定」時載入,安全模式除外;網頁版不會載入它們。 Normal keeps each plug-in's own limits; with Large, a plug-in filter or command may run at least 250 million instructions besides those for its input. The time limit stays the same. 「正常」保留每個增效模組自身的限制;選擇「大」時,增效模組的濾鏡或命令除處理其輸入所需的指令外,至少可執行 2.5 億條指令。時間限制不變。 From ba919a0ea0fb3a33ac4da296ea762660e2ae59aa Mon Sep 17 00:00:00 2001 From: bflatastic Date: Thu, 19 Nov 2026 23:03:34 +0700 Subject: [PATCH 53/55] Symbols: the step from the previous point reads it with get, so the adjust closure stays under the complexity limit --- crates/engine/src/cmd/brushsym/symbols.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/brushsym/symbols.rs b/crates/engine/src/cmd/brushsym/symbols.rs index 01b7ac9fab..e9ddf851be 100644 --- a/crates/engine/src/cmd/brushsym/symbols.rs +++ b/crates/engine/src/cmd/brushsym/symbols.rs @@ -1210,7 +1210,7 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result { let mut touched = std::collections::BTreeSet::new(); let mut sides = Sides::new(); for (j, (q, pressure)) in pts.iter().enumerate() { - let delta = if j > 0 { *q - pts[j - 1].0 } else { Vec2::ZERO }; + let delta = j.checked_sub(1).and_then(|i| pts.get(i)).map_or(Vec2::ZERO, |(prev, _)| *q - *prev); // Use Pressure Pen: the pen's pressure at the point is the intensity there. let strength = if use_pressure { *pressure } else { intensity }; // Average: the mean of the instances under the brush, as they are at this point. From 850338909e934f2e8cbb067dab8927be82bfd76d Mon Sep 17 00:00:00 2001 From: bflatastic Date: Thu, 19 Nov 2026 23:04:07 +0700 Subject: [PATCH 54/55] Symbols: a recolored instance is noted without a nested if --- crates/engine/src/cmd/brushsym/symbols.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/engine/src/cmd/brushsym/symbols.rs b/crates/engine/src/cmd/brushsym/symbols.rs index e9ddf851be..14e52ffe4f 100644 --- a/crates/engine/src/cmd/brushsym/symbols.rs +++ b/crates/engine/src/cmd/brushsym/symbols.rs @@ -1236,9 +1236,7 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result { // instance without one, or without a size, is left as it is. if let Some((to, step)) = &recolor { let fill = d.node(*id).and_then(|n| look(d, n, &mut sides)).and_then(|l| l.fill); - if recolor_keeping_amount(d, *id, fill, to, step * w) { - touched.insert(*id); - } + touched.extend(recolor_keeping_amount(d, *id, fill, to, step * w).then_some(*id)); continue; } // Average needs the instance's own values, so it leaves an instance without a size From f8ae50c8233cf9259de9f1ca19c8fee0423ed3ec Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Thu, 19 Nov 2026 17:13:54 +0000 Subject: [PATCH 55/55] AI editing data keeps dynamic symbols and their instance changes --- crates/eps/src/ai_editing.rs | 10 +++- crates/eps/src/ai_editing/tests.rs | 58 ++++++++++++++++++++- crates/eps/src/ai_editing/writer.rs | 11 +++- crates/eps/src/ai_editing/writer/symbols.rs | 43 +++++++++++++-- crates/eps/src/import/ai/read/directives.rs | 4 +- crates/eps/src/import/ai/read/document.rs | 13 +++++ crates/eps/src/import/ai/read/types.rs | 1 + 7 files changed, 127 insertions(+), 13 deletions(-) diff --git a/crates/eps/src/ai_editing.rs b/crates/eps/src/ai_editing.rs index 17177671cf..88daf4d7a1 100644 --- a/crates/eps/src/ai_editing.rs +++ b/crates/eps/src/ai_editing.rs @@ -118,7 +118,12 @@ //! `%AI24_EndSymbolList`); each instance as `/SymbolInstance :`, `(name) /SymbolRef ,`, the //! matrix taking the art to art space as `a b c d tx ty /RTransformMatrix`, `;`, then its name //! and opacity mask and a state block as a group's with its opacity and blending mode (an -//! instance with isolation, knockout or knockout shape of its own is written as its art). The +//! instance with isolation, knockout or knockout shape of its own is written as its art). A +//! dynamic symbol's art dictionary also holds `VectorCraftDynamicSymbol` (`/Int`, 1), and the +//! dictionary of an instance with changes of its own (`symbol_overrides`) holds +//! `VectorCraftSymbolOverrides`, a `/String` of the changes as hex-coded JSON: the format's own +//! entries, as other apps' editing data is not documented, read back by this reader and left out by +//! others. The //! definitions are at most the reader's 4,096. In a symbol's art, an instance's matrix and //! a gradient's take the art to the canvas's space turned y up about art space's origin there, //! and a gradient mesh's corners are in that space; an envelope's contents in its dictionary are @@ -191,7 +196,7 @@ //! and instances of //! symbols past 4,096 as their art (symbol art past [`vectorcraft_doc::MAX_SYMBOL_NODES`] objects //! in all left out), instances of symbols the document doesn't have as empty groups, symbols' 9-slice -//! guides, export types and dynamic type left out, gradient meshes the reader wouldn't read back as +//! guides, export types left out, gradient meshes the reader wouldn't read back as //! they are, folded meshes, meshes in pattern tiles and in art cut to a clipping object and every mesh //! on a large canvas as their drawn look, blends the reader wouldn't read back live as //! their steps, other live objects (placed documents included) as their art, @@ -220,6 +225,7 @@ use vectorcraft_pdf::PrivateData; use crate::ps; mod writer; +pub(crate) use writer::{DYNAMIC_KEY, OVERRIDES_KEY, hex_decode}; use writer::Writer; diff --git a/crates/eps/src/ai_editing/tests.rs b/crates/eps/src/ai_editing/tests.rs index 22d3203e3b..602b86910b 100644 --- a/crates/eps/src/ai_editing/tests.rs +++ b/crates/eps/src/ai_editing/tests.rs @@ -6394,7 +6394,8 @@ fn instances_the_data_cant_hold_are_written_as_their_art() { let layer = doc.layers[0].id; doc.insert(Some(layer), usize::MAX, changed).unwrap(); doc.insert(Some(layer), usize::MAX, plain).unwrap(); - assert_eq!(export_ai_editing(&doc, &opts()).unwrap().warnings, [writer::SYMBOL_ART, writer::SYMBOL_OPTIONS]); + doc.symbols[0].dynamic = false; + assert_eq!(export_ai_editing(&doc, &opts()).unwrap().warnings, [writer::SYMBOL_ART]); let back = read_back(&doc); assert_eq!(kinds(&back), ["art", "instance"]); let green = back.layers[0].children().unwrap()[0].clone(); @@ -6890,7 +6891,7 @@ fn symbol_options_and_linked_images_in_symbols_are_reported() { let layer = doc.layers[0].id; doc.insert(Some(layer), usize::MAX, one).unwrap(); let out = export_ai_editing(&doc, &opts()).unwrap(); - assert_eq!(out.warnings, [writer::SYMBOL_OPTIONS, writer::LINKS_EMBEDDED]); + assert_eq!(out.warnings, [writer::LINKS_EMBEDDED]); let p = program_shown(&doc); assert!(p.contains("%AI5_BeginRaster") && !p.contains("%AI5_BeginPlace"), "{p}"); let back = read_back(&doc); @@ -15982,3 +15983,56 @@ fn a_mesh_eight_levels_down_is_written_as_a_mesh() { assert_eq!(back.len(), 1, "{back:#?}"); assert_mesh_exact(mesh_of(&back[0]), &want, "eight levels down"); } + +fn dynamic_doc() -> Document { + let mut doc = Document::new(200.0, 100.0); + let art = square(&mut doc, Rect::new(0.0, 0.0, 10.0, 10.0), LEAF); + doc.symbols.push(Symbol { dynamic: true, name: "Leaf".into(), art: Arc::new(art) }); + let layer = doc.layers[0].id; + for (x, c) in [(10.0, Color::rgb(1.0, 0.0, 0.0)), (50.0, Color::rgb(0.0, 0.0, 1.0))] { + let mut i = instance(&mut doc, "Leaf", Affine::translate((x, 10.0))); + i.extras_mut().symbol_overrides = vec![vectorcraft_doc::SymbolOverride { fill: Some(solid(c)), opacity: Some(0.5), ..Default::default() }]; + doc.insert(Some(layer), usize::MAX, i).unwrap(); + } + let plain = instance(&mut doc, "Leaf", Affine::translate((90.0, 10.0))); + doc.insert(Some(layer), usize::MAX, plain).unwrap(); + doc +} + +#[test] +fn dynamic_symbols_and_their_instance_changes_survive_a_round_trip() { + let doc = dynamic_doc(); + let out = export_ai_editing(&doc, &opts()).unwrap(); + assert_eq!(out.warnings, [writer::SYMBOL_CHANGES]); + let back = read_back(&doc); + assert!(back.symbols[0].dynamic); + let kids = back.layers[0].children().unwrap(); + assert!(kids.iter().all(|n| matches!(n.kind, NodeKind::SymbolInstance { .. }))); + let want: Vec<_> = doc.layers[0].children().unwrap().iter().map(|n| n.extras().symbol_overrides.clone()).collect(); + let got: Vec<_> = kids.iter().map(|n| n.extras().symbol_overrides.clone()).collect(); + assert_eq!(got, want); + assert_ne!(got[0], got[1]); + assert!(got[2].is_empty()); +} + +#[test] +fn static_symbols_write_no_dynamic_entries() { + let mut doc = dynamic_doc(); + doc.symbols[0].dynamic = false; + let layer = doc.layers[0].id; + for n in doc.layers[0].children().unwrap().to_vec() { + doc.remove(n.id).unwrap(); + } + for x in [10.0, 50.0] { + let i = instance(&mut doc, "Leaf", Affine::translate((x, 10.0))); + doc.insert(Some(layer), usize::MAX, i).unwrap(); + } + let p = program(&doc); + assert!(!p.contains("VectorCraftDynamicSymbol") && !p.contains("VectorCraftSymbolOverrides")); + assert!(export_ai_editing(&doc, &opts()).unwrap().warnings.is_empty()); + let back = read_back(&doc); + assert!(!back.symbols[0].dynamic); + let kids = back.layers[0].children().unwrap(); + assert_eq!(kids.len(), 2); + assert!(kids.iter().all(|n| matches!(n.kind, NodeKind::SymbolInstance { .. }) && n.extras().symbol_overrides.is_empty())); +} diff --git a/crates/eps/src/ai_editing/writer.rs b/crates/eps/src/ai_editing/writer.rs index 41254840cb..6c1f4a398f 100644 --- a/crates/eps/src/ai_editing/writer.rs +++ b/crates/eps/src/ai_editing/writer.rs @@ -48,8 +48,9 @@ pub(super) use paints::{ GRADIENT_COMPARISONS, GRADIENT_DITHER, GRADIENT_HUE, GRADIENT_PERCEPTUAL, GRADIENT_SHAPES, GRADIENTS, SCANNED_DEFINITIONS, STOP_LINKS, SWATCH_PLACEMENT, free_gradient_name, }; +pub(crate) use symbols::{DYNAMIC_KEY, OVERRIDES_KEY, hex_decode}; #[cfg(test)] -pub(super) use symbols::{MISSING_SYMBOL, SYMBOL_ART, SYMBOL_COUNT, SYMBOL_OPTIONS}; +pub(super) use symbols::{MISSING_SYMBOL, SYMBOL_ART, SYMBOL_CHANGES, SYMBOL_COUNT, SYMBOL_OPTIONS}; #[cfg(test)] pub(super) use texts::{FONT_RESOLVES, RESOLVE_EACH_RUN, TYPE_ATTRIBUTES}; #[cfg(test)] @@ -286,6 +287,7 @@ pub(super) struct Writer<'a> { symbol_scales: HashMap, /// The entries a symbol's dictionary adds to its art's dictionary, and the art's id. root_entries: Option<(vectorcraft_doc::NodeId, String)>, + instance_entries: Option<(vectorcraft_doc::NodeId, String)>, /// The objects that may be written with an art style, as they were before baking, by id /// ([`styles::styled_objects`]). pub(super) styled: HashMap>, @@ -405,6 +407,7 @@ impl<'a> Writer<'a> { inner_scale: 1.0, symbol_scales: HashMap::new(), root_entries: None, + instance_entries: None, styled: HashMap::new(), symbol_styled: HashMap::new(), pattern_styled: HashMap::new(), @@ -818,7 +821,7 @@ impl<'a> Writer<'a> { mask_window = self.windowed.take(); } } - NodeKind::SymbolInstance { symbol, xf } if self.live_instance_in_room(n, symbol, *xf) => self.symbol_instance(symbol, *xf, xy), + NodeKind::SymbolInstance { symbol, xf } if self.live_instance_in_room(n, symbol, *xf) => self.symbol_instance(n, symbol, *xf, xy), NodeKind::SymbolInstance { symbol, xf } => { if !self.open_group("u") { return; @@ -1016,6 +1019,10 @@ impl<'a> Writer<'a> { Some((id, _)) if *id == n.id => self.root_entries.take().map(|(_, e)| e), _ => None, }; + let entries = match &self.instance_entries { + Some((id, _)) if *id == n.id => entries.or_else(|| self.instance_entries.take().map(|(_, e)| e)), + _ => entries, + }; let role = match &self.blend_role { Some((id, _)) if *id == n.id => self.blend_role.take().map(|(_, e)| e), _ => None, diff --git a/crates/eps/src/ai_editing/writer/symbols.rs b/crates/eps/src/ai_editing/writer/symbols.rs index 4d4bb2acba..a616d748d1 100644 --- a/crates/eps/src/ai_editing/writer/symbols.rs +++ b/crates/eps/src/ai_editing/writer/symbols.rs @@ -14,7 +14,27 @@ use crate::ps; pub(in crate::ai_editing) const SYMBOL_ART: &str = "symbol instances with a fill, appearance changes, isolation, knockout or knockout shape of their own, instances of symbols with 9-slice guides or pattern paint, instances in pattern tiles or in art cut to a clipping object, instances scaled almost flat, instances that turn, mirror or scale symbols holding type, live objects, instances written as their art, shapes with rounded live corners or strokes written as outlines or brush art, instances that scale their symbol more than 100 times, instances on the layers of a large canvas and instances of symbols past 4,096 are written as their art in the editing data for other apps"; pub(in crate::ai_editing) const SYMBOL_OPTIONS: &str = - "the 9-slice guides, export types and dynamic type of symbols are left out of the editing data for other apps"; + "the 9-slice guides and export types of symbols are left out of the editing data for other apps"; +pub(in crate::ai_editing) const SYMBOL_CHANGES: &str = + "the changes of dynamic symbol instances are kept in dictionary entries of their own, which other apps leave out"; +pub(crate) const DYNAMIC_KEY: &str = "VectorCraftDynamicSymbol"; +pub(crate) const OVERRIDES_KEY: &str = "VectorCraftSymbolOverrides"; +const MAX_OVERRIDES_BYTES: usize = 1 << 20; + +pub(crate) fn hex_decode(s: &str) -> Option> { + if !s.len().is_multiple_of(2) || s.len() / 2 > MAX_OVERRIDES_BYTES { + return None; + } + s.as_bytes().chunks(2).map(|c| u8::from_str_radix(std::str::from_utf8(c).ok()?, 16).ok()).collect() +} + +fn hex_encode(b: &[u8]) -> String { + b.iter().fold(String::with_capacity(b.len() * 2), |mut s, v| { + let _ = write!(s, "{v:02x}"); + s + }) +} + pub(in crate::ai_editing) const MISSING_SYMBOL: &str = "symbol instances of symbols the document doesn't have are written as empty groups in the editing data for other apps"; /// The most an instance may scale its symbol's art, nested instances' scales included: the art's @@ -55,7 +75,8 @@ impl Writer<'_> { /// that keeps the art's area as it is written and scales it as the definition allows /// ([`Self::keeps_scale`]). pub(super) fn live_instance(&mut self, n: &Node, symbol: &str, xf: Affine) -> bool { - let own = vectorcraft_brush::stain(n).is_some() || !n.extras().symbol_overrides.is_empty(); + let dynamic = self.symbol_doc.symbols.iter().any(|s| s.name == symbol && s.dynamic); + let own = vectorcraft_brush::stain(n).is_some() || (!dynamic && !n.extras().symbol_overrides.is_empty()); let group_state = n.isolate || n.knockout != Knockout::Neutral || n.knockout_shape; // The matrix as written (to ten decimals) must still keep the art's area. let m = Affine::new((self.instance_space * xf).as_coeffs().map(|v| (v * 1e10).round() / 1e10)); @@ -153,7 +174,16 @@ impl Writer<'_> { /// canvas's space turned y up about art space's origin there) as `a b c d tx ty /// /RTransformMatrix` (to ten decimals), `;`, then its state block as a group's: `Xy`, `0 0 Xd` /// and `6 () XW` when it has transparency, else `9 () XW`. Its dictionary goes between the two. - pub(super) fn symbol_instance(&mut self, symbol: &str, xf: Affine, xy: Xy) { + pub(super) fn symbol_instance(&mut self, n: &Node, symbol: &str, xf: Affine, xy: Xy) { + let o = &n.extras().symbol_overrides; + if !o.is_empty() + && let Ok(json) = serde_json::to_vec(o) + && json.len() <= MAX_OVERRIDES_BYTES + { + let e = format!("%_{} /String ({OVERRIDES_KEY}) ,\n", ps::bytes(hex_encode(&json).as_bytes())); + self.instance_entries = Some((n.id, e)); + self.warn(SYMBOL_CHANGES); + } let m = self.instance_space * xf; let _ = write!(self.body, "/SymbolInstance :\n{} /SymbolRef ,\n", ps::bytes(symbol.as_bytes())); for v in m.as_coeffs() { @@ -201,7 +231,7 @@ impl Writer<'_> { self.warn(SYMBOL_COUNT); return false; } - if sym.dynamic || doc.symbol_export_type(name) != SymbolExportType::default() || doc.symbol_nine_slice(name).is_some() { + if doc.symbol_export_type(name) != SymbolExportType::default() || doc.symbol_nine_slice(name).is_some() { self.warn(SYMBOL_OPTIONS); } // The art's effects are its own, not those of a drawn look that first places it, and its @@ -260,7 +290,10 @@ impl Writer<'_> { (self.to_art, self.grad_space, self.canvas, self.instance_space) = (Affine::IDENTITY, about_origin, Affine::IDENTITY, about_origin); self.block_end = usize::MAX; let registration = u16::from(doc.symbol_registration(name).0.min(8)) + 1; - let entries = format!("%_{registration} /Int (AI13PatternRegistrationType) ,\n"); + let mut entries = format!("%_{registration} /Int (AI13PatternRegistrationType) ,\n"); + if sym.dynamic { + let _ = writeln!(entries, "%_1 /Int ({DYNAMIC_KEY}) ,"); + } // The canvas draws a symbol's art even when its root is hidden, so the root is written shown. let shown; let root: &Node = if sym.art.visible { diff --git a/crates/eps/src/import/ai/read/directives.rs b/crates/eps/src/import/ai/read/directives.rs index 67b3e799e2..418ac283a8 100644 --- a/crates/eps/src/import/ai/read/directives.rs +++ b/crates/eps/src/import/ai/read/directives.rs @@ -620,7 +620,7 @@ impl<'a> Reader<'a> { || sub.mesh.is_some() || sub.gradient_def.is_some(); let head = sub.symbol.take().unwrap_or_default(); - let registration = head.registration; + let (registration, dynamic) = (head.registration, head.dynamic); let measured = read.is_ok() && !open && sub.unsupported.is_empty() && sub.unknown.is_empty() && sub.frames.len() == 1; let Some(frame) = sub.frames.pop().filter(|_| measured) else { return }; let mut kids = frame.children; @@ -662,7 +662,7 @@ impl<'a> Reader<'a> { } } let named = self.unique_symbol_name(if name.is_empty() { "Symbol" } else { &name }); - self.doc.symbols.push(Symbol { name: named.clone(), art: Arc::new(art), dynamic: false }); + self.doc.symbols.push(Symbol { name: named.clone(), art: Arc::new(art), dynamic }); if let Some(reg) = registration.and_then(symbol_registration) { self.doc.set_symbol_registration(&named, reg); } diff --git a/crates/eps/src/import/ai/read/document.rs b/crates/eps/src/import/ai/read/document.rs index 2eee5a0a15..a2e546eb97 100644 --- a/crates/eps/src/import/ai/read/document.rs +++ b/crates/eps/src/import/ai/read/document.rs @@ -781,6 +781,19 @@ impl<'a> Reader<'a> { { head.registration = Some(*r); } + if self.frames.len() == 1 + && let Some(head) = self.symbol.as_mut() + && o.nums(crate::ai_editing::DYNAMIC_KEY).first().is_some_and(|v| *v != 0.0) + { + head.dynamic = true; + } + if let Some(text) = o.text(crate::ai_editing::OVERRIDES_KEY) + && let Some(bytes) = crate::ai_editing::hex_decode(&text) + && let Ok(list) = serde_json::from_slice::>(&bytes) + && let Some(n) = self.last_object().filter(|n| matches!(n.kind, NodeKind::SymbolInstance { .. })) + { + n.extras_mut().symbol_overrides = list.into_iter().filter(|s| !s.is_empty()).collect(); + } self.constraint_art(o); self.placed_page(o); // A blend's key object or spine. diff --git a/crates/eps/src/import/ai/read/types.rs b/crates/eps/src/import/ai/read/types.rs index 02d4a3354a..a155d9f505 100644 --- a/crates/eps/src/import/ai/read/types.rs +++ b/crates/eps/src/import/ai/read/types.rs @@ -244,6 +244,7 @@ pub(super) struct PatternHead { pub(super) struct SymbolHead { /// `AI13PatternRegistrationType` in the dictionary after the art. pub(super) registration: Option, + pub(super) dynamic: bool, /// Art the reader left out (type, a placed file, non-native art, an image it can't read or /// place, a gradient it can't read): the symbol isn't kept, and its instances come in as the /// page draws them, within the box of the rest.