mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-22 10:23:16 +01:00
Merge storytold/main (770fbd27ce) into feat-8363-trim-view-guides
# Conflicts: # docs/roadmap.md # docs/target-app-parity.md
This commit is contained in:
commit
1cb320d4a0
108 files changed
+7088
-362
No files matched your search
@@ -128,6 +128,7 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap
|
||||
|
||||
- 2026-11-14: Built-in symbol library Weather Icons: adds a sixth procedural symbol library (Window › Symbol Libraries, the Symbols panel's Symbol Libraries Menu) containing six original vector symbols (Sun, Moon, Cloud, Rain, Thunder, Snow) generated in code without default 9-slice guides (part of Gap 5). Headline numbers unchanged.
|
||||
- 2026-11-14: Built-in Tech Circuit brush library: Circuit Trace (chamfered art with 45-degree elbows and terminal pads), Bus Lines (parallel conductor pattern) and Terminal Nodes (repeating solder pads, test points and leads), all original geometry generated in code. Ten built-in brush libraries; G5 remaining estimate 3–13 h (estimated), headline numbers unchanged.
|
||||
- 2026-11-18: Built-in Paint brush library: Flat Sweep, Dry Drag, Loaded Stroke and Fan Sweep, original art brushes generated in code that take the stroke color as tints. Thirteen built-in brush libraries; headline numbers unchanged.
|
||||
|
||||
- 2026-11-05: Window › Toolbars › Keep Tools Beside the Canvas, off by default, docks the Tools panel between left-side panels and the canvas instead of at the window's left edge, and the canvas's left edge then also docks a floating Tools panel (`window.toolsBesideCanvas`, #5395). Workspaces keep the setting; workspaces saved without it keep Tools at the window's edge. An optional VectorCraft layout choice; headline numbers unchanged.
|
||||
- 2026-11-17: The canvas's left edge docks a floating Tools panel whichever way Keep Tools Beside the Canvas is set: a drop there, right of panels docked on the left, turns the setting on, and a drop on the window's left edge turns it off (#7837). Headline numbers unchanged.
|
||||
|
||||
@@ -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;
|
||||
@@ -340,6 +341,49 @@ 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
|
||||
/// (<https://www.w3.org/TR/css-color-4/#rgb-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 (<https://www.w3.org/TR/css-color-4/#hsl-to-rgb>): the inverse of
|
||||
/// [`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);
|
||||
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 {
|
||||
@@ -499,6 +543,59 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
/// The HSL examples of CSS Color 4, section 7 (<https://www.w3.org/TR/css-color-4/#the-hsl-notation>),
|
||||
/// 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"),
|
||||
] {
|
||||
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] = 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] {
|
||||
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}");
|
||||
// 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.
|
||||
#[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]);
|
||||
|
||||
@@ -99,18 +99,24 @@ pub fn builtin_library(id: &str) -> Option<Arc<SwatchLibrary>> {
|
||||
|
||||
// ---------- 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
|
||||
/// (<https://www.w3.org/TR/css-color-4/#color-conversion-code>).
|
||||
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 <= 0.003_130_8 { 12.92 * v } else { 1.055 * v.powf(1.0 / 2.4) - 0.055 })
|
||||
]
|
||||
}
|
||||
|
||||
/// OKLab `[l, a, b]` of a colour's display RGB.
|
||||
@@ -118,11 +124,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
|
||||
/// (<https://www.w3.org/TR/css-color-4/#color-conversion-code>).
|
||||
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();
|
||||
|
||||
@@ -0,0 +1,266 @@
|
||||
//! OKLCH, the polar form of Oklab, as CSS Color 4 defines it
|
||||
//! (<https://www.w3.org/TR/css-color-4/#specifying-oklab-oklch>): 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_linear_srgb, 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 {
|
||||
largest_fitting_chroma(l, h, f64::INFINITY)
|
||||
}
|
||||
|
||||
/// 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 top = limit.min(0.5);
|
||||
if top <= 0.0 {
|
||||
return 0.0;
|
||||
}
|
||||
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;
|
||||
}
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
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)
|
||||
}
|
||||
|
||||
/// The real roots of `a t² + b t + c`.
|
||||
fn turning_points(a: f64, b: f64, c: f64) -> Vec<f64> {
|
||||
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
|
||||
/// 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, largest_fitting_chroma(l, h, 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);
|
||||
}
|
||||
|
||||
/// 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));
|
||||
}
|
||||
|
||||
/// 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]
|
||||
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}");
|
||||
}
|
||||
|
||||
/// 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);
|
||||
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]);
|
||||
}
|
||||
}
|
||||
@@ -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<NodeId, serde_json::Value> {
|
||||
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<NodeId, serde_json::Value>) {
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -451,12 +451,25 @@ 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, 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 mirror {
|
||||
let opposite = drawn.p - (pos - drawn.p);
|
||||
if out { drawn.h_in = opposite } else { drawn.h_out = opposite }
|
||||
}
|
||||
*a = drawn.transform(to_text);
|
||||
true
|
||||
})
|
||||
|
||||
@@ -175,6 +175,7 @@ pub const BUILTIN: &[BuiltinBrushLibrary] = &[
|
||||
BuiltinBrushLibrary { id: "calligraphic-nibs", name: "Calligraphic Nibs", make: calligraphic_nibs },
|
||||
BuiltinBrushLibrary { id: "pressure-sensitive", name: "Pressure Sensitive", make: pressure_sensitive },
|
||||
BuiltinBrushLibrary { id: "bristle-brushes", name: "Bristle Brushes", make: bristle_brushes },
|
||||
BuiltinBrushLibrary { id: "paint", name: "Paint", make: paint },
|
||||
BuiltinBrushLibrary { id: "pattern-borders", name: "Pattern Borders", make: pattern_borders },
|
||||
BuiltinBrushLibrary { id: "scatter-shapes", name: "Scatter Shapes", make: scatter_shapes },
|
||||
BuiltinBrushLibrary { id: "stipple", name: "Stipple", make: stipple },
|
||||
@@ -185,6 +186,7 @@ pub const BUILTIN: &[BuiltinBrushLibrary] = &[
|
||||
BuiltinBrushLibrary { id: "engraving", name: "Engraving", make: engraving },
|
||||
BuiltinBrushLibrary { id: "arrows", name: "Arrows", make: arrows },
|
||||
BuiltinBrushLibrary { id: "image-brush", name: "Image Brush", make: image_brush },
|
||||
BuiltinBrushLibrary { id: "artistic", name: "Artistic Brushes", make: artistic },
|
||||
];
|
||||
|
||||
/// Built-in library `id`, made once.
|
||||
@@ -238,6 +240,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 Brushes",
|
||||
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),
|
||||
],
|
||||
)
|
||||
}
|
||||
|
||||
/// Original fine-line art for an engraving-style brush library.
|
||||
fn engraving() -> BrushLibrary {
|
||||
let lines = |count: usize, width: f64, spacing: f64| {
|
||||
@@ -594,6 +632,45 @@ fn spacer(r: Rect) -> Node {
|
||||
Node::path(NodeId(0), shapes::rectangle(r), Appearance::default())
|
||||
}
|
||||
|
||||
/// Paint: original filled vector art with broad, broken, loaded, and fanned marks. Each is one
|
||||
/// stroke stretched along the path, with an intentionally different edge and paint distribution.
|
||||
fn paint() -> BrushLibrary {
|
||||
let flat_sweep = group(vec![
|
||||
black(band(100.0, 5.0, 64, |x| 0.8 * (x / 100.0 * std::f64::consts::TAU).sin())),
|
||||
black(polygon(&[(0.0, -2.5), (7.0, -3.8), (18.0, -2.5)])),
|
||||
black(polygon(&[(78.0, 2.5), (94.0, 4.0), (100.0, 2.5)])),
|
||||
]);
|
||||
let mut dry_drag = vec![];
|
||||
for (y, shift) in [(-5.0, 0.0), (-3.2, 4.0), (-1.3, 1.0), (0.8, 6.0), (2.8, 3.0), (4.8, 8.0)] {
|
||||
dry_drag.push(black(shapes::rectangle(Rect::new(2.0 + shift, y, 35.0 + shift, y + 0.8))));
|
||||
dry_drag.push(black(shapes::rectangle(Rect::new(40.0 + shift, y, 75.0 - shift / 2.0, y + 0.8))));
|
||||
dry_drag.push(black(shapes::rectangle(Rect::new(80.0 - shift / 2.0, y, 98.0, y + 0.8))));
|
||||
}
|
||||
let mut loaded_stroke = vec![black(band(100.0, 6.0, 64, |x| 1.2 * (x / 100.0 * 2.0 * std::f64::consts::TAU).sin()))];
|
||||
for (x, r) in [(12.0, 4.2), (39.0, 3.6), (64.0, 4.8), (88.0, 3.9)] {
|
||||
loaded_stroke.push(black(shapes::ellipse(Rect::new(x - r, -r - 1.5, x + r, r + 1.5))));
|
||||
}
|
||||
let mut fan_sweep = vec![];
|
||||
for i in -2..=2 {
|
||||
let offset = i as f64;
|
||||
fan_sweep.push(black(band(100.0, 1.2, 48, |x| offset * (1.4 + x * 0.045) + 0.3 * (x / 100.0 * std::f64::consts::TAU).sin())));
|
||||
}
|
||||
let paint_art = |name: &str, art: Node| Brush {
|
||||
name: name.into(),
|
||||
kind: BrushKind::Art(ArtBrush { art, width: 150.0, colorization: Colorization::Tints, ..Default::default() }),
|
||||
};
|
||||
built(
|
||||
"Paint",
|
||||
Document::new(100.0, 100.0),
|
||||
vec![
|
||||
paint_art("Flat Sweep", flat_sweep),
|
||||
paint_art("Dry Drag", group(dry_drag)),
|
||||
paint_art("Loaded Stroke", group(loaded_stroke)),
|
||||
paint_art("Fan Sweep", group(fan_sweep)),
|
||||
],
|
||||
)
|
||||
}
|
||||
|
||||
/// Pattern Borders: pattern brushes of tiles drawn here; Beads has corner tiles.
|
||||
fn pattern_borders() -> BrushLibrary {
|
||||
let zigzag = black(polygon(&[(0.0, 1.4), (5.0, -2.6), (10.0, 1.4), (10.0, 2.6), (5.0, -1.4), (0.0, 2.6)]));
|
||||
@@ -1036,10 +1113,14 @@ pub fn library(s: &Session, key: &str) -> Option<(LibraryInfo, Arc<BrushLibrary>
|
||||
return Some(found);
|
||||
}
|
||||
if let Some(b) = BUILTIN.iter().find(|b| b.id == key) {
|
||||
return Some((builtin_info(b), builtin_library(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<BrushLibrary>)> {
|
||||
|
||||
@@ -362,7 +362,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Symbol Sprayer",
|
||||
[],
|
||||
None,
|
||||
"{points: [[x,y]…] (a third number is not used; one that isn't a number is an error), 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; a `style` the document does not have is then an error. 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]…] (a third value is a number or null and is not used), 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}. 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, 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; a `style` the document does not have is then an error. 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
|
||||
),
|
||||
@@ -380,7 +380,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"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; average leaves an instance without a size (a scale of 0) as it is. 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. An instance counts only when it changes, and no undo step is added when none does (none under the brush, average with each already at the mean, or each already at the tool's limit). 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; average leaves an instance without a size as it is. 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. An instance counts only when it changes, and no undo step is added when none does (none under the brush, average with each already at the mean, each already at the tool's limit, 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
|
||||
),
|
||||
|
||||
@@ -86,8 +86,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<f64> {
|
||||
@@ -261,7 +262,10 @@ pub(super) fn mean(looks: &[&Look], at: Point, with_gap: bool) -> Option<Mean> {
|
||||
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) {
|
||||
|
||||
@@ -118,6 +118,20 @@ fn instances_of(d: &Document, name: Option<&str>) -> Vec<NodeId> {
|
||||
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<Item = &'a Node>) -> Vec<NodeId> {
|
||||
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<String>) {
|
||||
vectorcraft_doc::swatches::walk_with_masks(n, &mut |m| {
|
||||
@@ -917,11 +931,12 @@ fn samples(p: &Value, cmd: &str) -> Result<Vec<(Point, f64)>> {
|
||||
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()) {
|
||||
@@ -930,13 +945,15 @@ fn samples(p: &Value, cmd: &str) -> Result<Vec<(Point, f64)>> {
|
||||
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<Paint> {
|
||||
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).
|
||||
@@ -976,7 +993,7 @@ pub(super) fn symbol_spray(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
}
|
||||
let style = style_paint(&st.doc, p);
|
||||
// Style: User Defined uses the style `style` names, so one the document does not have is an error.
|
||||
if let Some(n) = str_param(p, "style").filter(|_| !modes.style && style.is_none()) {
|
||||
if let Some(n) = str_param(p, "style").filter(|n| !modes.style && !st.doc.graphic_styles.iter().any(|g| g.name == *n)) {
|
||||
return Err(bad(C, format!("unknown graphic style `{n}`")));
|
||||
}
|
||||
let size = natural_size(&st.doc, &name);
|
||||
@@ -1129,6 +1146,7 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
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.
|
||||
@@ -1141,20 +1159,8 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let style_paint = style_paint(&st.doc, p);
|
||||
let candidates: Vec<NodeId> = {
|
||||
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
|
||||
@@ -1172,12 +1178,39 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
// 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<NodeId> = 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, |orig, d| {
|
||||
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.
|
||||
@@ -1198,6 +1231,14 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
if w <= 0.0 {
|
||||
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, 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);
|
||||
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
|
||||
// as it is; the other methods change it as before.
|
||||
// The instance's own values are read for Average only.
|
||||
@@ -1261,8 +1302,9 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
};
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -1280,9 +1322,10 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
"stain" | "style" => {
|
||||
let paint = if tool == "style" { style_paint.clone().unwrap_or(Paint::solid(color)) } else { Paint::solid(color) };
|
||||
let (paint, o) = match &avg {
|
||||
// Toward the mean amount, keeping the stain or style the instance has.
|
||||
// Toward the mean amount, keeping the stain or style the instance has
|
||||
// (one at no opacity is none).
|
||||
Some((t, look)) => {
|
||||
let (own, cur) = look.fill.clone().map_or((None, 0.0), |(p, o)| (Some(p), o));
|
||||
let (own, cur) = look.fill.clone().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)
|
||||
}
|
||||
// Alt with the Symbol Styler removes the instance's appearance.
|
||||
@@ -1292,11 +1335,11 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
}
|
||||
None => {
|
||||
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) {
|
||||
// Random: the instance's share of the style, scaled by the
|
||||
// brush strength there.
|
||||
("style", Method::Random) => (share / 2.0 * w.min(1.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 })
|
||||
@@ -1324,9 +1367,108 @@ pub(super) fn symbol_adjust(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
}
|
||||
}
|
||||
}
|
||||
// An instance the stroke moved away and back again is not counted.
|
||||
// An instance the stroke moved away and back again, or reached but left as it was (at a
|
||||
// limit already), is not counted.
|
||||
touched.retain(|id| d.node(*id) != orig.node(*id));
|
||||
Ok((touched.len(), !touched.is_empty()))
|
||||
})?;
|
||||
Ok(json!({ "count": count }))
|
||||
}
|
||||
|
||||
/// 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
|
||||
/// 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 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;
|
||||
}
|
||||
let Some(f) = d.node_mut(id).and_then(|n| n.appearance.fill_mut()) else { return false };
|
||||
f.paint = paint;
|
||||
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<NodeId>, back: bool) -> Result<usize> {
|
||||
let parents: std::collections::BTreeSet<Option<NodeId>> = 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));
|
||||
let ch = d.children_mut(par)?;
|
||||
let len = Node::guide_run_start(ch);
|
||||
if len <= floor + 1 {
|
||||
continue;
|
||||
}
|
||||
let picked = |n: &Arc<Node>| 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)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
fn instance(id: u64) -> Arc<Node> {
|
||||
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<Node> = (0..40u64)
|
||||
.map(|g| {
|
||||
let base = g * 100;
|
||||
let mut children: Vec<Arc<Node>> = (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());
|
||||
}
|
||||
}
|
||||
@@ -109,6 +109,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<vectorcraft_doc::Guide>,
|
||||
/// 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<NodeId, Value>,
|
||||
/// The RGB and CMYK profiles the objects' colors showed through in the document they were
|
||||
/// copied from (its assigned profiles, else the working spaces then), by name; none for objects
|
||||
/// from outside an open document. Paste compares them with the destination's
|
||||
@@ -484,6 +487,7 @@ impl Clipboard {
|
||||
})
|
||||
.collect(),
|
||||
guides: self.guides.clone(),
|
||||
set_densities: self.set_densities.clone(),
|
||||
source_profiles: self.source_profiles.clone(),
|
||||
colors_converted: self.colors_converted,
|
||||
}
|
||||
|
||||
@@ -1161,6 +1161,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()
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"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; 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
|
||||
),
|
||||
@@ -1362,10 +1362,15 @@ fn convert_color(_: &mut Session, p: &Value) -> Result<Value> {
|
||||
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" => {
|
||||
// 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}`"))),
|
||||
};
|
||||
let de = c.gamut_error(&col);
|
||||
|
||||
@@ -1568,6 +1568,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 {
|
||||
|
||||
@@ -244,12 +244,22 @@ pub(super) fn spine_move_anchor(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
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)?;
|
||||
let link = switch_or(p, "link", 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`"));
|
||||
}
|
||||
if link && symmetric {
|
||||
return Err(bad(C, "`link` and `symmetric` cannot both be true"));
|
||||
}
|
||||
if link && independent {
|
||||
return Err(bad(C, "`link` and `independent` cannot both be true"));
|
||||
}
|
||||
@@ -264,6 +274,8 @@ pub(super) fn spine_move_anchor(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
}
|
||||
edit_spine(s, p, C, "Reshape Spine", |sp, anchors, keys| {
|
||||
let pull_out = handle.is_some_and(|out| sp.has_segment(index, !out));
|
||||
// At an open end of the spine the handle moves as it would without `symmetric`.
|
||||
let symmetric = symmetric && pull_out;
|
||||
let a = sp.anchors.get_mut(index).ok_or_else(|| bad(C, "no such spine point"))?;
|
||||
if let Some(out) = handle {
|
||||
if link {
|
||||
@@ -271,6 +283,10 @@ pub(super) fn spine_move_anchor(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
} else {
|
||||
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;
|
||||
|
||||
@@ -99,7 +99,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Move Spine Point",
|
||||
[],
|
||||
None,
|
||||
"{id? (default: the selected blend), anchor: index, x, y, with?: [index…], handle?: in|out, independent?: bool, link?: 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`; `link` makes the point smooth with the other handle in line at its own length, a retracted one pulled out to the moved handle's length where a segment leaves the point on its side; `link` needs `handle` and cannot go with `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, link?: 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; `link` makes the point smooth with the other handle in line at its own length, a retracted one pulled out to the moved handle's length where a segment leaves the point on its side; `symmetric` and `link` need `handle`, `symmetric` cannot go with `independent`, and `link` cannot go with `independent` or `symmetric`; all 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
|
||||
),
|
||||
|
||||
@@ -50,7 +50,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Move Direction Handle",
|
||||
[],
|
||||
None,
|
||||
"{id, subpath?, anchor, which: \"in\"|\"out\", x, y, independent?: bool, link?: bool, at?: [x,y]} move a direction handle; independent moves only that side and makes the anchor a corner; link makes the anchor smooth with the other handle in line at its own length (a retracted one is pulled out to the moved handle's length where a segment leaves the anchor on its side); link and independent cannot both be true; both default false; with link false, at moves the anchor and both handles before placing the chosen handle",
|
||||
"{id, subpath?, anchor, which: \"in\"|\"out\", x, y, independent?: bool, symmetric?: bool, link?: bool, at?: [x,y]} 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); link makes the anchor smooth with the other handle in line at its own length (a retracted one is pulled out to the moved handle's length where a segment leaves the anchor on its side); independent and symmetric cannot both be true, and link cannot go with either; all default false; with link false, at moves the anchor and both handles before placing the chosen handle",
|
||||
has_doc,
|
||||
set_handle
|
||||
),
|
||||
@@ -461,6 +461,13 @@ fn set_handle(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
return link_handle(s, p, id, si, ai, out, pos);
|
||||
}
|
||||
let independent = switch_or(p, "independent", false, "path.setHandle")?;
|
||||
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)?;
|
||||
let at = match p.get("at").filter(|v| !v.is_null()) {
|
||||
None => None,
|
||||
Some(v) => Some(finite_numbers(v).map(|[x, y]| Point::new(x, y)).ok_or_else(|| bad("path.setHandle", "`at` must be [x, y]"))?),
|
||||
@@ -472,6 +479,7 @@ fn set_handle(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
&& at.is_none_or(|to| to == a.p)
|
||||
&& (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();
|
||||
}
|
||||
@@ -504,6 +512,10 @@ fn set_handle(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
} else {
|
||||
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()
|
||||
@@ -519,6 +531,9 @@ fn link_handle(s: &mut Session, p: &Value, id: NodeId, si: usize, ai: usize, out
|
||||
if switch_or(p, "independent", false, C)? {
|
||||
return Err(bad(C, "`link` and `independent` cannot both be true"));
|
||||
}
|
||||
if switch_or(p, "symmetric", false, C)? {
|
||||
return Err(bad(C, "`link` and `symmetric` cannot both be true"));
|
||||
}
|
||||
if !(pos.x.abs() < 1e9 && pos.y.abs() < 1e9) {
|
||||
return Err(bad(C, "x and y must be finite"));
|
||||
}
|
||||
@@ -655,6 +670,16 @@ fn anchor_of(s: &Session, id: NodeId, si: usize, ai: usize) -> Result<Option<Anc
|
||||
Ok(d.node(id).and_then(|n| n.path_data()).and_then(|path| path.subpaths.get(si)).and_then(|sp| sp.anchors.get(ai)).copied())
|
||||
}
|
||||
|
||||
/// Whether anchor `ai` of subpath `si` of path `id` has a segment on its outgoing (`out`) or
|
||||
/// incoming side; false when the path, subpath or anchor is not there.
|
||||
fn has_segment(s: &Session, id: NodeId, si: usize, ai: usize, out: bool) -> Result<bool> {
|
||||
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<Value> {
|
||||
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"))?;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -122,7 +122,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"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, 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
|
||||
),
|
||||
@@ -1449,6 +1449,10 @@ fn set_path_handle(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
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)?;
|
||||
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()) {
|
||||
@@ -1461,7 +1465,7 @@ fn set_path_handle(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
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"));
|
||||
}
|
||||
|
||||
@@ -329,6 +329,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<String, serde_json::Value>)>,
|
||||
/// 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<NodeId>)>,
|
||||
/// The freeform gradient point selected once the tool took the press under way, which a
|
||||
|
||||
@@ -137,6 +137,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,
|
||||
|
||||
@@ -202,6 +202,7 @@ mod symbol_nine_slice;
|
||||
mod symbolbounds;
|
||||
mod symboledit;
|
||||
mod symbolism_options;
|
||||
mod symbolism_shift;
|
||||
mod symbollib;
|
||||
mod tangent_line;
|
||||
mod targeting;
|
||||
|
||||
@@ -112,6 +112,7 @@ fn the_builtin_libraries_are_original_brushes_generated_in_code() {
|
||||
"calligraphic-nibs",
|
||||
"pressure-sensitive",
|
||||
"bristle-brushes",
|
||||
"paint",
|
||||
"pattern-borders",
|
||||
"scatter-shapes",
|
||||
"stipple",
|
||||
@@ -121,7 +122,8 @@ fn the_builtin_libraries_are_original_brushes_generated_in_code() {
|
||||
"tech-circuit",
|
||||
"engraving",
|
||||
"arrows",
|
||||
"image-brush"
|
||||
"image-brush",
|
||||
"artistic"
|
||||
]
|
||||
);
|
||||
assert!(libs.iter().all(|l| l["category"] == "builtIn"));
|
||||
@@ -170,6 +172,7 @@ fn the_builtin_libraries_are_original_brushes_generated_in_code() {
|
||||
("calligraphic-nibs", "calligraphic"),
|
||||
("pressure-sensitive", "art"),
|
||||
("bristle-brushes", "bristle"),
|
||||
("paint", "art"),
|
||||
("pattern-borders", "pattern"),
|
||||
("scatter-shapes", "scatter"),
|
||||
("stipple", "scatter"),
|
||||
@@ -178,6 +181,7 @@ fn the_builtin_libraries_are_original_brushes_generated_in_code() {
|
||||
("dry-media", "art"),
|
||||
("arrows", "art"),
|
||||
("image-brush", "scatter"),
|
||||
("artistic", "art"),
|
||||
] {
|
||||
let (_, lib) = cmd::brushlib::library(&s, id).unwrap();
|
||||
assert!(lib.len() >= 4, "{id}");
|
||||
@@ -208,6 +212,46 @@ 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 (_, 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::<Vec<_>>(), 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()]);
|
||||
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);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn image_brush_stamps_draw_and_carry_their_pixels_when_added_and_saved() {
|
||||
let mut s = session();
|
||||
@@ -245,6 +289,26 @@ fn image_brush_stamps_draw_and_carry_their_pixels_when_added_and_saved() {
|
||||
assert_eq!(reopened.images, lib.doc.images);
|
||||
}
|
||||
|
||||
#[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");
|
||||
// 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).
|
||||
fn art_paths(n: &vectorcraft_doc::Node) -> Vec<(usize, f32)> {
|
||||
let mut out = vec![];
|
||||
@@ -544,6 +608,37 @@ fn pressure_sensitive_brushes_widen_with_pen_pressure_and_survive_a_saved_librar
|
||||
assert_eq!(vectorcraft_brush::library(&reopened), lib.brushes);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn paint_brushes_draw_distinct_marks_and_survive_a_saved_library() {
|
||||
let mut s = session();
|
||||
let (_, lib) = cmd::brushlib::library(&s, "Paint").unwrap();
|
||||
let names = ["Flat Sweep", "Dry Drag", "Loaded Stroke", "Fan Sweep"];
|
||||
assert_eq!(lib.brushes.iter().map(|b| b.name.as_str()).collect::<Vec<_>>(), names);
|
||||
let path = run(&mut s, "shape.line", json!({"x1": 10, "y1": 40, "x2": 190, "y2": 40}))["id"].as_u64().unwrap();
|
||||
let mut curve = line_to(20.0);
|
||||
curve.curve_to((60.0, -25.0), (140.0, 25.0), (180.0, 0.0));
|
||||
for b in &lib.brushes {
|
||||
let BrushKind::Art(art) = &b.kind else { panic!("{} is not an art brush", b.name) };
|
||||
assert_eq!(art.colorization, vectorcraft_brush::Colorization::Tints);
|
||||
assert_eq!(art.width, 150.0);
|
||||
for line in [line_to(2.0), line_to(180.0), curve.clone()] {
|
||||
let pieces = vectorcraft_brush::stroke_pieces(&lib.doc, b, &line, &black_stroke());
|
||||
let points = anchors(&pieces.iter().collect::<Vec<_>>());
|
||||
assert!(!points.is_empty() && points.iter().all(|p| p.x.is_finite() && p.y.is_finite()), "{}", b.name);
|
||||
}
|
||||
let before = undo_len(&s);
|
||||
let added = run(&mut s, "brush.addFromLibrary", json!({"library": "paint", "name": b.name, "apply": true, "ids": [path]}));
|
||||
assert_eq!(strs(&added["added"]), [b.name.as_str()]);
|
||||
assert_eq!(added["applied"], json!([path]));
|
||||
assert_eq!(undo_len(&s), before + 1);
|
||||
assert_eq!(doc(&s).node(NodeId(path)).unwrap().appearance.stroke().unwrap().brush.as_deref(), Some(b.name.as_str()));
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
/// Ink and Wash: a tapered ink art brush, a brush pen whose size follows the pen pressure and two
|
||||
/// translucent washes, with names of their own and a few paths of art each.
|
||||
#[test]
|
||||
|
||||
@@ -318,6 +318,45 @@ 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<f64> = 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 c: Vec<f64> = 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<f64> = vivid["values"].as_array().unwrap().iter().map(|v| v.as_f64().unwrap()).collect();
|
||||
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]
|
||||
fn assign_profile_is_stored_and_undoable() {
|
||||
let _g = GLOBAL.lock().unwrap_or_else(|e| e.into_inner());
|
||||
|
||||
@@ -180,6 +180,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() {
|
||||
@@ -279,6 +321,38 @@ 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 one of userDefined, average, random"),
|
||||
("sprayStain", json!("random"), "`sprayStain` must be one of average, userDefined"),
|
||||
("usePressure", json!("yes"), "`usePressure` must be true or false"),
|
||||
("diameter", json!("big"), "`diameter` must be a number from 2 to 2000"),
|
||||
("style", json!(3), "`style` must be a string or null"),
|
||||
("diameter", json!(1), "`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}");
|
||||
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")));
|
||||
// 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
|
||||
/// not used. A pressure that isn't a number is an error.
|
||||
#[test]
|
||||
@@ -316,6 +390,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]]});
|
||||
@@ -644,6 +725,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<Value> = (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::<Vec<_>>();
|
||||
let was = xs(&s);
|
||||
let middle = was.iter().sum::<f64>() / 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 set of one instance takes the new density without moving, as one undo step, so a later change
|
||||
/// packs it from that density; setting the density it already has adds no undo step.
|
||||
#[test]
|
||||
@@ -719,6 +839,102 @@ fn set_density_refuses_bad_densities_and_objects_without_a_set() {
|
||||
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");
|
||||
// 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<NodeId> = (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<f32> = 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<NodeId> = 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);
|
||||
}
|
||||
|
||||
/// An instance with no size is shifted and screened as before; only Average, which needs its size,
|
||||
/// leaves it as it is.
|
||||
#[test]
|
||||
@@ -759,6 +975,29 @@ fn an_instance_without_a_size_is_changed_by_every_method_but_average() {
|
||||
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);
|
||||
}
|
||||
|
||||
/// A stroke that leaves every instance under the brush as it is (each already at full stain, or
|
||||
/// at the least opacity) counts none and adds no undo step.
|
||||
#[test]
|
||||
|
||||
@@ -0,0 +1,272 @@
|
||||
//! 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<NodeId> {
|
||||
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<NodeId>) {
|
||||
let pts: Vec<Value> = (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<Point> = 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::<Vec<_>>(), 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}");
|
||||
// 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}))
|
||||
};
|
||||
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:?}");
|
||||
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);
|
||||
}
|
||||
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 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 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);
|
||||
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);
|
||||
}
|
||||
let stained = node(&s, a).appearance.fill().map(|f| f.opacity);
|
||||
adjust(&mut s, p);
|
||||
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)
|
||||
};
|
||||
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.
|
||||
#[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);
|
||||
}
|
||||
}
|
||||
@@ -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]
|
||||
|
||||
@@ -298,6 +298,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))
|
||||
@@ -611,13 +615,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<bool> = (self.held_input.iter().enumerate())
|
||||
@@ -635,6 +644,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 +679,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 +721,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 +731,7 @@ impl Session {
|
||||
}
|
||||
PointerKind::Up => {
|
||||
self.press_options = None;
|
||||
self.press_options_stored = false;
|
||||
self.press_type_selection = None;
|
||||
}
|
||||
_ => {}
|
||||
@@ -1315,9 +1332,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,
|
||||
@@ -1362,6 +1382,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));
|
||||
@@ -1399,9 +1421,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<Map<String, Value>> {
|
||||
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<Map<String, Value>>, 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
|
||||
|
||||
@@ -0,0 +1,630 @@
|
||||
//! 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() });
|
||||
}
|
||||
|
||||
#[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());
|
||||
}
|
||||
|
||||
#[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,
|
||||
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);
|
||||
}
|
||||
|
||||
#[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") };
|
||||
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<u32>) {
|
||||
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);
|
||||
}
|
||||
|
||||
/// `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");
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
@@ -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<String, f64>,
|
||||
/// 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<NodeId, Arc<Node>>,
|
||||
@@ -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,
|
||||
|
||||
@@ -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<Vec<u8>> {
|
||||
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 {
|
||||
|
||||
@@ -627,7 +627,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;
|
||||
@@ -669,7 +669,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);
|
||||
}
|
||||
|
||||
@@ -783,6 +783,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::<Vec<vectorcraft_doc::SymbolOverride>>(&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.
|
||||
|
||||
@@ -244,6 +244,7 @@ pub(super) struct PatternHead {
|
||||
pub(super) struct SymbolHead {
|
||||
/// `AI13PatternRegistrationType` in the dictionary after the art.
|
||||
pub(super) registration: Option<f64>,
|
||||
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.
|
||||
|
||||
@@ -687,6 +687,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 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",
|
||||
"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",
|
||||
@@ -1561,7 +1573,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
|
||||
"ui.colorWheel",
|
||||
"Color Wheel Options",
|
||||
"",
|
||||
"{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, harmony?: bool, harmonyRule?: complementary|splitComplementary|leftComplement|rightComplement|analogous|analogous2|triad|tetrad|tetrad2|tetrad3|compound|compound2|highContrast|highContrast3|pentagram, vision?: bool} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, 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); harmony shows a marker on the wheel's ring for each other color of harmonyRule (the Color Guide's rule of that id; a rule's label is taken too), as Show Harmony and Harmony Rule do, and a click on a marker applies its color; vision shows Show Color Vision Preview's row under the wheel or the box, four chips with the current color as simulated for protanopia, deuteranopia and tritanopia (the simulations of view.proofSetup's protanopia, deuteranopia and tritanopia targets) and for achromatopsia (the gray with the color's CIE L*), each named with its hex value in its tooltip and to screen readers, and taking the keyboard focus; a click or a key on a chip does not apply its color; keys left out or null keep their values ({} reads them), params that are not an object, another key or a value off the list are an error and change nothing, the settings are kept with the preferences, and the command does not open the panel (window.panel {panel: \"colorWheel\"} does) (ui.inspect: ui.color_wheel) → {view, channel, harmony, harmonyRule, vision}",
|
||||
"{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, sliders?: none|oklch|hsl, harmony?: bool, harmonyRule?: complementary|splitComplementary|leftComplement|rightComplement|analogous|analogous2|triad|tetrad|tetrad2|tetrad3|compound|compound2|highContrast|highContrast3|pentagram, vision?: bool} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, pick the box's channel, as Box Channel does, and show no slider rows under the wheel or the box (none), OKLCH Sliders (oklch) or HSL Sliders (hsl), as the menu items of those names do: the box is a color field with the channel's strip at its right, and the field shows the other two components (hue: saturation across and brightness up; saturation: hue across and brightness up; brightness: hue across and saturation up; red: blue across and green up; green: blue across and red up; blue: red across and green up); OKLCH Sliders edit lightness 0 to 100 %, chroma 0 to 100 % of 0.4 and hue 0 to 360°, CSS Color 4's OKLCH of the display sRGB, and a color outside sRGB keeps L and H and takes the largest chroma that fits; HSL Sliders edit hue 0 to 360°, saturation 0 to 100 % and lightness 0 to 100 %, CSS Color 4's HSL of the display sRGB; harmony shows a marker on the wheel's ring for each other color of harmonyRule (the Color Guide's rule of that id; a rule's label is taken too), as Show Harmony and Harmony Rule do, and a click on a marker applies its color; vision shows Show Color Vision Preview's row under the wheel or the box, four chips with the current color as simulated for protanopia, deuteranopia and tritanopia (the simulations of view.proofSetup's protanopia, deuteranopia and tritanopia targets) and for achromatopsia (the gray with the color's CIE L*), each named with its hex value in its tooltip and to screen readers, and taking the keyboard focus; a click or a key on a chip does not apply its color; keys left out or null keep their values ({} reads them), params that are not an object, another key or a value off the list are an error and change nothing, oklch is an error while the working RGB space is not sRGB, the settings are kept with the preferences, and the command does not open the panel (window.panel {panel: \"colorWheel\"} does) (ui.inspect: ui.color_wheel) → {view, channel, sliders, harmony, harmonyRule, vision}",
|
||||
),
|
||||
(
|
||||
"ui.savePdfDialog",
|
||||
|
||||
@@ -16,7 +16,11 @@
|
||||
//! range reaches, or a tab) are point type of their own, and an underline or strikethrough is carried across the space between.
|
||||
//! It is also carried on to the end of the last character's advance. Type on more than one line
|
||||
//! is placed a line at a time: each line is aligned by its own advances and split as a single
|
||||
//! line is.
|
||||
//! line is. A character cell runs from the font's OS/2 usWinAscent above the baseline to its
|
||||
//! usWinDescent below it, and top or bottom aligned text has the top or the bottom of its cells
|
||||
//! at the reference point. Text drawn in the opaque background mode (the mode a playback starts
|
||||
//! in) has one rectangle of the background color behind the character cells of each line, as
|
||||
//! far as its advances reach.
|
||||
//! - Clip regions and clip paths become clipping groups around what they clip; a rectangle around
|
||||
//! the whole picture clips nothing and is left out.
|
||||
//!
|
||||
@@ -541,22 +545,38 @@ impl Mapper {
|
||||
// one for every character: a NUL's advance goes to the character before it, or moves the
|
||||
// start when the string begins with one.
|
||||
let advances = t.dx.len() == t.text.chars().count() && t.dx.iter().all(|d| d.is_finite());
|
||||
let (mut s, mut dx, mut lead) = (String::new(), Vec::new(), 0.0f64);
|
||||
let (mut s, mut dx) = (String::new(), Vec::new());
|
||||
// How far before and after its start each character's advances (its own and the NULs'
|
||||
// after it) reach (text units): an advance may be negative. And the advance of the NULs
|
||||
// that move the start, with how far they reach.
|
||||
let mut reach = Vec::new();
|
||||
let mut lead = Lead::default();
|
||||
for (c, d) in t.text.chars().zip(t.dx.iter().map(|d| f64::from(*d)).chain(std::iter::repeat(0.0))) {
|
||||
if c != '\0' {
|
||||
s.push(c);
|
||||
dx.push(d);
|
||||
} else if let Some(last) = dx.last_mut() {
|
||||
reach.push((d.min(0.0), d.max(0.0)));
|
||||
} else if let (Some(last), Some(r)) = (dx.last_mut(), reach.last_mut()) {
|
||||
*last += d;
|
||||
*r = (r.0.min(*last), r.1.max(*last));
|
||||
} else {
|
||||
lead += d;
|
||||
lead.by += d;
|
||||
lead.reach = (lead.reach.0.min(lead.by), lead.reach.1.max(lead.by));
|
||||
}
|
||||
}
|
||||
if !advances {
|
||||
dx.clear();
|
||||
lead = 0.0;
|
||||
reach.clear();
|
||||
lead = Lead::default();
|
||||
}
|
||||
if s.trim().is_empty() || t.color[3] == 0 {
|
||||
// The leading NULs, of the text or of a string of NULs alone.
|
||||
let first = lead;
|
||||
// Type that draws nothing still fills its character cells on an opaque background.
|
||||
let background = t.background.filter(|c| c[3] > 0);
|
||||
let shows = !s.trim().is_empty() && t.color[3] > 0;
|
||||
// A string of NULs only fills the cells across its advances.
|
||||
let nuls = s.is_empty() && first.reach.0 < first.reach.1 && background.is_some();
|
||||
if (s.is_empty() && !nuls) || !(shows || background.is_some()) {
|
||||
return;
|
||||
}
|
||||
// Text space → document without the move: its vertical scale gives the type size, and what
|
||||
@@ -613,11 +633,26 @@ impl Mapper {
|
||||
if !dx.is_empty() {
|
||||
style.kerning = Some(0.0);
|
||||
}
|
||||
// Where the baseline is below the reference point.
|
||||
// The character cell above and below the baseline (points): the face's OS/2 usWinAscent
|
||||
// and usWinDescent at the type size (its own ascent and descent when it has no OS/2
|
||||
// table), as tall as a positive height asks.
|
||||
let cell = face
|
||||
.as_ref()
|
||||
.map(|face| {
|
||||
let (a, d) = face.win_ascent_descent().unwrap_or_else(|| face.vertical_metrics());
|
||||
(a / face.units_per_em() * size, d / face.units_per_em() * size)
|
||||
})
|
||||
.filter(|(a, d)| a.is_finite() && d.is_finite() && *a >= 0.0 && *d >= 0.0 && a + d > 0.0)
|
||||
.unwrap_or_else(|| {
|
||||
let c = if h > 0.0 { size / 0.85 } else { size };
|
||||
(0.8 * c, 0.2 * c)
|
||||
});
|
||||
// Where the baseline is below the reference point: the top or the bottom of the cell is at
|
||||
// the reference point.
|
||||
let drop = match t.v_align {
|
||||
VAlign::Baseline => 0.0,
|
||||
VAlign::Bottom => -0.2 * size,
|
||||
VAlign::Top => 0.8 * size,
|
||||
VAlign::Bottom => -cell.1,
|
||||
VAlign::Top => cell.0,
|
||||
};
|
||||
let origin = self.xf * Point::new(t.transform[4], t.transform[5]);
|
||||
let base = Affine::translate(origin.to_vec2()) * shape;
|
||||
@@ -633,19 +668,65 @@ impl Mapper {
|
||||
};
|
||||
let whole = point(&s);
|
||||
let opacity = f32::from(t.color[3]) / 255.0;
|
||||
let line = Line {
|
||||
base,
|
||||
drop,
|
||||
align: &t.h_align,
|
||||
decorated: f.underline || f.strike,
|
||||
shows,
|
||||
color: t.color,
|
||||
opacity,
|
||||
background,
|
||||
cell,
|
||||
point: &point,
|
||||
};
|
||||
// The backgrounds of every line and piece, and the type added after them so that none of
|
||||
// them covers it.
|
||||
let mut out = TextOut::default();
|
||||
if dx.is_empty() {
|
||||
let mut text = whole;
|
||||
let laid = vectorcraft_text::layout(db, &text);
|
||||
text.xf = base * Affine::translate((0.0, drop));
|
||||
text.cached_bounds = Some(vectorcraft_text::layout(db, &text).bounds);
|
||||
let mut n = Node::new(NodeId(0), NodeKind::Text(Box::new(text)));
|
||||
n.opacity = opacity;
|
||||
self.push(chain, n);
|
||||
return;
|
||||
text.cached_bounds = Some(laid.bounds);
|
||||
if background.is_some() {
|
||||
// How far one line's glyphs reach each way, and the sum of their advances, its
|
||||
// trailing blanks included.
|
||||
let along = laid.glyphs.iter().fold((f64::INFINITY, f64::NEG_INFINITY, 0.0), |(from, to, width), g| {
|
||||
let (a, b) = (g.origin.x, g.origin.x + g.advance);
|
||||
(from.min(a.min(b)), to.max(a.max(b)), width + g.advance)
|
||||
});
|
||||
let one = laid.lines.len() == 1 && along.0.is_finite() && along.1.is_finite() && along.2.is_finite();
|
||||
// The cells of one line run as far as its glyphs' advances reach, or for blanks
|
||||
// alone, which draw no type, where the alignment puts a line that long.
|
||||
// Those of more than one line run across each line's glyphs. NULs alone span
|
||||
// their advances, where the alignment puts them.
|
||||
let cells = if nuls {
|
||||
let start = aligned(first.by * k, 0.0, &t.h_align) - first.by * k;
|
||||
cell_rect(start + first.reach.0 * k, start + first.reach.1 * k, 0.0, cell)
|
||||
} else if one {
|
||||
let (x0, x1) = if shows {
|
||||
(along.0, along.1)
|
||||
} else {
|
||||
let x0 = aligned(0.0, along.2, &t.h_align);
|
||||
(x0, x0 + along.2)
|
||||
};
|
||||
cell_rect(x0, x1, laid.glyphs.first().map_or(0.0, |g| g.origin.y), cell)
|
||||
} else {
|
||||
cells(&laid, &s, cell, &t.h_align, shows && line.decorated)
|
||||
};
|
||||
out.backs.extend(self.background(&line, cells, text.xf));
|
||||
}
|
||||
if shows {
|
||||
let mut n = Node::new(NodeId(0), NodeKind::Text(Box::new(text)));
|
||||
n.opacity = opacity;
|
||||
out.texts.push(n);
|
||||
}
|
||||
return self.add_text(&chain, out);
|
||||
}
|
||||
// Text units grow by `k` along the baseline in the text object's own space.
|
||||
let dx: Vec<f64> = dx.iter().map(|d| d * k).collect();
|
||||
let reach: Vec<(f64, f64)> = reach.iter().map(|(lo, hi)| (lo * k, hi * k)).collect();
|
||||
let chars: Vec<char> = s.chars().collect();
|
||||
let line = Line { base, drop, align: &t.h_align, decorated: f.underline || f.strike, color: t.color, opacity, point: &point, chain: &chain };
|
||||
// Type on more than one line is placed a line at a time, each line aligned by its own
|
||||
// advances (layout leaves the tracking after a line's last character out of the width it
|
||||
// aligns, and each line ends with its own) and its underline carried on to its own end.
|
||||
@@ -655,25 +736,68 @@ impl Mapper {
|
||||
// a search.
|
||||
let starts: Vec<usize> = s.char_indices().map(|(at, _)| at).collect();
|
||||
let count = |to: usize| starts.partition_point(|at| *at < to);
|
||||
let first = laid.lines.first().map_or(0.0, |l| l.baseline);
|
||||
let top = laid.lines.first().map_or(0.0, |l| l.baseline);
|
||||
for (n, l) in laid.lines.iter().enumerate() {
|
||||
let (from, to) = (count(l.start), count(l.end));
|
||||
let (Some(cs), Some(dx)) = (chars.get(from..to), dx.get(from..to)) else { continue };
|
||||
let (Some(cs), Some(dx), Some(reach)) = (chars.get(from..to), dx.get(from..to), reach.get(from..to)) else { continue };
|
||||
// A leading NUL's advance comes before the first line only.
|
||||
let lead = if n == 0 { lead * k } else { 0.0 };
|
||||
let down = l.baseline - first;
|
||||
self.line(&line, cs, dx, lead, if down.is_finite() { down } else { 0.0 });
|
||||
let lead = if n == 0 { first.scaled(k) } else { Lead::default() };
|
||||
let down = l.baseline - top;
|
||||
self.line(&line, cs, Advances { dx, reach, lead }, if down.is_finite() { down } else { 0.0 }, &mut out);
|
||||
}
|
||||
} else {
|
||||
self.line(&line, &chars, &dx, lead * k, 0.0);
|
||||
self.line(&line, &chars, Advances { dx: &dx, reach: &reach, lead: first.scaled(k) }, 0.0, &mut out);
|
||||
}
|
||||
self.add_text(&chain, out);
|
||||
}
|
||||
|
||||
/// Adds a text record's backgrounds and then its type, leaving out backgrounds when there is
|
||||
/// no room for both.
|
||||
fn add_text(&mut self, chain: &[Arc<Clip>], out: TextOut) {
|
||||
let TextOut { mut backs, texts } = out;
|
||||
let keep = MAX_NODES.saturating_sub(self.out.len()).saturating_sub(texts.len());
|
||||
if backs.len() > keep {
|
||||
backs.truncate(keep);
|
||||
self.warn(TOO_MANY);
|
||||
}
|
||||
for n in backs.into_iter().chain(texts) {
|
||||
self.push(chain.to_vec(), n);
|
||||
}
|
||||
}
|
||||
|
||||
/// One line of text with advances `dx` (points along the baseline) for its characters `chars`,
|
||||
/// `down` below the first line's baseline: in pieces, each a text object of its own, a new
|
||||
/// piece after each cluster that tracking can't space by its advance.
|
||||
fn line(&mut self, line: &Line, chars: &[char], dx: &[f64], lead: f64, down: f64) {
|
||||
if chars.is_empty() || (chars.iter().all(|c| c.is_whitespace()) && !line.decorated) {
|
||||
/// Character cells `cells`, placed by `xf`, filled with the line's background when it has one.
|
||||
fn background(&self, line: &Line, mut cells: BezPath, xf: Affine) -> Option<Node> {
|
||||
let bg = line.background?;
|
||||
if cells.elements().is_empty() {
|
||||
return None;
|
||||
}
|
||||
cells.apply_affine(xf);
|
||||
self.path_node(cells, Some(bg), None, false)
|
||||
}
|
||||
|
||||
/// One line of text with advances `adv` (points along the baseline) for its characters
|
||||
/// `chars`, `down` below the first line's baseline: in pieces, each a text object of its own,
|
||||
/// a new piece after each cluster that tracking can't space by its advance.
|
||||
fn line(&mut self, line: &Line, chars: &[char], adv: Advances, down: f64, out: &mut TextOut) {
|
||||
let Advances { dx, reach, lead } = adv;
|
||||
// The line's cells, one rectangle behind every piece, run as far each way as its
|
||||
// advances reach (an advance may be negative), from where the leading NULs' advances
|
||||
// start, which the alignment puts where it puts a line as long as its advances. A line
|
||||
// of leading NULs alone fills the cells across their advances.
|
||||
let start = aligned(lead.by, dx.iter().sum(), line.align);
|
||||
if line.background.is_some() {
|
||||
let (mut lo, mut hi, mut pos) = (lead.reach.0 - lead.by, lead.reach.1 - lead.by, 0.0f64);
|
||||
for (d, r) in dx.iter().zip(reach) {
|
||||
(lo, hi) = (lo.min(pos + r.0), hi.max(pos + r.1));
|
||||
pos += d;
|
||||
}
|
||||
let xf = line.base * Affine::translate((0.0, line.drop + down));
|
||||
out.backs.extend(self.background(line, cell_rect(start + lo, start + hi, 0.0, line.cell), xf));
|
||||
}
|
||||
let blank = |cs: &[char]| cs.iter().all(|c| c.is_whitespace());
|
||||
// A piece's type draws when it shows: blanks only when underlined or struck through.
|
||||
let draws = |cs: &[char]| line.shows && (!blank(cs) || line.decorated);
|
||||
if chars.is_empty() || !draws(chars) {
|
||||
return;
|
||||
}
|
||||
let db = vectorcraft_text::FontDb::global();
|
||||
@@ -684,13 +808,13 @@ impl Mapper {
|
||||
// Along the baseline (the text object's own space), where the next piece starts from the
|
||||
// reference point: the line as long as its advances (a leading NUL's included), where the
|
||||
// alignment puts it.
|
||||
let mut at = aligned(lead, dx.iter().sum(), line.align);
|
||||
let mut at = start;
|
||||
let last = pieces.len().saturating_sub(1);
|
||||
for (i, (from, to)) in pieces.into_iter().enumerate() {
|
||||
let piece: String = chars.get(from..to).unwrap_or_default().iter().collect();
|
||||
let cs = chars.get(from..to).unwrap_or_default();
|
||||
let piece: String = cs.iter().collect();
|
||||
let dx = dx.get(from..to).unwrap_or_default();
|
||||
// Blanks of their own draw nothing unless they are underlined or struck through.
|
||||
if piece.trim().is_empty() && !line.decorated {
|
||||
if !draws(cs) {
|
||||
at += dx.iter().sum::<f64>();
|
||||
continue;
|
||||
}
|
||||
@@ -715,12 +839,12 @@ impl Mapper {
|
||||
let gap = if (split && i < last) || (i == last && line.decorated) { gaps(&laid, db, &text, x0 + span) } else { BezPath::new() };
|
||||
let mut n = Node::new(NodeId(0), NodeKind::Text(Box::new(text.clone())));
|
||||
n.opacity = line.opacity;
|
||||
self.push(line.chain.to_vec(), n);
|
||||
out.texts.push(n);
|
||||
if !gap.elements().is_empty() {
|
||||
let mut gap = gap;
|
||||
gap.apply_affine(text.xf);
|
||||
if let Some(n) = self.path_node(gap, Some(line.color), None, false) {
|
||||
self.push(line.chain.to_vec(), n);
|
||||
out.texts.push(n);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -785,16 +909,95 @@ fn aligned(lead: f64, span: f64, align: &HAlign) -> f64 {
|
||||
|
||||
/// What every piece of a text record's lines shares: the text space (`base`, with the baseline
|
||||
/// `drop` below the reference point), the alignment, whether the type is underlined or struck
|
||||
/// through, its color and opacity, a point type object of a string in its style, and its clips.
|
||||
/// through, whether the type shows, its color and opacity, its background and the character cell
|
||||
/// above and below the baseline (points), and a point type object of a string in its style.
|
||||
struct Line<'a> {
|
||||
base: Affine,
|
||||
drop: f64,
|
||||
align: &'a HAlign,
|
||||
decorated: bool,
|
||||
shows: bool,
|
||||
color: [u8; 4],
|
||||
opacity: f32,
|
||||
background: Option<[u8; 4]>,
|
||||
cell: (f64, f64),
|
||||
point: &'a dyn Fn(&str) -> TextObject,
|
||||
chain: &'a [Arc<Clip>],
|
||||
}
|
||||
|
||||
/// What a text record draws: the backgrounds behind its character cells, and its type (with the
|
||||
/// bars that carry an underline or strikethrough on), added after them.
|
||||
#[derive(Default)]
|
||||
struct TextOut {
|
||||
backs: Vec<Node>,
|
||||
texts: Vec<Node>,
|
||||
}
|
||||
|
||||
/// One line's advances (points along the baseline): each character's own, how far before and
|
||||
/// after its start the advances from it to the next character reach, and the leading NULs'.
|
||||
struct Advances<'a> {
|
||||
dx: &'a [f64],
|
||||
reach: &'a [(f64, f64)],
|
||||
lead: Lead,
|
||||
}
|
||||
|
||||
/// The NULs that move a line's start: their advance, and how far before and after the line's
|
||||
/// start they reach.
|
||||
#[derive(Clone, Copy, Default)]
|
||||
struct Lead {
|
||||
by: f64,
|
||||
reach: (f64, f64),
|
||||
}
|
||||
|
||||
impl Lead {
|
||||
/// The same NULs with their advances grown by `k`.
|
||||
fn scaled(self, k: f64) -> Lead {
|
||||
Lead { by: self.by * k, reach: (self.reach.0 * k, self.reach.1 * k) }
|
||||
}
|
||||
}
|
||||
|
||||
/// The character cell from `x0` to `x1` along a baseline at `y`, `cell.0` above and `cell.1`
|
||||
/// below it (points); empty when it has no area.
|
||||
fn cell_rect(x0: f64, x1: f64, y: f64, cell: (f64, f64)) -> BezPath {
|
||||
let r = Rect::new(x0, y - cell.0, x1, y + cell.1).abs();
|
||||
if r.width() > 0.0 && r.height() > 0.0 && r.is_finite() { shapes::rectangle(r).to_bezpath() } else { BezPath::new() }
|
||||
}
|
||||
|
||||
/// The character cells of `laid` (the type `s` laid out on more than one line), `cell.0` above
|
||||
/// and `cell.1` below each baseline (points), as one rectangle a line: across the line as layout
|
||||
/// places it and across its glyphs' advances, its trailing blanks included (layout leaves them
|
||||
/// out of the width it aligns). A line of blanks alone runs across its glyphs' advances when
|
||||
/// the type draws its underline or strikethrough (`decorated`), and otherwise as wide as their
|
||||
/// advances, where `align` puts a line that long.
|
||||
fn cells(laid: &vectorcraft_text::TextLayout, s: &str, cell: (f64, f64), align: &HAlign, decorated: bool) -> BezPath {
|
||||
// Each line's baseline, the sum of its glyphs' advances, how far before and after the
|
||||
// reference point they reach, and whether they are all blanks. Glyphs come line by line.
|
||||
type Row = (usize, f64, f64, (f64, f64), bool);
|
||||
let mut lines: Vec<Row> = Vec::new();
|
||||
for g in &laid.glyphs {
|
||||
let blank = s.get(g.byte..).and_then(|r| r.chars().next()).is_none_or(char::is_whitespace);
|
||||
let (from, to) = (g.origin.x.min(g.origin.x + g.advance), g.origin.x.max(g.origin.x + g.advance));
|
||||
match lines.last_mut() {
|
||||
Some((line, _, width, reach, all)) if *line == g.line => {
|
||||
*width += g.advance;
|
||||
*reach = (reach.0.min(from), reach.1.max(to));
|
||||
*all &= blank;
|
||||
}
|
||||
_ => lines.push((g.line, g.origin.y, g.advance, (from, to), blank)),
|
||||
}
|
||||
}
|
||||
let mut bp = BezPath::new();
|
||||
for (line, y, width, reach, blank) in lines {
|
||||
let (x0, x1) = match laid.lines.get(line) {
|
||||
Some(l) if !blank => (l.x0.min(reach.0), l.x1.max(reach.1)),
|
||||
_ if decorated => reach,
|
||||
_ => {
|
||||
let x0 = aligned(0.0, width, align);
|
||||
(x0, x0 + width)
|
||||
}
|
||||
};
|
||||
bp.extend(cell_rect(x0, x1, y, cell));
|
||||
}
|
||||
bp
|
||||
}
|
||||
|
||||
/// The most times [`advanced`] lays the type out again to correct its tracking.
|
||||
|
||||
@@ -274,7 +274,9 @@ fn hand_built_emf_plays_like_gdi() {
|
||||
let lines = &children[1];
|
||||
assert_eq!(lines.appearance.items.len(), 1);
|
||||
assert!(near(lines.geometric_bounds().unwrap(), Rect::new(0.0, 0.0, 5.0 * mm, 5.0 * mm), 0.01));
|
||||
let NodeKind::Text(t) = &children[2].kind else { panic!("text") };
|
||||
// The background mode starts opaque: the text's cells are filled white behind it.
|
||||
assert_eq!(fill_rgb(&children[2]), Some([255, 255, 255]));
|
||||
let NodeKind::Text(t) = &children[3].kind else { panic!("text") };
|
||||
assert_eq!(t.plain_text(), "Hi");
|
||||
let st = &t.runs[0].style;
|
||||
assert_eq!((st.font_family.as_str(), st.font_style.as_str()), ("Arial", "Bold"));
|
||||
@@ -884,6 +886,38 @@ fn wmf_font_width_becomes_horizontal_scale() {
|
||||
assert!((st.h_scale - want).abs() < 1e-9, "{} for {want}", st.h_scale);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn wmf_text_fills_its_cells_in_the_opaque_background_mode() {
|
||||
// CREATEFONTINDIRECT and SELECTOBJECT: a 0.1 inch em; SETBKCOLOR green; SETBKMODE `mode`
|
||||
// (none when 0); TEXTOUT "Hi" at (720, 360), top aligned.
|
||||
let backgrounds = |mode: i16| {
|
||||
let mut font = le16(&[-144, 0, 0, 0, 400]);
|
||||
font.extend([0u8; 8]);
|
||||
font.extend(b"Source Sans 3".iter().copied().chain(std::iter::repeat_n(0, 19)));
|
||||
let mut text = le16(&[2]);
|
||||
text.extend(b"Hi");
|
||||
text.extend(le16(&[360, 720]));
|
||||
let mut records = vec![(0x02FB, font), (0x012D, le16(&[0])), (0x0201, 0x0000_ff00u32.to_le_bytes().to_vec())];
|
||||
if mode != 0 {
|
||||
records.push((0x0102, le16(&[mode, 0])));
|
||||
}
|
||||
records.push((0x0521, text));
|
||||
paths(&import(&hand_wmf(1440, 1440, &records)).unwrap().document)
|
||||
};
|
||||
let mm = 72.0 / 25.4;
|
||||
// A file that never sets the mode, and one that sets OPAQUE: one green rectangle whose top
|
||||
// is at the reference point and whose left edge is at the start of the text.
|
||||
for mode in [0, 2] {
|
||||
let p = backgrounds(mode);
|
||||
assert_eq!(p.len(), 1, "{mode}");
|
||||
assert_eq!(fill_rgb(&p[0]), Some([0, 255, 0]), "{mode}");
|
||||
let b = p[0].geometric_bounds().unwrap();
|
||||
assert!((b.x0 - 12.7 * mm).abs() < 0.01 && (b.y0 - 6.35 * mm).abs() < 0.01 && b.x1 > b.x0 && b.y1 > b.y0, "{mode}: {b:?}");
|
||||
}
|
||||
// TRANSPARENT: no background.
|
||||
assert!(backgrounds(1).is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_clip_whose_box_holds_the_picture_still_clips() {
|
||||
// A diamond around the middle of the picture, whose box holds the whole frame but which cuts
|
||||
@@ -1001,7 +1035,8 @@ fn clipped_text_is_clipped_to_its_rectangle() {
|
||||
let mut font = le(&[2, -1000, 0, 0, 0, 400]);
|
||||
font.extend([0, 1, 1, 0, 0, 0, 0, 0]);
|
||||
font.extend("Arial".encode_utf16().chain(std::iter::repeat_n(0, 27)).flat_map(u16::to_le_bytes));
|
||||
let mut records = vec![(82, font), (37, le(&[2])), (84, text)];
|
||||
// SETBKMODE TRANSPARENT: no background behind the text.
|
||||
let mut records = vec![(18, le(&[1])), (82, font), (37, le(&[2])), (84, text)];
|
||||
let back = import(&hand_emf(5000, 3000, &records)).unwrap();
|
||||
let layer = back.document.layers[0].children().unwrap();
|
||||
assert_eq!(layer.len(), 1);
|
||||
@@ -1030,6 +1065,156 @@ fn clipped_text_is_clipped_to_its_rectangle() {
|
||||
assert!(matches!(children[1].kind, NodeKind::Text(_)));
|
||||
}
|
||||
|
||||
/// The layer of an EMF that sets the background color green, the background mode `mode` (none
|
||||
/// when 0) and the text alignment `align`, then draws `s` at (`x`, 1500) in `font` with the
|
||||
/// advances `dx`.
|
||||
fn on_background(mode: i32, align: i32, x: i32, font: Vec<u8>, s: &str, dx: &[i32]) -> Vec<std::sync::Arc<Node>> {
|
||||
let mut records = vec![(25, le(&[0x0000_ff00])), (22, le(&[align])), (82, font), (37, le(&[2])), (84, text_out(x, s, dx))];
|
||||
if mode > 0 {
|
||||
records.insert(0, (18, le(&[mode])));
|
||||
}
|
||||
import(&hand_emf(5000, 3000, &records)).unwrap().document.layers[0].children().unwrap().clone()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn opaque_backgrounds_fill_behind_the_character_cells() {
|
||||
let mm = 72.0 / 25.4;
|
||||
let aligned = on_background;
|
||||
// TA_BASELINE: the baseline at (10, 15) mm.
|
||||
let drawn = |mode: i32, font: Vec<u8>, s: &str, dx: &[i32]| aligned(mode, 24, 1000, font, s, dx);
|
||||
let opaque = |font: Vec<u8>, s: &str, dx: &[i32]| drawn(2, font, s, dx);
|
||||
// "Hi" with advances of 20 and 10 mm in a 10 mm em: the cells run across the advances, from
|
||||
// the face's usWinAscent above the baseline to its usWinDescent below it, behind the type.
|
||||
let layer = opaque(arial(), "Hi", &[2000, 1000]);
|
||||
assert_eq!(layer.len(), 2);
|
||||
assert_eq!(fill_rgb(&layer[0]), Some([0, 255, 0]));
|
||||
let NodeKind::Text(t) = &layer[1].kind else { panic!("text") };
|
||||
let face = vectorcraft_text::FontDb::global().style_face(&t.runs[0].style).unwrap();
|
||||
let (a, d) = face.win_ascent_descent().unwrap();
|
||||
let em = face.units_per_em();
|
||||
let b = layer[0].geometric_bounds().unwrap();
|
||||
assert!(near(b, Rect::new(10.0 * mm, (15.0 - 10.0 * a / em) * mm, 40.0 * mm, (15.0 + 10.0 * d / em) * mm), 0.01), "{b:?}");
|
||||
// TA_TOP and TA_BOTTOM put the top and the bottom of the cell at the reference point: the
|
||||
// baseline is usWinAscent below it, or usWinDescent above it.
|
||||
for (align, top) in [(0, 15.0), (8, 15.0 - 10.0 * (a + d) / em)] {
|
||||
let layer = aligned(2, align, 1000, arial(), "Hi", &[2000, 1000]);
|
||||
let b = layer[0].geometric_bounds().unwrap();
|
||||
assert!((b.y0 - top * mm).abs() < 0.01 && (b.height() - 10.0 * (a + d) / em * mm).abs() < 0.01, "{align}: {b:?}");
|
||||
let NodeKind::Text(t) = &layer[1].kind else { panic!("text") };
|
||||
let baseline = (t.xf * vectorcraft_geom::Point::ZERO).y;
|
||||
assert!((baseline - (top + 10.0 * a / em) * mm).abs() < 0.01, "{align}: {baseline}");
|
||||
}
|
||||
// A leading NUL's advance is filled too: right aligned at 50 mm, "\0Hi" fills from 10 mm.
|
||||
let b = aligned(2, 26, 5000, arial(), "\0Hi", &[1000, 2000, 1000])[0].geometric_bounds().unwrap();
|
||||
assert!((b.x0 - 10.0 * mm).abs() < 0.01 && (b.x1 - 50.0 * mm).abs() < 0.01, "{b:?}");
|
||||
// A positive height is the cell: 10 mm from top to bottom.
|
||||
let mut font = le(&[2, 1000, 0, 0, 0, 400]);
|
||||
font.extend([0; 8]);
|
||||
font.extend("Arial".encode_utf16().chain(std::iter::repeat_n(0, 27)).flat_map(u16::to_le_bytes));
|
||||
let b = opaque(font, "Hi", &[2000, 1000])[0].geometric_bounds().unwrap();
|
||||
assert!((b.height() - 10.0 * mm).abs() < 0.01, "{b:?}");
|
||||
// Without advances the cells run across the glyphs' own advances.
|
||||
let layer = opaque(arial(), "Hi", &[]);
|
||||
let NodeKind::Text(t) = &layer[1].kind else { panic!("text") };
|
||||
let (xs, end) = glyph_xs(t);
|
||||
let b = layer[0].geometric_bounds().unwrap();
|
||||
assert!((b.x0 - xs[0]).abs() < 0.01 && (b.x1 - end).abs() < 0.01, "{b:?} {xs:?} {end}");
|
||||
// Type split where an advance is further than tracking reaches: one background across the
|
||||
// whole line's advances comes before both pieces of type.
|
||||
let layer = opaque(arial(), "Hiy", &[12000, 500, 1000]);
|
||||
let kinds: Vec<bool> = layer.iter().map(|n| matches!(n.kind, NodeKind::Text(_))).collect();
|
||||
assert_eq!(kinds, [false, true, true]);
|
||||
let b = layer[0].geometric_bounds().unwrap();
|
||||
assert!((b.x0 - 10.0 * mm).abs() < 0.01 && (b.x1 - 145.0 * mm).abs() < 0.01, "{b:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn opaque_backgrounds_reach_as_far_as_the_advances() {
|
||||
let mm = 72.0 / 25.4;
|
||||
let aligned = on_background;
|
||||
// TA_BASELINE: the baseline at (10, 15) mm.
|
||||
let drawn = |mode: i32, font: Vec<u8>, s: &str, dx: &[i32]| aligned(mode, 24, 1000, font, s, dx);
|
||||
let opaque = |font: Vec<u8>, s: &str, dx: &[i32]| drawn(2, font, s, dx);
|
||||
// Two lines: a rectangle behind each, not one block over the space between them.
|
||||
let layer = opaque(arial(), "Hi\nHi", &[]);
|
||||
let NodeKind::Path { path, .. } = &layer[0].kind else { panic!("a path") };
|
||||
let rects = path.to_bezpath().elements().iter().filter(|e| matches!(e, vectorcraft_geom::PathEl::MoveTo(_))).count();
|
||||
assert_eq!(rects, 2);
|
||||
// Without advances, one line's cells run across its glyphs' advances, trailing spaces
|
||||
// included: right aligned, they run from the "H" to the end of the space after the "i".
|
||||
let layer = aligned(2, 26, 4000, arial(), "Hi ", &[]);
|
||||
let NodeKind::Text(t) = &layer[1].kind else { panic!("text") };
|
||||
let (xs, end) = glyph_xs(t);
|
||||
let b = layer[0].geometric_bounds().unwrap();
|
||||
assert!(xs.len() == 3, "{xs:?} {end}");
|
||||
assert!((b.x0 - xs[0]).abs() < 0.01 && (b.x1 - end).abs() < 0.01, "{b:?} {xs:?} {end}");
|
||||
// Layout aligns a line without its trailing spaces: right aligned at 40 mm, the space after
|
||||
// the "i" runs on past it. On more than one line, the cells also run across the trailing
|
||||
// spaces, as far as on one line.
|
||||
assert!(end > 41.0 * mm, "{end}");
|
||||
let b = aligned(2, 26, 4000, arial(), "Hi \nHi", &[])[0].geometric_bounds().unwrap();
|
||||
assert!((b.x1 - end).abs() < 0.01, "{b:?} {end}");
|
||||
// Leading NULs on a line of their own fill their cells across their advances, before the
|
||||
// next line: from 10 to 30 mm.
|
||||
let layer = opaque(arial(), "\0\nA", &[2000, 0, 1000]);
|
||||
let first = layer[0].geometric_bounds().unwrap();
|
||||
assert!((first.x0 - 10.0 * mm).abs() < 0.01 && (first.x1 - 30.0 * mm).abs() < 0.01, "{first:?}");
|
||||
assert!(matches!(layer[1].kind, NodeKind::Path { .. }) && matches!(layer[2].kind, NodeKind::Text(_)), "{layer:?}");
|
||||
// An underlined line of blanks between two others draws its bar across its glyphs, and its
|
||||
// cells run across the same glyphs.
|
||||
let layer = opaque(font_of("Arial", true), "A\n \nB", &[]);
|
||||
let (NodeKind::Path { path, .. }, NodeKind::Text(t)) = (&layer[0].kind, &layer[1].kind) else { panic!("a path and type") };
|
||||
let mut rects: Vec<(f64, f64, f64)> = Vec::new();
|
||||
for el in path.to_bezpath().elements() {
|
||||
let p = match el {
|
||||
vectorcraft_geom::PathEl::MoveTo(p) => {
|
||||
rects.push((p.x, p.x, p.y));
|
||||
*p
|
||||
}
|
||||
vectorcraft_geom::PathEl::LineTo(p) => *p,
|
||||
_ => continue,
|
||||
};
|
||||
if let Some(r) = rects.last_mut() {
|
||||
*r = (r.0.min(p.x), r.1.max(p.x), r.2.min(p.y));
|
||||
}
|
||||
}
|
||||
rects.sort_by(|a, b| a.2.total_cmp(&b.2));
|
||||
let laid = vectorcraft_text::layout(vectorcraft_text::FontDb::global(), t);
|
||||
let spaces: Vec<(f64, f64)> =
|
||||
laid.glyphs.iter().filter(|g| g.line == 1).map(|g| ((t.xf * g.origin).x, (t.xf * g.origin).x + g.advance)).collect();
|
||||
let (from, to) = spaces.iter().fold((f64::INFINITY, f64::NEG_INFINITY), |(a, b), (x0, x1)| (a.min(*x0), b.max(*x1)));
|
||||
assert!(rects.len() == 3 && (rects[1].0 - from).abs() < 0.01 && (rects[1].1 - to).abs() < 0.01, "{rects:?} {spaces:?}");
|
||||
// NULs whose advances go forward and back again still fill as far as they reach.
|
||||
let layer = opaque(arial(), "\0\0", &[1000, -1000]);
|
||||
assert_eq!(layer.len(), 1);
|
||||
let b = layer[0].geometric_bounds().unwrap();
|
||||
assert!((b.x0 - 10.0 * mm).abs() < 0.01 && (b.x1 - 20.0 * mm).abs() < 0.01, "{b:?}");
|
||||
let b = opaque(arial(), "H\0i", &[3000, -2000, 1000])[0].geometric_bounds().unwrap();
|
||||
assert!((b.x0 - 10.0 * mm).abs() < 0.01 && (b.x1 - 40.0 * mm).abs() < 0.01, "{b:?}");
|
||||
// An advance that goes back: the cells reach as far as the advances go, here to 30 mm.
|
||||
let b = opaque(arial(), "Hi", &[2000, -1000])[0].geometric_bounds().unwrap();
|
||||
assert!((b.x0 - 10.0 * mm).abs() < 0.01 && (b.x1 - 30.0 * mm).abs() < 0.01, "{b:?}");
|
||||
// NULs alone fill across their advances.
|
||||
let layer = opaque(arial(), "\0", &[2000]);
|
||||
assert_eq!(layer.len(), 1);
|
||||
let b = layer[0].geometric_bounds().unwrap();
|
||||
assert!((b.x0 - 10.0 * mm).abs() < 0.01 && (b.x1 - 30.0 * mm).abs() < 0.01, "{b:?}");
|
||||
// Blanks on an opaque background still fill their cells, from the reference point on; on a
|
||||
// transparent one nothing is left.
|
||||
let layer = opaque(arial(), " \t", &[]);
|
||||
assert_eq!(layer.len(), 1);
|
||||
let b = layer[0].geometric_bounds().unwrap();
|
||||
assert!((b.x0 - 10.0 * mm).abs() < 0.01 && b.x1 > 10.0 * mm, "{b:?}");
|
||||
assert!(drawn(1, arial(), " \t", &[]).is_empty());
|
||||
// NULs alone in an underlined font fill their cells and add no type.
|
||||
let layer = opaque(font_of("Arial", true), "\0", &[2000]);
|
||||
assert!(layer.len() == 1 && matches!(layer[0].kind, NodeKind::Path { .. }), "{layer:?}");
|
||||
// A file that never sets the mode draws in the opaque mode a playback starts in.
|
||||
let layer = drawn(0, arial(), "Hi", &[]);
|
||||
assert_eq!(fill_rgb(&layer[0]), Some([0, 255, 0]));
|
||||
assert!(drawn(1, arial(), "Hi", &[]).iter().all(|n| matches!(n.kind, NodeKind::Text(_))));
|
||||
}
|
||||
|
||||
/// The first text object of `d`.
|
||||
fn first_text(d: &Document) -> TextObject {
|
||||
all(d)
|
||||
@@ -1195,8 +1380,8 @@ fn multiline_text_with_advances_aligns_each_line() {
|
||||
}
|
||||
assert!(drops.iter().all(|d| (d - drops[0]).abs() < 0.01), "{drops:?}");
|
||||
// Underlined and left aligned, each line's underline ends with its own advances: no bar runs on
|
||||
// past either line.
|
||||
let records = vec![(82, font_of("Arial", true)), (37, le(&[2])), (84, text_out(1000, "Hi\nHi", &[2000, 1000, 0, 2000, 1000]))];
|
||||
// past either line (on a transparent background, SETBKMODE).
|
||||
let records = vec![(18, le(&[1])), (82, font_of("Arial", true)), (37, le(&[2])), (84, text_out(1000, "Hi\nHi", &[2000, 1000, 0, 2000, 1000]))];
|
||||
let back = import(&hand_emf(5000, 3000, &records)).unwrap();
|
||||
assert!(all(&back.document).iter().all(|n| !matches!(n.kind, NodeKind::Path { .. })));
|
||||
for (align, x, second) in [(6, 2500, [15.0, 30.0]), (2, 4000, [20.0, 35.0])] {
|
||||
@@ -1254,8 +1439,9 @@ fn wmf_text_is_spaced_by_its_advances() {
|
||||
fn split_type_keeps_its_underline_and_right_to_left_order() {
|
||||
let mm = 72.0 / 25.4;
|
||||
// Underlined "Hiy" with an advance further than tracking reaches after the "H": the bar runs on
|
||||
// from the end of the "H"'s underline to where "iy" starts, at 130 mm.
|
||||
let records = vec![(82, font_of("Arial", true)), (37, le(&[2])), (84, text_out(1000, "Hiy", &[12000, 500, 1000]))];
|
||||
// from the end of the "H"'s underline to where "iy" starts, at 130 mm. The background is
|
||||
// transparent (SETBKMODE) throughout.
|
||||
let records = vec![(18, le(&[1])), (82, font_of("Arial", true)), (37, le(&[2])), (84, text_out(1000, "Hiy", &[12000, 500, 1000]))];
|
||||
let back = import(&hand_emf(20000, 3000, &records)).unwrap();
|
||||
assert_eq!(texts_at(&back.document), vec![("H".to_string(), vec![10.0]), ("iy".to_string(), vec![130.0, 135.0])]);
|
||||
let bars: Vec<Rect> =
|
||||
@@ -1265,7 +1451,7 @@ fn split_type_keeps_its_underline_and_right_to_left_order() {
|
||||
assert!(b.x0 > 10.0 * mm && b.x0 < 130.0 * mm && (b.x1 - 130.0 * mm).abs() < 0.01 && b.height() < 2.0 * mm, "{b:?}");
|
||||
// The "H" and the "i" before the split are tracked apart and draw a bar each: only the bar that
|
||||
// ends the piece runs on, from the end of the "i" to 130 mm.
|
||||
let records = vec![(82, font_of("Arial", true)), (37, le(&[2])), (84, text_out(1000, "Hiy", &[1000, 12000, 1000]))];
|
||||
let records = vec![(18, le(&[1])), (82, font_of("Arial", true)), (37, le(&[2])), (84, text_out(1000, "Hiy", &[1000, 12000, 1000]))];
|
||||
let back = import(&hand_emf(20000, 3000, &records)).unwrap();
|
||||
assert_eq!(texts_at(&back.document), vec![("Hi".to_string(), vec![10.0, 20.0]), ("y".to_string(), vec![140.0])]);
|
||||
let gaps: Vec<Node> = all(&back.document).into_iter().filter(|n| matches!(n.kind, NodeKind::Path { .. })).collect();
|
||||
@@ -1276,12 +1462,12 @@ fn split_type_keeps_its_underline_and_right_to_left_order() {
|
||||
let b = gaps[0].geometric_bounds().unwrap();
|
||||
assert!(b.x0 > 20.0 * mm && (b.x1 - 140.0 * mm).abs() < 0.01, "{b:?}");
|
||||
// Without an underline, nothing but the type.
|
||||
let records = vec![(82, arial()), (37, le(&[2])), (84, text_out(1000, "Hiy", &[12000, 500, 1000]))];
|
||||
let records = vec![(18, le(&[1])), (82, arial()), (37, le(&[2])), (84, text_out(1000, "Hiy", &[12000, 500, 1000]))];
|
||||
let back = import(&hand_emf(20000, 3000, &records)).unwrap();
|
||||
assert!(all(&back.document).iter().all(|n| !matches!(n.kind, NodeKind::Path { .. })));
|
||||
// A last advance further than tracking reaches, right aligned at 140 mm: the "H" and the "i"
|
||||
// start at 10 and 20 mm, and the underline runs on from the "i" to 140 mm.
|
||||
let records = vec![(22, le(&[2])), (82, font_of("Arial", true)), (37, le(&[2])), (84, text_out(14000, "Hi", &[1000, 12000]))];
|
||||
let records = vec![(18, le(&[1])), (22, le(&[2])), (82, font_of("Arial", true)), (37, le(&[2])), (84, text_out(14000, "Hi", &[1000, 12000]))];
|
||||
let back = import(&hand_emf(20000, 3000, &records)).unwrap();
|
||||
assert_eq!(texts_at(&back.document), vec![("Hi".to_string(), vec![10.0, 20.0])]);
|
||||
let bars: Vec<Rect> =
|
||||
|
||||
@@ -372,6 +372,12 @@ impl FontFace {
|
||||
/// `usWinDescent`, at the face's location in a variable font), in font units; `None` when the
|
||||
/// font has no OS/2 table or the sum isn't positive.
|
||||
pub fn win_cell_height(&self) -> Option<f64> {
|
||||
self.win_ascent_descent().map(|(a, d)| a + d)
|
||||
}
|
||||
/// The face's character cell on Windows above and below the baseline (the OS/2 table's
|
||||
/// `usWinAscent` and `usWinDescent`, at the face's location in a variable font), in font
|
||||
/// units; `None` when the font has no OS/2 table or the sum isn't positive.
|
||||
pub fn win_ascent_descent(&self) -> Option<(f64, f64)> {
|
||||
use skrifa::raw::TableProvider;
|
||||
let f = self.skrifa()?;
|
||||
let o = f.os2().ok()?;
|
||||
@@ -380,8 +386,8 @@ impl FontFace {
|
||||
let varied = |tag: &[u8; 4]| {
|
||||
f.mvar().ok().and_then(|m| m.metric_delta(skrifa::Tag::new(tag), self.location().coords()).ok()).map_or(0.0, |d| d.to_f64())
|
||||
};
|
||||
let h = f64::from(o.us_win_ascent()) + varied(b"hcla") + f64::from(o.us_win_descent()) + varied(b"hcld");
|
||||
(h > 0.0 && h.is_finite()).then_some(h)
|
||||
let (a, d) = (f64::from(o.us_win_ascent()) + varied(b"hcla"), f64::from(o.us_win_descent()) + varied(b"hcld"));
|
||||
(a + d > 0.0 && (a + d).is_finite()).then_some((a, d))
|
||||
}
|
||||
/// The average width of the face's characters (the OS/2 table's `xAvgCharWidth`), in font
|
||||
/// units; `None` when the font has no OS/2 table or gives no positive width.
|
||||
|
||||
@@ -875,7 +875,8 @@ fn on_path_align_takes_a_variable_font_instances_em_box() {
|
||||
}
|
||||
|
||||
/// A variable font's instance takes its Windows character cell from the `usWinAscent` and
|
||||
/// `usWinDescent` its `MVAR` table varies: 200 units taller in Bold.
|
||||
/// `usWinDescent` its `MVAR` table varies: 200 units taller in Bold, 120 above the baseline and
|
||||
/// 80 below it.
|
||||
#[test]
|
||||
fn win_cell_height_takes_a_variable_font_instances_mvar() {
|
||||
use crate::test_fonts::{PATH_ALIGN_VARIABLE_FAMILY, path_align_font};
|
||||
@@ -885,6 +886,10 @@ fn win_cell_height_takes_a_variable_font_instances_mvar() {
|
||||
let cell = |font_style: &str| db.style_face(&st(font_style)).and_then(|f| f.win_cell_height()).unwrap();
|
||||
let (regular, bold) = (cell("Regular"), cell("Bold"));
|
||||
assert!((bold - regular - 200.0).abs() < 1e-6, "Regular {regular}, Bold {bold}");
|
||||
let split = |font_style: &str| db.style_face(&st(font_style)).and_then(|f| f.win_ascent_descent()).unwrap();
|
||||
let ((ra, rd), (ba, bd)) = (split("Regular"), split("Bold"));
|
||||
assert!((ba - ra - 120.0).abs() < 1e-6 && (bd - rd - 80.0).abs() < 1e-6, "Regular {ra}/{rd}, Bold {ba}/{bd}");
|
||||
assert!((ra + rd - regular).abs() < 1e-6);
|
||||
}
|
||||
|
||||
/// In vertical type, Align to Path moves the glyphs half an em, with their horizontal scale and not
|
||||
|
||||
@@ -78,6 +78,8 @@ struct HandleDrag {
|
||||
offset: Vec2,
|
||||
space: bool,
|
||||
independent: bool,
|
||||
/// The opposite handle mirrors this one ([`DirectSelectionTool::mirrors`]).
|
||||
symmetric: bool,
|
||||
translated: bool,
|
||||
}
|
||||
|
||||
@@ -261,9 +263,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<Point>,
|
||||
/// 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,
|
||||
@@ -291,6 +311,7 @@ impl DirectSelectionTool {
|
||||
frame_revision: (0, 0),
|
||||
frame_click: None,
|
||||
bracket_hover: None,
|
||||
lent_cmd: false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -441,6 +462,21 @@ fn spine_anchor(cx: &ToolContext, (id, ai): (NodeId, usize)) -> Option<vectorcra
|
||||
spine_path(cx, id)?.subpaths.first()?.anchors.get(ai).copied()
|
||||
}
|
||||
|
||||
/// Preview a drag of the clicked blend-spine direction handle.
|
||||
/// `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<Action> {
|
||||
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<PathData> {
|
||||
match &cx.doc.node(id)?.kind {
|
||||
@@ -789,10 +825,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
|
||||
@@ -851,6 +892,7 @@ impl Tool for DirectSelectionTool {
|
||||
}
|
||||
fn pointer(&mut self, cx: &ToolContext, ev: &PointerEvent) -> Vec<Action> {
|
||||
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;
|
||||
}
|
||||
@@ -908,6 +950,7 @@ impl Tool for DirectSelectionTool {
|
||||
offset: Vec2::ZERO,
|
||||
space: false,
|
||||
independent: false,
|
||||
symmetric: false,
|
||||
translated: false,
|
||||
})
|
||||
}
|
||||
@@ -1012,10 +1055,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 self.mirrors(ev) {
|
||||
params["symmetric"] = json!(true);
|
||||
}
|
||||
vec![Action::Preview(cmd.into(), params)]
|
||||
}
|
||||
(PointerKind::Drag, State::SpinePoint { id, anchor, from, start, began }) => {
|
||||
let mut out = vec![];
|
||||
@@ -1053,10 +1097,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, self.mirrors(ev)),
|
||||
(PointerKind::Drag, State::Mesh) => self.mesh.drag_to(p).unwrap_or_default(),
|
||||
(PointerKind::Up, State::Mesh) => {
|
||||
self.state = State::Idle;
|
||||
@@ -1568,15 +1609,20 @@ 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;
|
||||
}
|
||||
}
|
||||
// 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!({
|
||||
"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]);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,9 @@ const ROWS: &[Row] = &[
|
||||
"affectsDensity",
|
||||
],
|
||||
),
|
||||
// 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"]),
|
||||
|
||||
@@ -48,6 +48,8 @@ pub struct SymbolismTool {
|
||||
active: bool,
|
||||
hover: Option<Point>,
|
||||
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.
|
||||
@@ -113,6 +115,7 @@ impl SymbolismTool {
|
||||
active: false,
|
||||
hover: None,
|
||||
alt: false,
|
||||
shift: false,
|
||||
diameter: 80.0,
|
||||
intensity: 5.0,
|
||||
density: 5.0,
|
||||
@@ -196,6 +199,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)
|
||||
}
|
||||
}
|
||||
@@ -230,6 +236,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)]
|
||||
}
|
||||
@@ -577,6 +584,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}");
|
||||
}
|
||||
}
|
||||
|
||||
/// With Use Pressure Pen a drag sample where the pen stays is kept when the pressure changes;
|
||||
/// without it, or with the same pressure, the drag keeps thinning the samples by distance.
|
||||
#[test]
|
||||
|
||||
@@ -25,8 +25,8 @@ pub struct CanvasCache {
|
||||
/// last render took more than 8 ms, the canvas draws the frame shown reprojected and renders
|
||||
/// once the view has been still for [`canvas::STILL_SECS`].
|
||||
pub waits_for_still: bool,
|
||||
/// The cache key the canvas last asked for and when it first asked for it (seconds, egui's
|
||||
/// input time), kept while [`Self::waits_for_still`] is set.
|
||||
/// The cache key the canvas last asked for and when it first asked for its view (seconds,
|
||||
/// egui's input time), kept while [`Self::waits_for_still`] is set.
|
||||
pub still: Option<(CacheKey, f64)>,
|
||||
/// The low-resolution frame that covers the parts of the canvas the frame shown leaves
|
||||
/// uncovered while it is drawn for a view it was not rendered for ([`canvas::Fill`]).
|
||||
|
||||
@@ -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::{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};
|
||||
@@ -358,8 +359,10 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
poll_worker(app, ui, key.doc);
|
||||
// With `waits_for_still` set (the web build, which has no render worker), a heavy document is
|
||||
// not rendered while only the view changes: the frame shown is drawn reprojected below, and the
|
||||
// first frame after the view has been still for STILL_SECS renders.
|
||||
// first frame after the view has been still for STILL_SECS renders. An edit meanwhile is drawn
|
||||
// into the frame shown ([`edit_in_frame_shown`]).
|
||||
let wait = if app.canvas.waits_for_still {
|
||||
edit_in_frame_shown(app, &key, &doc, &effects, &drawn, (mask_view, smooth_images));
|
||||
let slow = app.canvas.last_ms > 8.0 && app.canvas.texture.is_some();
|
||||
still_wait(&mut app.canvas.still, app.canvas.key.as_ref(), &key, slow, ui.input(|i| i.time))
|
||||
} else {
|
||||
@@ -1149,6 +1152,72 @@ struct Frame<'a> {
|
||||
/// shows the document's paper without the art: about a frame at 60 Hz.
|
||||
pub(crate) const FIRST_FRAME_GRACE: std::time::Duration = std::time::Duration::from_millis(16);
|
||||
|
||||
/// Draw `region` of `frame` again, into the texture of the frame shown, which then shows `frame`'s
|
||||
/// key: only the document changed since the frame shown, in that part of it
|
||||
/// ([`changed_pixels`]). `None`: nothing in view changed. `last_ms` stays the whole frame's.
|
||||
fn draw_changed(app: &mut VectorcraftApp, frame: &Frame, region: Option<[u32; 4]>) {
|
||||
let Frame { key, doc, effects, view, opts, pixel, .. } = frame;
|
||||
let t0 = now_ms();
|
||||
if region.is_none() {
|
||||
// Nothing in view to draw again: what was made to measure the edit isn't drawn.
|
||||
app.canvas.renderer.let_go_of_measured();
|
||||
}
|
||||
let display = app.display_profile.transform(app.session.prefs.monitor_profile_display);
|
||||
if let (Some([x0, y0, x1, y1]), Some(tex)) = (region, &mut app.canvas.texture) {
|
||||
let renderer = &mut app.canvas.renderer;
|
||||
let part_view = Affine::translate((-f64::from(x0), -f64::from(y0))) * *view;
|
||||
let mut part = effects.view(|| renderer.render(doc, x1 - x0, y1 - y0, part_view, opts));
|
||||
let width = part.width;
|
||||
crate::display_profile::convert_over(display.as_deref(), &mut part.pixels, width, part_view, key.over());
|
||||
let color = color_image(&part);
|
||||
let options = if pixel.is_some() { egui::TextureOptions::NEAREST } else { egui::TextureOptions::LINEAR };
|
||||
tex.set_partial([x0 as usize, y0 as usize], color, options);
|
||||
app.canvas.moved |= app.canvas.renderer.stats.moved > 0;
|
||||
}
|
||||
app.canvas.key = Some((*key).clone());
|
||||
app.canvas.shown = Some(((*doc).clone(), opts.clone()));
|
||||
app.perf.render_ms = now_ms() - t0;
|
||||
}
|
||||
|
||||
/// With `waits_for_still` set (the web build) and the last render slow, an edit while the view
|
||||
/// moves (a tool's drag that scrolls the view at an edge of the canvas, or a wheel scroll during a
|
||||
/// drag) is drawn into the frame shown, at the view it was rendered for: the part the edit changed
|
||||
/// only ([`changed_pixels`]). The frame shown then stays drawn reprojected with the view, and the
|
||||
/// canvas renders whole once the view has been still for [`STILL_SECS`], as for a view change
|
||||
/// without an edit (#8688). When more than the view and the document differ from the frame shown,
|
||||
/// or the edit changed more than half of it, nothing is drawn here: the frame renders whole.
|
||||
fn edit_in_frame_shown(
|
||||
app: &mut VectorcraftApp,
|
||||
key: &CacheKey,
|
||||
doc: &std::sync::Arc<vectorcraft_doc::Document>,
|
||||
effects: &vectorcraft_plugins::deferred::Deferrals,
|
||||
drawn: &View,
|
||||
(mask_view, smooth_images): (Option<vectorcraft_doc::NodeId>, bool),
|
||||
) {
|
||||
let slow = app.canvas.last_ms > 8.0 && app.canvas.texture.is_some();
|
||||
let Some(shown) = app.canvas.key.clone().filter(|_| slow) else { return };
|
||||
let at_shown = CacheKey {
|
||||
zoom: shown.zoom,
|
||||
cx: shown.cx,
|
||||
cy: shown.cy,
|
||||
w: shown.w,
|
||||
h: shown.h,
|
||||
ppp: shown.ppp,
|
||||
rot: shown.rot,
|
||||
pixel: shown.pixel,
|
||||
..key.clone()
|
||||
};
|
||||
if at_shown == shown || at_shown == *key || shown.pixel.is_some() != key.pixel.is_some() {
|
||||
return;
|
||||
}
|
||||
let v = View { center: Point::new(shown.cx, shown.cy), zoom: shown.zoom, rotation: shown.rot, ..*drawn };
|
||||
let (w, h, view) = frame_view(at_shown.pixel, (at_shown.w, at_shown.h), &v, at_shown.ppp);
|
||||
let opts = frame_options(app, &at_shown, mask_view, smooth_images);
|
||||
if let Some(region) = changed_pixels(app, &at_shown, doc, &opts, view, w, h) {
|
||||
draw_changed(app, &Frame { key: &at_shown, doc, effects, size: (w, h), view, opts, pixel: at_shown.pixel }, region);
|
||||
}
|
||||
}
|
||||
|
||||
fn draw_frame(app: &mut VectorcraftApp, ui: &Ui, frame: Frame) {
|
||||
let Frame { key, doc, effects, size: (w, h), view, opts, pixel } = frame;
|
||||
// Frames that would be slow on this thread (the last one took over 8 ms) go
|
||||
@@ -1172,27 +1241,7 @@ fn draw_frame(app: &mut VectorcraftApp, ui: &Ui, frame: Frame) {
|
||||
match (&mut app.canvas.worker, heavy, changed) {
|
||||
// Only the document changed since the frame shown, in a part of it: that part is
|
||||
// rendered again, here, into the texture. `last_ms` stays the whole frame's.
|
||||
(_, _, Some(region)) => {
|
||||
let t0 = now_ms();
|
||||
if region.is_none() {
|
||||
// Nothing in view to draw again: what was made to measure the edit isn't drawn.
|
||||
app.canvas.renderer.let_go_of_measured();
|
||||
}
|
||||
if let (Some([x0, y0, x1, y1]), Some(tex)) = (region, &mut app.canvas.texture) {
|
||||
let renderer = &mut app.canvas.renderer;
|
||||
let part_view = Affine::translate((-f64::from(x0), -f64::from(y0))) * view;
|
||||
let mut part = effects.view(|| renderer.render(doc, x1 - x0, y1 - y0, part_view, &opts));
|
||||
let width = part.width;
|
||||
crate::display_profile::convert_over(display.as_deref(), &mut part.pixels, width, part_view, key.over());
|
||||
let color = color_image(&part);
|
||||
let options = if pixel.is_some() { egui::TextureOptions::NEAREST } else { egui::TextureOptions::LINEAR };
|
||||
tex.set_partial([x0 as usize, y0 as usize], color, options);
|
||||
app.canvas.moved |= app.canvas.renderer.stats.moved > 0;
|
||||
}
|
||||
app.canvas.key = Some(key.clone());
|
||||
app.canvas.shown = Some((doc.clone(), opts.clone()));
|
||||
app.perf.render_ms = now_ms() - t0;
|
||||
}
|
||||
(_, _, Some(region)) => draw_changed(app, &Frame { key, doc, effects, size: (w, h), view, opts, pixel }, region),
|
||||
(Some(worker), true, None) => {
|
||||
// The worker draws the frame: what this thread's renderer made to measure the edit
|
||||
// isn't drawn here.
|
||||
|
||||
@@ -51,11 +51,13 @@ pub(super) fn hover_wait(moved: &mut Option<(ViewKey, f64)>, key: ViewKey, now:
|
||||
|
||||
/// Note that the canvas asks for `key` at time `now` (seconds, egui's input time) → how many more
|
||||
/// seconds it draws the frame `shown` reprojected instead of rendering `key`: while the last
|
||||
/// render was `slow`, only the view differs between the two, and the canvas has asked for `key`
|
||||
/// for less than [`STILL_SECS`]. `still` holds the key last asked for and when the canvas first
|
||||
/// asked for it. None: the canvas renders `key` now, unless it is the frame shown.
|
||||
/// render was `slow`, only the view differs between the two, and the canvas has asked for the view
|
||||
/// of `key` for less than [`STILL_SECS`]. `still` holds the key last asked for and when the canvas first
|
||||
/// asked for its view. An edit leaves that time as it is: with the view still and edits drawn into
|
||||
/// the frame shown at each step of a drag, the canvas still renders whole once the view has been
|
||||
/// still for [`STILL_SECS`]. None: the canvas renders `key` now, unless it is the frame shown.
|
||||
pub(super) fn still_wait(still: &mut Option<(CacheKey, f64)>, shown: Option<&CacheKey>, key: &CacheKey, slow: bool, now: f64) -> Option<f64> {
|
||||
if still.as_ref().is_none_or(|(k, _)| k != key) {
|
||||
if still.as_ref().is_none_or(|(k, _)| !same_view(k, key)) {
|
||||
*still = Some((key.clone(), now));
|
||||
}
|
||||
let waited = still.as_ref().map_or(0.0, |(_, at)| now - at);
|
||||
@@ -64,6 +66,12 @@ pub(super) fn still_wait(still: &mut Option<(CacheKey, f64)>, shown: Option<&Cac
|
||||
(slow && waiting && shown.is_some_and(|s| s != key && only_view_differs(s, key))).then_some(STILL_SECS - waited)
|
||||
}
|
||||
|
||||
/// Whether two cache keys are of the same document at the same view (zoom, center, rotation,
|
||||
/// canvas size, pixel density and Pixel Preview's document pixels), whatever else differs.
|
||||
fn same_view(a: &CacheKey, b: &CacheKey) -> bool {
|
||||
(a.doc, a.zoom, a.cx, a.cy, a.w, a.h, a.ppp, a.rot, a.pixel) == (b.doc, b.zoom, b.cx, b.cy, b.w, b.h, b.ppp, b.rot, b.pixel)
|
||||
}
|
||||
|
||||
/// Whether two cache keys differ only in the view (zoom, center, rotation, canvas size, pixel
|
||||
/// density and Pixel Preview's document pixels), with Pixel Preview on in both or off in both.
|
||||
pub(super) fn only_view_differs(a: &CacheKey, b: &CacheKey) -> bool {
|
||||
|
||||
@@ -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::<bool>(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 {
|
||||
@@ -182,7 +190,10 @@ 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. 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";
|
||||
@@ -351,6 +362,13 @@ 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 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;
|
||||
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.
|
||||
let room = bounds.width() - BAR_FRAME;
|
||||
@@ -371,6 +389,13 @@ 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()), Some(c.id(shape.is_some())))));
|
||||
let chips: Vec<Chip> = chips.into_iter().filter(|c| !hidden.contains(c.id(shape.is_some()))).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<f32> = 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 +523,21 @@ 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 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 })));
|
||||
}
|
||||
}
|
||||
});
|
||||
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 +619,112 @@ 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)
|
||||
}
|
||||
|
||||
/// 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 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
|
||||
/// 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<std::collections::BTreeSet<String>, D::Error> {
|
||||
let value = <serde_json::Value as serde::Deserialize>::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
|
||||
|
||||
@@ -4357,7 +4357,8 @@ fn a_pan_fills_the_area() {
|
||||
/// With the web build's setting (`waits_for_still`, no render worker), a heavy document's canvas
|
||||
/// is not rendered while the view moves: each frame draws the frame shown moved and scaled with
|
||||
/// the view and asks for a frame within STILL_SECS. The canvas renders once the view has been
|
||||
/// still for STILL_SECS, and at once after an edit. With a worker's build settings the same frames render at once, as
|
||||
/// still for STILL_SECS. An edit while the view moves draws the part it changed into the frame
|
||||
/// shown, and one that changes most of the frame renders it whole at once. With a worker's build settings the same frames render at once, as
|
||||
/// before.
|
||||
#[test]
|
||||
fn without_a_worker_a_heavy_canvas_is_reprojected_until_the_view_is_still() {
|
||||
@@ -4421,15 +4422,39 @@ fn without_a_worker_a_heavy_canvas() {
|
||||
let now = app.canvas.key.clone().unwrap();
|
||||
assert_eq!((now.cx, now.zoom), (app.view().unwrap().center.x, app.view().unwrap().zoom), "rendered for the view");
|
||||
assert!((b.min - rect.min).length() < 0.01 && (b.max - rect.max).length() < 0.01, "{b:?} over {rect:?}");
|
||||
// An edit renders at once, even while the view moves.
|
||||
// An edit while the view moves shows at once: the part it changed is drawn into the frame
|
||||
// shown, at the view that frame was rendered for, and the frame stays drawn reprojected until
|
||||
// the view is still (#8688).
|
||||
app.canvas.last_ms = 50.0;
|
||||
app.view_mut().unwrap().center.y += 10.0;
|
||||
frame(&mut app);
|
||||
assert_eq!(app.canvas.key.as_ref(), Some(&now), "waiting");
|
||||
app.session.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 20, "height": 20})).unwrap();
|
||||
app.session.execute("shape.rectangle", &json!({"x": 110, "y": 60, "width": 20, "height": 20})).unwrap();
|
||||
let render_ms = app.canvas.last_ms;
|
||||
let (b, delay) = frame(&mut app);
|
||||
let k = app.canvas.key.clone().unwrap();
|
||||
assert_eq!(k.revision, app.session.active().unwrap().revision, "the edit is drawn");
|
||||
assert_eq!((k.cx, k.cy, k.zoom), (now.cx, now.cy, now.zoom), "at the view of the frame shown");
|
||||
assert_eq!(app.canvas.last_ms, render_ms, "the frame was not rendered whole");
|
||||
let (old, new) = (Xf::new(rect, &View { center: Point::new(now.cx, now.cy), ..*app.view().unwrap() }), Xf::new(rect, app.view().unwrap()));
|
||||
let (a, z) = (new.to_screen(old.to_doc(rect.min)), new.to_screen(old.to_doc(rect.max)));
|
||||
assert!((b.min - a).length() < 0.01 && (b.max - z).length() < 0.01, "{b:?}: the frame shown at {a:?} to {z:?}");
|
||||
assert!(delay <= std::time::Duration::from_secs_f64(STILL_SECS), "a frame within STILL_SECS: {delay:?}");
|
||||
let mut frames = 0;
|
||||
while app.canvas.key.as_ref() == Some(&k) && frames < 60 {
|
||||
frames += 1;
|
||||
frame(&mut app);
|
||||
}
|
||||
let k = app.canvas.key.clone().unwrap();
|
||||
assert_eq!((k.revision, k.cy), (app.session.active().unwrap().revision, app.view().unwrap().center.y), "rendered once still");
|
||||
// An edit that changes more than half of the frame renders whole at once, view and all.
|
||||
app.canvas.last_ms = 50.0;
|
||||
app.view_mut().unwrap().center.y += 10.0;
|
||||
frame(&mut app);
|
||||
app.session.execute("shape.rectangle", &json!({"x": -1000, "y": -1000, "width": 3000, "height": 3000})).unwrap();
|
||||
frame(&mut app);
|
||||
let k = app.canvas.key.clone().unwrap();
|
||||
assert_eq!((k.revision, k.cy), (app.session.active().unwrap().revision, app.view().unwrap().center.y), "rendered after the edit");
|
||||
assert_eq!((k.revision, k.cy), (app.session.active().unwrap().revision, app.view().unwrap().center.y), "rendered whole after the edit");
|
||||
// With a worker's build settings and no worker (VECTORCRAFT_SYNC_RENDER), a heavy document
|
||||
// renders every change of view at once.
|
||||
app.canvas.waits_for_still = false;
|
||||
@@ -4439,6 +4464,48 @@ fn without_a_worker_a_heavy_canvas() {
|
||||
assert_eq!(app.canvas.key.as_ref().map(|k| k.cx), Some(app.view().unwrap().center.x), "rendered at once");
|
||||
}
|
||||
|
||||
/// With the web build's setting (`waits_for_still`, no render worker), a heavy document's view
|
||||
/// that stops moving while a drag goes on editing the document renders whole once the view has
|
||||
/// been still for STILL_SECS: each edit is drawn into the frame shown and does not start the wait
|
||||
/// again.
|
||||
#[test]
|
||||
fn without_a_worker_edits_while_the_view_is_still_do_not_hold_off_the_render() {
|
||||
keeping_color_settings(edits_while_the_view_is_still);
|
||||
}
|
||||
|
||||
fn edits_while_the_view_is_still() {
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap();
|
||||
app.session.execute("shape.rectangle", &json!({"x": 100, "y": 50, "width": 200, "height": 200})).unwrap();
|
||||
app.canvas.worker_started = true; // no worker, as in the web build
|
||||
app.canvas.waits_for_still = true;
|
||||
let ctx = egui::Context::default();
|
||||
let frame = |app: &mut VectorcraftApp| {
|
||||
let raw = egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0))), ..Default::default() };
|
||||
let mut out = ctx.run_ui(raw, |ui| show(app, ui));
|
||||
out.textures_delta.clear();
|
||||
};
|
||||
frame(&mut app); // the first frame fits the view to the artboard
|
||||
frame(&mut app);
|
||||
app.canvas.last_ms = 50.0;
|
||||
// The view moves once (a drag at an edge of the canvas scrolls it) and then stays still.
|
||||
app.view_mut().unwrap().center.y += 10.0;
|
||||
frame(&mut app);
|
||||
let shown = app.canvas.key.clone().unwrap();
|
||||
assert_ne!(shown.cy, app.view().unwrap().center.y, "waiting");
|
||||
// The drag edits the document on every frame, at 60 fps (egui's input time without a clock).
|
||||
let mut frames = 0;
|
||||
while app.canvas.key.as_ref().is_none_or(|k| k.cy != app.view().unwrap().center.y) && frames < 60 {
|
||||
frames += 1;
|
||||
let x = 110 + (frames % 10) * 5;
|
||||
app.session.execute("shape.rectangle", &json!({"x": x, "y": 60, "width": 4, "height": 4})).unwrap();
|
||||
frame(&mut app);
|
||||
let k = app.canvas.key.as_ref().unwrap();
|
||||
assert_eq!(k.revision, app.session.active().unwrap().revision, "each edit is drawn");
|
||||
}
|
||||
assert!((11..=13).contains(&frames), "rendered whole about STILL_SECS after the view stopped: {frames} frames");
|
||||
}
|
||||
|
||||
/// [`still_wait`] waits while only the view changes on a slow canvas: each change starts
|
||||
/// STILL_SECS again. It does not wait for a light document, a still view, a clock that went
|
||||
/// back, an edit, a switch into Pixel Preview or a canvas with no frame shown.
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
use serde_json::{Map, Value, json};
|
||||
use vectorcraft_tools::settings::SYMBOLISM;
|
||||
|
||||
use super::{DialogResult, DialogSpec, form, set_tool_options_and_close};
|
||||
use super::{DialogResult, DialogSpec, form, modal, set_tool_options_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).
|
||||
@@ -107,10 +114,9 @@ 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 that can be edited (not locked or hidden).
|
||||
/// The selected symbol sets that can be edited (a locked or hidden one keeps its density).
|
||||
fn selected_sets(app: &VectorcraftApp) -> Vec<u64> {
|
||||
let Some(st) = app.session.active() else { return vec![] };
|
||||
let editable = st.doc.editable();
|
||||
@@ -123,39 +129,42 @@ fn selected_sets(app: &VectorcraftApp) -> Vec<u64> {
|
||||
}
|
||||
|
||||
/// OK: set the brush the Symbolism tools share, after giving a new Symbol Set Density to the
|
||||
/// selected symbol sets. Every option is checked first, so a value the tools refuse (a number out
|
||||
/// of its range included) leaves the symbol sets and the options as they are.
|
||||
/// selected symbol sets. A value outside its range is refused and changes nothing.
|
||||
fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> DialogResult {
|
||||
let mut values: Map<String, Value> =
|
||||
NUMBERS.iter().filter(|k| d.fields.contains_key(**k)).map(|k| (k.to_string(), json!(d.f64(k, 0.0)))).collect();
|
||||
// The checkboxes and choices as the fields hold them, so a value the tools do not have is refused.
|
||||
values.extend(SWITCHES.iter().chain(&SPRAY).chain(&["method"]).filter_map(|k| Some((k.to_string(), d.fields.get(*k)?.clone()))));
|
||||
// An option `tool.setOption` refuses leaves the symbol sets as they are too.
|
||||
// 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<String, Value> = 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: 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}`"));
|
||||
}
|
||||
// A number, or text that reads as one (a length with its unit for the diameter).
|
||||
let readable = |v: &Value| match v {
|
||||
Value::Number(_) => true,
|
||||
Value::String(s) => vectorcraft_doc::Unit::Points.parse(s).is_some(),
|
||||
_ => false,
|
||||
};
|
||||
if let Some(k) = NUMBERS.iter().chain(&[DENSITY_WAS]).find(|k| d.fields.get(**k).is_some_and(|v| !readable(v))) {
|
||||
return Err(format!("`{k}` must be a number"));
|
||||
}
|
||||
vectorcraft_tools::symbolism::check_options(&tool, &values)?;
|
||||
vectorcraft_tools::option_check::check_values(&vectorcraft_tools::symbolism::SymbolismTool::new(&tool), &values)?;
|
||||
// The density the sets had when the dialog opened is read as a number too.
|
||||
if stored(DENSITY_WAS).is_some_and(|v| !v.is_number()) {
|
||||
return Err(format!("`{DENSITY_WAS}` must be a number"));
|
||||
}
|
||||
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 }))?;
|
||||
}
|
||||
set_tool_options_and_close(app, json!({ "tool": d.str("tool"), "values": values }))
|
||||
set_tool_options_and_close(app, json!({ "tool": tool, "values": values }))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use egui_kittest::kittest::Queryable;
|
||||
use vectorcraft_engine::Session;
|
||||
|
||||
fn app() -> VectorcraftApp {
|
||||
@@ -168,6 +177,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();
|
||||
@@ -280,6 +322,56 @@ 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));
|
||||
// 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")),
|
||||
("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));
|
||||
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 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));
|
||||
|
||||
@@ -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<egui::Event>| {
|
||||
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<egui::Event>) -> (Vec<(String, egui::Rect, egui::Rect)>, Vec<egui::Rect>) + 'r;
|
||||
type Texts = Vec<(String, egui::Rect, egui::Rect)>;
|
||||
type Run<'r> = dyn FnMut(&mut VectorcraftApp, Vec<egui::Event>) -> (Texts, Vec<egui::Rect>, 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 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() {
|
||||
fn walk(shape: &egui::Shape, clip: egui::Rect, texts: &mut Vec<(String, egui::Rect, egui::Rect)>, bars: &mut Vec<egui::Rect>) {
|
||||
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<egui::Event>| {
|
||||
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);
|
||||
|
||||
@@ -632,6 +632,8 @@ font-technology Variable Променливи
|
||||
Contextual Task Bar Контекстна лента със задачи
|
||||
Pin Bar Position Закачане на позицията на лентата
|
||||
Reset Bar Position Нулиране на позицията на лентата
|
||||
Bar Actions Действия на лентата
|
||||
Reset Bar Actions Нулиране на действията на лентата
|
||||
Resize Преоразмеряване
|
||||
Contrast Контраст
|
||||
Control Контрол
|
||||
@@ -1958,6 +1960,11 @@ font-technology Variable Променливи
|
||||
Knife Нож
|
||||
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 пространство
|
||||
Lab Spot Colors: Спот цветове по Lab:
|
||||
Lab Values Стойности по Lab
|
||||
Landscape Пейзаж
|
||||
@@ -3271,9 +3278,10 @@ 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; 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 милиона инструкции освен тези за входните си данни. Ограничението по време остава същото.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Колко инструкции може да използва всяко изпълнение на филтър за обекти от плъгин; „Голям“ позволява повече от „Нормално“ при същия лимит от 60 секунди. Тежките филтри запазват своя бюджет.
|
||||
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 го запазва, но все още не използва временни дискове.
|
||||
@@ -3292,6 +3300,8 @@ 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 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 кадъра в секунда.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. От следващото стартиране настолната версия рисува с този вид графичен процесор; „Автоматично“ предпочита този, който управлява дисплея. Уеб версията не го използва.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. От следващото стартиране прозорецът показва кадрите, без да чака опресняването на дисплея, най-много 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. Най-многото стъпки за отмяна, които всеки документ пази; по-малко число премахва най-старите стъпки, когато щракнете върху ОК. Стъпки може да отпаднат и по-рано, ако заемат твърде много памет.
|
||||
@@ -3324,7 +3334,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. Стойностите по подразбиране се прилагат, когато щракнете върху ОК в Настройки. Отказ там запазва текущите ви настройки.
|
||||
@@ -4753,6 +4762,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, 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` трябва да бъде масив
|
||||
@msg `freeform.lines` must be an array `freeform.lines` трябва да бъде масив
|
||||
@@ -7886,6 +7897,16 @@ breakText Glyphs Глифи
|
||||
@msg A joint does not close by {gap} pt. Една връзка не се затваря с {gap} pt.
|
||||
@msg Two panels pass through each other. Два панела минават един през друг.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer трябва да е "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine"
|
||||
Orbit Lines Орбитални линии
|
||||
Petal Garland Гирлянд от венчелистчета
|
||||
Lattice Braid Решетъчна плетка
|
||||
Facet Sweep Фасетен щрих
|
||||
Artistic Brushes Художествени четки
|
||||
Paint Боя
|
||||
Flat Sweep Плосък замах
|
||||
Dry Drag Сухо влачене
|
||||
Loaded Stroke Плътен мазок
|
||||
Fan Sweep Ветрилообразен замах
|
||||
@msg `at` must be "start" or "end" `at` трябва да е "start" или "end"
|
||||
@msg give exactly one of `through` and `toward` посочете точно едно от `through` и `toward`
|
||||
@msg no arc fits these points: two are the same or all three lie on one line няма дъга през тези точки: две съвпадат или и трите лежат на една права
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -797,6 +797,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
|
||||
@@ -4549,6 +4551,11 @@ axis Both Obje
|
||||
Image Slika
|
||||
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
|
||||
Medium Srednje
|
||||
Name Naziv
|
||||
None Ništa
|
||||
@@ -4761,9 +4768,9 @@ 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; 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.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Koliko instrukcija smije koristiti svako pokretanje filtera objekata iz dodatka; Veliko dopušta više od Normalno uz isto ograničenje od 60 sekundi. Teški filteri zadržavaju svoj budžet.
|
||||
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.
|
||||
@@ -4782,6 +4789,8 @@ 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 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.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Od sljedećeg pokretanja desktop verzija crta ovom vrstom grafičkog procesora; Automatski daje prednost onom koji pokreće ekran. Web verzija ga ne koristi.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. Od sljedećeg pokretanja prozor prikazuje kadrove bez čekanja na osvježavanje ekrana, najviše 240 u sekundi; isključeno, ritam određuje ekran. Način prikaza zadan pri pokretanju ima prednost.
|
||||
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.
|
||||
@@ -5201,6 +5210,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, 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
|
||||
@msg `{name}` is a built-in workspace; choose another name `{name}` je ugrađeni radni prostor; odaberite drugi naziv
|
||||
@@ -7941,6 +7952,16 @@ shape Open Otvoren
|
||||
@msg A joint does not close by {gap} pt. Spoj se ne zatvara za {gap} pt.
|
||||
@msg Two panels pass through each other. Dva panela prolaze jedan kroz drugi.
|
||||
@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
|
||||
Artistic Brushes Umjetničke četke
|
||||
Paint Boja
|
||||
Flat Sweep Ravni potez
|
||||
Dry Drag Suhi potez
|
||||
Loaded Stroke Bogati potez
|
||||
Fan Sweep Lepezasti potez
|
||||
@msg `at` must be "start" or "end" `at` mora biti "start" ili "end"
|
||||
@msg give exactly one of `through` and `toward` navedite tačno jedno od `through` i `toward`
|
||||
@msg no arc fits these points: two are the same or all three lie on one line nijedan luk ne odgovara ovim tačkama: dvije su iste ili sve tri leže na jednoj pravoj
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -2499,6 +2499,11 @@ digits Malayalam Malaiàlam
|
||||
Knife Ganivet
|
||||
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
|
||||
Lab Spot Colors Colors directes Lab
|
||||
Lab Spot Colors: Colors directes Lab:
|
||||
Lab Values Valors Lab
|
||||
@@ -3949,6 +3954,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…
|
||||
@@ -4129,9 +4136,10 @@ digits Malayalam Malaiàlam
|
||||
Edit type set in fonts that aren't available? Voleu editar el text en tipus de lletra que no estan disponibles?
|
||||
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.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Quantes instruccions pot fer servir cada execució d’un filtre d’objectes d’un complement; Gran en permet més que Normal amb el mateix límit de 60 segons. Els filtres pesants conserven el seu pressupost.
|
||||
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.
|
||||
@@ -4150,6 +4158,8 @@ 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 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.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. A partir del pròxim inici, la versió d’escriptori dibuixa amb aquest tipus de processador gràfic; Automàtic prefereix el que controla la pantalla. La versió web no l’utilitza.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. A partir del pròxim inici, la finestra mostra els fotogrames sense esperar que la pantalla es refresqui, com a màxim 240 per segon; desactivat, la pantalla marca el ritme. Un mode de presentació definit en iniciar té prioritat.
|
||||
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.
|
||||
@@ -4182,7 +4192,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.
|
||||
@@ -6144,6 +6153,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, 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
|
||||
@msg `pathfinder` must be an object `pathfinder` ha de ser un objecte
|
||||
@@ -8922,6 +8933,16 @@ breakText Glyphs Glifs
|
||||
@msg A joint does not close by {gap} pt. Una unió no es tanca per {gap} pt.
|
||||
@msg Two panels pass through each other. Dos panells es travessen l’un a l’altre.
|
||||
@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
|
||||
Artistic Brushes Pinzells artístics
|
||||
Paint Pintura
|
||||
Flat Sweep Traç pla
|
||||
Dry Drag Arrossegament sec
|
||||
Loaded Stroke Traç carregat
|
||||
Fan Sweep Traç en ventall
|
||||
Engraving Gravat
|
||||
Fine Hatching Ratllat fi
|
||||
Dense Hatching Ratllat dens
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -809,6 +809,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ů
|
||||
@@ -4658,6 +4660,11 @@ axis Both Obě
|
||||
Image Obraz
|
||||
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
|
||||
Medium Střední
|
||||
Name Název
|
||||
None Žádné
|
||||
@@ -4870,9 +4877,9 @@ 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; 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ý.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Kolik instrukcí smí použít každé spuštění filtru objektů ze zásuvného modulu; Velké povoluje víc než Normální při stejném limitu 60 sekund. Náročné filtry si ponechají vlastní rozpočet.
|
||||
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á.
|
||||
@@ -4891,6 +4898,8 @@ 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 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.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Od příštího spuštění kreslí desktopová verze tímto druhem grafického procesoru; Automaticky dává přednost tomu, který řídí displej. Webová verze ho nepoužívá.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. Od příštího spuštění okno zobrazuje snímky bez čekání na obnovení displeje, nejvýše 240 za sekundu; vypnuto, tempo určuje displej. Režim zobrazení nastavený při spuštění má přednost.
|
||||
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.
|
||||
@@ -5496,6 +5505,8 @@ liquify-list-end {0}, {1} {0} a {1}
|
||||
@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, 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
|
||||
@msg `{name}` is a built-in workspace; choose another name `{name}` je vestavěný pracovní prostor; zvolte jiný název
|
||||
@@ -10746,6 +10757,16 @@ 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
|
||||
Artistic Brushes Umělecké štětce
|
||||
Paint Malba
|
||||
Flat Sweep Plochý tah
|
||||
Dry Drag Suchý tah
|
||||
Loaded Stroke Sytý tah
|
||||
Fan Sweep Vějířový tah
|
||||
Engraving Rytina
|
||||
Fine Hatching Jemné šrafování
|
||||
Dense Hatching Husté šrafování
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3507,6 +3507,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
|
||||
@@ -7103,6 +7105,11 @@ axis Both Begge
|
||||
Image Billede
|
||||
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
|
||||
Medium Medium
|
||||
Name Navn
|
||||
None Ingen
|
||||
@@ -7313,9 +7320,9 @@ 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; 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.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Hvor mange instruktioner hver kørsel af et plug-ins objektfilter må bruge; Stor tillader flere end Normal med den samme grænse på 60 sekunder. Tunge filtre beholder deres eget budget.
|
||||
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.
|
||||
@@ -7334,6 +7341,8 @@ 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 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.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Fra næste start tegner desktopversionen med denne type grafikprocessor; Automatisk foretrækker den, der styrer skærmen. Webversionen bruger den ikke.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. Fra næste start viser vinduet billeder uden at vente på, at skærmen opdateres, højst 240 i sekundet; slået fra bestemmer skærmen tempoet. En visningstilstand angivet ved start har forrang.
|
||||
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.
|
||||
@@ -9107,6 +9116,8 @@ variable-list-end {0}, {1} {0} og {1}
|
||||
@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, 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
|
||||
@msg this system has no screen color sampler dette system har ingen skærmfarvesampler
|
||||
@@ -10808,6 +10819,16 @@ breakText Glyphs Glyffer
|
||||
@msg A joint does not close by {gap} pt. En samling lukker ikke med {gap} pt.
|
||||
@msg Two panels pass through each other. To paneler går gennem hinanden.
|
||||
@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
|
||||
Artistic Brushes Kunstneriske pensler
|
||||
Paint Maling
|
||||
Flat Sweep Fladt strøg
|
||||
Dry Drag Tørt træk
|
||||
Loaded Stroke Fyldigt strøg
|
||||
Fan Sweep Viftestrøg
|
||||
Engraving Gravering
|
||||
Fine Hatching Fin skravering
|
||||
Dense Hatching Tæt skravering
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -636,6 +636,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
|
||||
@@ -2038,6 +2040,11 @@ file-filter Templates Vorlagen
|
||||
Knife Messer
|
||||
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
|
||||
Lab Spot Colors: Lab-Volltonfarben:
|
||||
Lab Values Lab-Werte
|
||||
Landscape Querformat
|
||||
@@ -3340,9 +3347,10 @@ digits Malayalam Malayalam
|
||||
Edit type set in fonts that aren't available? Text in Schriften bearbeiten, die nicht verfügbar sind?
|
||||
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.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Wie viele Anweisungen jeder Lauf eines Objektfilters aus einem Plug-in verwenden darf; „Groß“ erlaubt mehr als „Normal“, bei derselben Grenze von 60 Sekunden. Aufwendige Filter behalten ihr eigenes Budget.
|
||||
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.
|
||||
@@ -3361,6 +3369,8 @@ 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 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.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Ab dem nächsten Start zeichnet die Desktop-Version mit dieser Art von Grafikprozessor; „Automatisch“ bevorzugt den, der den Bildschirm ansteuert. Die Webversion verwendet sie nicht.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. Ab dem nächsten Start zeigt das Fenster Bilder, ohne auf die Bildwiederholung des Bildschirms zu warten, höchstens 240 pro Sekunde; aus, gibt der Bildschirm den Takt vor. Ein beim Start festgelegter Darstellungsmodus hat Vorrang.
|
||||
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.
|
||||
@@ -3393,7 +3403,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.
|
||||
@@ -5072,6 +5081,8 @@ liquify-list-end {0}, {1} {0} und {1}
|
||||
@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, 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
|
||||
@msg `{name}` is a built-in workspace; choose another name `{name}` ist ein integrierter Arbeitsbereich; wählen Sie einen anderen Namen
|
||||
@@ -10387,6 +10398,16 @@ 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
|
||||
Artistic Brushes Künstlerische Pinsel
|
||||
Paint Farbe
|
||||
Flat Sweep Flacher Schwung
|
||||
Dry Drag Trockener Zug
|
||||
Loaded Stroke Satter Pinselstrich
|
||||
Fan Sweep Fächerschwung
|
||||
Engraving Gravur
|
||||
Fine Hatching Feine Schraffur
|
||||
Dense Hatching Dichte Schraffur
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -610,6 +610,8 @@ font-technology Variable Μεταβλητές
|
||||
Contextual Task Bar Γραμμή εργασιών βάσει περιβάλλοντος
|
||||
Pin Bar Position Σταθεροποίηση θέσης γραμμής
|
||||
Reset Bar Position Επαναφορά θέσης γραμμής
|
||||
Bar Actions Ενέργειες γραμμής
|
||||
Reset Bar Actions Επαναφορά ενεργειών γραμμής
|
||||
Resize Αλλαγή μεγέθους
|
||||
Contrast Αντίθεση
|
||||
Control Έλεγχος
|
||||
@@ -1933,6 +1935,11 @@ font-technology Variable Μεταβλητές
|
||||
Knife Μαχαίρι (Knife)
|
||||
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
|
||||
Lab Spot Colors: Πλακάτα χρώματα Lab:
|
||||
Lab Values Τιμές Lab
|
||||
Landscape Οριζόντιος προσανατολισμός
|
||||
@@ -4193,9 +4200,10 @@ 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; 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 εκατομμύρια εντολές επιπλέον εκείνων για την είσοδό του. Το χρονικό όριο μένει το ίδιο.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Πόσες εντολές μπορεί να χρησιμοποιεί κάθε εκτέλεση φίλτρου αντικειμένων επέκτασης· το Μεγάλο επιτρέπει περισσότερες από το Κανονική, με το ίδιο όριο 60 δευτερολέπτων. Τα βαριά φίλτρα κρατούν το δικό τους όριο.
|
||||
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 την αποθηκεύει, αλλά δεν χρησιμοποιεί ακόμη δίσκους προσωρινής αποθήκευσης.
|
||||
@@ -4214,6 +4222,8 @@ 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 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 καρέ το δευτερόλεπτο.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Από την επόμενη εκκίνηση, η έκδοση για υπολογιστή σχεδιάζει με αυτό το είδος επεξεργαστή γραφικών· το Αυτόματο προτιμά αυτόν που οδηγεί την οθόνη. Η έκδοση web δεν το χρησιμοποιεί.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. Από την επόμενη εκκίνηση, το παράθυρο δείχνει τα καρέ χωρίς αναμονή για ανανέωση της οθόνης, έως 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. Τα περισσότερα βήματα αναίρεσης που κρατά κάθε έγγραφο· μικρότερος αριθμός αφαιρεί τα παλαιότερα βήματα όταν κάνετε κλικ στο Εντάξει. Βήματα μπορεί να φύγουν και νωρίτερα αν πιάνουν πολλή μνήμη.
|
||||
@@ -4246,7 +4256,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. Οι προεπιλογές εφαρμόζονται όταν κάνετε κλικ στο Εντάξει στις Προτιμήσεις. Το Ακύρωση εκεί διατηρεί τις τρέχουσες προτιμήσεις σας.
|
||||
@@ -6983,6 +6992,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, 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 επιλέξτε φάκελο προορισμού
|
||||
@msg choose a source folder επιλέξτε φάκελο προέλευσης
|
||||
@@ -8895,6 +8906,16 @@ breakText Glyphs Γλύφοι
|
||||
@msg A joint does not close by {gap} pt. Μια ένωση δεν κλείνει κατά {gap} pt.
|
||||
@msg Two panels pass through each other. Δύο πάνελ διαπερνούν το ένα το άλλο.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" το composer πρέπει να είναι "singleLine", "everyLine", "standardSingleLine" ή "standardEveryLine"
|
||||
Orbit Lines Τροχιακές γραμμές
|
||||
Petal Garland Γιρλάντα πετάλων
|
||||
Lattice Braid Πλεξούδα πλέγματος
|
||||
Facet Sweep Πολυεδρική πινελιά
|
||||
Artistic Brushes Καλλιτεχνικά πινέλα
|
||||
Paint Ζωγραφική
|
||||
Flat Sweep Επίπεδη πινελιά
|
||||
Dry Drag Στεγνό σύρσιμο
|
||||
Loaded Stroke Γεμάτη πινελιά
|
||||
Fan Sweep Βεντάλια
|
||||
Engraving Χαρακτική
|
||||
Fine Hatching Λεπτή διαγράμμιση
|
||||
Dense Hatching Πυκνή διαγράμμιση
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -656,6 +656,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
|
||||
@@ -2037,6 +2039,11 @@ font-technology Variable Variables
|
||||
Knife Cuchilla
|
||||
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
|
||||
Lab Spot Colors: Tintas planas Lab:
|
||||
Lab Values Valores Lab
|
||||
Landscape Horizontal
|
||||
@@ -3377,9 +3384,10 @@ digits Malayalam Malayálam
|
||||
Edit type set in fonts that aren't available? ¿Editar el texto en fuentes que no están disponibles?
|
||||
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.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Cuántas instrucciones puede usar cada ejecución de un filtro de objetos de un plugin; Grande permite más que Normal con el mismo límite de 60 segundos. Los filtros pesados conservan su propio presupuesto.
|
||||
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.
|
||||
@@ -3398,6 +3406,8 @@ 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 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.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. A partir del próximo inicio, la versión de escritorio dibuja con este tipo de procesador gráfico; Automático prefiere el que controla la pantalla. La versión web no lo usa.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. A partir del próximo inicio, la ventana muestra los fotogramas sin esperar a que la pantalla se actualice, como máximo 240 por segundo; desactivado, la pantalla marca el ritmo. Un modo de presentación definido al iniciar tiene prioridad.
|
||||
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.
|
||||
@@ -3430,7 +3440,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.
|
||||
@@ -5184,6 +5193,8 @@ liquify-list-end {0}, {1} {0}, {1}
|
||||
@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, 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
|
||||
@msg `{name}` is a built-in workspace; choose another name `{name}` es un espacio de trabajo integrado; elige otro nombre
|
||||
@@ -10639,6 +10650,16 @@ breakText Glyphs Glifos
|
||||
@msg A joint does not close by {gap} pt. Una unión no cierra por {gap} pt.
|
||||
@msg Two panels pass through each other. Dos paneles se atraviesan entre sí.
|
||||
@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
|
||||
Artistic Brushes Pinceles artísticos
|
||||
Paint Pintura
|
||||
Flat Sweep Barrido plano
|
||||
Dry Drag Arrastre seco
|
||||
Loaded Stroke Trazo cargado
|
||||
Fan Sweep Barrido en abanico
|
||||
Engraving Grabado
|
||||
Fine Hatching Rayado fino
|
||||
Dense Hatching Rayado denso
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -795,6 +795,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
|
||||
@@ -4568,6 +4570,11 @@ axis Both Molemmat
|
||||
Image Kuva
|
||||
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
|
||||
Medium Keskitaso
|
||||
Name Nimi
|
||||
None Ei mitään
|
||||
@@ -4780,9 +4787,10 @@ font-technology Variable Muuttuvat
|
||||
Edit type set in fonts that aren't available? Muokataanko tekstiä, jonka fontit eivät ole käytettävissä?
|
||||
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.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Kuinka monta käskyä laajennuksen objektisuotimen kukin suorituskerta saa käyttää; Suuri sallii enemmän kuin Normaali samalla 60 sekunnin rajalla. Raskaat suotimet säilyttävät oman budjettinsa.
|
||||
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ä.
|
||||
@@ -4801,6 +4809,8 @@ 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 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.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Seuraavasta käynnistyksestä alkaen työpöytäversio piirtää tämän tyyppisellä grafiikkasuorittimella; Automaattinen suosii näyttöä ohjaavaa. Verkkoversio ei käytä sitä.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. Seuraavasta käynnistyksestä alkaen ikkuna näyttää kuvat odottamatta näytön virkistystä, enintään 240 sekunnissa; pois päältä näyttö tahdittaa ne. Käynnistettäessä asetettu esitystila ohittaa sen.
|
||||
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.
|
||||
@@ -4833,7 +4843,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.
|
||||
@@ -6988,6 +6997,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, 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
|
||||
@msg choose a source folder valitse lähdekansio
|
||||
@@ -8978,6 +8989,16 @@ breakText Glyphs Merkit
|
||||
@msg A joint does not close by {gap} pt. Liitos ei sulkeudu, rako {gap} pt.
|
||||
@msg Two panels pass through each other. Kaksi paneelia kulkee toistensa läpi.
|
||||
@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
|
||||
Artistic Brushes Taidesiveltimet
|
||||
Paint Maalaus
|
||||
Flat Sweep Tasainen veto
|
||||
Dry Drag Kuiva veto
|
||||
Loaded Stroke Runsas siveltimenveto
|
||||
Fan Sweep Viuhkaveto
|
||||
Engraving Kaiverrus
|
||||
Fine Hatching Hieno viivoitus
|
||||
Dense Hatching Tiheä viivoitus
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -657,6 +657,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
|
||||
@@ -2027,6 +2029,11 @@ font-technology Variable Variables
|
||||
Knife Cutter
|
||||
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
|
||||
Lab Spot Colors: Tons directs Lab :
|
||||
Lab Values Valeurs Lab
|
||||
Landscape Paysage
|
||||
@@ -3365,9 +3372,10 @@ digits Malayalam Malayalam
|
||||
Edit type set in fonts that aren't available? Modifier le texte composé dans des polices non disponibles ?
|
||||
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.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Le nombre d’instructions que chaque exécution d’un filtre d’objets d’un module externe peut utiliser. Grand en autorise plus que Normal, avec la même limite de 60 secondes. Les filtres lourds gardent leur propre budget.
|
||||
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.
|
||||
@@ -3386,6 +3394,8 @@ 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 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.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. À partir du prochain démarrage, la version de bureau dessine avec ce type de processeur graphique. Automatique préfère celui qui pilote l’écran. La version web ne l’utilise pas.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. À partir du prochain démarrage, la fenêtre affiche les images sans attendre le rafraîchissement de l’écran, au plus 240 par seconde. Désactivé, l’écran les cadence. Un mode de présentation défini au lancement a la priorité.
|
||||
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.
|
||||
@@ -3418,7 +3428,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.
|
||||
@@ -5143,6 +5152,8 @@ liquify-list-end {0}, {1} {0} et {1}
|
||||
@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, 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
|
||||
@msg `{name}` is a built-in workspace; choose another name `{name}` est un espace de travail intégré ; choisissez un autre nom
|
||||
@@ -10709,6 +10720,16 @@ breakText Glyphs Glyphes
|
||||
@msg A joint does not close by {gap} pt. Un joint ne se ferme pas, avec un écart de {gap} pt.
|
||||
@msg Two panels pass through each other. Deux panneaux se traversent.
|
||||
@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
|
||||
Artistic Brushes Pinceaux artistiques
|
||||
Paint Peinture
|
||||
Flat Sweep Balayage plat
|
||||
Dry Drag Traînée sèche
|
||||
Loaded Stroke Trait chargé
|
||||
Fan Sweep Balayage en éventail
|
||||
Engraving Gravure
|
||||
Fine Hatching Hachures fines
|
||||
Dense Hatching Hachures denses
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2040,6 +2040,12 @@
|
||||
Knife નાઇફ
|
||||
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 જરૂરી છે
|
||||
Lightness લાઇટનેસ
|
||||
Lab Spot Colors: Lab સ્પોટ રંગો:
|
||||
Landscape લેન્ડસ્કેપ
|
||||
Language ભાષા
|
||||
@@ -3284,6 +3290,8 @@ arrowhead Feather પીંછું
|
||||
Reselect ફરી પસંદ કરો
|
||||
Reset રીસેટ કરો
|
||||
Reset Bar Position બાર સ્થિતિ રીસેટ કરો
|
||||
Bar Actions બાર ક્રિયાઓ
|
||||
Reset Bar Actions બાર ક્રિયાઓ રીસેટ કરો
|
||||
Reset Bounding Box બાઉન્ડિંગ બોક્સ રીસેટ કરો
|
||||
Rotate Bounding Box બાઉન્ડિંગ બોક્સ ફેરવો
|
||||
Rotate Bounding Box… બાઉન્ડિંગ બોક્સ ફેરવો…
|
||||
@@ -3443,9 +3451,9 @@ 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; 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 મિલિયન સૂચનાઓ ચલાવી શકે છે. સમય મર્યાદા એ જ રહે છે.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. પ્લગ-ઇનના ઑબ્જેક્ટ ફિલ્ટરનું દરેક રન કેટલી સૂચનાઓ વાપરી શકે; મોટું સામાન્ય કરતાં વધુ મંજૂરી આપે છે, 60 સેકન્ડની એ જ મર્યાદા સાથે. ભારે ફિલ્ટર પોતાનું બજેટ રાખે છે.
|
||||
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 તેને સાચવે છે, પરંતુ હજી સ્ક્રેચ ડિસ્કનો ઉપયોગ કરતું નથી.
|
||||
@@ -3464,6 +3472,8 @@ arrowhead Feather પીંછું
|
||||
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 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 ફ્રેમ.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. આગલી શરૂઆતથી, ડેસ્કટોપ સંસ્કરણ આ પ્રકારના ગ્રાફિક્સ પ્રોસેસરથી દોરે છે; સ્વચાલિત ડિસ્પ્લે ચલાવતા પ્રોસેસરને પસંદ કરે છે. વેબ સંસ્કરણ તેનો ઉપયોગ કરતું નથી.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. આગલી શરૂઆતથી, વિન્ડો ડિસ્પ્લે રિફ્રેશની રાહ જોયા વિના ફ્રેમ બતાવે છે, સેકન્ડમાં વધુમાં વધુ 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. દરેક દસ્તાવેજ રાખે તે પૂર્વવત્ પગલાંની મહત્તમ સંખ્યા; ઓછી સંખ્યા ઠીક પર ક્લિક કરો ત્યારે સૌથી જૂનાં પગલાં દૂર કરે છે. પગલાં વધુ મેમરી લે ત્યારે વહેલાં પણ દૂર થઈ શકે છે.
|
||||
@@ -5634,6 +5644,16 @@ 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 પાસાદાર રેખા
|
||||
Artistic Brushes કલાત્મક બ્રશ
|
||||
Paint રંગકામ
|
||||
Flat Sweep સપાટ લસરકો
|
||||
Dry Drag સૂકો ઘસારો
|
||||
Loaded Stroke ઘાટો પીંછીનો ઘસારો
|
||||
Fan Sweep પંખા જેવો લસરકો
|
||||
@msg `at` must be "start" or "end" `at` "start" અથવા "end" હોવું જોઈએ
|
||||
@msg give exactly one of `through` and `toward` `through` અને `toward` માંથી બરાબર એક આપો
|
||||
@msg no arc fits these points: two are the same or all three lie on one line આ પૉઇન્ટ્સમાં કોઈ આર્ક બેસતો નથી: બે એકસરખા છે અથવા ત્રણેય એક જ રેખા પર છે
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 72 and column 5.
|
@@ -3001,6 +3001,11 @@ arrowhead Feather पंख
|
||||
Knife चाकू
|
||||
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 होना चाहिए
|
||||
Lab Spot Colors लैब स्पॉट रंग
|
||||
Lab Spot Colors: लैब स्पॉट रंग:
|
||||
Lab Values लैब मूल्य
|
||||
@@ -4575,6 +4580,8 @@ arrowhead Feather पंख
|
||||
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… बाउंडिंग बॉक्स घुमाएँ…
|
||||
@@ -4760,9 +4767,9 @@ 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; 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 मिलियन निर्देश चला सकता है। समय सीमा वही रहती है।
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. प्लग-इन के ऑब्जेक्ट फ़िल्टर का हर रन कितने निर्देश इस्तेमाल कर सकता है; बड़ा सामान्य से अधिक की अनुमति देता है, 60 सेकंड की उसी सीमा के साथ। भारी फ़िल्टर अपना बजट रखते हैं।
|
||||
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 इसे सहेजता है, पर अभी स्क्रैच डिस्क का उपयोग नहीं करता।
|
||||
@@ -4781,6 +4788,8 @@ arrowhead Feather पंख
|
||||
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 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 फ़्रेम प्रति सेकंड।
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. अगली शुरुआत से, डेस्कटॉप संस्करण इस प्रकार के ग्राफ़िक्स प्रोसेसर से बनाता है; स्वचालित उस प्रोसेसर को प्राथमिकता देता है जो डिस्प्ले चलाता है। वेब संस्करण इसका उपयोग नहीं करता।
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. अगली शुरुआत से, विंडो डिस्प्ले रीफ़्रेश का इंतज़ार किए बिना फ़्रेम दिखाती है, एक सेकंड में अधिकतम 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. हर दस्तावेज़ अधिकतम जितने पूर्ववत चरण रखता है; कम संख्या ठीक है पर क्लिक करने पर सबसे पुराने चरण हटा देती है। ज़्यादा मेमोरी लेने पर चरण पहले भी हट सकते हैं।
|
||||
@@ -7064,6 +7073,8 @@ arrowhead Feather पंख
|
||||
@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, 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" होना चाहिए।
|
||||
@msg `name` is empty `name` खाली है
|
||||
@@ -10352,6 +10363,16 @@ 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 पहलूदार स्ट्रोक
|
||||
Artistic Brushes कलात्मक ब्रश
|
||||
Paint चित्रकारी
|
||||
Flat Sweep सपाट फेरा
|
||||
Dry Drag सूखा घिसाव
|
||||
Loaded Stroke गाढ़ा ब्रश स्ट्रोक
|
||||
Fan Sweep पंखे जैसा फेरा
|
||||
Engraving नक्काशी
|
||||
Fine Hatching बारीक रेखांकन
|
||||
Dense Hatching घना रेखांकन
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2521,6 +2521,11 @@ file-filter Templates Sablonok
|
||||
Knife Kés
|
||||
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
|
||||
Lab Spot Colors Lab-direktszínek
|
||||
Lab Spot Colors: Lab-direktszínek:
|
||||
Lab Values Lab-értékek
|
||||
@@ -3788,6 +3793,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…
|
||||
@@ -3969,9 +3976,9 @@ 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; 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.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Hány utasítást használhat egy bővítmény objektumszűrőjének egy-egy futása; a Nagy többet enged, mint a Normál, ugyanazzal a 60 másodperces korláttal. A nehéz szűrők megtartják saját keretüket.
|
||||
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.
|
||||
@@ -3990,6 +3997,8 @@ 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 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.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. A következő indítástól az asztali változat ilyen típusú grafikus processzorral rajzol; az Automatikus a kijelzőt meghajtót részesíti előnyben. A webes változat nem használja.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. A következő indítástól az ablak a képkockákat a kijelző frissítésére várás nélkül jeleníti meg, legfeljebb másodpercenként 240-et; kikapcsolva a kijelző diktálja az ütemet. Az indításkor megadott megjelenítési mód felülírja.
|
||||
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.
|
||||
@@ -5523,6 +5532,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, 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}`
|
||||
@msg `{name}` is a built-in workspace; choose another name beépített munkaterület: `{name}`; válassz másik nevet
|
||||
@@ -10735,6 +10746,16 @@ 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
|
||||
Artistic Brushes Művészi ecsetek
|
||||
Paint Festék
|
||||
Flat Sweep Lapos húzás
|
||||
Dry Drag Száraz húzás
|
||||
Loaded Stroke Telített ecsetvonás
|
||||
Fan Sweep Legyezővonás
|
||||
Engraving Metszet
|
||||
Fine Hatching Finom vonalkázás
|
||||
Dense Hatching Sűrű vonalkázás
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1384,6 +1384,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
|
||||
@@ -4969,6 +4971,11 @@ axis Both Keduanya
|
||||
Image Gambar
|
||||
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
|
||||
Medium Sedang
|
||||
Name Nama
|
||||
None Nihil
|
||||
@@ -5179,9 +5186,10 @@ font-technology Variable Variabel
|
||||
Edit type set in fonts that aren't available? Edit teks dengan font yang tidak tersedia?
|
||||
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.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Berapa banyak instruksi yang boleh dipakai setiap jalannya filter objek dari plug-in; Besar mengizinkan lebih banyak daripada Normal dengan batas 60 detik yang sama. Filter berat mempertahankan anggarannya sendiri.
|
||||
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.
|
||||
@@ -5200,6 +5208,8 @@ 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 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.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Mulai dari peluncuran berikutnya, versi desktop menggambar dengan jenis prosesor grafis ini; Otomatis mengutamakan yang menjalankan layar. Versi web tidak menggunakannya.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. Mulai dari peluncuran berikutnya, jendela menampilkan bingkai tanpa menunggu layar menyegarkan, paling banyak 240 per detik; jika nonaktif, layar mengatur lajunya. Mode presentasi yang diatur saat peluncuran menggantikannya.
|
||||
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.
|
||||
@@ -5232,7 +5242,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.
|
||||
@@ -6897,6 +6906,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, 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
|
||||
@msg this system has no screen color sampler sistem ini tidak memiliki pengambil warna layar
|
||||
@@ -8584,6 +8595,16 @@ breakText Glyphs Glif
|
||||
@msg A joint does not close by {gap} pt. Sebuah sambungan tidak menutup sejauh {gap} pt.
|
||||
@msg Two panels pass through each other. Dua panel saling menembus.
|
||||
@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
|
||||
Artistic Brushes Kuas Artistik
|
||||
Paint Cat
|
||||
Flat Sweep Sapuan Datar
|
||||
Dry Drag Tarikan Kering
|
||||
Loaded Stroke Sapuan Tebal
|
||||
Fan Sweep Sapuan Kipas
|
||||
@msg `at` must be "start" or "end" `at` harus "start" atau "end"
|
||||
@msg give exactly one of `through` and `toward` berikan tepat satu dari `through` dan `toward`
|
||||
@msg no arc fits these points: two are the same or all three lie on one line tidak ada busur yang cocok dengan titik-titik ini: dua titik sama atau ketiganya segaris
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -658,6 +658,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
|
||||
@@ -2078,6 +2080,11 @@ file-filter Templates Modelli
|
||||
Knife Coltello
|
||||
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
|
||||
Lab Spot Colors: Colori spot Lab:
|
||||
Lab Values Valori Lab
|
||||
Landscape Orizzontale
|
||||
@@ -3425,9 +3432,10 @@ digits Malayalam Malayalam
|
||||
Edit type set in fonts that aren't available? Modificare il testo in font non disponibili?
|
||||
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.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Quante istruzioni può usare ogni esecuzione di un filtro di oggetti di un plug-in; Grande ne consente più di Normale con lo stesso limite di 60 secondi. I filtri pesanti mantengono il proprio budget.
|
||||
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.
|
||||
@@ -3446,6 +3454,8 @@ 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 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.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Dal prossimo avvio, la versione desktop disegna con questo tipo di processore grafico; Automatico preferisce quello che gestisce lo schermo. La versione web non lo usa.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. Dal prossimo avvio, la finestra mostra i fotogrammi senza attendere l'aggiornamento dello schermo, al massimo 240 al secondo; disattivato, è lo schermo a scandirli. Una modalità di presentazione impostata all'avvio ha la precedenza.
|
||||
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.
|
||||
@@ -3478,7 +3488,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.
|
||||
@@ -5210,6 +5219,8 @@ liquify-list-end {0}, {1} {0} e {1}
|
||||
@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, 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
|
||||
@msg `{name}` is a built-in workspace; choose another name `{name}` è un'area di lavoro integrata; scegli un altro nome
|
||||
@@ -10421,6 +10432,16 @@ 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
|
||||
Artistic Brushes Pennelli artistici
|
||||
Paint Pittura
|
||||
Flat Sweep Passata piatta
|
||||
Dry Drag Trascinamento secco
|
||||
Loaded Stroke Tratto carico
|
||||
Fan Sweep Passata a ventaglio
|
||||
Engraving Incisione
|
||||
Fine Hatching Tratteggio fine
|
||||
Dense Hatching Tratteggio fitto
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -846,6 +846,8 @@ digits Malayalam マラヤーラム数字
|
||||
Contextual Task Bar コンテキストタスクバー
|
||||
Pin Bar Position バーの位置を固定
|
||||
Reset Bar Position バーの位置をリセット
|
||||
Bar Actions バーのアクション
|
||||
Reset Bar Actions バーのアクションをリセット
|
||||
Resize サイズを変更
|
||||
Tools ツール
|
||||
Toolbars ツールバー
|
||||
@@ -3398,9 +3400,9 @@ 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; 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 万命令を実行できます。時間の制限は変わりません。
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. プラグインのオブジェクトフィルターを 1 回実行するときに使える命令の数です。大では通常より多く使え、60 秒の制限は変わりません。重いフィルターは独自の予算を保ちます。
|
||||
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 は保存しますが、仮想記憶ディスクはまだ使用しません。
|
||||
@@ -3419,6 +3421,8 @@ 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 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 フレームです。
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. 次回の起動から、デスクトップ版はこの種類のグラフィックプロセッサーで描画します。自動ではディスプレイを駆動しているものが優先されます。Web 版では使われません。
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. 次回の起動から、ウィンドウはディスプレイの更新を待たずにフレームを表示します。上限は毎秒 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 をクリックしたときに古いステップから削除されます。メモリを使いすぎる場合は、さらに早く削除されることがあります。
|
||||
@@ -4416,6 +4420,11 @@ file-filter Templates テンプレート
|
||||
Keep the pasted color as a new swatch with a numbered name. ペーストしたカラーを、番号付きの名前で新規スウォッチとして残します。
|
||||
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 が必要です
|
||||
Lab Values Lab 値
|
||||
Large List View 大きいリスト表示
|
||||
Large Thumbnail View 大きいサムネール表示
|
||||
@@ -5640,6 +5649,8 @@ variable-list-end {0}, {1} {0}、{1}
|
||||
@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, 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 にすることはできません
|
||||
@msg `select` must be true or false `select` には true または false を指定してください
|
||||
@@ -10484,6 +10495,16 @@ 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 多面体のストローク
|
||||
Artistic Brushes アートブラシ
|
||||
Paint ペイント
|
||||
Flat Sweep 平筆の一掃き
|
||||
Dry Drag ドライドラッグ
|
||||
Loaded Stroke 厚塗りストローク
|
||||
Fan Sweep 扇形の一掃き
|
||||
Engraving 彫刻
|
||||
Fine Hatching 細いハッチング
|
||||
Dense Hatching 密なハッチング
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2920,6 +2920,8 @@
|
||||
Contextual Task Bar კონტექსტური ამოცანების ზოლი
|
||||
Pin Bar Position ზოლის პოზიციის ჩამაგრება
|
||||
Reset Bar Position ზოლის პოზიციის ჩამოყრა
|
||||
Bar Actions ზოლის მოქმედებები
|
||||
Reset Bar Actions ზოლის მოქმედებების ჩამოყრა
|
||||
Tools ხელსაწყოები
|
||||
Toolbars ხელსაწყოთა ზოლები
|
||||
Advanced დამატებითი
|
||||
@@ -6363,6 +6365,11 @@ axis Both ორივე
|
||||
Image გამოსახულება
|
||||
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 სჭირდება
|
||||
Medium საშუალო
|
||||
Name სახელი
|
||||
None არცერთი
|
||||
@@ -6572,9 +6579,10 @@ font-technology Variable ცვლადი
|
||||
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; 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 მილიონი ინსტრუქცია მისი შეყვანისთვის საჭირო ინსტრუქციების გარდა. დროის ლიმიტი იგივე რჩება.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. რამდენი ინსტრუქციის გამოყენება შეუძლია პლაგინის ობიექტების ფილტრის თითოეულ გაშვებას; დიდი ჩვეულებრივზე მეტს უშვებს, იმავე 60-წამიანი ლიმიტით. მძიმე ფილტრები საკუთარ ბიუჯეტს ინარჩუნებენ.
|
||||
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 მას ინახავს, მაგრამ სამუშაო დისკებს ჯერ არ იყენებს.
|
||||
@@ -6593,6 +6601,8 @@ 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 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 კადრისა.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. შემდეგი გაშვებიდან დესკტოპის ვერსია ხატავს ამ ტიპის გრაფიკული პროცესორით; ავტომატური უპირატესობას ანიჭებს ეკრანის მმართველს. ვებ-ვერსია მას არ იყენებს.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. შემდეგი გაშვებიდან ფანჯარა აჩვენებს კადრებს ეკრანის განახლების მოლოდინის გარეშე, წამში არაუმეტეს 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-ზე დაწკაპუნებისას შლის უძველეს ნაბიჯებს. ნაბიჯები შეიძლება ადრეც წაიშალოს, თუ ბევრ მეხსიერებას იკავებს.
|
||||
@@ -6625,7 +6635,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-ს დააჭერთ. იქ გაუქმება ინარჩუნებს თქვენს მიმდინარე პარამეტრებს.
|
||||
@@ -8774,6 +8783,8 @@ liquify-list-end {0}, {1} {0} და {1}
|
||||
@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, 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.
|
||||
Intertwine გადახლართვა
|
||||
@@ -11032,6 +11043,16 @@ font-script Japanese იაპონური
|
||||
@msg A joint does not close by {gap} pt. შეერთება არ იხურება {gap} pt-ით.
|
||||
@msg Two panels pass through each other. ორი პანელი ერთმანეთში გადის.
|
||||
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer უნდა იყოს "singleLine", "everyLine", "standardSingleLine" ან "standardEveryLine"
|
||||
Orbit Lines ორბიტული ხაზები
|
||||
Petal Garland ფურცლების გირლანდა
|
||||
Lattice Braid ბადის ნაწნავი
|
||||
Facet Sweep წახნაგოვანი მონასმი
|
||||
Artistic Brushes მხატვრული ფუნჯები
|
||||
Paint საღებავი
|
||||
Flat Sweep ბრტყელი მოსმა
|
||||
Dry Drag მშრალი მოსმა
|
||||
Loaded Stroke სქელი მონასმი
|
||||
Fan Sweep მარაოსებრი მოსმა
|
||||
Engraving გრავიურა
|
||||
Fine Hatching წვრილი შტრიხები
|
||||
Dense Hatching მჭიდრო შტრიხები
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -839,6 +839,8 @@ digits Malayalam 말라얄람어
|
||||
Contextual Task Bar 상황별 작업 표시줄
|
||||
Pin Bar Position 표시줄 위치 고정
|
||||
Reset Bar Position 표시줄 위치 재설정
|
||||
Bar Actions 표시줄 동작
|
||||
Reset Bar Actions 표시줄 동작 재설정
|
||||
Resize 크기 조절
|
||||
Tools 도구
|
||||
Toolbars 도구 모음
|
||||
@@ -3387,9 +3389,10 @@ 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; 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천만 개의 명령어를 실행할 수 있습니다. 시간 제한은 그대로입니다.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. 플러그인의 개체 필터를 한 번 실행할 때 쓸 수 있는 명령어 수입니다. 크게는 표준보다 많이 허용하며 60초 제한은 같습니다. 무거운 필터는 자체 예산을 유지합니다.
|
||||
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는 이 값을 저장하지만 아직 스크래치 디스크를 사용하지 않습니다.
|
||||
@@ -3408,6 +3411,8 @@ 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 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프레임입니다.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. 다음 시작부터 데스크톱 버전은 이 종류의 그래픽 프로세서로 그립니다. 자동은 디스플레이를 구동하는 프로세서를 우선합니다. 웹 버전은 사용하지 않습니다.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. 다음 시작부터 창은 디스플레이 새로 고침을 기다리지 않고 프레임을 표시하며, 초당 최대 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. 각 문서가 보관하는 실행 취소 단계의 최대 수입니다. 낮추면 확인을 클릭할 때 가장 오래된 단계가 삭제됩니다. 메모리를 너무 많이 쓰면 단계가 더 일찍 삭제될 수도 있습니다.
|
||||
@@ -3440,7 +3445,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. 기본값은 환경 설정에서 확인을 클릭하면 적용됩니다. 그곳에서 취소를 누르면 현재 환경 설정이 유지됩니다.
|
||||
@@ -4406,6 +4410,11 @@ file-filter Templates 템플릿
|
||||
Keep the pasted color as a new swatch with a numbered name. 붙여넣은 색상을 번호가 붙은 이름의 새 견본으로 보관합니다.
|
||||
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여야 합니다
|
||||
Lab Values Lab 값
|
||||
Large List View 큰 목록 보기
|
||||
Large Thumbnail View 큰 축소판 보기
|
||||
@@ -5569,6 +5578,8 @@ variable-list-end {0}, {1} {0} 및 {1}
|
||||
@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, 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로 지정할 수 없습니다
|
||||
@msg `select` must be true or false `select`은(는) true 또는 false여야 합니다
|
||||
@@ -10384,6 +10395,16 @@ 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 면 분할 붓질
|
||||
Artistic Brushes 예술 브러시
|
||||
Paint 페인트
|
||||
Flat Sweep 평평한 붓질
|
||||
Dry Drag 마른 붓질
|
||||
Loaded Stroke 두터운 붓질
|
||||
Fan Sweep 부채꼴 붓질
|
||||
Engraving 판화
|
||||
Fine Hatching 가는 해칭
|
||||
Dense Hatching 촘촘한 해칭
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1376,6 +1376,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
|
||||
@@ -4974,6 +4976,11 @@ axis Both Beide
|
||||
Image Afbeelding
|
||||
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
|
||||
Medium Gemiddeld
|
||||
Name Naam
|
||||
None Geen
|
||||
@@ -5184,9 +5191,10 @@ font-technology Variable Variabel
|
||||
Edit type set in fonts that aren't available? Tekst in lettertypen bewerken die niet beschikbaar zijn?
|
||||
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.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Hoeveel instructies elke uitvoering van een objectfilter uit een plug-in mag gebruiken; Groot staat er meer toe dan Normaal, met dezelfde limiet van 60 seconden. Zware filters houden hun eigen budget.
|
||||
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.
|
||||
@@ -5205,6 +5213,8 @@ 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 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.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Vanaf de volgende start tekent de desktopversie met dit soort grafische processor; Automatisch kiest bij voorkeur de processor die het beeldscherm aanstuurt. De webversie gebruikt het niet.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. Vanaf de volgende start toont het venster beelden zonder op de verversing van het beeldscherm te wachten, hoogstens 240 per seconde; uit bepaalt het beeldscherm het tempo. Een presentatiemodus die bij het starten is ingesteld, gaat voor.
|
||||
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.
|
||||
@@ -5237,7 +5247,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.
|
||||
@@ -8890,6 +8899,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, 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
|
||||
@msg this system has no screen color sampler dit systeem heeft geen schermkleurkiezer
|
||||
@@ -10785,6 +10796,16 @@ 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
|
||||
Artistic Brushes Artistieke penselen
|
||||
Paint Verf
|
||||
Flat Sweep Vlakke streek
|
||||
Dry Drag Droge sleep
|
||||
Loaded Stroke Dikke verfstreek
|
||||
Fan Sweep Waaierstreek
|
||||
Engraving Gravure
|
||||
Fine Hatching Fijne arcering
|
||||
Dense Hatching Dichte arcering
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -758,6 +758,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
|
||||
@@ -4501,6 +4503,11 @@ axis Both Obie
|
||||
Image Obraz
|
||||
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
|
||||
Medium Średni
|
||||
Name Nazwa
|
||||
None Brak
|
||||
@@ -4716,6 +4723,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.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Ile instrukcji może zużyć każde uruchomienie filtra obiektów z wtyczki; Duże pozwala na więcej niż Normalny przy tym samym limicie 60 sekund. Ciężkie filtry zachowują własny budżet.
|
||||
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.
|
||||
@@ -4735,14 +4743,16 @@ 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 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ę.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. Od następnego uruchomienia okno pokazuje klatki bez czekania na odświeżenie ekranu, najwyżej 240 na sekundę; po wyłączeniu tempo wyznacza ekran. Tryb prezentacji ustawiony przy uruchomieniu ma pierwszeństwo.
|
||||
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.
|
||||
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 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ą.
|
||||
@@ -5313,6 +5323,8 @@ liquify-list-end {0}, {1} {0} i {1}
|
||||
@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, 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
|
||||
@msg `{name}` is a built-in workspace; choose another name `{name}` to wbudowany obszar roboczy; wybierz inną nazwę
|
||||
@@ -10609,6 +10621,16 @@ 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
|
||||
Artistic Brushes Pędzle artystyczne
|
||||
Paint Farba
|
||||
Flat Sweep Płaskie pociągnięcie
|
||||
Dry Drag Suche przeciągnięcie
|
||||
Loaded Stroke Grube pociągnięcie
|
||||
Fan Sweep Wachlarzowy ślad
|
||||
Engraving Grawerowanie
|
||||
Fine Hatching Drobne kreskowanie
|
||||
Dense Hatching Gęste kreskowanie
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -601,6 +601,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
|
||||
@@ -2841,9 +2843,10 @@ digits Malayalam Malaiala
|
||||
Edit type set in fonts that aren't available? Editar o texto em fontes que não estão disponíveis?
|
||||
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.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Quantas instruções cada execução de um filtro de objetos de um plug-in pode usar; Grande permite mais que Normal com o mesmo limite de 60 segundos. Filtros pesados mantêm seu próprio orçamento.
|
||||
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.
|
||||
@@ -2862,6 +2865,8 @@ 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 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.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. A partir da próxima inicialização, a versão para desktop desenha com este tipo de processador gráfico; Automático prefere o que controla a tela. A versão web não o usa.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. A partir da próxima inicialização, a janela mostra os quadros sem esperar a tela atualizar, no máximo 240 por segundo; desativado, a tela dita o ritmo. Um modo de apresentação definido na inicialização tem prioridade.
|
||||
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.
|
||||
@@ -2894,7 +2899,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.
|
||||
@@ -5718,6 +5722,11 @@ variable-list-end {0}, {1} {0} e {1}
|
||||
@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
|
||||
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
|
||||
Lab Values Valores Lab
|
||||
Large List View Exibição em Lista Grande
|
||||
Large Thumbnail View Exibição em Miniaturas Grandes
|
||||
@@ -6929,6 +6938,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, 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
|
||||
|
||||
# User Interface › Accent Color
|
||||
@@ -10818,6 +10829,16 @@ 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
|
||||
Artistic Brushes Pincéis artísticos
|
||||
Paint Pintura
|
||||
Flat Sweep Pincelada plana
|
||||
Dry Drag Arrasto seco
|
||||
Loaded Stroke Traço carregado
|
||||
Fan Sweep Pincelada em leque
|
||||
Engraving Gravura
|
||||
Fine Hatching Hachuras finas
|
||||
Dense Hatching Hachuras densas
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -654,6 +654,8 @@ font-technology Variable Вариативные
|
||||
Contextual Task Bar Контекстная панель задач
|
||||
Pin Bar Position Закрепить положение панели
|
||||
Reset Bar Position Сбросить положение панели
|
||||
Bar Actions Действия панели
|
||||
Reset Bar Actions Сбросить действия панели
|
||||
Resize Изменить размер
|
||||
Contrast Контраст
|
||||
Control Control
|
||||
@@ -2064,6 +2066,11 @@ file-filter Templates Шаблоны
|
||||
Knife Нож
|
||||
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
|
||||
Lab Spot Colors: Плашечные цвета Lab:
|
||||
Lab Values Значения Lab
|
||||
Landscape Альбомная
|
||||
@@ -3408,9 +3415,9 @@ 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; 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 миллионов инструкций сверх тех, что нужны для её входных данных. Ограничение по времени не меняется.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Сколько инструкций может использовать каждый запуск фильтра объектов из модуля; «Большой» разрешает больше, чем «Обычный», при том же ограничении в 60 секунд. Тяжёлые фильтры сохраняют свой бюджет.
|
||||
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 сохраняет его, но пока не использует рабочие диски.
|
||||
@@ -3429,6 +3436,8 @@ 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 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 кадров в секунду.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Со следующего запуска настольная версия рисует этим типом графического процессора; «Автоматически» предпочитает тот, что управляет дисплеем. Веб-версия его не использует.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. Со следующего запуска окно показывает кадры, не дожидаясь обновления дисплея, не более 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. Наибольшее число шагов отмены, которое хранит каждый документ; меньшее число удаляет самые старые шаги при нажатии ОК. Шаги могут уйти и раньше, если занимают слишком много памяти.
|
||||
@@ -5206,6 +5215,8 @@ liquify-list-end {0}, {1} {0} и {1}
|
||||
@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, 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}` не имеет параметров
|
||||
@msg `{name}` is a built-in workspace; choose another name `{name}` — встроенная рабочая среда; выберите другое имя
|
||||
@@ -10802,6 +10813,16 @@ shape Open Открытый
|
||||
@msg Two panels pass through each other. Две панели проходят друг сквозь друга.
|
||||
@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 Гранёный мазок
|
||||
Artistic Brushes Художественные кисти
|
||||
Paint Краска
|
||||
Flat Sweep Плоский мазок
|
||||
Dry Drag Сухой протяг
|
||||
Loaded Stroke Густой мазок
|
||||
Fan Sweep Веерный мазок
|
||||
Engraving Гравировка
|
||||
Fine Hatching Тонкая штриховка
|
||||
Dense Hatching Плотная штриховка
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -639,6 +639,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
|
||||
@@ -1980,6 +1982,11 @@ font-technology Variable Variabla
|
||||
Knife Kniv
|
||||
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
|
||||
Lab Spot Colors: Lab-dekorfärger:
|
||||
Lab Values Lab-värden
|
||||
Landscape Liggande
|
||||
@@ -3297,9 +3304,10 @@ digits Malayalam Malayalam
|
||||
Edit type set in fonts that aren't available? Redigera text i typsnitt som inte är tillgängliga?
|
||||
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.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Hur många instruktioner varje körning av ett objektfilter från ett plugin får använda; Stor tillåter fler än Normal med samma gräns på 60 sekunder. Tunga filter behåller sin egen budget.
|
||||
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.
|
||||
@@ -3318,6 +3326,8 @@ 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 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.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Från nästa start ritar skrivbordsversionen med den här typen av grafikprocessor; Automatisk föredrar den som driver skärmen. Webbversionen använder den inte.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. Från nästa start visar fönstret bildrutor utan att vänta på att skärmen uppdateras, högst 240 per sekund; avstängt styr skärmen takten. Ett presentationsläge som anges vid start går före.
|
||||
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.
|
||||
@@ -3350,7 +3360,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.
|
||||
@@ -6969,6 +6978,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, 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
|
||||
@msg choose a source folder välj en källmapp
|
||||
@@ -10839,6 +10850,16 @@ digits Hindi Hindi
|
||||
@msg A joint does not close by {gap} pt. En fog sluter inte med {gap} pt.
|
||||
@msg Two panels pass through each other. Två paneler går igenom varandra.
|
||||
@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
|
||||
Artistic Brushes Konstnärliga penslar
|
||||
Paint Färg
|
||||
Flat Sweep Platt penseldrag
|
||||
Dry Drag Torrt drag
|
||||
Loaded Stroke Fylligt penseldrag
|
||||
Fan Sweep Solfjädersdrag
|
||||
Engraving Gravyr
|
||||
Fine Hatching Fin skraffering
|
||||
Dense Hatching Tät skraffering
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -636,6 +636,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
|
||||
@@ -1859,6 +1861,11 @@ font-technology Variable Değişken
|
||||
Knife Bıçak
|
||||
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
|
||||
Lab Spot Colors: Laboratuvar Spot Renkleri:
|
||||
Lab Values Laboratuvar Değerleri
|
||||
Landscape Manzara
|
||||
@@ -3142,9 +3149,10 @@ digits Malayalam Malayalam
|
||||
Edit type set in fonts that aren't available? Mevcut olmayan yazı tiplerindeki metin düzenlensin mi?
|
||||
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.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Bir eklentinin nesne filtresinin her çalıştırmasının kullanabileceği talimat sayısı; Büyük, aynı 60 saniyelik sınırla Normal'den fazlasına izin verir. Ağır filtreler kendi bütçelerini korur.
|
||||
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.
|
||||
@@ -3163,6 +3171,8 @@ 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 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.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Bir sonraki başlatmadan itibaren masaüstü sürümü bu tür grafik işlemciyle çizer; Otomatik, ekranı süren işlemciyi tercih eder. Web sürümü bunu kullanmaz.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. Bir sonraki başlatmadan itibaren pencere, ekranın yenilenmesini beklemeden kareleri gösterir, saniyede en fazla 240; kapalıyken hızı ekran belirler. Başlatırken ayarlanan bir sunum modu önceliklidir.
|
||||
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.
|
||||
@@ -3195,7 +3205,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.
|
||||
@@ -4911,6 +4920,8 @@ liquify-list-end {0}, {1} {0} ve {1}
|
||||
@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, 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
|
||||
@msg `{name}` is a built-in workspace; choose another name `{name}` yerleşik bir çalışma alanıdır; başka bir isim seç
|
||||
@@ -10704,6 +10715,16 @@ 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
|
||||
Artistic Brushes Sanatsal Fırçalar
|
||||
Paint Boya
|
||||
Flat Sweep Düz fırça izi
|
||||
Dry Drag Kuru sürükleme
|
||||
Loaded Stroke Yoğun fırça izi
|
||||
Fan Sweep Yelpaze izi
|
||||
Engraving Gravür
|
||||
Fine Hatching İnce tarama
|
||||
Dense Hatching Yoğun tarama
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -652,6 +652,8 @@ font-technology Variable Варіативні
|
||||
Contextual Task Bar Контекстна панель завдань
|
||||
Pin Bar Position Закріпити положення панелі
|
||||
Reset Bar Position Скинути положення панелі
|
||||
Bar Actions Дії панелі
|
||||
Reset Bar Actions Скинути дії панелі
|
||||
Resize Змінити розмір
|
||||
Contrast Контраст
|
||||
Control Панель керування
|
||||
@@ -2072,6 +2074,11 @@ file-filter Templates Шаблони
|
||||
Knife Ніж
|
||||
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
|
||||
Lab Spot Colors: Плашкові кольори Lab:
|
||||
Lab Values Значення Lab
|
||||
Landscape Альбомна
|
||||
@@ -3417,9 +3424,9 @@ 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; 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 мільйонів інструкцій понад ті, що потрібні для її вхідних даних. Обмеження часу не змінюється.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Скільки інструкцій може використати кожен запуск фільтра об’єктів із модуля; «Великий» дозволяє більше, ніж «Звичайний», з тим самим обмеженням у 60 секунд. Важкі фільтри зберігають власний бюджет.
|
||||
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 зберігає його, але поки не використовує робочі диски.
|
||||
@@ -3438,6 +3445,8 @@ 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 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 кадрів на секунду.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. З наступного запуску настільна версія малює цим типом графічного процесора; «Автоматично» надає перевагу тому, що керує дисплеєм. Веб-версія його не використовує.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. З наступного запуску вікно показує кадри, не чекаючи оновлення дисплея, не більше 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. Найбільша кількість кроків скасування, яку зберігає кожен документ; менше число видаляє найстаріші кроки, коли ви натискаєте ОК. Кроки можуть зникнути й раніше, якщо займають надто багато пам’яті.
|
||||
@@ -5194,6 +5203,8 @@ liquify-list-end {0}, {1} {0} і {1}
|
||||
@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, 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}` не має параметрів
|
||||
@msg `{name}` is a built-in workspace; choose another name `{name}` - вбудоване робоче середовище; виберіть інше ім’я
|
||||
@@ -10397,6 +10408,16 @@ 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 Гранований мазок
|
||||
Artistic Brushes Художні пензлі
|
||||
Paint Фарба
|
||||
Flat Sweep Плоский мазок
|
||||
Dry Drag Сухий протяг
|
||||
Loaded Stroke Густий мазок
|
||||
Fan Sweep Віяловий мазок
|
||||
Engraving Гравіювання
|
||||
Fine Hatching Тонке штрихування
|
||||
Dense Hatching Щільне штрихування
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2372,6 +2372,11 @@ digits Hindi Hindi
|
||||
Knife Dao
|
||||
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
|
||||
Lab Spot Colors: Màu đặc Lab:
|
||||
Lab Values Giá trị Lab
|
||||
Landscape Ngang
|
||||
@@ -3566,6 +3571,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…
|
||||
@@ -3741,9 +3748,9 @@ 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; 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.
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. Số lệnh mà mỗi lần chạy bộ lọc đối tượng của plug-in được dùng; Lớn cho phép nhiều hơn Thường với cùng giới hạn 60 giây. Bộ lọc nặng giữ ngân sách riêng.
|
||||
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.
|
||||
@@ -3762,6 +3769,8 @@ 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 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.
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. Từ lần khởi động tới, phiên bản máy tính vẽ bằng loại bộ xử lý đồ họa này; Tự động ưu tiên bộ xử lý điều khiển màn hình. Phiên bản web không dùng nó.
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. Từ lần khởi động tới, cửa sổ hiển thị khung hình mà không chờ màn hình làm mới, tối đa 240 mỗi giây; khi tắt, màn hình quyết định nhịp. Chế độ trình chiếu đặt khi khởi động sẽ được ưu tiên.
|
||||
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ớ.
|
||||
@@ -5192,6 +5201,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, 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
|
||||
@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
|
||||
@@ -8594,6 +8605,16 @@ 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
|
||||
Artistic Brushes Cọ nghệ thuật
|
||||
Paint Sơn
|
||||
Flat Sweep Nét quét phẳng
|
||||
Dry Drag Nét kéo khô
|
||||
Loaded Stroke Nét cọ đậm
|
||||
Fan Sweep Nét quét hình quạt
|
||||
Engraving Khắc nét
|
||||
Fine Hatching Nét gạch mảnh
|
||||
Dense Hatching Nét gạch dày
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -603,6 +603,8 @@ antiAlias Sharp 锐利
|
||||
Contextual Task Bar 上下文任务栏
|
||||
Pin Bar Position 固定任务栏位置
|
||||
Reset Bar Position 重置任务栏位置
|
||||
Bar Actions 任务栏操作
|
||||
Reset Bar Actions 重置任务栏操作
|
||||
Resize 调整大小
|
||||
Contrast 对比
|
||||
Control 控制栏
|
||||
@@ -1954,6 +1956,11 @@ file-filter Templates 模板
|
||||
Knife 刻刀
|
||||
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 工作空间
|
||||
Lab Spot Colors: Lab 专色:
|
||||
Lab Values Lab 值
|
||||
Landscape 横向
|
||||
@@ -3267,9 +3274,9 @@ 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; 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 亿条指令。时间限制不变。
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. 增效工具的对象滤镜每次运行可使用的指令数;“大”比“正常”允许更多,60 秒的时间限制不变。重型滤镜保留自己的预算。
|
||||
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 会存储它,但尚未使用暂存盘。
|
||||
@@ -3288,6 +3295,8 @@ 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 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 帧。
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. 从下次启动起,桌面版使用这类图形处理器绘制;“自动”优先使用驱动显示器的图形处理器。Web 版不使用此项。
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. 从下次启动起,窗口不等待显示器刷新就显示帧,每秒最多 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. 每个文档保留的最大撤销步骤数;调低后,单击“确定”时会删除最早的步骤。步骤占用过多内存时也可能更早被删除。
|
||||
@@ -5309,6 +5318,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, 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
|
||||
@msg `select` must be true or false `select` 必须是 true 或 false
|
||||
@@ -10589,6 +10600,16 @@ breakText Glyphs 字形
|
||||
@msg A joint does not close by {gap} pt. 有一处接缝相差 {gap} pt 未闭合。
|
||||
@msg Two panels pass through each other. 两个面板相互穿插。
|
||||
@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 切面笔触
|
||||
Artistic Brushes 艺术画笔
|
||||
Paint 绘画
|
||||
Flat Sweep 平刷
|
||||
Dry Drag 干拖
|
||||
Loaded Stroke 厚涂笔触
|
||||
Fan Sweep 扇形笔触
|
||||
Engraving 雕刻
|
||||
Fine Hatching 细线排线
|
||||
Dense Hatching 密集排线
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -620,6 +620,8 @@ font-technology Variable 可變
|
||||
Contextual Task Bar 快捷工作列
|
||||
Pin Bar Position 釘選工作列位置
|
||||
Reset Bar Position 重設工作列位置
|
||||
Bar Actions 工作列動作
|
||||
Reset Bar Actions 重設工作列動作
|
||||
Resize 調整大小
|
||||
Contrast 對比
|
||||
Control 控制
|
||||
@@ -2683,6 +2685,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, 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
|
||||
@msg `select` must be true or false `select` 必須是 true 或 false
|
||||
@@ -3339,6 +3343,11 @@ liquify-list-end {0}, {1} {0}和{1}
|
||||
Knife 美工刀
|
||||
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 工作空間
|
||||
Lab Spot Colors: Lab 特別色:
|
||||
Lab Values Lab 值
|
||||
Landscape 橫向
|
||||
@@ -4708,9 +4717,9 @@ 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; 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 億條指令。時間限制不變。
|
||||
How many instructions each run of a plug-in object filter may use; Large allows more than Normal with the same 60-second limit. Heavy filters keep their own budget. 增效模組的物件濾鏡每次執行可使用的指令數;「大」比「正常」允許更多,60 秒的時間限制不變。重型濾鏡保留自己的預算。
|
||||
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 會儲存它,但尚未使用暫存磁碟。
|
||||
@@ -4729,6 +4738,8 @@ 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 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 影格。
|
||||
From the next start, the desktop version draws with this kind of graphics processor; Automatic prefers the one that drives the display. The web version does not use it. 從下次啟動起,桌面版使用這類圖形處理器繪製;「自動」優先使用驅動顯示器的圖形處理器。網頁版不使用此選項。
|
||||
From the next start, the window shows frames without waiting for the display to refresh, at most 240 a second; off, the display paces them. A present mode set at launch overrides it. 從下次啟動起,視窗不等待顯示器重新整理就顯示畫面,每秒最多 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. 每份文件保留的最大復原步驟數;調低後,按一下「確定」時會刪除最早的步驟。步驟佔用過多記憶體時也可能更早被刪除。
|
||||
@@ -10404,6 +10415,16 @@ breakText Glyphs 字符
|
||||
@msg A joint does not close by {gap} pt. 有一處接縫相差 {gap} pt 未閉合。
|
||||
@msg Two panels pass through each other. 兩個面板相互穿插。
|
||||
@msg {what} would print on more than {MAX_TILES} tiles: scale it down {what} 會列印在超過 {MAX_TILES} 個拼貼上:請縮小
|
||||
Orbit Lines 軌道線
|
||||
Petal Garland 花瓣花環
|
||||
Lattice Braid 格紋編織
|
||||
Facet Sweep 切面筆觸
|
||||
Artistic Brushes 藝術筆刷
|
||||
Paint 繪畫
|
||||
Flat Sweep 平刷
|
||||
Dry Drag 乾拖
|
||||
Loaded Stroke 厚塗筆觸
|
||||
Fan Sweep 扇形筆觸
|
||||
Engraving 雕刻
|
||||
Fine Hatching 細線排線
|
||||
Dense Hatching 密集排線
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -667,6 +667,26 @@ fn run_ui_part6(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Result<
|
||||
app.ui.task_bar_place = Default::default();
|
||||
Ok(Value::Null)
|
||||
}
|
||||
// More Options › Bar Actions: one of the bar's actions or chips on or off.
|
||||
"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::<Vec<_>>().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
|
||||
|
||||
@@ -95,6 +95,10 @@ pub fn checked(app: &VectorcraftApp, id: &str, p: &Value) -> Option<bool> {
|
||||
"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("");
|
||||
|
||||
@@ -688,6 +688,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 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",
|
||||
"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",
|
||||
@@ -1562,7 +1574,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
|
||||
"ui.colorWheel",
|
||||
"Color Wheel Options",
|
||||
"",
|
||||
"{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, harmony?: bool, harmonyRule?: complementary|splitComplementary|leftComplement|rightComplement|analogous|analogous2|triad|tetrad|tetrad2|tetrad3|compound|compound2|highContrast|highContrast3|pentagram, vision?: bool} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, 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); harmony shows a marker on the wheel's ring for each other color of harmonyRule (the Color Guide's rule of that id; a rule's label is taken too), as Show Harmony and Harmony Rule do, and a click on a marker applies its color; vision shows Show Color Vision Preview's row under the wheel or the box, four chips with the current color as simulated for protanopia, deuteranopia and tritanopia (the simulations of view.proofSetup's protanopia, deuteranopia and tritanopia targets) and for achromatopsia (the gray with the color's CIE L*), each named with its hex value in its tooltip and to screen readers, and taking the keyboard focus; a click or a key on a chip does not apply its color; keys left out or null keep their values ({} reads them), params that are not an object, another key or a value off the list are an error and change nothing, the settings are kept with the preferences, and the command does not open the panel (window.panel {panel: \"colorWheel\"} does) (ui.inspect: ui.color_wheel) → {view, channel, harmony, harmonyRule, vision}",
|
||||
"{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, sliders?: none|oklch|hsl, harmony?: bool, harmonyRule?: complementary|splitComplementary|leftComplement|rightComplement|analogous|analogous2|triad|tetrad|tetrad2|tetrad3|compound|compound2|highContrast|highContrast3|pentagram, vision?: bool} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, pick the box's channel, as Box Channel does, and show no slider rows under the wheel or the box (none), OKLCH Sliders (oklch) or HSL Sliders (hsl), as the menu items of those names do: the box is a color field with the channel's strip at its right, and the field shows the other two components (hue: saturation across and brightness up; saturation: hue across and brightness up; brightness: hue across and saturation up; red: blue across and green up; green: blue across and red up; blue: red across and green up); OKLCH Sliders edit lightness 0 to 100 %, chroma 0 to 100 % of 0.4 and hue 0 to 360°, CSS Color 4's OKLCH of the display sRGB, and a color outside sRGB keeps L and H and takes the largest chroma that fits; HSL Sliders edit hue 0 to 360°, saturation 0 to 100 % and lightness 0 to 100 %, CSS Color 4's HSL of the display sRGB; harmony shows a marker on the wheel's ring for each other color of harmonyRule (the Color Guide's rule of that id; a rule's label is taken too), as Show Harmony and Harmony Rule do, and a click on a marker applies its color; vision shows Show Color Vision Preview's row under the wheel or the box, four chips with the current color as simulated for protanopia, deuteranopia and tritanopia (the simulations of view.proofSetup's protanopia, deuteranopia and tritanopia targets) and for achromatopsia (the gray with the color's CIE L*), each named with its hex value in its tooltip and to screen readers, and taking the keyboard focus; a click or a key on a chip does not apply its color; keys left out or null keep their values ({} reads them), params that are not an object, another key or a value off the list are an error and change nothing, oklch is an error while the working RGB space is not sRGB, the settings are kept with the preferences, and the command does not open the panel (window.panel {panel: \"colorWheel\"} does) (ui.inspect: ui.color_wheel) → {view, channel, sliders, harmony, harmonyRule, vision}",
|
||||
),
|
||||
(
|
||||
"ui.savePdfDialog",
|
||||
|
||||
@@ -22,15 +22,25 @@
|
||||
//! Setup uses, and for achromatopsia as the gray with the color's CIE L*. The chips only show the
|
||||
//! simulation.
|
||||
//!
|
||||
//! The view, the channel, Show Harmony, Harmony Rule and Show Color Vision Preview 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:
|
||||
//! <https://www.w3.org/TR/css-color-4/#specifying-oklab-oklch>), 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
|
||||
//! (<https://www.w3.org/TR/css-color-4/#the-hsl-notation>). The choice is kept with the
|
||||
//! preferences too.
|
||||
//!
|
||||
//! The view, the channel, the slider rows, Show Harmony, Harmony Rule and Show Color Vision
|
||||
//! Preview are kept with the preferences (`ui.colorWheel`).
|
||||
|
||||
use egui::{Rect, Sense, Stroke, StrokeKind, Ui, UiBuilder, vec2};
|
||||
use egui::{Color32, Rect, Sense, Stroke, StrokeKind, Ui, UiBuilder, pos2, vec2};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_color::cms::{self, Cms, ProofSetup, ProofTarget};
|
||||
use vectorcraft_color::harmony::Harmony;
|
||||
use vectorcraft_color::{Color, Paint, hsb_to_rgb, rgb_to_hsb};
|
||||
use vectorcraft_color::oklab::{self, CHROMA_FULL};
|
||||
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};
|
||||
@@ -82,6 +92,8 @@ 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,
|
||||
/// Show Harmony: markers on the ring for the other colors of `harmony_rule`.
|
||||
#[serde(deserialize_with = "deserialize_flag")]
|
||||
pub harmony: bool,
|
||||
@@ -94,9 +106,50 @@ pub struct Settings {
|
||||
pub vision: bool,
|
||||
}
|
||||
|
||||
/// 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,
|
||||
/// HSL Sliders: hue, saturation and lightness.
|
||||
Hsl,
|
||||
}
|
||||
|
||||
impl Sliders {
|
||||
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",
|
||||
}
|
||||
}
|
||||
|
||||
pub fn parse(s: &str) -> Option<Self> {
|
||||
Self::ALL.into_iter().find(|v| v.id() == s)
|
||||
}
|
||||
}
|
||||
|
||||
fn deserialize_sliders<'de, D: serde::Deserializer<'de>>(d: D) -> Result<Sliders, D::Error> {
|
||||
let v = <Value as Deserialize>::deserialize(d)?;
|
||||
Ok(v.as_str().and_then(Sliders::parse).unwrap_or_default())
|
||||
}
|
||||
|
||||
impl Default for Settings {
|
||||
fn default() -> Self {
|
||||
Self { view: View::default(), channel: Channel::default(), harmony: false, harmony_rule: Harmony::Complementary, vision: false }
|
||||
Self {
|
||||
view: View::default(),
|
||||
channel: Channel::default(),
|
||||
sliders: Sliders::default(),
|
||||
harmony: false,
|
||||
harmony_rule: Harmony::Complementary,
|
||||
vision: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,12 +199,22 @@ pub fn deserialize_settings<'de, D: serde::Deserializer<'de>>(d: D) -> Result<Se
|
||||
Ok(serde_json::from_value(v).unwrap_or_default())
|
||||
}
|
||||
|
||||
/// `ui.colorWheel {view?, channel?, harmony?, harmonyRule?, vision?}`: show the wheel or the box,
|
||||
/// pick the box's channel, show the colors of a harmony rule on the wheel, and show or hide the
|
||||
/// color vision row. Keys left out or null keep their values; params that are not an object,
|
||||
/// another key or a value off the list are an error and change nothing. → the settings.
|
||||
/// `ui.colorWheel {view?, channel?, sliders?, harmony?, harmonyRule?, vision?}`: show the wheel or
|
||||
/// the box, pick the box's channel, show OKLCH Sliders, HSL Sliders or neither, show the colors of
|
||||
/// a harmony rule on the wheel, and show or hide the color vision row. Keys left out or null keep
|
||||
/// their values; params that are not an object, another key or a value off the list are an error
|
||||
/// and change nothing.
|
||||
/// `sliders: "oklch"` is an error while the active document's RGB space (its assigned profile,
|
||||
/// else the working RGB space) is not sRGB. → the settings.
|
||||
pub(crate) fn command(app: &mut VectorcraftApp, p: &Value) -> Result<Value, String> {
|
||||
const KEYS: [&str; 5] = ["view", "channel", "harmony", "harmonyRule", "vision"];
|
||||
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; 6] = ["view", "channel", "sliders", "harmony", "harmonyRule", "vision"];
|
||||
match p {
|
||||
Value::Null => {}
|
||||
Value::Object(o) => {
|
||||
@@ -161,7 +224,7 @@ pub(crate) fn command(app: &mut VectorcraftApp, p: &Value) -> Result<Value, Stri
|
||||
}
|
||||
got => 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")?,
|
||||
@@ -170,6 +233,16 @@ pub(crate) fn command(app: &mut VectorcraftApp, p: &Value) -> Result<Value, Stri
|
||||
None | Some(Value::Null) => {}
|
||||
Some(v) => set.channel = v.as_str().and_then(Channel::parse).ok_or("`channel` must be hue, saturation, brightness, red, green or blue")?,
|
||||
}
|
||||
match p.get("sliders") {
|
||||
None | Some(Value::Null) => {}
|
||||
Some(v) => {
|
||||
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());
|
||||
}
|
||||
set.sliders = sliders;
|
||||
}
|
||||
}
|
||||
let key = "harmony";
|
||||
match p.get(key) {
|
||||
None | Some(Value::Null) => {}
|
||||
@@ -188,12 +261,13 @@ pub(crate) fn command(app: &mut VectorcraftApp, p: &Value) -> Result<Value, Stri
|
||||
if let Some(on) = crate::menus::opt_bool(p, "vision")? {
|
||||
set.vision = on;
|
||||
}
|
||||
app.ui.color_wheel = set;
|
||||
Ok(json!(app.ui.color_wheel))
|
||||
*settings = set;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// The panel menu: Wheel View and Box View, and Box Channel while the box shows; Show Harmony
|
||||
/// and Harmony Rule while the wheel shows; and Show Color Vision Preview.
|
||||
/// The panel menu: Wheel View and Box View, and Box Channel while the box shows; HSL Sliders and
|
||||
/// OKLCH Sliders; Show Harmony and Harmony Rule while the wheel shows; and Show Color Vision
|
||||
/// Preview.
|
||||
pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
let set = app.ui.color_wheel.clone();
|
||||
for (label, view) in [(tl!("Wheel View"), View::Wheel), (tl!("Box View"), View::Box)] {
|
||||
@@ -211,6 +285,22 @@ 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();
|
||||
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);
|
||||
}
|
||||
}
|
||||
if menu_item(ui, tl!("Show Harmony"), set.view == View::Wheel, set.harmony) {
|
||||
command(app, &json!({ "harmony": !set.harmony })).ok();
|
||||
}
|
||||
@@ -299,6 +389,16 @@ 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";
|
||||
/// 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.
|
||||
const HSL_MEMORY: &str = "color-wheel-hsl";
|
||||
/// The height of the color vision chips and the space between them.
|
||||
const VISION_CHIP: f32 = 16.0;
|
||||
const VISION_GAP: f32 = 3.0;
|
||||
@@ -399,6 +499,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<T: Clone + Send + Sync + 'static>(
|
||||
app: &VectorcraftApp,
|
||||
ui: &Ui,
|
||||
key: &str,
|
||||
tgt: &Target,
|
||||
color: Option<Color>,
|
||||
cms: &Cms,
|
||||
) -> Option<([f32; 3], T)> {
|
||||
let (owner, shown, v) = pstate::<Option<(Owner, [f32; 3], T)>>(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))
|
||||
@@ -416,7 +538,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);
|
||||
@@ -450,14 +577,215 @@ fn replaced(app: &VectorcraftApp, tgt: &Target, behind: bool) -> Option<Color> {
|
||||
}
|
||||
}
|
||||
|
||||
/// 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(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.
|
||||
/// 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
|
||||
/// 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<f64>) -> 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(_) if oklab::in_srgb(exact) => (exact, false),
|
||||
_ => {
|
||||
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);
|
||||
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<Color>, 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, 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(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.
|
||||
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;
|
||||
// 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<Color32>)>; 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);
|
||||
// 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 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<Color32> = (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);
|
||||
// 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());
|
||||
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));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
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.
|
||||
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(clipped_rgb(cms, 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<Color>, cms: &Cms) -> Option<([f32; 3], Live)> {
|
||||
let t = Tokens::get(ui.ctx());
|
||||
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(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
|
||||
// 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();
|
||||
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::<Option<(Owner, [f32; 3], [f32; 3])>>(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();
|
||||
@@ -512,16 +840,80 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
pick = Some(([hsb[0], x, 1.0 - y], field_phase));
|
||||
}
|
||||
});
|
||||
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);
|
||||
}
|
||||
}
|
||||
// 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::<Option<Sliders>>(ui.ctx(), ROWS_LIVE);
|
||||
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()
|
||||
{
|
||||
app.status(e.to_string());
|
||||
}
|
||||
app.sync_views();
|
||||
set_pstate(ui.ctx(), ROWS_LIVE, None::<Sliders>);
|
||||
}
|
||||
if app.ui.color_wheel.vision {
|
||||
ui.add_space(4.0);
|
||||
vision_row(ui, &cms, color.as_ref());
|
||||
}
|
||||
let Some((hsb, phase)) = pick else { return };
|
||||
let behind = super::alt_held(ui);
|
||||
let cmyk_doc = app.session.active().is_some_and(|d| d.doc.color_mode == ColorMode::Cmyk);
|
||||
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;
|
||||
}
|
||||
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 {
|
||||
asked.remember(ui, key, Owner::of(app, &tgt, c), cms.display_rgb(&c));
|
||||
}
|
||||
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 {
|
||||
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))),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,10 @@
|
||||
//! (Small and Large List View), shown on a square or on type; a style with no fill and no stroke
|
||||
//! 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;
|
||||
//! double-click opens Graphic Style Options. Dragging a style moves it in the list (dropped on
|
||||
//! 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 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
|
||||
//! copy of it and of the styles highlighted with it at the end of the list; art dragged off the
|
||||
@@ -552,6 +554,11 @@ 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 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();
|
||||
}
|
||||
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.
|
||||
@@ -1689,15 +1696,23 @@ 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]));
|
||||
// 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);
|
||||
|
||||
@@ -622,7 +622,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| {
|
||||
@@ -698,6 +698,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() {
|
||||
@@ -767,6 +775,78 @@ fn break_link(app: &mut VectorcraftApp, ids: Vec<u64>) {
|
||||
});
|
||||
}
|
||||
|
||||
/// Embed images `ids` (`links.embed`).
|
||||
fn embed_images(app: &mut VectorcraftApp, ids: Vec<u64>) {
|
||||
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 {
|
||||
@@ -893,21 +973,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[..] {
|
||||
|
||||
@@ -474,7 +474,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
});
|
||||
let zone = ui.interact(list_rect, ui.scope_id().with("symbols-drop"), Sense::hover());
|
||||
if !over_symbol && let Some(ids) = widgets::art_drop(ui, &zone) {
|
||||
// Shift held at the release keeps the dropped art as ordinary art.
|
||||
// Shift held at the release that ends the drag keeps the dropped art as ordinary art.
|
||||
let mut p = json!({ "ids": ids, "type": "dynamic" });
|
||||
if modifiers_at_release(ui).shift {
|
||||
p["keepArt"] = json!(true);
|
||||
@@ -529,8 +529,8 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
} else if new.clicked() {
|
||||
// Alt skips Symbol Options: the symbol is made under the default name, dynamic as the
|
||||
// dialog's default. Shift keeps the selected art as ordinary art, with or without Alt.
|
||||
// Both are read as the primary button went up, when it did in this frame.
|
||||
let m = modifiers_at_release(ui);
|
||||
// Both are read as the button went up on it.
|
||||
let m = modifiers_released_in(ui, new.interact_rect, new.clicked_by(egui::PointerButton::Primary));
|
||||
let (cmd, mut p) = if m.alt { ("symbol.new", json!({"type": "dynamic"})) } else { ("ui.symbolOptions", json!({})) };
|
||||
if m.shift {
|
||||
p["keepArt"] = json!(true);
|
||||
@@ -545,7 +545,8 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
let picked = if marked.contains(&name) { &marked[..] } else { &[] };
|
||||
delete(app, picked, Some(&name), alt_at_release(ui));
|
||||
} else if trash.clicked() {
|
||||
delete(app, &marked, sel.as_deref(), alt_at_release(ui));
|
||||
let pointer = trash.clicked_by(egui::PointerButton::Primary);
|
||||
delete(app, &marked, sel.as_deref(), modifiers_released_in(ui, trash.interact_rect, pointer).alt);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -558,18 +559,21 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
let has_sel = app.session.active().is_some_and(|d| !d.selection.is_empty());
|
||||
let inst = has_instances_selected(app);
|
||||
let name = json!({"name": sel});
|
||||
// Shift keeps the selected art as ordinary art instead of making it an instance. It is read as
|
||||
// the primary button went up, when it did in this frame.
|
||||
let shift = modifiers_at_release(ui).shift;
|
||||
let redefine = if shift { json!({"name": sel, "keepArt": true}) } else { name.clone() };
|
||||
let new = if shift { json!({"keepArt": true}) } else { json!({}) };
|
||||
let items: [(&str, bool, &str, Value); 3] = [
|
||||
(tl!("New Symbol…"), has_sel, "ui.symbolOptions", new),
|
||||
(tl!("Redefine Symbol"), has_sel && sel.is_some(), "symbol.update", redefine),
|
||||
(tl!("Duplicate Symbol"), sel.is_some(), "symbol.duplicate", name.clone()),
|
||||
// Shift, held as the button went up on New Symbol… or Redefine Symbol, keeps the selected art
|
||||
// as ordinary art instead of making it an instance.
|
||||
let items: [(&str, bool, &str, Value, bool); 3] = [
|
||||
(tl!("New Symbol…"), has_sel, "ui.symbolOptions", json!({}), true),
|
||||
(tl!("Redefine Symbol"), has_sel && sel.is_some(), "symbol.update", name.clone(), true),
|
||||
(tl!("Duplicate Symbol"), sel.is_some(), "symbol.duplicate", name.clone(), false),
|
||||
];
|
||||
for (label, enabled, cmd, params) in items {
|
||||
if menu_item(ui, label, enabled, false) {
|
||||
for (label, enabled, cmd, mut params, keeps_art) in items {
|
||||
let top = ui.cursor().min.y;
|
||||
let item = widgets::menu_item_response(ui, label, enabled, false);
|
||||
if item.clicked() {
|
||||
let row = egui::Rect::from_x_y_ranges(ui.max_rect().x_range(), top..=ui.cursor().min.y);
|
||||
if keeps_art && modifiers_released_in(ui, row, item.clicked_by(egui::PointerButton::Primary)).shift {
|
||||
params["keepArt"] = json!(true);
|
||||
}
|
||||
app.run(cmd, params).ok();
|
||||
}
|
||||
}
|
||||
@@ -668,14 +672,71 @@ fn art_redefine_drop(ui: &Ui, item: &egui::Response, doc: &Document, uid: Option
|
||||
item.dnd_release_payload::<PanelDrag>().map(|_| ids.iter().map(|id| id.0).collect())
|
||||
}
|
||||
|
||||
/// Whether Alt (Option) is held for a drop or a click: when the primary button went up in this frame, as it
|
||||
/// went up, else now.
|
||||
/// Whether Alt (Option) is held for a drop: as [`modifiers_at_release`] gives it.
|
||||
fn alt_at_release(ui: &Ui) -> bool {
|
||||
modifiers_at_release(ui).alt
|
||||
}
|
||||
|
||||
/// The modifiers held for a drop or a click: when the primary button went up in this frame, as it went up,
|
||||
/// else now.
|
||||
/// The modifiers held for a click on the widget whose interact rectangle is `rect`: when the
|
||||
/// primary button last went up in this frame as a click (the pointer stayed within egui's click
|
||||
/// distance of where the button went down) after going down over `rect` or within egui's interact
|
||||
/// radius of it (egui gives a press that close to the widget), as it went up (egui reports the
|
||||
/// click of the last such release in the frame); else, when no such click happened in this frame,
|
||||
/// as the first release of the frame went up, which ends a press of an earlier frame that egui
|
||||
/// counted as the click; else now. A release that ends a drag is not a click and is skipped.
|
||||
/// `pointer` is whether egui reports the widget clicked by the primary button; when it is false,
|
||||
/// the click came from the keyboard or a screen reader and the modifiers held now are used.
|
||||
fn modifiers_released_in(ui: &Ui, rect: egui::Rect, pointer: bool) -> egui::Modifiers {
|
||||
if !pointer {
|
||||
return ui.input(|i| i.modifiers);
|
||||
}
|
||||
let radius = ui.ctx().global_style().interaction.interact_radius;
|
||||
let max_click_dist = ui.ctx().options(|o| o.input_options.max_click_dist);
|
||||
ui.input(|i| {
|
||||
// Where the button went down in this frame, and whether the pointer has since moved too far
|
||||
// for a click.
|
||||
let mut origin: Option<egui::Pos2> = None;
|
||||
let mut moved = false;
|
||||
// Whether a button went down earlier in this frame; until one does, a release ends a press
|
||||
// of an earlier frame.
|
||||
let mut pressed_here = false;
|
||||
// The modifiers of the release that ends a press of an earlier frame.
|
||||
let mut early = None;
|
||||
let mut found = None;
|
||||
for e in &i.events {
|
||||
match e {
|
||||
egui::Event::PointerMoved(pos) => {
|
||||
moved |= origin.is_some_and(|o| o.distance(*pos) > max_click_dist);
|
||||
}
|
||||
egui::Event::PointerButton { pos, pressed: true, .. } => {
|
||||
origin = Some(*pos);
|
||||
moved = false;
|
||||
pressed_here = true;
|
||||
}
|
||||
egui::Event::PointerButton { pos, button, pressed: false, modifiers } => {
|
||||
moved |= origin.is_some_and(|o| o.distance(*pos) > max_click_dist);
|
||||
let over = origin.is_some_and(|o| rect.distance_sq_to_pos(o) <= radius * radius);
|
||||
if *button == egui::PointerButton::Primary {
|
||||
if !pressed_here {
|
||||
early = early.or(Some(*modifiers));
|
||||
} else if !moved && over {
|
||||
found = Some(*modifiers);
|
||||
}
|
||||
}
|
||||
origin = None;
|
||||
moved = false;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
// egui tracks a press of an earlier frame. A widget it reports clicked by the pointer, with
|
||||
// no click on it after a press of this frame, was clicked by the early release.
|
||||
found.or(early).unwrap_or(i.modifiers)
|
||||
})
|
||||
}
|
||||
|
||||
/// The modifiers held for a drop: when the primary button went up in this frame, as it first went
|
||||
/// up, which is the release that ends a drag under way when the frame starts; else now.
|
||||
fn modifiers_at_release(ui: &Ui) -> egui::Modifiers {
|
||||
ui.input(|i| {
|
||||
i.events
|
||||
@@ -1110,6 +1171,21 @@ mod tests {
|
||||
assert_eq!(art(&app, "New Symbol 2"), (1, 0), "without Shift the rectangle becomes an instance");
|
||||
}
|
||||
|
||||
/// A Shift-click on New Symbol… in the panel menu that goes down in one frame and up in the next
|
||||
/// keeps the art as ordinary art, though a plain click elsewhere follows in the same frame.
|
||||
#[test]
|
||||
fn a_shift_click_on_new_symbol_in_the_menu_counts_though_a_click_elsewhere_follows() {
|
||||
let (mut app, _) = leaf_dot_and_rect();
|
||||
let ctx = egui::Context::default();
|
||||
crate::theme::install_fonts(&ctx);
|
||||
let off = pos2(-10.0, -10.0);
|
||||
let after = vec![egui::Event::PointerMoved(off), button(off, true), button(off, false), egui::Event::ModifiersChanged(egui::Modifiers::NONE)];
|
||||
click_menu_held_then(&ctx, &mut app, "New Symbol…", egui::Modifiers::SHIFT, after);
|
||||
assert_eq!(dialog_kind(&app), Some(crate::dialogs::symbol_options::KIND));
|
||||
crate::dialogs::confirm(&mut app).unwrap();
|
||||
assert_eq!(art(&app, "New Symbol"), (0, 1), "the rectangle stays ordinary art");
|
||||
}
|
||||
|
||||
/// Clicks the panel's New Symbol button with `modifiers` held.
|
||||
fn click_new(app: &mut VectorcraftApp, modifiers: egui::Modifiers) {
|
||||
click_button_then(app, "New Symbol", modifiers, vec![]);
|
||||
@@ -1267,6 +1343,181 @@ mod tests {
|
||||
assert_eq!(art(&app, "New Symbol 2"), (1, 0), "without Shift the rectangle becomes an instance");
|
||||
}
|
||||
|
||||
/// A drop on the panel reads Shift from the release that ends the drag: a click on the list
|
||||
/// without Shift later in the same frame keeps a Shift drop's art as ordinary art, and a click
|
||||
/// with Shift does not keep a plain drop's art.
|
||||
#[test]
|
||||
fn a_drop_on_the_panel_reads_shift_from_the_release_that_ends_the_drag() {
|
||||
let (mut app, rect) = leaf_dot_and_rect();
|
||||
let ctx = egui::Context::default();
|
||||
let at = pos2(180.0, 60.0);
|
||||
let release = |modifiers| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed: false, modifiers };
|
||||
let press = |modifiers| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed: true, modifiers };
|
||||
widgets::drag_art(&ctx, uid(&app).unwrap(), vec![rect]);
|
||||
frame_held(&ctx, &mut app, vec![egui::Event::PointerMoved(at)], egui::Modifiers::SHIFT);
|
||||
let plain = egui::Modifiers::NONE;
|
||||
let events = vec![release(egui::Modifiers::SHIFT), egui::Event::ModifiersChanged(plain), press(plain), release(plain)];
|
||||
frame_held(&ctx, &mut app, events, egui::Modifiers::SHIFT);
|
||||
assert_eq!(art(&app, "New Symbol"), (0, 1), "the Shift drop keeps the rectangle as ordinary art");
|
||||
widgets::drag_art(&ctx, uid(&app).unwrap(), vec![rect]);
|
||||
frame_held(&ctx, &mut app, vec![egui::Event::PointerMoved(at)], plain);
|
||||
let shift = egui::Modifiers::SHIFT;
|
||||
let events = vec![release(plain), egui::Event::ModifiersChanged(shift), press(shift), release(shift)];
|
||||
frame_held(&ctx, &mut app, events, plain);
|
||||
assert_eq!(art(&app, "New Symbol 2"), (1, 0), "the plain drop makes the rectangle an instance");
|
||||
}
|
||||
|
||||
/// A click of the primary button off the panel with no modifiers held, the pointer then back
|
||||
/// at `at`.
|
||||
fn stray_click(at: Pos2) -> [egui::Event; 4] {
|
||||
let off = pos2(-10.0, -10.0);
|
||||
let button =
|
||||
|pressed| egui::Event::PointerButton { pos: off, button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::NONE };
|
||||
[egui::Event::PointerMoved(off), button(true), button(false), egui::Event::PointerMoved(at)]
|
||||
}
|
||||
|
||||
/// Clicks the panel button labeled `label` with `modifiers` held as the primary button goes up,
|
||||
/// between two clicks off the panel without them, and lets them go later in the same frame.
|
||||
fn click_button_let_go(app: &mut VectorcraftApp, label: &str, modifiers: egui::Modifiers) {
|
||||
let ctx = egui::Context::default();
|
||||
ctx.enable_accesskit();
|
||||
let out = frame_held(&ctx, app, vec![], modifiers);
|
||||
let at = clickable(&out).into_iter().find(|(l, _)| l == label).unwrap_or_else(|| panic!("a {label} button")).1;
|
||||
let press = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers };
|
||||
let let_go = egui::Event::ModifiersChanged(egui::Modifiers::NONE);
|
||||
let mut events = stray_click(at).to_vec();
|
||||
events.extend([press(true), press(false), let_go]);
|
||||
events.extend(stray_click(at));
|
||||
frame_held(&ctx, app, events, modifiers);
|
||||
}
|
||||
|
||||
/// Clicks the menu item labeled `label` with `modifiers` held as the primary button goes up,
|
||||
/// between two clicks off the menu without them, and lets them go later in the same frame.
|
||||
fn click_menu_let_go(ctx: &egui::Context, app: &mut VectorcraftApp, label: &str, modifiers: egui::Modifiers) {
|
||||
let held = egui::Event::ModifiersChanged(modifiers);
|
||||
let labels = menu_frame(ctx, app, vec![held.clone()]);
|
||||
let item = labels.iter().find(|(t, _)| t.trim() == label).map(|(_, r)| r.center()).unwrap_or_else(|| panic!("{label} in the menu"));
|
||||
let press = |pressed| egui::Event::PointerButton { pos: item, button: egui::PointerButton::Primary, pressed, modifiers };
|
||||
let mut events = vec![held];
|
||||
events.extend(stray_click(item));
|
||||
events.extend([press(true), press(false), egui::Event::ModifiersChanged(egui::Modifiers::NONE)]);
|
||||
events.extend(stray_click(item));
|
||||
menu_frame(ctx, app, events);
|
||||
}
|
||||
|
||||
/// The New Symbol and Delete Symbol buttons and the menu's New Symbol… and Redefine Symbol read
|
||||
/// Shift and Alt as the primary button goes up on them, though clicks elsewhere without them
|
||||
/// come before and after and they are let go later in the same frame.
|
||||
#[test]
|
||||
fn symbol_clicks_read_the_modifiers_as_the_button_goes_up() {
|
||||
let (mut app, rect) = leaf_dot_and_rect();
|
||||
click_button_let_go(&mut app, "New Symbol", egui::Modifiers::SHIFT | egui::Modifiers::ALT);
|
||||
assert_eq!(dialog_kind(&app), None, "Alt skips Symbol Options");
|
||||
assert_eq!(symbols(&mut app), ["Leaf", "Dot", "New Symbol"]);
|
||||
assert_eq!(art(&app, "New Symbol"), (0, 1), "Shift: the rectangle stays ordinary art");
|
||||
let ctx = egui::Context::default();
|
||||
crate::theme::install_fonts(&ctx);
|
||||
click_menu_let_go(&ctx, &mut app, "New Symbol…", egui::Modifiers::SHIFT);
|
||||
crate::dialogs::confirm(&mut app).unwrap();
|
||||
assert_eq!(art(&app, "New Symbol 2"), (0, 1), "the menu's Shift keeps the rectangle as ordinary art");
|
||||
app.run("symbol.setCurrent", json!({"name": "Dot"})).unwrap();
|
||||
click_menu_let_go(&ctx, &mut app, "Redefine Symbol", egui::Modifiers::SHIFT);
|
||||
assert_eq!(art(&app, "Dot"), (0, 1), "Redefine Symbol with Shift keeps the rectangle as ordinary art");
|
||||
assert_eq!(app.session.active().unwrap().selection.objects, vec![rect]);
|
||||
// Dot holds the rectangle now and nothing places it, so Alt deletes it without asking.
|
||||
click_button_let_go(&mut app, "Delete Symbol", egui::Modifiers::ALT);
|
||||
assert_eq!(dialog_kind(&app), None, "Alt deletes an unused symbol without asking");
|
||||
assert_eq!(symbols(&mut app), ["Leaf", "New Symbol", "New Symbol 2"]);
|
||||
}
|
||||
|
||||
/// A click just outside New Symbol, which egui still counts as a click on it, reads Shift and
|
||||
/// Alt as the primary button goes up there, though they are let go later in the same frame.
|
||||
#[test]
|
||||
fn a_click_just_outside_new_symbol_reads_the_modifiers_as_the_button_goes_up() {
|
||||
let (mut app, _) = leaf_dot_and_rect();
|
||||
let ctx = egui::Context::default();
|
||||
ctx.enable_accesskit();
|
||||
let modifiers = egui::Modifiers::SHIFT | egui::Modifiers::ALT;
|
||||
let out = frame_held(&ctx, &mut app, vec![], modifiers);
|
||||
let nodes = &out.platform_output.accesskit_update.as_ref().expect("an accessibility tree").nodes;
|
||||
let b = nodes
|
||||
.iter()
|
||||
.find(|(_, n)| n.label().is_some_and(|l| l.trim() == "New Symbol"))
|
||||
.and_then(|(_, n)| n.bounds())
|
||||
.expect("a New Symbol button");
|
||||
let at = pos2(b.x0 as f32 - 2.0, ((b.y0 + b.y1) / 2.0) as f32);
|
||||
let press = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers };
|
||||
let events = vec![egui::Event::PointerMoved(at), press(true), press(false), egui::Event::ModifiersChanged(egui::Modifiers::NONE)];
|
||||
frame_held(&ctx, &mut app, events, modifiers);
|
||||
assert_eq!(dialog_kind(&app), None, "Alt skips Symbol Options");
|
||||
assert_eq!(symbols(&mut app), ["Leaf", "Dot", "New Symbol"]);
|
||||
assert_eq!(art(&app, "New Symbol"), (0, 1), "Shift: the rectangle stays ordinary art");
|
||||
}
|
||||
|
||||
/// A click that goes down on the edge of New Symbol and, in the next frame, up past egui's
|
||||
/// interact radius but within its click distance counts as a click on it and reads Shift and Alt
|
||||
/// as the button goes up, though they are let go later in the same frame.
|
||||
#[test]
|
||||
fn a_click_released_past_the_interact_radius_reads_the_modifiers_as_the_button_goes_up() {
|
||||
let (mut app, _) = leaf_dot_and_rect();
|
||||
let ctx = egui::Context::default();
|
||||
ctx.enable_accesskit();
|
||||
let modifiers = egui::Modifiers::SHIFT | egui::Modifiers::ALT;
|
||||
let out = frame_held(&ctx, &mut app, vec![], modifiers);
|
||||
let nodes = &out.platform_output.accesskit_update.as_ref().expect("an accessibility tree").nodes;
|
||||
let b = nodes
|
||||
.iter()
|
||||
.find(|(_, n)| n.label().is_some_and(|l| l.trim() == "New Symbol"))
|
||||
.and_then(|(_, n)| n.bounds())
|
||||
.expect("a New Symbol button");
|
||||
let y = ((b.y0 + b.y1) / 2.0) as f32;
|
||||
let (down, up) = (pos2(b.x0 as f32 + 0.5, y), pos2(b.x0 as f32 - 5.4, y));
|
||||
let radius = ctx.global_style().interaction.interact_radius;
|
||||
let max_click_dist = ctx.options(|o| o.input_options.max_click_dist);
|
||||
assert!(down.distance(up) <= max_click_dist && b.x0 as f32 - up.x > radius, "the release is a click outside the radius");
|
||||
let button = |at, pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers };
|
||||
frame_held(&ctx, &mut app, vec![egui::Event::PointerMoved(down), button(down, true)], modifiers);
|
||||
let events = vec![egui::Event::PointerMoved(up), button(up, false), egui::Event::ModifiersChanged(egui::Modifiers::NONE)];
|
||||
frame_held(&ctx, &mut app, events, modifiers);
|
||||
assert_eq!(dialog_kind(&app), None, "Alt skips Symbol Options");
|
||||
assert_eq!(symbols(&mut app), ["Leaf", "Dot", "New Symbol"]);
|
||||
assert_eq!(art(&app, "New Symbol"), (0, 1), "Shift: the rectangle stays ordinary art");
|
||||
}
|
||||
|
||||
/// An Alt-click on Delete Symbol followed in the same frame by a drag that ends just outside
|
||||
/// it without Alt reads Alt from the click: the release that ends the drag is not a click.
|
||||
#[test]
|
||||
fn a_drag_ending_near_delete_symbol_after_an_alt_click_keeps_the_click_modifiers() {
|
||||
let mut app = leaf_and_dot();
|
||||
let ctx = egui::Context::default();
|
||||
ctx.enable_accesskit();
|
||||
let out = frame_held(&ctx, &mut app, vec![], egui::Modifiers::NONE);
|
||||
let nodes = &out.platform_output.accesskit_update.as_ref().expect("an accessibility tree").nodes;
|
||||
let b = nodes
|
||||
.iter()
|
||||
.find(|(_, n)| n.label().is_some_and(|l| l.trim() == "Delete Symbol"))
|
||||
.and_then(|(_, n)| n.bounds())
|
||||
.expect("a Delete Symbol button");
|
||||
let center = pos2(((b.x0 + b.x1) / 2.0) as f32, ((b.y0 + b.y1) / 2.0) as f32);
|
||||
let near = pos2(b.x0 as f32 - 1.0, center.y);
|
||||
let from = pos2(near.x, near.y - 12.0);
|
||||
let button = |pos, pressed, modifiers| egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers };
|
||||
let (alt, none) = (egui::Modifiers::ALT, egui::Modifiers::NONE);
|
||||
let events = vec![
|
||||
egui::Event::PointerMoved(center),
|
||||
button(center, true, alt),
|
||||
button(center, false, alt),
|
||||
egui::Event::ModifiersChanged(none),
|
||||
egui::Event::PointerMoved(from),
|
||||
button(from, true, none),
|
||||
egui::Event::PointerMoved(near),
|
||||
button(near, false, none),
|
||||
];
|
||||
frame_held(&ctx, &mut app, events, alt);
|
||||
assert_eq!(dialog_kind(&app), None, "Alt deletes the unused symbol without asking");
|
||||
assert_eq!(symbols(&mut app), ["Leaf"]);
|
||||
}
|
||||
|
||||
/// `ui.symbolOptions` takes `keepArt` only as true or false, and only for a new symbol.
|
||||
#[test]
|
||||
fn symbol_options_checks_keep_art() {
|
||||
@@ -2962,6 +3213,111 @@ mod tests {
|
||||
assert!(Arc::ptr_eq(&leaf, &symbol_art(&app, "Leaf")), "Leaf is unchanged");
|
||||
}
|
||||
|
||||
/// A plain art drop on a symbol followed in the same frame by an Alt-click on that symbol makes
|
||||
/// a new symbol and leaves the symbol as it was: the release that ends the drag decides.
|
||||
#[test]
|
||||
fn an_alt_click_after_a_plain_art_drop_in_the_same_frame_does_not_redefine() {
|
||||
let mut app = leaf_and_dot();
|
||||
let shape = app.run("shape.rectangle", json!({"x": 200, "y": 120, "width": 40, "height": 20})).unwrap()["id"].as_u64().unwrap();
|
||||
let leaf = symbol_art(&app, "Leaf");
|
||||
let ctx = egui::Context::default();
|
||||
let at = item_at(&ctx, &mut app, "Leaf");
|
||||
widgets::drag_art(&ctx, uid(&app).unwrap(), vec![NodeId(shape)]);
|
||||
frame_held(&ctx, &mut app, vec![egui::Event::PointerMoved(at)], egui::Modifiers::NONE);
|
||||
let alt_press = egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed: true, modifiers: egui::Modifiers::ALT };
|
||||
let events = vec![button(at, false), egui::Event::ModifiersChanged(egui::Modifiers::ALT), alt_press, alt_release(at)];
|
||||
frame_held(&ctx, &mut app, events, egui::Modifiers::NONE);
|
||||
assert_eq!(symbols(&mut app).len(), 3, "a new symbol");
|
||||
assert!(Arc::ptr_eq(&leaf, &symbol_art(&app, "Leaf")), "Leaf is unchanged");
|
||||
}
|
||||
|
||||
/// A plain drop of an unused symbol on Delete Symbol followed in the same frame by an Alt-click
|
||||
/// on the button still asks first: the release that ends the drag decides.
|
||||
#[test]
|
||||
fn an_alt_click_after_a_plain_drop_on_delete_in_the_same_frame_still_asks() {
|
||||
let mut app = leaf_and_dot();
|
||||
let ctx = egui::Context::default();
|
||||
crate::theme::install_fonts(&ctx);
|
||||
let trash = button_rect(&ctx, &mut app, "Delete Symbol").center();
|
||||
let dot = item_at(&ctx, &mut app, "Dot");
|
||||
frame(&ctx, &mut app, vec![]);
|
||||
frame(&ctx, &mut app, vec![egui::Event::PointerMoved(dot), button(dot, true)]);
|
||||
frame(&ctx, &mut app, vec![egui::Event::PointerMoved(dot + vec2(40.0, 40.0))]);
|
||||
frame(&ctx, &mut app, vec![egui::Event::PointerMoved(dot + vec2(80.0, 80.0))]);
|
||||
frame_held(&ctx, &mut app, vec![egui::Event::PointerMoved(trash)], egui::Modifiers::NONE);
|
||||
let alt_press =
|
||||
egui::Event::PointerButton { pos: trash, button: egui::PointerButton::Primary, pressed: true, modifiers: egui::Modifiers::ALT };
|
||||
let events = vec![button(trash, false), egui::Event::ModifiersChanged(egui::Modifiers::ALT), alt_press, alt_release(trash)];
|
||||
frame_held(&ctx, &mut app, events, egui::Modifiers::NONE);
|
||||
assert_eq!(dialog_kind(&app), Some(crate::dialogs::symbol_delete::KIND), "the plain drop asks first");
|
||||
assert_eq!(symbols(&mut app), ["Leaf", "Dot"]);
|
||||
}
|
||||
|
||||
/// A screen reader's Click on Delete Symbol asks first for an unused symbol, though an Alt-click
|
||||
/// elsewhere comes before it in the same frame and Alt is let go after.
|
||||
#[test]
|
||||
fn a_screen_reader_click_on_delete_does_not_take_alt_from_another_click() {
|
||||
use egui::accesskit::{Action, ActionRequest, TreeId};
|
||||
let mut app = leaf_and_dot();
|
||||
let ctx = egui::Context::default();
|
||||
ctx.enable_accesskit();
|
||||
let out = frame_held(&ctx, &mut app, vec![], egui::Modifiers::NONE);
|
||||
let nodes = &out.platform_output.accesskit_update.as_ref().expect("an accessibility tree").nodes;
|
||||
let node =
|
||||
nodes.iter().find(|(_, n)| n.label().is_some_and(|l| l.trim() == "Delete Symbol")).map(|(id, _)| *id).expect("a Delete Symbol node");
|
||||
let off = pos2(-10.0, -10.0);
|
||||
let alt = |pressed| egui::Event::PointerButton { pos: off, button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::ALT };
|
||||
let click =
|
||||
egui::Event::AccessKitActionRequest(ActionRequest { action: Action::Click, target_node: node, target_tree: TreeId::ROOT, data: None });
|
||||
let events = vec![egui::Event::PointerMoved(off), alt(true), alt(false), egui::Event::ModifiersChanged(egui::Modifiers::NONE), click];
|
||||
frame_held(&ctx, &mut app, events, egui::Modifiers::ALT);
|
||||
assert_eq!(dialog_kind(&app), Some(crate::dialogs::symbol_delete::KIND), "the screen reader's Click asks first");
|
||||
assert_eq!(symbols(&mut app), ["Leaf", "Dot"]);
|
||||
}
|
||||
|
||||
/// A screen reader's Click on Delete Symbol asks first for an unused symbol, though in the same
|
||||
/// frame an Alt release over the button ends a drag that began in an earlier frame and Alt is
|
||||
/// let go after.
|
||||
#[test]
|
||||
fn a_screen_reader_click_on_delete_does_not_take_alt_from_a_drag_begun_earlier() {
|
||||
use egui::accesskit::{Action, ActionRequest, TreeId};
|
||||
let mut app = leaf_and_dot();
|
||||
let ctx = egui::Context::default();
|
||||
ctx.enable_accesskit();
|
||||
let out = frame_held(&ctx, &mut app, vec![], egui::Modifiers::NONE);
|
||||
let nodes = &out.platform_output.accesskit_update.as_ref().expect("an accessibility tree").nodes;
|
||||
let node =
|
||||
nodes.iter().find(|(_, n)| n.label().is_some_and(|l| l.trim() == "Delete Symbol")).map(|(id, _)| *id).expect("a Delete Symbol node");
|
||||
let trash = clickable(&out).into_iter().find(|(l, _)| l == "Delete Symbol").expect("a Delete Symbol button").1;
|
||||
let off = pos2(-10.0, -10.0);
|
||||
let press = egui::Event::PointerButton { pos: off, button: egui::PointerButton::Primary, pressed: true, modifiers: egui::Modifiers::ALT };
|
||||
frame_held(&ctx, &mut app, vec![egui::Event::PointerMoved(off), press], egui::Modifiers::ALT);
|
||||
frame_held(&ctx, &mut app, vec![egui::Event::PointerMoved(trash - vec2(0.0, 80.0))], egui::Modifiers::ALT);
|
||||
let click =
|
||||
egui::Event::AccessKitActionRequest(ActionRequest { action: Action::Click, target_node: node, target_tree: TreeId::ROOT, data: None });
|
||||
let events = vec![egui::Event::PointerMoved(trash), alt_release(trash), egui::Event::ModifiersChanged(egui::Modifiers::NONE), click];
|
||||
frame_held(&ctx, &mut app, events, egui::Modifiers::ALT);
|
||||
assert_eq!(dialog_kind(&app), Some(crate::dialogs::symbol_delete::KIND), "the screen reader's Click asks first");
|
||||
assert_eq!(symbols(&mut app), ["Leaf", "Dot"]);
|
||||
}
|
||||
|
||||
/// A click on Delete Symbol that goes down in one frame and up with Alt held in the next deletes
|
||||
/// an unused symbol without asking, though a plain click elsewhere follows in the same frame.
|
||||
#[test]
|
||||
fn an_alt_click_on_delete_across_frames_counts_though_a_click_elsewhere_follows() {
|
||||
let mut app = leaf_and_dot();
|
||||
let ctx = egui::Context::default();
|
||||
ctx.enable_accesskit();
|
||||
let out = frame_held(&ctx, &mut app, vec![], egui::Modifiers::NONE);
|
||||
let trash = clickable(&out).into_iter().find(|(l, _)| l == "Delete Symbol").expect("a Delete Symbol button").1;
|
||||
frame_held(&ctx, &mut app, vec![egui::Event::PointerMoved(trash), button(trash, true)], egui::Modifiers::ALT);
|
||||
let off = pos2(-10.0, -10.0);
|
||||
let events = vec![alt_release(trash), egui::Event::PointerMoved(off), button(off, true), button(off, false)];
|
||||
frame_held(&ctx, &mut app, events, egui::Modifiers::ALT);
|
||||
assert_eq!(dialog_kind(&app), None, "Alt deletes an unused symbol without asking");
|
||||
assert_eq!(symbols(&mut app), ["Leaf"]);
|
||||
}
|
||||
|
||||
/// An Alt drop that cannot redefine the symbol under the pointer changes nothing, makes no new
|
||||
/// symbol and adds no undo step: art of another document, objects the document no longer has,
|
||||
/// no objects, and a release away from the panel are not outlined, and art holding an instance
|
||||
|
||||
@@ -197,6 +197,7 @@ fn the_window_menu_and_the_brushes_panel_open_brush_libraries() {
|
||||
json!("calligraphic-nibs"),
|
||||
json!("pressure-sensitive"),
|
||||
json!("bristle-brushes"),
|
||||
json!("paint"),
|
||||
json!("pattern-borders"),
|
||||
json!("scatter-shapes"),
|
||||
json!("stipple"),
|
||||
@@ -206,7 +207,8 @@ fn the_window_menu_and_the_brushes_panel_open_brush_libraries() {
|
||||
json!("tech-circuit"),
|
||||
json!("engraving"),
|
||||
json!("arrows"),
|
||||
json!("image-brush")
|
||||
json!("image-brush"),
|
||||
json!("artistic")
|
||||
]
|
||||
);
|
||||
let dry = entries.iter().find(|e| under(e) && e.params["library"] == "dry-media").map(|e| e.label.as_str());
|
||||
@@ -237,21 +239,42 @@ 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 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"));
|
||||
assert_eq!(undo_len(&app), undo + 1);
|
||||
let r = app.run("window.brushLibrary", json!({"library": "Pressure Sensitive"})).unwrap();
|
||||
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!(
|
||||
app.session.doc().unwrap().doc.node(vectorcraft_doc::NodeId(path)).unwrap().appearance.stroke().unwrap().brush.as_deref(),
|
||||
Some("Flex Ribbon")
|
||||
);
|
||||
let r = app.run("window.brushLibrary", json!({"library": "Paint"})).unwrap();
|
||||
assert_eq!((r["open"].as_str(), r["count"].as_u64()), (Some("paint"), Some(4)));
|
||||
let path = app.run("shape.line", json!({"x1": 10, "y1": 140, "x2": 180, "y2": 140})).unwrap()["id"].as_u64().unwrap();
|
||||
let undo = undo_len(&app);
|
||||
click(&mut app, &ctx, "Flat Sweep", Modifiers::NONE, 5.0);
|
||||
assert!(has(&app, "Flat Sweep") && !has(&app, "Dry Drag"));
|
||||
assert_eq!(undo_len(&app), undo + 1);
|
||||
assert_eq!(
|
||||
app.session.doc().unwrap().doc.node(vectorcraft_doc::NodeId(path)).unwrap().appearance.stroke().unwrap().brush.as_deref(),
|
||||
Some("Flat Sweep")
|
||||
);
|
||||
let r = app.run("window.brushLibrary", json!({"library": "Image Brush"})).unwrap();
|
||||
assert_eq!((r["open"].as_str(), r["count"].as_u64()), (Some("image-brush"), Some(4)));
|
||||
let undo = undo_len(&app);
|
||||
click(&mut app, &ctx, "Soft Bloom", Modifiers::NONE, 4.0);
|
||||
click(&mut app, &ctx, "Soft Bloom", Modifiers::NONE, 6.0);
|
||||
assert!(has(&app, "Soft Bloom") && !has(&app, "Color Flecks"));
|
||||
assert_eq!(undo_len(&app), undo + 1);
|
||||
// Without brushes there is nothing to save.
|
||||
|
||||
@@ -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_hsl, remembered_oklch, set, show, stored,
|
||||
};
|
||||
use crate::VectorcraftApp;
|
||||
|
||||
/// An app with a selected rectangle filled with `fill`.
|
||||
@@ -581,3 +583,573 @@ 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");
|
||||
}
|
||||
// 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));
|
||||
// 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));
|
||||
}
|
||||
|
||||
/// 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 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() {
|
||||
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 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 rail = oklch_slider(&h, "Lightness").rect();
|
||||
click(&mut h, on_rail(rail, 0.2), Modifiers::NONE);
|
||||
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
|
||||
/// 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)));
|
||||
}
|
||||
|
||||
/// 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"}), 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}");
|
||||
}
|
||||
}
|
||||
|
||||
/// `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": "hwb"})).unwrap_err(), "`sliders` must be none, oklch or hsl");
|
||||
let got = app.run("ui.colorWheel", json!({"sliders": "oklch"})).unwrap();
|
||||
let want = json!({"view": "box", "channel": "red", "harmony": false, "harmonyRule": "complementary", "vision": false, "sliders": "oklch"});
|
||||
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");
|
||||
}
|
||||
|
||||
/// 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");
|
||||
}
|
||||
}
|
||||
|
||||
/// 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]
|
||||
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}");
|
||||
}
|
||||
}
|
||||
@@ -167,7 +167,7 @@ fn the_strip_takes_the_arrow_keys_and_screen_readers_actions() {
|
||||
#[test]
|
||||
fn ui_color_wheel_sets_and_reads_the_view_and_the_channel() {
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
let harmony = json!({"harmony": false, "harmonyRule": "complementary", "vision": false});
|
||||
let harmony = json!({"sliders": "none", "harmony": false, "harmonyRule": "complementary", "vision": false});
|
||||
let with = |v: serde_json::Value| {
|
||||
let mut v = v;
|
||||
v.as_object_mut().unwrap().extend(harmony.as_object().unwrap().clone());
|
||||
@@ -217,9 +217,9 @@ fn ui_color_wheel_rejects_other_params() {
|
||||
let e = app.run("ui.colorWheel", json!([1])).unwrap_err();
|
||||
assert_eq!(e, "the params must be an object, not [1]");
|
||||
let e = app.run("ui.colorWheel", json!({"veiw": "wheel"})).unwrap_err();
|
||||
assert_eq!(e, "unknown parameter `veiw`; the command takes: view, channel, harmony, harmonyRule, vision");
|
||||
assert_eq!(e, "unknown parameter `veiw`; the command takes: view, channel, sliders, harmony, harmonyRule, vision");
|
||||
let e = app.run("ui.colorWheel", json!({"view": "wheel", "chanel": "blue"})).unwrap_err();
|
||||
assert_eq!(e, "unknown parameter `chanel`; the command takes: view, channel, harmony, harmonyRule, vision");
|
||||
assert_eq!(e, "unknown parameter `chanel`; the command takes: view, channel, sliders, harmony, harmonyRule, vision");
|
||||
assert_eq!(app.ui.color_wheel, Settings { view: View::Box, channel: Channel::Red, ..Default::default() }, "an error changes nothing");
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -736,3 +736,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<RefCell<Vec<String>>> = 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());
|
||||
}
|
||||
@@ -279,7 +279,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",
|
||||
|
||||
@@ -515,6 +515,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<String>,
|
||||
/// 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)]
|
||||
@@ -834,8 +838,8 @@ pub struct UiState {
|
||||
/// of an RGB field, `ui.colorPanel`, [`crate::panels::color::deserialize_rgb_percent`]).
|
||||
#[serde(default, deserialize_with = "crate::panels::color::deserialize_rgb_percent")]
|
||||
pub color_rgb_percent: bool,
|
||||
/// Color Wheel panel: the wheel or the box, the box's channel, and the color vision row
|
||||
/// (`ui.colorWheel`, [`crate::panels::color_wheel::deserialize_settings`]).
|
||||
/// Color Wheel panel: the wheel or the box, the box's channel, the slider rows and the color
|
||||
/// vision row (`ui.colorWheel`, [`crate::panels::color_wheel::deserialize_settings`]).
|
||||
#[serde(default, deserialize_with = "crate::panels::color_wheel::deserialize_settings")]
|
||||
pub color_wheel: crate::panels::color_wheel::Settings,
|
||||
/// Swatches panel: Show Recent Colors in its panel menu, which draws the panel's Recent Colors
|
||||
@@ -1283,6 +1287,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,
|
||||
|
||||
@@ -1573,3 +1573,469 @@ 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:?}");
|
||||
// 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:
|
||||
/// 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::<Vec<_>>();
|
||||
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, false or null 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::<Vec<_>>(), ["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::<Vec<_>>();
|
||||
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::<Vec<_>>());
|
||||
}
|
||||
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::<Vec<_>>();
|
||||
(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 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 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");
|
||||
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<dyn Fn(&mut VectorcraftApp) + 'a>;
|
||||
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", "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"],
|
||||
),
|
||||
(
|
||||
"the Type tool editing type",
|
||||
Box::new(|app| {
|
||||
edited_type(app, "type");
|
||||
}),
|
||||
&["fill"],
|
||||
),
|
||||
(
|
||||
"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", "dynamicText"],
|
||||
),
|
||||
(
|
||||
"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", "dynamicText"],
|
||||
),
|
||||
(
|
||||
"an Image Trace object",
|
||||
Box::new(|app| {
|
||||
place_image(app, &dir);
|
||||
app.run("imageTrace.make", json!({"params": {}})).unwrap();
|
||||
}),
|
||||
&["expand", "duplicate"],
|
||||
),
|
||||
(
|
||||
"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: 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");
|
||||
}
|
||||
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 (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<String> = 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");
|
||||
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:?}");
|
||||
}
|
||||
}
|
||||
@@ -27,11 +27,11 @@ 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_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, flat_button_fit_width, icon_button_info, paint_icon_button_named, primary_button_width, secondary_button_width,
|
||||
button_width, flat_button_fit_width, icon_button_info, menu_item_response, paint_icon_button_named, primary_button_width, secondary_button_width,
|
||||
};
|
||||
#[cfg(test)]
|
||||
use chips::gradient_chip_colors;
|
||||
@@ -42,13 +42,15 @@ pub use color::{
|
||||
color_slider_valued, harmony_wheel, hex_field, hex_field_named, hsb32, hue_ring, recolor_wheel, region_texture, ring_markers, ring_square,
|
||||
segment_color, segment_color_on, segmented_wheel, stepped_area, wheel_of,
|
||||
};
|
||||
pub(crate) use color::{HEX_FIELD_CHARS, focus_by_pointer, hex_text, pointer_phase};
|
||||
pub(crate) use color::{HEX_FIELD_CHARS, color_rail_bar, focus_by_pointer, hex_text, pointer_phase};
|
||||
pub use drag::{
|
||||
PanelDrag, RowClick, SwatchRows, apply_row_click, art_drag_doc, art_drop, doc_preview, drag_art, drag_ghost, drag_source, drop_target_outline,
|
||||
ghost_row, row_click,
|
||||
};
|
||||
#[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,
|
||||
|
||||
@@ -213,9 +213,30 @@ pub fn menu_item(ui: &mut Ui, label: &str, enabled: bool, checked: bool) -> bool
|
||||
menu_item_name(ui, tl!(label), enabled, checked)
|
||||
}
|
||||
|
||||
/// [`menu_item`] that returns the row's response, for a caller that needs to know how it was
|
||||
/// clicked.
|
||||
pub(crate) fn menu_item_response(ui: &mut Ui, label: &str, enabled: bool, checked: bool) -> egui::Response {
|
||||
menu_item_name_response(ui, tl!(label), enabled, checked)
|
||||
}
|
||||
|
||||
/// [`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_item_name_response(ui, label, enabled, checked).clicked()
|
||||
}
|
||||
|
||||
/// [`menu_item_name`] that returns the row's response.
|
||||
fn menu_item_name_response(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))
|
||||
}
|
||||
|
||||
/// [`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()
|
||||
}
|
||||
@@ -279,6 +279,11 @@ fn rail_step(ui: &Ui, id: egui::Id, focused: bool, always: bool, s: &SliderValue
|
||||
(v != from || (end && v != s.value) || (always && asked)).then_some(if exact { v } else { round_to(v, STEP_DECIMALS).clamp(lo, hi) })
|
||||
}
|
||||
|
||||
/// The colored bar inside the rail `rect` of [`color_slider_stepped`] and its siblings.
|
||||
pub(crate) fn color_rail_bar(rect: Rect) -> 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(
|
||||
@@ -292,7 +297,7 @@ fn color_rail(
|
||||
) -> (Response, Option<f32>, 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);
|
||||
|
||||
@@ -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::<u64>(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,17 +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 response = craft_ui::ComboBox::from_id_salt(HashOnly(&id))
|
||||
.selected_text(current)
|
||||
.width(width - 4.0)
|
||||
.height(ui.spacing().combo_height)
|
||||
.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).
|
||||
@@ -261,6 +258,178 @@ 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 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<R>(ui: &Ui, button: &Response, list: impl FnOnce(&mut Ui) -> R) -> Option<R> {
|
||||
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();
|
||||
});
|
||||
// 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::<egui::Id>(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 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 = 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 = 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))
|
||||
}
|
||||
_ => (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 = (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.
|
||||
// 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::<f32>(too_wide_key).is_none() {
|
||||
let rows = d.get_temp::<f32>(natural_key).unwrap_or(screen.width());
|
||||
d.insert_temp(too_wide_key, rows);
|
||||
}
|
||||
});
|
||||
}
|
||||
let (measured, scrolls) = ctx.data(|d| (d.get_temp::<f32>(too_wide_key), d.get_temp::<bool>(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(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);
|
||||
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::<f32>(too_wide_key);
|
||||
d.remove::<f32>(natural_key);
|
||||
d.remove::<bool>(scrolls_key);
|
||||
});
|
||||
}
|
||||
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<egui::epaint::ClippedShape> {
|
||||
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
|
||||
|
||||
@@ -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<egui::Event>| {
|
||||
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<egui::Event>| {
|
||||
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");
|
||||
@@ -804,6 +812,517 @@ fn kerning_reads_parentheses_around_its_text_with_a_manual_value_too() {
|
||||
}
|
||||
}
|
||||
|
||||
/// 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<String> = (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<egui::Event>| {
|
||||
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<String>) {
|
||||
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<egui::epaint::RectShape>) {
|
||||
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:?}");
|
||||
}
|
||||
|
||||
// #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<String> = (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<egui::Event>| {
|
||||
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:?}");
|
||||
}
|
||||
}
|
||||
|
||||
// #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<String> = (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<egui::Event>| {
|
||||
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.
|
||||
#[test]
|
||||
fn a_click_on_a_dropdown_lists_scroll_bar_scrolls_it_and_leaves_it_open() {
|
||||
let items: Vec<String> = (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<egui::Event>| {
|
||||
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<Rect>) {
|
||||
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");
|
||||
}
|
||||
|
||||
// #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<String> = (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<egui::Event>| {
|
||||
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<Rect>) {
|
||||
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:?}");
|
||||
}
|
||||
|
||||
// #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<String> = (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<egui::Event>| {
|
||||
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]
|
||||
|
||||
Loaded 100 of 108 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user