mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-25 11:51:05 +01:00
Part of #978: Show Opacity in the Color Wheel panel sets the opacity of the fill or stroke
The Color Wheel panel menu gets Show Opacity, kept with the preferences
(`ui.colorWheel {opacity}`). It adds a row under the wheel or the box with
a slider and a percent field. The row sets the opacity of the fill or
stroke item, the selected gradient stop or the selected freeform point
(the first stop or point when none is selected, as for a color pick), and
a drag is one undo step. The row is gray with nothing selected, for an
object selected in a symbol instance, and when the fill or stroke item it
would set is on type characters or missing.
- paint.setFill and paint.setStroke take `opacity` (a percentage, 0 to
100), with or without a new paint. An opacity that no target takes is
an error and leaves the paint undone too. paint.proxies answers
`fillOpacity` and `strokeOpacity` from the first row the command would
edit. A graph series keeps the opacity on regeneration.
- The opacity slider and the swatch chips draw the same checkerboard.
- New error and menu strings have rows in the catalogs.
Docs: docs/mcp.md, docs/control-protocol.md, docs/target-app-parity.md.
This commit is contained in:
1 parent
22b8c6ce5a
commit
4f065ccbbf
46 files changed
+1227
-110
No files matched your search
@@ -333,6 +333,25 @@ fn an_item_opacity_on_a_series_mark_survives_regeneration() {
|
||||
assert_eq!((kept.fill_opacity, kept.stroke_opacity), (Some(0.4), None));
|
||||
}
|
||||
|
||||
/// `paint.setFill {opacity}` and `paint.setStroke {opacity}` on one series mark are kept by the graph as the transparency
|
||||
/// commands' item opacity is: every path of that series has them after the graph is drawn again.
|
||||
#[test]
|
||||
fn a_paint_opacity_on_a_series_mark_survives_regeneration() {
|
||||
let mut s = Session::new();
|
||||
s.execute("file.new", &json!({})).unwrap();
|
||||
let id = graph(&mut s, "column");
|
||||
let bar = series(s.doc().unwrap().doc.node(id).unwrap(), 0).children().unwrap()[0].id;
|
||||
s.execute("paint.setFill", &json!({"ids": [bar.0], "opacity": 40})).unwrap();
|
||||
s.execute("paint.setStroke", &json!({"ids": [bar.0], "color": "#ff0000", "opacity": 60})).unwrap();
|
||||
let kept = spec(&s, id).series_paints[0].clone();
|
||||
assert_eq!((kept.fill_opacity, kept.stroke_opacity), (Some(0.4), Some(0.6)));
|
||||
s.execute("graph.setData", &json!({"rows": [[1, 2], [3, 4]]})).unwrap();
|
||||
let n = s.doc().unwrap().doc.node(id).unwrap().clone();
|
||||
let marks = series(&n, 0).children().unwrap().to_vec();
|
||||
let opacities: Vec<(f32, f32)> = marks.iter().map(|m| (m.appearance.fill().unwrap().opacity, m.appearance.stroke().unwrap().opacity)).collect();
|
||||
assert!(opacities.iter().all(|o| *o == (0.4, 0.6)), "{opacities:?}");
|
||||
}
|
||||
|
||||
/// Clear Appearance and Reduce to Basic Appearance on a series mark take its fill and stroke opacity away, and the
|
||||
/// graph keeps none, so the series stays opaque when it is drawn again.
|
||||
#[test]
|
||||
|
||||
+219
-78
@@ -21,7 +21,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Fill",
|
||||
[],
|
||||
None,
|
||||
"{color?: \"#rrggbb\"|[r,g,b]|{c,m,y,k}|{gray}|{l,a,b} (CIE Lab; #rrggbbaa and #rgba are refused), none?: true, swatch?: name (a global or spot colour stays linked, so swatch edits recolour it; a tint swatch links to its base at its tint; a gradient swatch is recorded as the gradient's swatch and fits each object, keeping its aspect; the built-in \"[Registration]\" prints on every plate), tint?: 0..100 (% of a global or spot `swatch`; default 100, or a tint swatch's own), gradient?: {kind?: linear|radial|conic|diamond|freeform (conic, also accepted as angle or conical: the stops sweep once around the center `start`, clockwise from the vector; diamond: the stops run from the center `start` out to a square with a corner at `end`), method?: classic|perceptual|hue-clockwise|hue-counterclockwise (as paint.editGradient; default classic), spread?: pad|repeat|reflect (as paint.editGradient; default pad), repeats?: 1..100 (as paint.editGradient; default 1), stops?: [{offset 0..1, color, opacity? 0..1 (or 0..100), midpoint? 0.13..0.87, swatch?: global or spot colour (or tint) swatch the stop links to (its colour comes from the swatch), tint?: 0..100}] (at least 2; default white→black), angle?: deg counter-clockwise (0: the gradient runs left to right), start?: [x,y], end?: [x,y] (the vector in document coordinates, both or neither; type objects keep it in text space), aspect?: % (radial, conic and diamond; a negative one mirrors a conic's sweep, counterclockwise, and is an error for the other kinds; without start/end the gradient is placed on each object's bounds), focal?: [x,y] (radial, with start/end: the focal point, where the first stop sits; an error with a conic or diamond), dither?: bool (linear, radial, conic and diamond fills: drawn with fine noise that hides banding, and as pixels in SVG and PDF exports; strokes ignore it), swatch?: linked gradient swatch name}, item?: appearance item index|null (omitted: the Appearance panel's active item if it is a fill, else the top fill), ids?|id?, focus?: true (false keeps the active proxy), keepModel?: false (in a CMYK document, RGB colours and gradient stops are stored as CMYK unless true; Gray stays Gray), target?: \"object\"|\"contents\", span?: \"object\" (default: each target fits a gradient to its own bounds)|\"selection\" (a linear, radial, conic or diamond `gradient` without start/end is placed once on the union of the targets' bounds, so it runs across them)} sets the selection's fill and the default (new art fits a gradient to itself); a solid colour recolours only the gradient mesh point last clicked with the Mesh tool or Direct Selection; while the Type tool has characters selected (and no ids or item are given), the paint goes to those characters only; without `item`, a grayscale or 1-bit image takes a solid color as the color it is drawn in (white pixels transparent; `none` takes it off; an image with an alpha channel takes only a spot color, black or white; a colorized image whose link is missing takes a solid color as its new colorize color, and refuses a process color while its color is a spot color, black or white); with an object of a dynamic symbol instance selected by Direct Selection and no ids, id or item, that object's fill changes for this instance only (solid, none, gradient or pattern). On a path directly in a graph series, the graph also stores the paint of the topmost visible fill when the command wrote that row or changed it (exceptions: docs/mcp.md); on a graph label, the graph stores the paint for every label of its kind, as a character fill when the characters took it and with the label's rows when a row did → {objects: how many objects took the paint (the objects inside a group, unless an appearance item of the group's own is targeted; 0 when only the default changed)}",
|
||||
"{color?: \"#rrggbb\"|[r,g,b]|{c,m,y,k}|{gray}|{l,a,b} (CIE Lab; #rrggbbaa and #rgba are refused), none?: true, swatch?: name (a global or spot colour stays linked, so swatch edits recolour it; a tint swatch links to its base at its tint; a gradient swatch is recorded as the gradient's swatch and fits each object, keeping its aspect; the built-in \"[Registration]\" prints on every plate), tint?: 0..100 (% of a global or spot `swatch`; default 100, or a tint swatch's own), gradient?: {kind?: linear|radial|conic|diamond|freeform (conic, also accepted as angle or conical: the stops sweep once around the center `start`, clockwise from the vector; diamond: the stops run from the center `start` out to a square with a corner at `end`), method?: classic|perceptual|hue-clockwise|hue-counterclockwise (as paint.editGradient; default classic), spread?: pad|repeat|reflect (as paint.editGradient; default pad), repeats?: 1..100 (as paint.editGradient; default 1), stops?: [{offset 0..1, color, opacity? 0..1 (or 0..100), midpoint? 0.13..0.87, swatch?: global or spot colour (or tint) swatch the stop links to (its colour comes from the swatch), tint?: 0..100}] (at least 2; default white→black), angle?: deg counter-clockwise (0: the gradient runs left to right), start?: [x,y], end?: [x,y] (the vector in document coordinates, both or neither; type objects keep it in text space), aspect?: % (radial, conic and diamond; a negative one mirrors a conic's sweep, counterclockwise, and is an error for the other kinds; without start/end the gradient is placed on each object's bounds), focal?: [x,y] (radial, with start/end: the focal point, where the first stop sits; an error with a conic or diamond), dither?: bool (linear, radial, conic and diamond fills: drawn with fine noise that hides banding, and as pixels in SVG and PDF exports; strokes ignore it), swatch?: linked gradient swatch name}, item?: appearance item index|null (omitted: the Appearance panel's active item if it is a fill, else the top fill), opacity?: 0..100 (a percentage, as transparency.set's; the opacity of that fill item on each target, in the undo step of the paint, or alone without color, none, swatch or gradient, when it changes neither the defaults nor the recent colors; the gradient mesh points last clicked with the Mesh tool or Direct Selection take it themselves; with no paint, a target without that fill item is left as it is (a paint given with the opacity creates the item, which then takes it), and an opacity that no target takes is an error that also leaves the paint undone; type characters have no opacity of their own, so an opacity that only characters would take is an error, and so are one with nothing selected and no ids and one for an object selected in a symbol instance), ids?|id?, focus?: true (false keeps the active proxy), keepModel?: false (in a CMYK document, RGB colours and gradient stops are stored as CMYK unless true; Gray stays Gray), target?: \"object\"|\"contents\", span?: \"object\" (default: each target fits a gradient to its own bounds)|\"selection\" (a linear, radial, conic or diamond `gradient` without start/end is placed once on the union of the targets' bounds, so it runs across them)} sets the selection's fill and the default (new art fits a gradient to itself); a solid colour recolours only the gradient mesh point last clicked with the Mesh tool or Direct Selection; while the Type tool has characters selected (and no ids or item are given), the paint goes to those characters only; without `item`, a grayscale or 1-bit image takes a solid color as the color it is drawn in (white pixels transparent; `none` takes it off; an image with an alpha channel takes only a spot color, black or white; a colorized image whose link is missing takes a solid color as its new colorize color, and refuses a process color while its color is a spot color, black or white); with an object of a dynamic symbol instance selected by Direct Selection and no ids, id or item, that object's fill changes for this instance only (solid, none, gradient or pattern). On a path directly in a graph series, the graph also stores the paint of the topmost visible fill when the command wrote that row or changed it, and its opacity when `opacity` changed it (exceptions: docs/mcp.md); on a graph label, the graph stores the paint for every label of its kind, as a character fill when the characters took it and with the label's rows when a row did → {objects: how many objects took the paint (the objects inside a group, unless an appearance item of the group's own is targeted; 0 when only the default changed)}",
|
||||
has_doc,
|
||||
|s, p| set_paint(s, p, true)
|
||||
),
|
||||
@@ -30,7 +30,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Stroke",
|
||||
[],
|
||||
None,
|
||||
"{…as paint.setFill, item?: the stroke item to set} same as paint.setFill, for the stroke; with an object of a dynamic symbol instance selected by Direct Selection and no ids, id or item, that object's stroke changes for this instance only (solid, none, gradient or pattern). On a path directly in a graph series, the graph also stores the paint and weight of the topmost visible stroke when the command wrote that row or changed it (exceptions: docs/mcp.md); on a graph label, as paint.setFill",
|
||||
"{…as paint.setFill, item?: the stroke item to set, opacity?: 0..100 (the opacity of that stroke item, as paint.setFill's for the fill item)} same as paint.setFill, for the stroke; with an object of a dynamic symbol instance selected by Direct Selection and no ids, id or item, that object's stroke changes for this instance only (solid, none, gradient or pattern). On a path directly in a graph series, the graph also stores the paint and weight of the topmost visible stroke when the command wrote that row or changed it, and its opacity when `opacity` changed it (exceptions: docs/mcp.md); on a graph label, as paint.setFill",
|
||||
has_doc,
|
||||
|s, p| { set_paint(s, p, false) }
|
||||
),
|
||||
@@ -154,7 +154,7 @@ pub fn proxy_specs() -> Vec<CommandSpec> {
|
||||
"Fill and Stroke",
|
||||
[],
|
||||
None,
|
||||
"{} → {fill, stroke: the paints the Fill/Stroke proxies show (the Appearance panel's active item for the proxy of its kind, else the first selected object's, a group's first painted object's, type: its first run's; else the defaults for new art), fillActive, fillMixed, strokeMixed: the selected objects' (or a selected group's contents') fills (strokes) differ, shown as a \"?\" proxy}",
|
||||
"{} → {fill, stroke: the paints the Fill/Stroke proxies show (the Appearance panel's active item for the proxy of its kind, else the first selected object's, a group's first painted object's, type: its first run's; else the defaults for new art), fillActive, fillMixed, strokeMixed: the selected objects' (or a selected group's contents') fills (strokes) differ, shown as a \"?\" proxy, fillOpacity, strokeOpacity: 0..100, the opacity of the fill (stroke) item that paint.setFill {opacity} sets, from the first selected object (or painted object in a selected group) that has one (a gradient mesh's first picked point's), or null with nothing selected (the defaults for new art), for an object selected in a symbol instance, and when only type characters or objects without that item are selected}",
|
||||
always,
|
||||
proxies
|
||||
),
|
||||
@@ -208,6 +208,44 @@ impl Session {
|
||||
nodes.first().map(|n| (Cow::Borrowed(*n), None))
|
||||
}
|
||||
|
||||
/// The opacity (0..1) of the fill (or stroke) that `paint.setFill {opacity}` sets: the item's,
|
||||
/// or for a gradient mesh with points picked the first picked point's. The rows the command
|
||||
/// would edit are read in order (a group without an active Appearance row stands for its
|
||||
/// contents), and the first that exists answers. `None` with nothing selected, for an object
|
||||
/// selected in a symbol instance, and when only type characters or objects without that item
|
||||
/// are selected.
|
||||
pub fn proxy_opacity(&self, stroke: bool) -> Option<f32> {
|
||||
let st = self.active()?;
|
||||
if st.selection.symbol_part.is_some() {
|
||||
return None;
|
||||
}
|
||||
let item = self.appearance_item();
|
||||
let of = |n: &Node, item: Option<usize>| -> Option<f32> {
|
||||
if item.is_none() && matches!(n.kind, NodeKind::Text(_)) {
|
||||
return None;
|
||||
}
|
||||
if !stroke
|
||||
&& item.is_none()
|
||||
&& let NodeKind::Mesh(m) = &n.kind
|
||||
&& let Some((_, points)) = picked_mesh_points(self, &[n.id]).first()
|
||||
{
|
||||
return points.first().and_then(|i| m.points.get(*i)).map(|q| q.opacity);
|
||||
}
|
||||
if stroke { n.appearance.stroke_at(item).map(|s| s.opacity) } else { n.appearance.fill_at(item).map(|f| f.opacity) }
|
||||
};
|
||||
let subjects = st.selection.subjects();
|
||||
// As the command picks its rows (ItemTarget::of_kind): the active item when it is a row of
|
||||
// this kind in the first selected object's stack, read in the selected objects' own
|
||||
// stacks; else the topmost one of the painted leaves (a group's contents).
|
||||
let first = subjects.first().and_then(|id| st.doc.node(*id));
|
||||
let active = item.filter(|i| first.and_then(|n| n.appearance.items.get(*i)).is_some_and(|it| it.is_fill() == !stroke));
|
||||
if active.is_some() {
|
||||
return subjects.iter().filter_map(|id| st.doc.node(*id)).find_map(|n| of(n, active));
|
||||
}
|
||||
let leaves = super::leaf_targets(self, subjects).ok()?;
|
||||
leaves.iter().filter_map(|id| st.doc.node(*id)).find_map(|n| of(n, None))
|
||||
}
|
||||
|
||||
pub(crate) fn remember_paint_now(&mut self, p: &Paint) {
|
||||
match p {
|
||||
Paint::Solid { color, .. } => {
|
||||
@@ -321,7 +359,12 @@ impl Session {
|
||||
fn proxies(s: &mut Session, _: &Value) -> Result<Value> {
|
||||
let (fill, stroke) = s.proxy_paints();
|
||||
let (fill_mixed, stroke_mixed) = s.proxy_mixed();
|
||||
Ok(json!({"fill": fill, "stroke": stroke, "fillActive": s.fill_active, "fillMixed": fill_mixed, "strokeMixed": stroke_mixed}))
|
||||
// As transparency.info answers an opacity: a percentage to two places.
|
||||
let percent = |o: Option<f32>| o.map(|o| (f64::from(o) * 10_000.0).round() / 100.0);
|
||||
Ok(json!({
|
||||
"fill": fill, "stroke": stroke, "fillActive": s.fill_active, "fillMixed": fill_mixed, "strokeMixed": stroke_mixed,
|
||||
"fillOpacity": percent(s.proxy_opacity(false)), "strokeOpacity": percent(s.proxy_opacity(true)),
|
||||
}))
|
||||
}
|
||||
|
||||
/// `stroke` param, defaulting to the proxy that is in front.
|
||||
@@ -440,13 +483,34 @@ fn set_paint(s: &mut Session, p: &Value, fill: bool) -> Result<Value> {
|
||||
return Err(bad(cmd, "`tint` goes with a global or spot `swatch`"));
|
||||
}
|
||||
check_keep_model(p, cmd)?;
|
||||
let paint = paint_from(s, p)?.ok_or_else(|| bad(cmd, "give color, none, swatch or gradient"))?;
|
||||
let opacity = opacity_param(p, cmd)?;
|
||||
let paint = paint_from(s, p)?;
|
||||
if paint.is_none() && opacity.is_none() {
|
||||
return Err(bad(cmd, "give color, none, swatch, gradient or opacity"));
|
||||
}
|
||||
// As `paint.editGradient`: a `dither` given applies to gradient fills only. A gradient swatch
|
||||
// (named) keeps its own dither; `"swatch": null` names none.
|
||||
if !fill && matches!(&paint, Paint::Gradient(g) if g.gradient.dither) && p.get("swatch").and_then(Value::as_str).is_none() {
|
||||
if !fill && matches!(&paint, Some(Paint::Gradient(g)) if g.gradient.dither) && p.get("swatch").and_then(Value::as_str).is_none() {
|
||||
return Err(bad(cmd, "`dither` applies to gradient fills (paint.setFill)"));
|
||||
}
|
||||
apply_paint(s, p, paint, fill)
|
||||
apply_paint_opacity(s, p, paint, opacity, fill)
|
||||
}
|
||||
|
||||
/// The `opacity` param of `paint.setFill` and `paint.setStroke` (a percentage) as 0..1; `None`
|
||||
/// when it is left out or null.
|
||||
fn opacity_param(p: &Value, cmd: &str) -> Result<Option<f32>> {
|
||||
match p.get("opacity") {
|
||||
None | Some(Value::Null) => Ok(None),
|
||||
Some(v) => match v.as_f64() {
|
||||
Some(o) if (0.0..=100.0).contains(&o) => Ok(Some((o / 100.0) as f32)),
|
||||
_ => Err(bad(cmd, "`opacity` must be a number from 0 to 100")),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/// The error for an `opacity` that would go to type characters, which have no opacity of their own.
|
||||
fn characters_have_no_opacity(cmd: &str) -> EngineError {
|
||||
bad(cmd, "type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke")
|
||||
}
|
||||
|
||||
/// [`apply_paint`] on the proxy named by `stroke` (default: the active one), focusing it.
|
||||
@@ -459,15 +523,28 @@ fn apply_to_proxy(s: &mut Session, p: &Value, paint: Paint, cmd: &str) -> Result
|
||||
/// `paint.setFill`) and of the defaults for new art, focus its proxy unless `focus` is false, and
|
||||
/// remember the paint. Replies `{objects}`: how many objects took the paint.
|
||||
pub(crate) fn apply_paint(s: &mut Session, p: &Value, paint: Paint, fill: bool) -> Result<Value> {
|
||||
apply_paint_opacity(s, p, Some(paint), None, fill)
|
||||
}
|
||||
|
||||
/// [`apply_paint`] with `paint` optional, which also sets the `opacity` (0..1) of the fill (or
|
||||
/// stroke) item each target takes it on, in the same undo step: the picked gradient mesh points'
|
||||
/// own opacity for a fill, nothing on a target without that item. The opacity alone changes neither
|
||||
/// the defaults for new art nor the remembered colors. An opacity that would go only to type
|
||||
/// characters, to an object selected in a symbol instance, or to no target at all is an error.
|
||||
fn apply_paint_opacity(s: &mut Session, p: &Value, paint: Option<Paint>, opacity: Option<f32>, fill: bool) -> Result<Value> {
|
||||
let cmd = if fill { "paint.setFill" } else { "paint.setStroke" };
|
||||
let focus = switch_or(p, "focus", true, cmd)?;
|
||||
let span = spans_targets(p, &paint).map_err(|e| bad(cmd, e))?;
|
||||
let span = match &paint {
|
||||
Some(paint) => spans_targets(p, paint).map_err(|e| bad(cmd, e))?,
|
||||
None => false,
|
||||
};
|
||||
// Characters selected with the Type tool take the paint, not the whole type object (#1063).
|
||||
if p.get("ids").is_none()
|
||||
&& p.get("item").is_none()
|
||||
&& let Some((id, a, b)) = super::textedit::editing_range(s)?
|
||||
&& a != b
|
||||
{
|
||||
let (Some(paint), None) = (paint, opacity) else { return Err(characters_have_no_opacity(cmd)) };
|
||||
// After Select All in threaded text, every frame's text takes it.
|
||||
let story = super::textedit::editing_story(s);
|
||||
let ranges: Vec<(NodeId, usize, usize)> =
|
||||
@@ -520,6 +597,9 @@ pub(crate) fn apply_paint(s: &mut Session, p: &Value, paint: Paint, fill: bool)
|
||||
// An object of a dynamic symbol instance's art selected with Direct Selection: that object's
|
||||
// fill or stroke changes for this instance only (solid, none, gradient or pattern).
|
||||
if let Some((id, path)) = selected_part_target(s, p, cmd)? {
|
||||
let Some(paint) = paint.filter(|_| opacity.is_none()) else {
|
||||
return Err(bad(cmd, "an object selected in a symbol instance has no fill or stroke opacity of its own"));
|
||||
};
|
||||
super::brushsym::edit_part(s, id, &path, if fill { "Fill Color" } else { "Stroke Color" }, |o| {
|
||||
if fill {
|
||||
o.fill = Some(paint.clone());
|
||||
@@ -538,23 +618,124 @@ pub(crate) fn apply_paint(s: &mut Session, p: &Value, paint: Paint, fill: bool)
|
||||
let item = item_target(s, p, cmd)?.of_kind(s, fill);
|
||||
let selected = item.targets(s, p)?;
|
||||
let ids = super::graph::paint_targets(&s.doc()?.doc, &selected);
|
||||
let paint = if span { placed_across(&s.doc()?.doc, &ids, paint, p, fill) } else { paint };
|
||||
// An opacity has nothing to go to without targets; with a paint, the defaults then stay too.
|
||||
if opacity.is_some() && ids.is_empty() {
|
||||
return Err(bad(cmd, "select objects or give ids"));
|
||||
}
|
||||
let paint = match paint {
|
||||
Some(paint) if span => Some(placed_across(&s.doc()?.doc, &ids, paint, p, fill)),
|
||||
paint => paint,
|
||||
};
|
||||
// The gradient mesh points picked with the Mesh tool or Direct Selection: a solid fill
|
||||
// recolours just those points of their meshes.
|
||||
let mesh_points = if fill && matches!(paint, Paint::Solid { .. }) { picked_mesh_points(s, &ids) } else { vec![] };
|
||||
// recolours just those points of their meshes, and a fill opacity fades just them.
|
||||
let mesh_points = if fill && matches!(paint, Some(Paint::Solid { .. }) | None) { picked_mesh_points(s, &ids) } else { vec![] };
|
||||
// Without `item`, unless the Appearance panel's active fill item takes the paint.
|
||||
let colorized = if fill && p.get("item").is_none() && item == ItemTarget::Top {
|
||||
colorized_images(&s.doc()?.doc, &ids, &paint).map_err(|e| bad(cmd, e))?
|
||||
} else {
|
||||
vec![]
|
||||
let colorized = match &paint {
|
||||
Some(paint) if fill && p.get("item").is_none() && item == ItemTarget::Top => {
|
||||
colorized_images(&s.doc()?.doc, &ids, paint).map_err(|e| bad(cmd, e))?
|
||||
}
|
||||
_ => vec![],
|
||||
};
|
||||
let label = match paint {
|
||||
None => "Opacity",
|
||||
Some(_) if fill => "Fill Color",
|
||||
Some(_) => "Stroke Color",
|
||||
};
|
||||
let label = if fill { "Fill Color" } else { "Stroke Color" };
|
||||
// Each object whose appearance took the paint, with the row it went to, for the paint a graph stores for its series
|
||||
// (a series mark is a path, so it always has a row here).
|
||||
let written = std::cell::RefCell::new(Vec::new());
|
||||
// The type objects whose characters took the paint (no row targeted): only those change what a graph's labels keep
|
||||
// for their characters; a row edit is kept with the label's rows.
|
||||
let characters = std::cell::RefCell::new(Vec::new());
|
||||
// Whether a target took the opacity, and whether one would have given it to its characters.
|
||||
let (took_opacity, characters_skipped) = (std::cell::Cell::new(false), std::cell::Cell::new(false));
|
||||
let paint_one = |n: &mut Node, index: Option<usize>, paint: &Paint| -> Result<()> {
|
||||
if index.is_none() && matches!(n.kind, NodeKind::Text(_)) {
|
||||
characters.borrow_mut().push(n.id);
|
||||
}
|
||||
if index.is_none() && colorized.contains(&n.id) {
|
||||
n.extras_mut().colorize = paint.color().map(|_| Box::new(paint.clone()));
|
||||
return Ok(());
|
||||
}
|
||||
if index.is_none()
|
||||
&& let Paint::Solid { color, .. } = paint
|
||||
&& let Some((_, points)) = mesh_points.iter().find(|(id, _)| *id == n.id)
|
||||
&& let NodeKind::Mesh(m) = &mut n.kind
|
||||
{
|
||||
for i in points {
|
||||
if let Some(q) = m.points.get_mut(*i) {
|
||||
q.color = *color;
|
||||
}
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
if index.is_none()
|
||||
&& let NodeKind::Text(t) = &mut n.kind
|
||||
{
|
||||
let (xf, lb) = (t.xf, t.local_bounds());
|
||||
for r in &mut t.runs {
|
||||
if !fill && !paint.is_none() {
|
||||
run_stroke_weight(&mut r.style);
|
||||
}
|
||||
let (cur, b) = run_paint_mut(r, !fill, lb);
|
||||
*cur = place_run_paint(paint, p, xf, b);
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
// A missing top fill or stroke is created first: a new stroke's weight sizes the box its
|
||||
// gradient fits.
|
||||
if n.appearance.paint_at(index, fill).is_none() {
|
||||
n.appearance.set_paint_at(index, fill, Paint::None);
|
||||
}
|
||||
if !fill {
|
||||
restore_unpainted_stroke(&mut n.appearance, index, paint);
|
||||
}
|
||||
let new_paint = keep_pattern_xf(paint, p, n.appearance.paint_at(index, fill));
|
||||
let placed = place_paint(&new_paint, p, item_paint_bounds(n, index, fill));
|
||||
n.appearance.set_paint_at(index, fill, placed);
|
||||
if !fill
|
||||
&& paint.is_none()
|
||||
&& let Some(stroke) = n.appearance.stroke_at_mut(index)
|
||||
{
|
||||
// A stroke without paint has no weight; painting it again restores the 1 pt default.
|
||||
stroke.width = 0.0;
|
||||
}
|
||||
if !fill {
|
||||
super::object::snap_if_aligned(n);
|
||||
}
|
||||
let at = match index {
|
||||
Some(_) => n.appearance.item_of_kind(index, fill),
|
||||
None => n.appearance.items.iter().rposition(|it| it.is_fill() == fill),
|
||||
};
|
||||
written.borrow_mut().extend(at.map(|at| (n.id, at)));
|
||||
Ok(())
|
||||
};
|
||||
// The opacity goes to what the paint went to: the picked mesh points, else the fill or stroke
|
||||
// item. Characters, and targets without that item, are left as they are.
|
||||
let opacity_one = |n: &mut Node, index: Option<usize>, o: f32| {
|
||||
if index.is_none() && matches!(n.kind, NodeKind::Text(_)) {
|
||||
characters_skipped.set(true);
|
||||
return;
|
||||
}
|
||||
if index.is_none()
|
||||
&& let Some((_, points)) = mesh_points.iter().find(|(id, _)| *id == n.id)
|
||||
&& let NodeKind::Mesh(m) = &mut n.kind
|
||||
{
|
||||
for i in points {
|
||||
if let Some(q) = m.points.get_mut(*i) {
|
||||
q.opacity = o;
|
||||
took_opacity.set(true);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
let item =
|
||||
if fill { n.appearance.fill_at_mut(index).map(|f| &mut f.opacity) } else { n.appearance.stroke_at_mut(index).map(|s| &mut s.opacity) };
|
||||
if let Some(item) = item {
|
||||
*item = o;
|
||||
took_opacity.set(true);
|
||||
}
|
||||
};
|
||||
edit_items_then(
|
||||
s,
|
||||
&ids,
|
||||
@@ -563,87 +744,47 @@ pub(crate) fn apply_paint(s: &mut Session, p: &Value, paint: Paint, fill: bool)
|
||||
label,
|
||||
fill,
|
||||
|n, index| {
|
||||
if index.is_none() && matches!(n.kind, NodeKind::Text(_)) {
|
||||
characters.borrow_mut().push(n.id);
|
||||
if let Some(paint) = &paint {
|
||||
paint_one(n, index, paint)?;
|
||||
}
|
||||
if index.is_none() && colorized.contains(&n.id) {
|
||||
n.extras_mut().colorize = paint.color().map(|_| Box::new(paint.clone()));
|
||||
return Ok(());
|
||||
if let Some(o) = opacity {
|
||||
opacity_one(n, index, o);
|
||||
}
|
||||
if index.is_none()
|
||||
&& let Paint::Solid { color, .. } = &paint
|
||||
&& let Some((_, points)) = mesh_points.iter().find(|(id, _)| *id == n.id)
|
||||
&& let NodeKind::Mesh(m) = &mut n.kind
|
||||
{
|
||||
for i in points {
|
||||
if let Some(q) = m.points.get_mut(*i) {
|
||||
q.color = *color;
|
||||
}
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
if index.is_none()
|
||||
&& let NodeKind::Text(t) = &mut n.kind
|
||||
{
|
||||
let (xf, lb) = (t.xf, t.local_bounds());
|
||||
for r in &mut t.runs {
|
||||
if !fill && !paint.is_none() {
|
||||
run_stroke_weight(&mut r.style);
|
||||
}
|
||||
let (cur, b) = run_paint_mut(r, !fill, lb);
|
||||
*cur = place_run_paint(&paint, p, xf, b);
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
// A missing top fill or stroke is created first: a new stroke's weight sizes the box its
|
||||
// gradient fits.
|
||||
if n.appearance.paint_at(index, fill).is_none() {
|
||||
n.appearance.set_paint_at(index, fill, Paint::None);
|
||||
}
|
||||
if !fill {
|
||||
restore_unpainted_stroke(&mut n.appearance, index, &paint);
|
||||
}
|
||||
let new_paint = keep_pattern_xf(&paint, p, n.appearance.paint_at(index, fill));
|
||||
let placed = place_paint(&new_paint, p, item_paint_bounds(n, index, fill));
|
||||
n.appearance.set_paint_at(index, fill, placed);
|
||||
if !fill
|
||||
&& paint.is_none()
|
||||
&& let Some(stroke) = n.appearance.stroke_at_mut(index)
|
||||
{
|
||||
// A stroke without paint has no weight; painting it again restores the 1 pt default.
|
||||
stroke.width = 0.0;
|
||||
}
|
||||
if !fill {
|
||||
super::object::snap_if_aligned(n);
|
||||
}
|
||||
let at = match index {
|
||||
Some(_) => n.appearance.item_of_kind(index, fill),
|
||||
None => n.appearance.items.iter().rposition(|it| it.is_fill() == fill),
|
||||
};
|
||||
written.borrow_mut().extend(at.map(|at| (n.id, at)));
|
||||
Ok(())
|
||||
},
|
||||
|before, d, changed| {
|
||||
// An opacity that no target took is an error, which also takes back the paint given with it.
|
||||
if opacity.is_some() && !took_opacity.get() {
|
||||
if characters_skipped.get() {
|
||||
return Err(characters_have_no_opacity(cmd));
|
||||
}
|
||||
return Err(bad(cmd, "no target has that fill or stroke to take the opacity"));
|
||||
}
|
||||
// A graph keeps the opacity of a series mark's topmost visible fill and stroke for the whole series.
|
||||
let kept = opacity.is_some() && super::appearance::capture_series_changes(before, d, changed);
|
||||
let Some(paint) = &paint else { return Ok(kept) };
|
||||
let series = super::appearance::capture_series_paint_writes(before, d, changed, &written.borrow());
|
||||
let labels = super::graph::capture_label_styles(d, &characters.borrow(), &|st| {
|
||||
if fill {
|
||||
st.fill = unplaced(&paint);
|
||||
st.fill = unplaced(paint);
|
||||
} else {
|
||||
if !paint.is_none() {
|
||||
run_stroke_weight(st);
|
||||
}
|
||||
st.stroke = unplaced(&paint);
|
||||
st.stroke = unplaced(paint);
|
||||
}
|
||||
});
|
||||
Ok(series || labels)
|
||||
Ok(series || labels || kept)
|
||||
},
|
||||
)?;
|
||||
// Rejected edits leave the next shape's appearance and active proxy untouched.
|
||||
paint_new_art(s, &paint, fill);
|
||||
if focus {
|
||||
s.fill_active = fill;
|
||||
}
|
||||
s.remember_paint(&paint);
|
||||
// Rejected edits leave the next shape's appearance and active proxy untouched.
|
||||
if let Some(paint) = &paint {
|
||||
paint_new_art(s, paint, fill);
|
||||
s.remember_paint(paint);
|
||||
}
|
||||
Ok(json!({"objects": ids.iter().collect::<std::collections::BTreeSet<_>>().len()}))
|
||||
}
|
||||
|
||||
|
||||
@@ -116,6 +116,7 @@ mod outlineobject;
|
||||
pub(super) mod outlinestroke;
|
||||
mod overprint;
|
||||
mod package;
|
||||
mod paintopacity;
|
||||
mod paintproxy;
|
||||
mod panelcmds;
|
||||
mod paragraphs;
|
||||
|
||||
@@ -0,0 +1,293 @@
|
||||
//! `opacity` on `paint.setFill` and `paint.setStroke`: the opacity of the fill or stroke item the
|
||||
//! paint goes to, and `fillOpacity` and `strokeOpacity` on `paint.proxies`.
|
||||
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_color::{Color, Paint};
|
||||
use vectorcraft_doc::{Node, NodeKind};
|
||||
use vectorcraft_tools::{PointerEvent, PointerKind};
|
||||
|
||||
use crate::tooling::ViewInfo;
|
||||
use crate::*;
|
||||
|
||||
fn session() -> Session {
|
||||
let mut s = Session::new();
|
||||
s.execute("file.new", &json!({"width": 400, "height": 300})).unwrap();
|
||||
s
|
||||
}
|
||||
|
||||
fn rect(s: &mut Session, x: f64) -> NodeId {
|
||||
let r = s.execute("shape.rectangle", &json!({"x": x, "y": 10, "width": 100, "height": 50})).unwrap();
|
||||
NodeId(r["id"].as_u64().unwrap())
|
||||
}
|
||||
|
||||
fn text(s: &mut Session) -> NodeId {
|
||||
let r = s.execute("text.create", &json!({"x": 10, "y": 150, "text": "Hi"})).unwrap();
|
||||
NodeId(r["id"].as_u64().unwrap())
|
||||
}
|
||||
|
||||
fn node(s: &Session, id: NodeId) -> Node {
|
||||
s.doc().unwrap().doc.node(id).unwrap().clone()
|
||||
}
|
||||
|
||||
fn select(s: &mut Session, ids: &[NodeId]) {
|
||||
s.execute("select.set", &json!({"ids": ids.iter().map(|i| i.0).collect::<Vec<_>>()})).unwrap();
|
||||
}
|
||||
|
||||
fn fill_opacity(s: &Session, id: NodeId) -> f32 {
|
||||
node(s, id).appearance.fill().unwrap().opacity
|
||||
}
|
||||
|
||||
fn undo_labels(s: &Session) -> Vec<String> {
|
||||
s.doc().unwrap().history.undo.iter().map(|e| e.label.clone()).collect()
|
||||
}
|
||||
|
||||
fn proxies(s: &mut Session) -> Value {
|
||||
s.execute("paint.proxies", &json!({})).unwrap()
|
||||
}
|
||||
|
||||
/// `paint.setFill {opacity}` alone sets the opacity of the selected object's top fill item, as one
|
||||
/// undo step named Opacity, and leaves its paint, its stroke and the object's own opacity as they
|
||||
/// were; `paint.setStroke {opacity}` does the same for the top stroke, and `paint.proxies` answers
|
||||
/// both.
|
||||
#[test]
|
||||
fn opacity_alone_sets_the_fill_or_stroke_item() {
|
||||
let mut s = session();
|
||||
let id = rect(&mut s, 10.0);
|
||||
select(&mut s, &[id]);
|
||||
let before = node(&s, id);
|
||||
let undo = undo_labels(&s).len();
|
||||
s.execute("paint.setFill", &json!({"opacity": 40})).unwrap();
|
||||
let n = node(&s, id);
|
||||
assert!((fill_opacity(&s, id) - 0.4).abs() < 1e-6);
|
||||
assert_eq!(n.appearance.fill_paint(), before.appearance.fill_paint());
|
||||
assert_eq!(n.appearance.stroke().unwrap().opacity, 1.0);
|
||||
assert_eq!(n.opacity, 1.0);
|
||||
let labels = undo_labels(&s);
|
||||
assert_eq!((labels.len(), labels.last().map(String::as_str)), (undo + 1, Some("Opacity")));
|
||||
assert_eq!(proxies(&mut s)["fillOpacity"], 40.0);
|
||||
assert_eq!(proxies(&mut s)["strokeOpacity"], 100.0);
|
||||
// The defaults for new art keep their paint.
|
||||
assert_eq!(s.paint.fill, Paint::solid(Color::WHITE));
|
||||
|
||||
s.execute("paint.setStroke", &json!({"opacity": 25})).unwrap();
|
||||
assert!((node(&s, id).appearance.stroke().unwrap().opacity - 0.25).abs() < 1e-6);
|
||||
assert!((fill_opacity(&s, id) - 0.4).abs() < 1e-6);
|
||||
assert_eq!(proxies(&mut s)["strokeOpacity"], 25.0);
|
||||
}
|
||||
|
||||
/// A selected group stands for its contents: every member's fill takes the opacity, as one undo step.
|
||||
#[test]
|
||||
fn a_group_sets_every_member_in_one_step() {
|
||||
let mut s = session();
|
||||
let (a, b) = (rect(&mut s, 10.0), rect(&mut s, 200.0));
|
||||
select(&mut s, &[a, b]);
|
||||
s.execute("object.group", &json!({})).unwrap();
|
||||
let undo = undo_labels(&s).len();
|
||||
s.execute("paint.setFill", &json!({"opacity": 60})).unwrap();
|
||||
assert!((fill_opacity(&s, a) - 0.6).abs() < 1e-6 && (fill_opacity(&s, b) - 0.6).abs() < 1e-6);
|
||||
assert_eq!(undo_labels(&s).len(), undo + 1);
|
||||
}
|
||||
|
||||
/// A group with a fill of its own: without an active Appearance row, `paint.proxies` answers the
|
||||
/// opacity of the contents' fills, which `paint.setFill {opacity}` sets, not the group's own fill.
|
||||
#[test]
|
||||
fn a_group_with_its_own_fill_answers_for_its_contents() {
|
||||
let mut s = session();
|
||||
let (a, b) = (rect(&mut s, 10.0), rect(&mut s, 200.0));
|
||||
select(&mut s, &[a, b]);
|
||||
s.execute("object.group", &json!({})).unwrap();
|
||||
let g = s.doc().unwrap().selection.subjects()[0];
|
||||
select(&mut s, &[g]);
|
||||
s.execute("appearance.addFill", &json!({})).unwrap();
|
||||
let own = node(&s, g).appearance.items.iter().position(|it| it.is_fill()).unwrap();
|
||||
s.execute("paint.setFill", &json!({"item": own, "opacity": 30})).unwrap();
|
||||
select(&mut s, &[g]);
|
||||
assert_eq!(proxies(&mut s)["fillOpacity"], 100.0);
|
||||
s.execute("paint.setFill", &json!({"opacity": 60})).unwrap();
|
||||
assert_eq!(proxies(&mut s)["fillOpacity"], 60.0);
|
||||
assert!((node(&s, g).appearance.items[own].opacity() - 0.3).abs() < 1e-6, "the group's own fill keeps its opacity");
|
||||
}
|
||||
|
||||
/// With the Appearance panel's lower fill row active, that row takes the opacity and the top fill
|
||||
/// keeps its own.
|
||||
#[test]
|
||||
fn the_active_appearance_row_takes_the_opacity() {
|
||||
let mut s = session();
|
||||
let id = rect(&mut s, 10.0);
|
||||
select(&mut s, &[id]);
|
||||
s.execute("appearance.addFill", &json!({})).unwrap(); // [Fill, Stroke, Fill]
|
||||
s.execute("appearance.setActiveItem", &json!({"index": 0})).unwrap();
|
||||
s.execute("paint.setFill", &json!({"opacity": 30})).unwrap();
|
||||
let ap = node(&s, id).appearance;
|
||||
assert!((ap.items[0].opacity() - 0.3).abs() < 1e-6);
|
||||
assert_eq!(ap.items[2].opacity(), 1.0);
|
||||
assert_eq!(proxies(&mut s)["fillOpacity"], 30.0);
|
||||
}
|
||||
|
||||
/// A color and an opacity change together in one undo step, and the same call again records no
|
||||
/// step.
|
||||
#[test]
|
||||
fn color_and_opacity_are_one_step_and_a_repeat_records_none() {
|
||||
let mut s = session();
|
||||
let id = rect(&mut s, 10.0);
|
||||
select(&mut s, &[id]);
|
||||
let undo = undo_labels(&s).len();
|
||||
let p = json!({"color": "#ff0000", "opacity": 50});
|
||||
s.execute("paint.setFill", &p).unwrap();
|
||||
assert_eq!(node(&s, id).appearance.fill_paint(), Paint::solid(Color::rgb8(255, 0, 0)));
|
||||
assert!((fill_opacity(&s, id) - 0.5).abs() < 1e-6);
|
||||
assert_eq!(undo_labels(&s).len(), undo + 1);
|
||||
assert_eq!(undo_labels(&s).last().map(String::as_str), Some("Fill Color"));
|
||||
s.execute("paint.setFill", &p).unwrap();
|
||||
s.execute("paint.setFill", &json!({"opacity": 50})).unwrap();
|
||||
assert_eq!(undo_labels(&s).len(), undo + 1);
|
||||
}
|
||||
|
||||
/// Bad values, nothing selected, and characters selected with the Type tool answer errors and leave
|
||||
/// the document and the defaults for new art as they were.
|
||||
#[test]
|
||||
fn errors_leave_the_document_and_defaults_alone() {
|
||||
let mut s = session();
|
||||
let id = rect(&mut s, 10.0);
|
||||
select(&mut s, &[id]);
|
||||
for bad in [json!(101), json!(-1), json!("50"), json!(true)] {
|
||||
let e = s.execute("paint.setFill", &json!({"opacity": bad})).unwrap_err();
|
||||
assert!(e.to_string().contains("`opacity` must be a number from 0 to 100"), "{bad}: {e}");
|
||||
}
|
||||
let e = s.execute("paint.setFill", &json!({})).unwrap_err();
|
||||
assert!(e.to_string().contains("give color, none, swatch, gradient or opacity"), "{e}");
|
||||
s.execute("select.none", &json!({})).unwrap();
|
||||
let doc = s.doc().unwrap().doc.clone();
|
||||
for p in [json!({"opacity": 40}), json!({"color": "#ff0000", "opacity": 40})] {
|
||||
let e = s.execute("paint.setFill", &p).unwrap_err();
|
||||
assert!(e.to_string().contains("select objects or give ids"), "{p}: {e}");
|
||||
}
|
||||
assert_eq!(s.paint.fill, Paint::solid(Color::WHITE));
|
||||
assert_eq!(*s.doc().unwrap().doc, *doc);
|
||||
|
||||
// Characters selected with the Type tool.
|
||||
let v = ViewInfo::default();
|
||||
s.select_tool("type", v).unwrap();
|
||||
for kind in [PointerKind::Down, PointerKind::Up] {
|
||||
s.pointer(&PointerEvent::new(kind, 50.0, 250.0), v).unwrap();
|
||||
}
|
||||
s.tool_text("Sample", v).unwrap();
|
||||
s.set_tool_option("select", &json!({"start": 0, "end": 3}));
|
||||
let doc = s.doc().unwrap().doc.clone();
|
||||
for p in [json!({"opacity": 40}), json!({"color": "#ff0000", "opacity": 40})] {
|
||||
let e = s.execute("paint.setFill", &p).unwrap_err();
|
||||
assert!(e.to_string().contains("type characters have no opacity of their own"), "{p}: {e}");
|
||||
}
|
||||
assert_eq!(*s.doc().unwrap().doc, *doc);
|
||||
assert_eq!(proxies(&mut s)["fillOpacity"], Value::Null);
|
||||
}
|
||||
|
||||
/// A type object whose characters take the paint is left alone beside a rectangle that takes the
|
||||
/// opacity, with no error; alone, it answers the characters error.
|
||||
#[test]
|
||||
fn type_beside_other_art_is_left_alone() {
|
||||
let mut s = session();
|
||||
let r = rect(&mut s, 10.0);
|
||||
let t = text(&mut s);
|
||||
let runs = |s: &Session| match &node(s, t).kind {
|
||||
NodeKind::Text(t) => t.runs.clone(),
|
||||
_ => panic!("not type"),
|
||||
};
|
||||
let before = (node(&s, t), runs(&s));
|
||||
select(&mut s, &[r, t]);
|
||||
s.execute("paint.setFill", &json!({"opacity": 40})).unwrap();
|
||||
assert!((fill_opacity(&s, r) - 0.4).abs() < 1e-6);
|
||||
assert_eq!((node(&s, t), runs(&s)), before);
|
||||
select(&mut s, &[t]);
|
||||
assert_eq!(proxies(&mut s)["fillOpacity"], Value::Null);
|
||||
let e = s.execute("paint.setFill", &json!({"opacity": 40})).unwrap_err();
|
||||
assert!(e.to_string().contains("type characters have no opacity of their own"), "{e}");
|
||||
assert_eq!((node(&s, t), runs(&s)), before);
|
||||
}
|
||||
|
||||
/// A color with an opacity on type alone answers the characters error and takes the color back too.
|
||||
#[test]
|
||||
fn type_alone_takes_back_the_paint_given_with_an_opacity() {
|
||||
let mut s = session();
|
||||
let t = text(&mut s);
|
||||
select(&mut s, &[t]);
|
||||
let doc = s.doc().unwrap().doc.clone();
|
||||
let undo = undo_labels(&s).len();
|
||||
let e = s.execute("paint.setFill", &json!({"color": "#ff0000", "opacity": 40})).unwrap_err();
|
||||
assert!(e.to_string().contains("type characters have no opacity of their own"), "{e}");
|
||||
assert_eq!(*s.doc().unwrap().doc, *doc);
|
||||
assert_eq!(undo_labels(&s).len(), undo);
|
||||
assert_eq!(s.paint.fill, Paint::solid(Color::WHITE), "the defaults keep their paint");
|
||||
}
|
||||
|
||||
/// An opacity that no target takes (the only selected object has no fill item) is an error, with or
|
||||
/// without a paint, and leaves the document as it was; `paint.proxies` answers null for it, and
|
||||
/// beside an object with a fill item it answers that object's opacity.
|
||||
#[test]
|
||||
fn an_opacity_no_target_takes_is_an_error() {
|
||||
let mut s = session();
|
||||
let (a, b) = (rect(&mut s, 10.0), rect(&mut s, 200.0));
|
||||
select(&mut s, &[a]);
|
||||
s.execute("appearance.removeItem", &json!({"index": 0})).unwrap();
|
||||
assert!(node(&s, a).appearance.fill().is_none());
|
||||
assert_eq!(proxies(&mut s)["fillOpacity"], Value::Null);
|
||||
let doc = s.doc().unwrap().doc.clone();
|
||||
let e = s.execute("paint.setFill", &json!({"opacity": 40})).unwrap_err();
|
||||
assert!(e.to_string().contains("no target has that fill or stroke to take the opacity"), "{e}");
|
||||
assert_eq!(*s.doc().unwrap().doc, *doc);
|
||||
// A paint given with the opacity creates the fill, which takes the opacity.
|
||||
s.execute("paint.setFill", &json!({"color": "#ff0000", "opacity": 40})).unwrap();
|
||||
assert!((fill_opacity(&s, a) - 0.4).abs() < 1e-6);
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
assert_eq!(*s.doc().unwrap().doc, *doc);
|
||||
|
||||
select(&mut s, &[b]);
|
||||
s.execute("paint.setFill", &json!({"opacity": 70})).unwrap();
|
||||
select(&mut s, &[a, b]);
|
||||
assert_eq!(proxies(&mut s)["fillOpacity"], 70.0, "the first selected object with a fill item answers");
|
||||
s.execute("paint.setFill", &json!({"opacity": 20})).unwrap();
|
||||
assert!((fill_opacity(&s, b) - 0.2).abs() < 1e-6);
|
||||
assert!(node(&s, a).appearance.fill().is_none());
|
||||
}
|
||||
|
||||
/// An object selected in a dynamic symbol instance has no opacity of its own: `opacity` is an error
|
||||
/// that leaves the document alone, and `paint.proxies` answers null.
|
||||
#[test]
|
||||
fn an_object_in_a_symbol_instance_refuses_an_opacity() {
|
||||
let mut s = session();
|
||||
let id = rect(&mut s, 10.0);
|
||||
select(&mut s, &[id]);
|
||||
let inst = s.execute("symbol.new", &json!({"name": "One", "ids": [id.0], "type": "dynamic"})).unwrap()["id"].clone();
|
||||
s.execute("symbol.instance.selectPart", &json!({"id": inst, "path": []})).unwrap();
|
||||
let doc = s.doc().unwrap().doc.clone();
|
||||
for p in [json!({"opacity": 40}), json!({"color": "#ff0000", "opacity": 40})] {
|
||||
let e = s.execute("paint.setFill", &p).unwrap_err();
|
||||
assert!(e.to_string().contains("an object selected in a symbol instance has no fill or stroke opacity of its own"), "{p}: {e}");
|
||||
}
|
||||
assert_eq!(*s.doc().unwrap().doc, *doc);
|
||||
assert_eq!(proxies(&mut s)["fillOpacity"], Value::Null);
|
||||
}
|
||||
|
||||
/// A gradient mesh point picked with the Mesh tool takes a fill opacity itself, and the proxy shows
|
||||
/// it; the object's fill item and the other points stay as they were.
|
||||
#[test]
|
||||
fn a_picked_mesh_point_takes_the_fill_opacity() {
|
||||
let mut s = session();
|
||||
let m = rect(&mut s, 10.0);
|
||||
select(&mut s, &[m]);
|
||||
s.execute("object.mesh.create", &json!({"rows": 2, "cols": 2})).unwrap();
|
||||
select(&mut s, &[m]);
|
||||
let v = ViewInfo::default();
|
||||
let NodeKind::Mesh(g) = &node(&s, m).kind else { panic!("not a mesh") };
|
||||
let q = g.points[4].p;
|
||||
s.select_tool("mesh", v).unwrap();
|
||||
for kind in [PointerKind::Down, PointerKind::Up] {
|
||||
s.pointer(&PointerEvent::new(kind, q.x, q.y), v).unwrap();
|
||||
}
|
||||
s.execute("paint.setFill", &json!({"opacity": 30})).unwrap();
|
||||
let NodeKind::Mesh(g) = &node(&s, m).kind else { panic!("not a mesh") };
|
||||
let o: Vec<f32> = g.points.iter().map(|p| p.opacity).collect();
|
||||
assert!((o[4] - 0.3).abs() < 1e-6, "{o:?}");
|
||||
assert!(o.iter().enumerate().all(|(i, a)| i == 4 || *a == 1.0), "{o:?}");
|
||||
assert_eq!(proxies(&mut s)["fillOpacity"], 30.0);
|
||||
}
|
||||
@@ -1324,7 +1324,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
|
||||
"ui.colorWheel",
|
||||
"Color Wheel Options",
|
||||
"",
|
||||
"{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, and pick the box's channel, as Box Channel does: the box is a color field with the channel's strip at its right, and the field shows the other two components (hue: saturation across and brightness up; saturation: hue across and brightness up; brightness: hue across and saturation up; red: blue across and green up; green: blue across and red up; blue: red across and green up); keys left out keep their values, params that are not an object, another key or a value off the list are an error and change nothing, both are kept with the preferences, and the command does not open the panel (window.panel {panel: \"colorWheel\"} does) (ui.inspect: ui.color_wheel) → {view, channel}",
|
||||
"{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, opacity?: 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); opacity checks (true) or unchecks (false) Show Opacity, as the panel menu does: a row under the wheel or the box with a slider and a percent field that set the opacity of what the panel edits (the fill or stroke item, as paint.setFill {opacity} sets it, the selected gradient stop, or the selected freeform point, the first stop or point when none is selected; gray with nothing selected, for an object selected in a symbol instance, and when the fill or stroke item it would set is on type characters or missing); keys left out keep their values, params that are not an object, another key or a value off the list (opacity: not true or false) 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, opacity}",
|
||||
),
|
||||
(
|
||||
"ui.savePdfDialog",
|
||||
|
||||
@@ -2287,6 +2287,7 @@ font-technology Variable Променливи
|
||||
One Point Perspective Preset 5 Предварителна настройка 5 за едноточкова перспектива
|
||||
Only Web Colors Само уеб цветове
|
||||
Opacity Непрозрачност
|
||||
Show Opacity Показване на непрозрачността
|
||||
Opacity & Mask Define Knockout Shape Непрозрачността и маската определят формата на изрязване
|
||||
Opacity Mask Маска за непрозрачност
|
||||
Opacity Mask Info Информация за маската за непрозрачност
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -450,6 +450,7 @@
|
||||
Fill & Stroke Ispuna i potez
|
||||
Fill Color Boja ispune
|
||||
Opacity Neprozirnost
|
||||
Show Opacity Prikaži neprozirnost
|
||||
Stroke Color Boja poteza
|
||||
Fill Gradient Gradijent ispune
|
||||
Stroke Gradient Gradijent poteza
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -2911,6 +2911,7 @@ digits Malayalam Malaiàlam
|
||||
One Point Perspective Preset 5 Preajust 5 de perspectiva d’un punt
|
||||
Only Web Colors Només colors web
|
||||
Opacity Opacitat
|
||||
Show Opacity Mostra l’opacitat
|
||||
Opacity & Mask Define Knockout Shape L’opacitat i la màscara defineixen la forma d’exclusió
|
||||
Opacity Mask Màscara d’opacitat
|
||||
Opacity Mask Info Informació de la màscara d’opacitat
|
||||
@@ -6550,6 +6551,11 @@ digits Malayalam Malaiàlam
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` i `maxItems` han de ser 0-{MAX_LIST}, `maxItems` com a mínim 1, i el valor predeterminat ha de tenir aquesta quantitat
|
||||
@msg `name` must be a string `name` ha de ser una cadena
|
||||
@msg `opacity` must be a number `opacity` ha de ser un nombre
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` ha de ser un nombre del 0 al 100
|
||||
@msg `opacity` must be true or false `opacity` ha de ser true o false
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke els caràcters de text no tenen opacitat pròpia: afegiu un farciment o un traç amb Afegeix un farciment nou o Afegeix un traç nou del tauler Aparença
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own un objecte seleccionat en una instància de símbol no té opacitat pròpia de farciment ni de traç
|
||||
@msg no target has that fill or stroke to take the opacity cap objectiu no té aquest farciment o traç per rebre l'opacitat
|
||||
@msg `type` must be "path" or "compound" `type` ha de ser "path" o "compound"
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit` ha de tenir 1-{MAX_UNIT} caràcters imprimibles
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen` ha d’indicar d’1 a {MAX_CONDITION_VALUES} valors per a `{other}`
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -463,6 +463,7 @@
|
||||
Fill & Stroke Výplň a tah
|
||||
Fill Color Barva výplně
|
||||
Opacity Krytí
|
||||
Show Opacity Zobrazit krytí
|
||||
Stroke Color Barva tahu
|
||||
Fill Gradient Přechod výplně
|
||||
Stroke Gradient Přechod tahu
|
||||
@@ -6445,6 +6446,11 @@ axis Y Axis osa Y
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` a `maxItems` musí být 0-{MAX_LIST}, `maxItems` alespoň 1 a výchozí hodnota musí mít tolik položek
|
||||
@msg `name` must be a string `name` musí být řetězec
|
||||
@msg `opacity` must be a number `opacity` musí být číslo
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` musí být číslo od 0 do 100
|
||||
@msg `opacity` must be true or false `opacity` musí být true nebo false
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke znaky textu nemají vlastní krytí: přidejte výplň nebo tah příkazem Přidat novou výplň nebo Přidat nový tah v panelu Vzhled
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own objekt vybraný v instanci symbolu nemá vlastní krytí výplně ani tahu
|
||||
@msg no target has that fill or stroke to take the opacity žádný cíl nemá tuto výplň nebo tah, který by převzal krytí
|
||||
@msg `type` must be "path" or "compound" `type` musí být "path" nebo "compound"
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit` musí mít 1-{MAX_UNIT} tisknutelných znaků
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen` musí uvádět 1 až {MAX_CONDITION_VALUES} hodnot pro `{other}`
|
||||
@@ -8252,6 +8258,7 @@ breakText Glyphs Glyfy
|
||||
@msg give a pattern name or select an object painted with a pattern zadejte název vzorku nebo vyberte objekt vybarvený vzorkem
|
||||
@msg give at least one of clip, invert, disabled, linked zadejte alespoň jedno z clip, invert, disabled, linked
|
||||
@msg give color, none, swatch or gradient zadejte color, none, swatch nebo gradient
|
||||
@msg give color, none, swatch, gradient or opacity zadejte color, none, swatch, gradient nebo opacity
|
||||
@msg give dataBase64 zadejte dataBase64
|
||||
@msg give either at (a click) or area (a path drawn around the overlaps) zadejte buď at (kliknutí), nebo area (cestu nakreslenou kolem překryvů)
|
||||
@msg give exactly one of `at`, `rect` and `points` zadejte právě jedno z `at`, `rect` a `points`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -418,6 +418,7 @@
|
||||
Fill & Stroke Fyld og streg
|
||||
Fill Color Fyldfarve
|
||||
Opacity Opacitet
|
||||
Show Opacity Vis opacitet
|
||||
Stroke Color Stregfarve
|
||||
Fill Gradient Fyldgradient
|
||||
Stroke Gradient Streggradient
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -2321,6 +2321,7 @@ file-filter Templates Vorlagen
|
||||
One Point Perspective Preset 5 Einpunktperspektive – Vorgabe 5
|
||||
Only Web Colors Nur Webfarben
|
||||
Opacity Deckkraft
|
||||
Show Opacity Deckkraft einblenden
|
||||
Opacity & Mask Define Knockout Shape Deckkraft und Maske definieren Aussparungsform
|
||||
Opacity Mask Deckkraftmaske
|
||||
Opacity Mask Info Informationen zur Deckkraftmaske
|
||||
@@ -6037,6 +6038,11 @@ axis Y Axis Y-Achse
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` und `maxItems` müssen 0-{MAX_LIST} sein, `maxItems` mindestens 1, und der Standardwert muss so viele Einträge haben
|
||||
@msg `name` must be a string `name` muss eine Zeichenkette sein
|
||||
@msg `opacity` must be a number `opacity` muss eine Zahl sein
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` muss eine Zahl von 0 bis 100 sein
|
||||
@msg `opacity` must be true or false `opacity` muss true oder false sein
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke Textzeichen haben keine eigene Deckkraft: Fügen Sie mit „Neue Fläche hinzufügen“ oder „Neue Kontur hinzufügen“ im Bedienfeld „Aussehen“ eine Fläche oder Kontur hinzu
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own ein in einer Symbolinstanz ausgewähltes Objekt hat keine eigene Flächen- oder Konturdeckkraft
|
||||
@msg no target has that fill or stroke to take the opacity kein Ziel hat diese Fläche oder Kontur, die die Deckkraft übernehmen könnte
|
||||
@msg `type` must be "path" or "compound" `type` muss "path" oder "compound" sein
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit` muss 1-{MAX_UNIT} druckbare Zeichen haben
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen` muss 1 bis {MAX_CONDITION_VALUES} Werte für `{other}` nennen
|
||||
@@ -8044,6 +8050,7 @@ breakText Glyphs Glyphen
|
||||
@msg give a pattern name or select an object painted with a pattern geben Sie einen Musternamen an, oder wählen Sie ein mit einem Muster gefärbtes Objekt aus
|
||||
@msg give at least one of clip, invert, disabled, linked geben Sie mindestens eines von clip, invert, disabled, linked an
|
||||
@msg give color, none, swatch or gradient geben Sie color, none, swatch oder gradient an
|
||||
@msg give color, none, swatch, gradient or opacity geben Sie color, none, swatch, gradient oder opacity an
|
||||
@msg give dataBase64 geben Sie dataBase64 an
|
||||
@msg give either at (a click) or area (a path drawn around the overlaps) geben Sie entweder at (einen Klick) oder area (einen um die Überlappungen gezeichneten Pfad) an
|
||||
@msg give formats or a preset, not both geben Sie formats oder eine Vorgabe an, nicht beides
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1899,6 +1899,7 @@ font-technology Variable Μεταβλητές
|
||||
On Ενεργό
|
||||
Only Web Colors Μόνο χρώματα ιστού
|
||||
Opacity Αδιαφάνεια
|
||||
Show Opacity Εμφάνιση αδιαφάνειας
|
||||
Opacity Mask Μάσκα αδιαφάνειας
|
||||
Opacity: Αδιαφάνεια:
|
||||
Open Άνοιγμα
|
||||
@@ -6397,6 +6398,11 @@ axis Y Axis Άξονας Y
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many τα `minItems` και `maxItems` πρέπει να είναι 0-{MAX_LIST}, το `maxItems` τουλάχιστον 1 και η προεπιλογή να έχει τόσα στοιχεία
|
||||
@msg `name` must be a string το `name` πρέπει να είναι συμβολοσειρά
|
||||
@msg `opacity` must be a number το `opacity` πρέπει να είναι αριθμός
|
||||
@msg `opacity` must be a number from 0 to 100 το `opacity` πρέπει να είναι αριθμός από 0 έως 100
|
||||
@msg `opacity` must be true or false το `opacity` πρέπει να είναι true ή false
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke οι χαρακτήρες κειμένου δεν έχουν δική τους αδιαφάνεια: προσθέστε γέμισμα ή περίγραμμα με την Προσθήκη νέου γεμίσματος ή την Προσθήκη νέου περιγράμματος του πίνακα Εμφάνιση
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own ένα αντικείμενο επιλεγμένο σε στιγμιότυπο συμβόλου δεν έχει δική του αδιαφάνεια γεμίσματος ή περιγράμματος
|
||||
@msg no target has that fill or stroke to take the opacity κανένας στόχος δεν έχει αυτό το γέμισμα ή περίγραμμα για να λάβει την αδιαφάνεια
|
||||
@msg `type` must be "path" or "compound" το `type` πρέπει να είναι "path" ή "compound"
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters το `unit` πρέπει να έχει 1-{MAX_UNIT} εκτυπώσιμους χαρακτήρες
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` το `visibleWhen` πρέπει να αναφέρει 1 έως {MAX_CONDITION_VALUES} τιμές για το `{other}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2359,6 +2359,7 @@ font-technology Variable Variables
|
||||
One Point Perspective Preset 5 Preajuste de perspectiva de un punto 5
|
||||
Only Web Colors Solo colores web
|
||||
Opacity Opacidad
|
||||
Show Opacity Mostrar opacidad
|
||||
Opacity & Mask Define Knockout Shape La opacidad y la máscara definen la forma de exclusión
|
||||
Opacity Mask Máscara de opacidad
|
||||
Opacity Mask Info Información de máscara de opacidad
|
||||
@@ -6388,6 +6389,11 @@ axis Y Axis Eje Y
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` y `maxItems` deben ser 0-{MAX_LIST}, `maxItems` al menos 1, y el valor predeterminado debe tener esa cantidad
|
||||
@msg `name` must be a string `name` debe ser una cadena
|
||||
@msg `opacity` must be a number `opacity` debe ser un número
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` debe ser un número de 0 a 100
|
||||
@msg `opacity` must be true or false `opacity` debe ser true o false
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke los caracteres de texto no tienen opacidad propia: agregue un relleno o un trazo con Agregar nuevo relleno o Agregar nuevo trazo del panel Apariencia
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own un objeto seleccionado en una instancia de símbolo no tiene opacidad propia de relleno ni de trazo
|
||||
@msg no target has that fill or stroke to take the opacity ningún destino tiene ese relleno o trazo para recibir la opacidad
|
||||
@msg `type` must be "path" or "compound" `type` debe ser "path" o "compound"
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit` debe tener 1-{MAX_UNIT} caracteres imprimibles
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen` debe indicar de 1 a {MAX_CONDITION_VALUES} valores para `{other}`
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -460,6 +460,7 @@
|
||||
Fill & Stroke Täyttö ja viiva
|
||||
Fill Color Täyttöväri
|
||||
Opacity Peittävyys
|
||||
Show Opacity Näytä peittävyys
|
||||
Stroke Color Viivan väri
|
||||
Fill Gradient Täytön liukuväri
|
||||
Stroke Gradient Viivan liukuväri
|
||||
@@ -6475,6 +6476,11 @@ axis Y Axis Y-akseli
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` ja `maxItems` on oltava 0-{MAX_LIST}, `maxItems` vähintään 1, ja oletusarvossa on oltava niin monta kohdetta
|
||||
@msg `name` must be a string `name` on oltava merkkijono
|
||||
@msg `opacity` must be a number `opacity` on oltava luku
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` on oltava luku 0:sta 100:aan
|
||||
@msg `opacity` must be true or false `opacity` on oltava true tai false
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke tekstin merkeillä ei ole omaa peittävyyttä: lisää täyttö tai viiva Ulkoasu-paneelin komennolla Lisää uusi täyttö tai Lisää uusi viiva
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own symbolin ilmentymästä valitulla objektilla ei ole omaa täytön tai viivan peittävyyttä
|
||||
@msg no target has that fill or stroke to take the opacity millään kohteella ei ole tätä täyttöä tai viivaa, joka ottaisi peittävyyden
|
||||
@msg `type` must be "path" or "compound" `type` on oltava "path" tai "compound"
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit`-kentässä on oltava 1-{MAX_UNIT} tulostettavaa merkkiä
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen`-kentässä on lueteltava 1-{MAX_CONDITION_VALUES} arvoa parametrille `{other}`
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -2351,6 +2351,7 @@ font-technology Variable Variables
|
||||
One Point Perspective Preset 5 Paramètre prédéfini de perspective à un point 5
|
||||
Only Web Colors Couleurs Web uniquement
|
||||
Opacity Opacité
|
||||
Show Opacity Afficher l’opacité
|
||||
Opacity & Mask Define Knockout Shape L’opacité et le masque définissent la forme de masquage
|
||||
Opacity Mask Masque d’opacité
|
||||
Opacity Mask Info Infos sur le masque d’opacité
|
||||
@@ -6440,6 +6441,11 @@ axis Y Axis Axe Y
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` et `maxItems` doivent valoir 0-{MAX_LIST}, `maxItems` au moins 1, et la valeur par défaut doit en compter autant
|
||||
@msg `name` must be a string `name` doit être une chaîne
|
||||
@msg `opacity` must be a number `opacity` doit être un nombre
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` doit être un nombre compris entre 0 et 100
|
||||
@msg `opacity` must be true or false `opacity` doit valoir true ou false
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke les caractères du texte n’ont pas d’opacité propre : ajoutez un fond ou un contour avec Ajouter un nouveau fond ou Ajouter un nouveau contour dans le panneau Aspect
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own un objet sélectionné dans une occurrence de symbole n’a pas d’opacité de fond ou de contour propre
|
||||
@msg no target has that fill or stroke to take the opacity aucune cible n’a ce fond ou ce contour pour recevoir l’opacité
|
||||
@msg `type` must be "path" or "compound" `type` doit valoir "path" ou "compound"
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit` doit compter 1-{MAX_UNIT} caractères imprimables
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen` doit indiquer 1 à {MAX_CONDITION_VALUES} valeurs pour `{other}`
|
||||
@@ -8233,6 +8239,7 @@ breakText Glyphs Glyphes
|
||||
@msg give a pattern name or select an object painted with a pattern indiquez un nom de motif ou sélectionnez un objet peint avec un motif
|
||||
@msg give at least one of clip, invert, disabled, linked indiquez au moins l’un des paramètres clip, invert, disabled, linked
|
||||
@msg give color, none, swatch or gradient indiquez color, none, swatch ou gradient
|
||||
@msg give color, none, swatch, gradient or opacity indiquez color, none, swatch, gradient ou opacity
|
||||
@msg give dataBase64 indiquez dataBase64
|
||||
@msg give either at (a click) or area (a path drawn around the overlaps) indiquez soit at (un clic), soit area (un tracé dessiné autour des chevauchements)
|
||||
@msg give exactly one of `path`, `data` and `dataBase64` indiquez exactement un paramètre parmi `path`, `data` et `dataBase64`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2391,6 +2391,7 @@
|
||||
One page per artboard. દરેક આર્ટબોર્ડ માટે એક પેજ.
|
||||
Only Web Colors માત્ર વેબ રંગો
|
||||
Opacity અપારદર્શકતા
|
||||
Show Opacity અપારદર્શકતા બતાવો
|
||||
Opacity & Mask Define Knockout Shape અપારદર્શકતા અને માસ્ક નૉકઆઉટ આકાર વ્યાખ્યાયિત કરે છે
|
||||
Opacity Mask Info અપારદર્શકતા માસ્ક માહિતી
|
||||
Opacity Mask Options અપારદર્શકતા માસ્ક વિકલ્પો
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 72 and column 5.
|
@@ -3183,6 +3183,7 @@ antiAlias Sharp शार्प
|
||||
One Point Perspective Preset 5 एक बिंदु पर्सपेक्टिव पूर्व निर्धारित 5
|
||||
Only Web Colors केवल वेब रंग
|
||||
Opacity ओपेसिटी
|
||||
Show Opacity ओपेसिटी दिखाएँ
|
||||
Opacity & Mask Define Knockout Shape ओपेसिटी एंड मास्क डिफ़ाइन नॉकआउट शेप
|
||||
Opacity Mask ओपेसिटी मास्क
|
||||
Opacity Mask Info ओपेसिटी मास्क की जानकारी
|
||||
@@ -5601,6 +5602,11 @@ antiAlias Sharp शार्प
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` और `maxItems` 0-{MAX_LIST} होने चाहिए, `maxItems` कम से कम 1, और डिफ़ॉल्ट में उतने ही आइटम होने चाहिए
|
||||
@msg `name` must be a string `name` एक स्ट्रिंग होना चाहिए
|
||||
@msg `opacity` must be a number `opacity` एक संख्या होना चाहिए
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` 0 से 100 तक की संख्या होना चाहिए
|
||||
@msg `opacity` must be true or false `opacity` true या false होना चाहिए
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke टेक्स्ट के कैरेक्टर्स की अपनी ओपेसिटी नहीं होती: अपीयरेंस पैनल के नया फ़िल जोड़ें या नया स्ट्रोक जोड़ें से फ़िल या स्ट्रोक जोड़ें
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own सिंबल इंस्टेंस में सिलेक्ट किए गए ऑब्जेक्ट की अपनी फ़िल या स्ट्रोक ओपेसिटी नहीं होती
|
||||
@msg no target has that fill or stroke to take the opacity किसी भी टारगेट में वह फ़िल या स्ट्रोक नहीं है जो ओपेसिटी ले सके
|
||||
@msg `type` must be "path" or "compound" `type` "path" या "compound" होना चाहिए
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit` में 1-{MAX_UNIT} प्रिंट करने योग्य वर्ण होने चाहिए
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen` में `{other}` के लिए 1 से {MAX_CONDITION_VALUES} मान होने चाहिए
|
||||
@@ -6908,6 +6914,7 @@ antiAlias Sharp शार्प
|
||||
@msg give at least one of clip, invert, disabled, linked कम से कम एक क्लिप, उलटा, विकलांग, लिंक्ड देना
|
||||
@msg give both `start` and `end` [x, y] (or neither) `start` और `end` दोनों [x, y] दें (या दोनों न दें)
|
||||
@msg give color, none, swatch or gradient color, none, swatch या gradient दें
|
||||
@msg give color, none, swatch, gradient or opacity color, none, swatch, gradient या opacity दें
|
||||
@msg give corners of the path: anchors between two straight sides पाथ के कोने: दो सीधे पक्षों के बीच एंकर
|
||||
@msg give corners of the path: anchors where its sides meet at an angle पाथ के कोने: एंकर जहां इसके पक्ष एक कोण पर मिलते हैं
|
||||
@msg give dataBase64 dataBase64 दें
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2831,6 +2831,7 @@ file-filter Templates Sablonok
|
||||
One Point Perspective Preset 5 Egypontos perspektíva, 5. előbeállítás
|
||||
Only Web Colors Csak webes színek
|
||||
Opacity Átlátszatlanság
|
||||
Show Opacity Átlátszatlanság megjelenítése
|
||||
Opacity & Mask Define Knockout Shape Az átlátszatlanság és a maszk adja a kiütés alakját
|
||||
Opacity Mask Átlátszósági maszk
|
||||
Opacity Mask Info Átlátszósági maszk adatai
|
||||
@@ -6428,6 +6429,11 @@ axis Y Axis Y tengely
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many a `minItems` és a `maxItems` 0-{MAX_LIST} legyen, a `maxItems` legalább 1, és az alapértelmezett érték ennyi elemből álljon
|
||||
@msg `name` must be a string `name`: karakterlánc kell
|
||||
@msg `opacity` must be a number `opacity`: szám kell
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity`: 0 és 100 közötti szám kell
|
||||
@msg `opacity` must be true or false `opacity`: true vagy false kell
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke a szöveg karaktereinek nincs saját átlátszatlansága: adjon hozzá kitöltést vagy körvonalat a Megjelenés panel Új kitöltés hozzáadása vagy Új körvonal hozzáadása parancsával
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own a szimbólumpéldányban kijelölt objektumnak nincs saját kitöltési vagy körvonal-átlátszatlansága
|
||||
@msg no target has that fill or stroke to take the opacity egyik célnak sincs olyan kitöltése vagy körvonala, amely felvehetné az átlátszatlanságot
|
||||
@msg `type` must be "path" or "compound" `type`: "path" vagy "compound" kell
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters a `unit` 1-{MAX_UNIT} nyomtatható karakter legyen
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` a `visibleWhen` 1-{MAX_CONDITION_VALUES} értéket adjon meg ehhez: `{other}`
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -418,6 +418,7 @@
|
||||
Fill & Stroke Isian & stroke
|
||||
Fill Color Warna isian
|
||||
Opacity Opasitas
|
||||
Show Opacity Tampilkan opasitas
|
||||
Stroke Color Warna stroke
|
||||
Fill Gradient Gradien isian
|
||||
Stroke Gradient Gradien stroke
|
||||
|
||||
|
@@ -2397,6 +2397,7 @@ file-filter Templates Modelli
|
||||
One Point Perspective Preset 5 Preset prospettiva a un punto 5
|
||||
Only Web Colors Solo colori web
|
||||
Opacity Opacità
|
||||
Show Opacity Mostra opacità
|
||||
Opacity & Mask Define Knockout Shape Opacità e maschera definiscono la forma di foratura
|
||||
Opacity Mask Maschera di opacità
|
||||
Opacity Mask Info Informazioni maschera di opacità
|
||||
@@ -6071,6 +6072,11 @@ axis Y Axis Asse Y
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` e `maxItems` devono essere 0-{MAX_LIST}, `maxItems` almeno 1, e il valore predefinito deve averne altrettanti
|
||||
@msg `name` must be a string `name` deve essere una stringa
|
||||
@msg `opacity` must be a number `opacity` deve essere un numero
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` deve essere un numero compreso tra 0 e 100
|
||||
@msg `opacity` must be true or false `opacity` deve essere true o false
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke i caratteri del testo non hanno un'opacità propria: aggiungi un riempimento o una traccia con Aggiungi nuovo riempimento o Aggiungi nuova traccia del pannello Aspetto
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own un oggetto selezionato in un'istanza di simbolo non ha un'opacità propria di riempimento o di traccia
|
||||
@msg no target has that fill or stroke to take the opacity nessuna destinazione ha quel riempimento o quella traccia per ricevere l'opacità
|
||||
@msg `type` must be "path" or "compound" `type` deve essere "path" o "compound"
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit` deve avere 1-{MAX_UNIT} caratteri stampabili
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen` deve elencare da 1 a {MAX_CONDITION_VALUES} valori per `{other}`
|
||||
@@ -8092,6 +8098,7 @@ breakText Glyphs Glifi
|
||||
@msg give a pattern name or select an object painted with a pattern indica il nome di un motivo o seleziona un oggetto dipinto con un motivo
|
||||
@msg give at least one of clip, invert, disabled, linked indica almeno uno tra clip, invert, disabled, linked
|
||||
@msg give color, none, swatch or gradient indica color, none, swatch o gradient
|
||||
@msg give color, none, swatch, gradient or opacity indica color, none, swatch, gradient o opacity
|
||||
@msg give dataBase64 indica dataBase64
|
||||
@msg give either at (a click) or area (a path drawn around the overlaps) indica at (un clic) o area (un tracciato disegnato attorno alle sovrapposizioni)
|
||||
@msg give formats or a preset, not both indica formats o un predefinito, non entrambi
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -502,6 +502,7 @@ digits Malayalam マラヤーラム数字
|
||||
Side Length: 辺の長さ:
|
||||
Make Sides Equal 辺の長さをそろえる
|
||||
Opacity 不透明度
|
||||
Show Opacity 不透明度を表示
|
||||
Pie End Angle: 扇形の終了角度:
|
||||
Pie Start Angle: 扇形の開始角度:
|
||||
Stroke Color カラー (線)
|
||||
@@ -6137,6 +6138,11 @@ axis Y Axis Y 軸
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` と `maxItems` は 0-{MAX_LIST}、`maxItems` は 1 以上にし、デフォルト値の項目数をその範囲にしてください
|
||||
@msg `name` must be a string `name` は文字列にしてください
|
||||
@msg `opacity` must be a number `opacity` には数値を指定してください
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` には 0 から 100 までの数値を指定してください
|
||||
@msg `opacity` must be true or false `opacity` には true または false を指定してください
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke 文字には独自の不透明度がありません。アピアランスパネルの「新規塗りを追加」または「新規線を追加」で塗りまたは線を追加してください
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own シンボルインスタンス内で選択したオブジェクトには、塗りや線の独自の不透明度がありません
|
||||
@msg no target has that fill or stroke to take the opacity 不透明度を適用できる塗りまたは線を持つ対象がありません
|
||||
@msg `type` must be "path" or "compound" `type` は "path" または "compound" にしてください
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit` は印刷可能な 1-{MAX_UNIT} 文字にしてください
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen` には `{other}` の値を 1 から {MAX_CONDITION_VALUES} 個指定してください
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -389,6 +389,7 @@
|
||||
Fill & Stroke შევსება და კონტური
|
||||
Fill Color შევსების ფერი
|
||||
Opacity გაუმჭვირვალობა
|
||||
Show Opacity გაუმჭვირვალობის ჩვენება
|
||||
Stroke Color კონტურის ფერი
|
||||
Fill Gradient შევსების გრადიენტი
|
||||
Stroke Gradient კონტურის გრადიენტი
|
||||
@@ -6396,6 +6397,11 @@ axis Y Axis Y ღერძი
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` და `maxItems` უნდა იყოს 0-{MAX_LIST}, `maxItems` მინიმუმ 1, ხოლო ნაგულისხმევ მნიშვნელობაში უნდა იყოს ამდენი ელემენტი
|
||||
@msg `name` must be a string `name` უნდა იყოს სტრიქონი
|
||||
@msg `opacity` must be a number `opacity` უნდა იყოს რიცხვი
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` უნდა იყოს რიცხვი 0-დან 100-მდე
|
||||
@msg `opacity` must be true or false `opacity` უნდა იყოს true ან false
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke ტექსტის სიმბოლოებს საკუთარი გაუმჭვირვალობა არ აქვთ: დაამატეთ შევსება ან კონტური იერსახის პანელის ბრძანებით ახალი შევსების დამატება ან ახალი კონტურის დამატება
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own სიმბოლოს ეგზემპლარში არჩეულ ობიექტს შევსების ან კონტურის საკუთარი გაუმჭვირვალობა არ აქვს
|
||||
@msg no target has that fill or stroke to take the opacity არცერთ სამიზნეს არ აქვს ის შევსება ან კონტური, რომელიც გაუმჭვირვალობას მიიღებს
|
||||
@msg `type` must be "path" or "compound" `type` უნდა იყოს "path" ან "compound"
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit` უნდა შედგებოდეს 1-{MAX_UNIT} დასაბეჭდი სიმბოლოსგან
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen`-ში `{other}`-ისთვის უნდა იყოს 1-დან {MAX_CONDITION_VALUES}-მდე მნიშვნელობა
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -495,6 +495,7 @@ digits Malayalam 말라얄람어
|
||||
Side Length: 변 길이:
|
||||
Make Sides Equal 변 길이 같게
|
||||
Opacity 불투명도
|
||||
Show Opacity 불투명도 표시
|
||||
Pie End Angle: 파이 끝 각도:
|
||||
Pie Start Angle: 파이 시작 각도:
|
||||
Stroke Color 선 색상
|
||||
@@ -6032,6 +6033,11 @@ axis Y Axis Y축
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems`와 `maxItems`는 0-{MAX_LIST}, `maxItems`는 1 이상이어야 하며 기본값의 항목 수도 그 범위여야 합니다
|
||||
@msg `name` must be a string `name`은(는) 문자열이어야 합니다
|
||||
@msg `opacity` must be a number `opacity`은(는) 숫자여야 합니다
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity`은(는) 0에서 100 사이의 숫자여야 합니다
|
||||
@msg `opacity` must be true or false `opacity`은(는) true 또는 false여야 합니다
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke 문자에는 자체 불투명도가 없습니다. 모양새 패널의 새 칠 추가 또는 새 선 추가로 칠이나 선을 추가하세요
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own 심볼 인스턴스에서 선택한 개체에는 자체 칠 또는 선 불투명도가 없습니다
|
||||
@msg no target has that fill or stroke to take the opacity 불투명도를 적용할 해당 칠 또는 선이 있는 대상이 없습니다
|
||||
@msg `type` must be "path" or "compound" `type`은(는) "path" 또는 "compound"여야 합니다
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit`은(는) 인쇄 가능한 문자 1-{MAX_UNIT}자여야 합니다
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen`에는 `{other}`의 값을 1-{MAX_CONDITION_VALUES}개 나열해야 합니다
|
||||
@@ -7845,6 +7851,7 @@ breakText Glyphs 글리프
|
||||
@msg give a pattern name or select an object painted with a pattern 패턴 이름을 지정하거나 패턴으로 칠한 개체를 선택하세요
|
||||
@msg give at least one of clip, invert, disabled, linked clip, invert, disabled, linked 중 하나 이상을 지정하세요
|
||||
@msg give color, none, swatch or gradient color, none, swatch 또는 gradient를 지정하세요
|
||||
@msg give color, none, swatch, gradient or opacity color, none, swatch, gradient 또는 opacity를 지정하세요
|
||||
@msg give dataBase64 dataBase64를 지정하세요
|
||||
@msg give either at (a click) or area (a path drawn around the overlaps) at(클릭) 또는 area(겹친 부분 둘레에 그린 패스) 중 하나를 지정하세요
|
||||
@msg give exactly one of `at`, `rect` and `points` `at`, `rect`, `points` 중 정확히 하나를 지정하세요
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -334,6 +334,11 @@
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` en `maxItems` moeten 0-{MAX_LIST} zijn, `maxItems` minstens 1, en de standaardwaarde zoveel items
|
||||
@msg `name` must be a string `name` moet een string zijn
|
||||
@msg `opacity` must be a number `opacity` moet een getal zijn
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` moet een getal van 0 tot 100 zijn
|
||||
@msg `opacity` must be true or false `opacity` moet true of false zijn
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke tekens van tekst hebben geen eigen dekking: voeg een vulling of streek toe met Nieuwe vulling toevoegen of Nieuwe streek toevoegen in het deelvenster Uiterlijk
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own een object dat in een symboolinstantie is geselecteerd, heeft geen eigen dekking voor vulling of streek
|
||||
@msg no target has that fill or stroke to take the opacity geen enkel doel heeft die vulling of streek om de dekking te krijgen
|
||||
@msg `type` must be "path" or "compound" `type` moet "path" of "compound" zijn
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit` moet uit 1-{MAX_UNIT} afdrukbare tekens bestaan
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen` noemt 1 tot {MAX_CONDITION_VALUES} waarden voor `{other}`
|
||||
@@ -936,6 +941,7 @@
|
||||
Fill & Stroke Vulling en contour
|
||||
Fill Color Vulkleur
|
||||
Opacity Dekking
|
||||
Show Opacity Dekking tonen
|
||||
Stroke Color Contourkleur
|
||||
Fill Gradient Vulverloop
|
||||
Stroke Gradient Contourverloop
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -422,6 +422,7 @@
|
||||
Fill & Stroke Wypełnienie i obrys
|
||||
Fill Color Kolor wypełnienia
|
||||
Opacity Krycie
|
||||
Show Opacity Pokaż krycie
|
||||
Stroke Color Kolor obrysu
|
||||
Fill Gradient Gradient wypełnienia
|
||||
Stroke Gradient Gradient obrysu
|
||||
@@ -6300,6 +6301,11 @@ axis Y Axis Oś Y
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` i `maxItems` muszą wynosić 0-{MAX_LIST}, `maxItems` co najmniej 1, a wartość domyślna musi mieć tyle elementów
|
||||
@msg `name` must be a string `name` musi być ciągiem znaków
|
||||
@msg `opacity` must be a number `opacity` musi być liczbą
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` musi być liczbą od 0 do 100
|
||||
@msg `opacity` must be true or false `opacity` musi mieć wartość true lub false
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke znaki tekstu nie mają własnego krycia: dodaj wypełnienie lub obrys poleceniem Dodaj nowe wypełnienie lub Dodaj nowy obrys w panelu Wygląd
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own obiekt zaznaczony w wystąpieniu symbolu nie ma własnego krycia wypełnienia ani obrysu
|
||||
@msg no target has that fill or stroke to take the opacity żaden cel nie ma tego wypełnienia ani obrysu, które przyjęłoby krycie
|
||||
@msg `type` must be "path" or "compound" `type` musi mieć wartość "path" lub "compound"
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit` musi mieć 1-{MAX_UNIT} drukowalnych znaków
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen` musi podawać od 1 do {MAX_CONDITION_VALUES} wartości dla `{other}`
|
||||
@@ -8330,6 +8336,7 @@ breakText Glyphs Glify
|
||||
@msg give a pattern name or select an object painted with a pattern podaj nazwę wzorka albo zaznacz obiekt pomalowany wzorkiem
|
||||
@msg give at least one of clip, invert, disabled, linked podaj co najmniej jedno z: clip, invert, disabled, linked
|
||||
@msg give color, none, swatch or gradient podaj color, none, swatch lub gradient
|
||||
@msg give color, none, swatch, gradient or opacity podaj color, none, swatch, gradient lub opacity
|
||||
@msg give dataBase64 podaj dataBase64
|
||||
@msg give either at (a click) or area (a path drawn around the overlaps) podaj at (kliknięcie) albo area (ścieżkę narysowaną wokół nakładających się obszarów)
|
||||
@msg give formats or a preset, not both podaj formats albo ustawienie, nie oba naraz
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1953,6 +1953,7 @@ antiAlias Sharp Nítido
|
||||
One page per artboard. Uma página por mesa de trabalho.
|
||||
Only Web Colors Apenas Cores da Web
|
||||
Opacity Opacidade
|
||||
Show Opacity Mostrar Opacidade
|
||||
Opacity & Mask Define Knockout Shape Opacidade e Máscara Definem Forma de Isolamento
|
||||
Opacity Mask Máscara de Opacidade
|
||||
Opacity Mask Info Informações da Máscara de Opacidade
|
||||
@@ -6360,6 +6361,11 @@ axis Y Axis Eixo Y
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` e `maxItems` devem ser 0-{MAX_LIST}, `maxItems` pelo menos 1, e o valor padrão deve ter essa quantidade
|
||||
@msg `name` must be a string `name` deve ser uma string
|
||||
@msg `opacity` must be a number `opacity` deve ser um número
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` deve ser um número de 0 a 100
|
||||
@msg `opacity` must be true or false `opacity` deve ser true ou false
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke os caracteres do texto não têm opacidade própria: adicione um preenchimento ou traçado com Adicionar Novo Preenchimento ou Adicionar Novo Traçado do painel Aparência
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own um objeto selecionado em uma instância de símbolo não tem opacidade própria de preenchimento ou traçado
|
||||
@msg no target has that fill or stroke to take the opacity nenhum destino tem esse preenchimento ou traçado para receber a opacidade
|
||||
@msg `type` must be "path" or "compound" `type` deve ser "path" ou "compound"
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit` deve ter 1-{MAX_UNIT} caracteres imprimíveis
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen` deve listar de 1 a {MAX_CONDITION_VALUES} valores para `{other}`
|
||||
@@ -8319,6 +8325,7 @@ swatch Yellow Green Verde-amarelado
|
||||
@msg give a pattern name or select an object painted with a pattern informe o nome de um padrão ou selecione um objeto pintado com um padrão
|
||||
@msg give at least one of clip, invert, disabled, linked informe pelo menos um de clip, invert, disabled, linked
|
||||
@msg give color, none, swatch or gradient informe color, none, swatch ou gradient
|
||||
@msg give color, none, swatch, gradient or opacity informe color, none, swatch, gradient ou opacity
|
||||
@msg give dataBase64 informe dataBase64
|
||||
@msg give either at (a click) or area (a path drawn around the overlaps) informe at (um clique) ou area (um caminho desenhado em volta das sobreposições)
|
||||
@msg give exactly one of `at`, `rect` and `points` informe exatamente um de `at`, `rect` e `points`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2384,6 +2384,7 @@ file-filter Templates Шаблоны
|
||||
One Point Perspective Preset 5 Набор одноточечной перспективы 5
|
||||
Only Web Colors Только web-цвета
|
||||
Opacity Непрозрачность
|
||||
Show Opacity Показать непрозрачность
|
||||
Opacity & Mask Define Knockout Shape Непрозрачность и маска определяют форму вырезания
|
||||
Opacity Mask Непрозрачная маска
|
||||
Opacity Mask Info Сведения о непрозрачной маске
|
||||
@@ -6056,6 +6057,11 @@ axis Y Axis Ось Y
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` и `maxItems` должны быть 0-{MAX_LIST}, `maxItems` не меньше 1, а значение по умолчанию должно содержать столько элементов
|
||||
@msg `name` must be a string `name` должно быть строкой
|
||||
@msg `opacity` must be a number `opacity` должно быть числом
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` должно быть числом от 0 до 100
|
||||
@msg `opacity` must be true or false `opacity` должно быть true или false
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke у символов текста нет собственной непрозрачности: добавьте заливку или обводку командой «Добавить новую заливку» или «Добавить новую обводку» на панели «Оформление»
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own у объекта, выбранного в экземпляре символа, нет собственной непрозрачности заливки или обводки
|
||||
@msg no target has that fill or stroke to take the opacity ни у одного объекта нет такой заливки или обводки, чтобы задать непрозрачность
|
||||
@msg `type` must be "path" or "compound" `type` должно быть "path" или "compound"
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit` должно содержать 1-{MAX_UNIT} печатаемых символов
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen` должно перечислять от 1 до {MAX_CONDITION_VALUES} значений для `{other}`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2298,6 +2298,7 @@ font-technology Variable Variabla
|
||||
One Point Perspective Preset 5 Förinställning 5 för enpunktsperspektiv
|
||||
Only Web Colors Endast webbfärger
|
||||
Opacity Opacitet
|
||||
Show Opacity Visa opacitet
|
||||
Opacity & Mask Define Knockout Shape Opacitet och mask definierar utsparningsform
|
||||
Opacity Mask Opacitetsmask
|
||||
Opacity Mask Info Info om opacitetsmask
|
||||
@@ -6430,6 +6431,11 @@ axis Y Axis Y-axel
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` och `maxItems` måste vara 0-{MAX_LIST}, `maxItems` minst 1, och standardvärdet måste ha så många poster
|
||||
@msg `name` must be a string `name` måste vara en sträng
|
||||
@msg `opacity` must be a number `opacity` måste vara ett tal
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` måste vara ett tal från 0 till 100
|
||||
@msg `opacity` must be true or false `opacity` måste vara true eller false
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke tecken i text har ingen egen opacitet: lägg till en fyllning eller kontur med Lägg till ny fyllning eller Lägg till ny kontur i panelen Utseende
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own ett objekt som är markerat i en symbolinstans har ingen egen opacitet för fyllning eller kontur
|
||||
@msg no target has that fill or stroke to take the opacity inget mål har den fyllningen eller konturen som kan ta emot opaciteten
|
||||
@msg `type` must be "path" or "compound" `type` måste vara "path" eller "compound"
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit` måste ha 1-{MAX_UNIT} utskrivbara tecken
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen` måste ange 1 till {MAX_CONDITION_VALUES} värden för `{other}`
|
||||
@@ -8030,6 +8036,7 @@ digits Hindi Hindi
|
||||
@msg give a pattern name or select an object painted with a pattern ange ett mönsternamn eller markera ett objekt som är målat med ett mönster
|
||||
@msg give at least one of clip, invert, disabled, linked ange minst en av clip, invert, disabled, linked
|
||||
@msg give color, none, swatch or gradient ange color, none, swatch eller gradient
|
||||
@msg give color, none, swatch, gradient or opacity ange color, none, swatch, gradient eller opacity
|
||||
@msg give dataBase64 ange dataBase64
|
||||
@msg give either at (a click) or area (a path drawn around the overlaps) ange antingen at (ett klick) eller area (en bana ritad runt överlappningarna)
|
||||
@msg give formats or a preset, not both ange formats eller en förinställning, inte båda
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -362,6 +362,30 @@ fn objects_on_path_detach_strings_are_in_complete_catalogs() {
|
||||
}
|
||||
}
|
||||
|
||||
/// The Color Wheel panel's Show Opacity and the errors of `paint.setFill {opacity}` and
|
||||
/// `ui.colorWheel {opacity}`.
|
||||
#[test]
|
||||
fn color_wheel_opacity_strings_are_in_complete_catalogs() {
|
||||
for lang in LANGUAGES.iter().filter(|lang| lang.complete_menus) {
|
||||
assert!(lang.catalog().plain("Show Opacity").is_some(), "{} is missing Show Opacity", lang.code);
|
||||
}
|
||||
let messages = [
|
||||
"`opacity` must be a number from 0 to 100",
|
||||
"`opacity` must be true or false",
|
||||
"type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke",
|
||||
"an object selected in a symbol instance has no fill or stroke opacity of its own",
|
||||
"no target has that fill or stroke to take the opacity",
|
||||
];
|
||||
let literals = message_literals();
|
||||
for m in messages {
|
||||
assert!(literals.contains(m), "{m}");
|
||||
for code in COMPLETE_MESSAGES {
|
||||
let lang = Lang::from_code(code).expect("registered");
|
||||
assert_ne!(message(lang, m), m, "{code}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The Window › Brush Libraries menu, built from the built-in library table, names each library.
|
||||
#[test]
|
||||
fn built_in_brush_library_names_are_in_complete_catalogs() {
|
||||
|
||||
@@ -2143,6 +2143,7 @@ font-technology Variable Değişken
|
||||
One Point Perspective Preset 5 Tek Noktalı Perspektif Ön Ayarı 5
|
||||
Only Web Colors Yalnızca Web Renkleri
|
||||
Opacity Opaklık
|
||||
Show Opacity Opaklığı Göster
|
||||
Opacity & Mask Define Knockout Shape Opaklık ve Maske Tanımlama Nakavt Şekli
|
||||
Opacity Mask Opaklık Maskesi
|
||||
Opacity Mask Info Opaklık Maskesi Bilgisi
|
||||
@@ -6401,6 +6402,11 @@ axis Y Axis Y ekseni
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` ve `maxItems` 0-{MAX_LIST} olmalı, `maxItems` en az 1 olmalı ve varsayılan değer bu kadar öğe içermelidir
|
||||
@msg `name` must be a string `name` bir dize olmalıdır
|
||||
@msg `opacity` must be a number `opacity` bir sayı olmalıdır
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` 0 ile 100 arasında bir sayı olmalıdır
|
||||
@msg `opacity` must be true or false `opacity` true veya false olmalıdır
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke metin karakterlerinin kendi opaklığı yoktur: Görünüm panelindeki Yeni Dolgu Ekle veya Yeni Kontur Ekle ile bir dolgu veya kontur ekleyin
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own bir sembol örneğinde seçilen nesnenin kendi dolgu veya kontur opaklığı yoktur
|
||||
@msg no target has that fill or stroke to take the opacity hiçbir hedefte opaklığı alacak o dolgu veya kontur yok
|
||||
@msg `type` must be "path" or "compound" `type` "path" veya "compound" olmalıdır
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit` 1-{MAX_UNIT} yazdırılabilir karakter olmalıdır
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen`, `{other}` için 1 ile {MAX_CONDITION_VALUES} arasında değer listelemelidir
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 5 and column 25.
|
@@ -2389,6 +2389,7 @@ file-filter Templates Шаблони
|
||||
One Point Perspective Preset 5 Набір одноточкової перспективи 5
|
||||
Only Web Colors Тільки web-кольору
|
||||
Opacity Непрозорість
|
||||
Show Opacity Показати непрозорість
|
||||
Opacity & Mask Define Knockout Shape Непрозорість та маска визначають форму вирізування
|
||||
Opacity Mask Маска непрозорості
|
||||
Opacity Mask Info Відомості про маску непрозорості
|
||||
@@ -6051,6 +6052,11 @@ axis Y Axis Вісь Y
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` і `maxItems` мають бути 0-{MAX_LIST}, `maxItems` щонайменше 1, а типове значення має містити стільки елементів
|
||||
@msg `name` must be a string `name` має бути рядком
|
||||
@msg `opacity` must be a number `opacity` має бути числом
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` має бути числом від 0 до 100
|
||||
@msg `opacity` must be true or false `opacity` має бути true або false
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke символи тексту не мають власної непрозорості: додайте заливку або обведення командою «Додати нову заливку» або «Додати нове обведення» на панелі «Оформлення»
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own об’єкт, виділений в екземплярі символу, не має власної непрозорості заливки чи обведення
|
||||
@msg no target has that fill or stroke to take the opacity жодна ціль не має такої заливки чи обведення, щоб задати непрозорість
|
||||
@msg `type` must be "path" or "compound" `type` має бути "path" або "compound"
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit` має містити 1-{MAX_UNIT} друкованих символів
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen` має перелічувати від 1 до {MAX_CONDITION_VALUES} значень для `{other}`
|
||||
@@ -7853,6 +7859,7 @@ breakText Glyphs Гліфи
|
||||
@msg give a pattern name or select an object painted with a pattern укажіть ім’я візерунка або виділіть об’єкт, зафарбований візерунком
|
||||
@msg give at least one of clip, invert, disabled, linked укажіть принаймні одне з: clip, invert, disabled, linked
|
||||
@msg give color, none, swatch or gradient укажіть color, none, swatch або gradient
|
||||
@msg give color, none, swatch, gradient or opacity укажіть color, none, swatch, gradient або opacity
|
||||
@msg give dataBase64 укажіть dataBase64
|
||||
@msg give either at (a click) or area (a path drawn around the overlaps) укажіть at (клацання) або area (контур, намальований навколо перекриттів)
|
||||
@msg give exactly one of `path`, `data` and `dataBase64` укажіть рівно одне з: `path`, `data`, `dataBase64`
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -2652,6 +2652,7 @@ digits Hindi Hindi
|
||||
One Point Perspective Preset 5 Thiết lập sẵn phối cảnh một điểm 5
|
||||
Only Web Colors Chỉ màu web
|
||||
Opacity Độ mờ
|
||||
Show Opacity Hiện độ mờ
|
||||
Opacity & Mask Define Knockout Shape Độ mờ & Mặt nạ xác định hình dạng Knockout
|
||||
Opacity Mask Mặt nạ độ mờ
|
||||
Opacity Mask Info Thông tin mặt nạ độ mờ
|
||||
@@ -6052,6 +6053,11 @@ axis Y Axis Trục Y
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` và `maxItems` phải là 0-{MAX_LIST}, `maxItems` ít nhất là 1, và giá trị mặc định phải có đúng số mục đó
|
||||
@msg `name` must be a string `name` phải là một chuỗi
|
||||
@msg `opacity` must be a number `opacity` phải là một số
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` phải là một số từ 0 đến 100
|
||||
@msg `opacity` must be true or false `opacity` phải là true hoặc false
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke ký tự văn bản không có độ mờ riêng: hãy thêm tô hoặc nét bằng Thêm tô mới hoặc Thêm nét mới trong bảng Diện mạo
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own đối tượng được chọn trong một phiên bản biểu tượng không có độ mờ tô hoặc nét riêng
|
||||
@msg no target has that fill or stroke to take the opacity không đối tượng nào có tô hoặc nét đó để nhận độ mờ
|
||||
@msg `type` must be "path" or "compound" `type` phải là "path" hoặc "compound"
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit` phải có 1-{MAX_UNIT} ký tự in được
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen` phải liệt kê 1 đến {MAX_CONDITION_VALUES} giá trị cho `{other}`
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 204 and column 5.
|
@@ -2252,6 +2252,7 @@ file-filter Templates 模板
|
||||
One Point Perspective Preset 5 一点透视预设 5
|
||||
Only Web Colors 仅 Web 颜色
|
||||
Opacity 不透明度
|
||||
Show Opacity 显示不透明度
|
||||
Opacity & Mask Define Knockout Shape 不透明度与蒙版定义挖空形状
|
||||
Opacity Mask 不透明度蒙版
|
||||
Opacity Mask Info 不透明度蒙版信息
|
||||
@@ -6284,6 +6285,11 @@ axis Y Axis Y 轴
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` 和 `maxItems` 必须是 0-{MAX_LIST},`maxItems` 至少为 1,且默认值的项数在此范围内
|
||||
@msg `name` must be a string `name` 必须是字符串
|
||||
@msg `opacity` must be a number `opacity` 必须是数字
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` 必须是 0 到 100 之间的数字
|
||||
@msg `opacity` must be true or false `opacity` 必须是 true 或 false
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke 文字字符没有自己的不透明度:请用“外观”面板的“添加新填色”或“添加新描边”添加填色或描边
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own 在符号实例中选中的对象没有自己的填色或描边不透明度
|
||||
@msg no target has that fill or stroke to take the opacity 没有目标具有可接受该不透明度的填色或描边
|
||||
@msg `type` must be "path" or "compound" `type` 必须是 "path" 或 "compound"
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit` 必须是 1-{MAX_UNIT} 个可打印字符
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen` 必须为 `{other}` 列出 1 到 {MAX_CONDITION_VALUES} 个值
|
||||
@@ -8316,6 +8322,7 @@ breakText Glyphs 字形
|
||||
@msg give a pattern name or select an object painted with a pattern 请给出图案名称,或选择用图案上色的对象
|
||||
@msg give at least one of clip, invert, disabled, linked 请至少给出 clip、invert、disabled、linked 之一
|
||||
@msg give color, none, swatch or gradient 请给出 color、none、swatch 或 gradient
|
||||
@msg give color, none, swatch, gradient or opacity 请给出 color、none、swatch、gradient 或 opacity
|
||||
@msg give dataBase64 请给出 dataBase64
|
||||
@msg give either at (a click) or area (a path drawn around the overlaps) 请给出 at (一次单击) 或 area (围绕重叠处绘制的路径)
|
||||
@msg give formats or a preset, not both 请给出 formats 或一个预设,不能两者都给
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3467,6 +3467,7 @@ file-filter Templates 範本
|
||||
One Point Perspective Preset 5 一點透視預設集 5
|
||||
Only Web Colors 僅限網頁色彩
|
||||
Opacity 不透明度
|
||||
Show Opacity 顯示不透明度
|
||||
Opacity & Mask Define Knockout Shape 不透明度與遮色片定義挖空形狀
|
||||
Opacity Mask 不透明度遮色片
|
||||
Opacity Mask Info 不透明度遮色片資訊
|
||||
@@ -6091,6 +6092,11 @@ axis Y Axis Y 軸
|
||||
@msg `minItems` and `maxItems` must be 0-{MAX_LIST}, `maxItems` at least 1, and the default that many `minItems` 和 `maxItems` 必須是 0-{MAX_LIST},`maxItems` 至少為 1,且預設值的項目數須在此範圍內
|
||||
@msg `name` must be a string `name` 必須是字串
|
||||
@msg `opacity` must be a number `opacity` 必須是數字
|
||||
@msg `opacity` must be a number from 0 to 100 `opacity` 必須是 0 到 100 之間的數字
|
||||
@msg `opacity` must be true or false `opacity` 必須是 true 或 false
|
||||
@msg type characters have no opacity of their own: add a fill or stroke with the Appearance panel's Add New Fill or Add New Stroke 文字字元沒有自己的不透明度:請用「外觀」面板的「新增填色」或「新增筆畫」新增填色或筆畫
|
||||
@msg an object selected in a symbol instance has no fill or stroke opacity of its own 在符號實體中選取的物件沒有自己的填色或筆畫不透明度
|
||||
@msg no target has that fill or stroke to take the opacity 沒有目標具有可接受該不透明度的填色或筆畫
|
||||
@msg `type` must be "path" or "compound" `type` 必須是 "path" 或 "compound"
|
||||
@msg `unit` must be 1-{MAX_UNIT} printable characters `unit` 必須是 1-{MAX_UNIT} 個可列印字元
|
||||
@msg `visibleWhen` lists 1 to {MAX_CONDITION_VALUES} values for `{other}` `visibleWhen` 必須為 `{other}` 列出 1 到 {MAX_CONDITION_VALUES} 個值
|
||||
@@ -8125,6 +8131,7 @@ breakText Glyphs 字符
|
||||
@msg give a pattern name or select an object painted with a pattern 請提供圖樣名稱,或選取以圖樣上色的物件
|
||||
@msg give at least one of clip, invert, disabled, linked clip、invert、disabled、linked 請至少提供一個
|
||||
@msg give color, none, swatch or gradient 請提供 color、none、swatch 或 gradient
|
||||
@msg give color, none, swatch, gradient or opacity 請提供 color、none、swatch、gradient 或 opacity
|
||||
@msg give dataBase64 請提供 dataBase64
|
||||
@msg give either at (a click) or area (a path drawn around the overlaps) 請提供 at (一次點按) 或 area (圍繞重疊處繪製的路徑) 其中之一
|
||||
@msg give formats or a preset, not both 請提供 formats 或預設集,不要兩者都提供
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1325,7 +1325,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
|
||||
"ui.colorWheel",
|
||||
"Color Wheel Options",
|
||||
"",
|
||||
"{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue} show the Color Wheel panel's wheel or its box, as the panel menu's Wheel View and Box View do, and pick the box's channel, as Box Channel does: the box is a color field with the channel's strip at its right, and the field shows the other two components (hue: saturation across and brightness up; saturation: hue across and brightness up; brightness: hue across and saturation up; red: blue across and green up; green: blue across and red up; blue: red across and green up); keys left out keep their values, params that are not an object, another key or a value off the list are an error and change nothing, both are kept with the preferences, and the command does not open the panel (window.panel {panel: \"colorWheel\"} does) (ui.inspect: ui.color_wheel) → {view, channel}",
|
||||
"{view?: wheel|box, channel?: hue|saturation|brightness|red|green|blue, opacity?: 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); opacity checks (true) or unchecks (false) Show Opacity, as the panel menu does: a row under the wheel or the box with a slider and a percent field that set the opacity of what the panel edits (the fill or stroke item, as paint.setFill {opacity} sets it, the selected gradient stop, or the selected freeform point, the first stop or point when none is selected; gray with nothing selected, for an object selected in a symbol instance, and when the fill or stroke item it would set is on type characters or missing); keys left out keep their values, params that are not an object, another key or a value off the list (opacity: not true or false) 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, opacity}",
|
||||
),
|
||||
(
|
||||
"ui.savePdfDialog",
|
||||
|
||||
@@ -698,6 +698,8 @@ mod tests_color_wheel;
|
||||
#[cfg(test)]
|
||||
mod tests_color_wheel_box;
|
||||
#[cfg(test)]
|
||||
mod tests_color_wheel_opacity;
|
||||
#[cfg(test)]
|
||||
mod tests_constrain;
|
||||
#[cfg(test)]
|
||||
mod tests_css_properties;
|
||||
|
||||
@@ -11,6 +11,13 @@
|
||||
//! channel strip at its right, for the channel picked under Box Channel (Hue, Saturation,
|
||||
//! Brightness, Red, Green or Blue). The field shows the other two components on the Color
|
||||
//! Picker's axes. The view and the channel are kept with the preferences (`ui.colorWheel`).
|
||||
//!
|
||||
//! The panel menu's Show Opacity adds a row under the wheel or the box that sets the opacity of
|
||||
//! what the panel edits: the fill or stroke item (`paint.setFill {opacity}`), the selected
|
||||
//! gradient stop or the selected freeform point (the first stop or point when none is selected,
|
||||
//! as for a color pick). The row is gray with nothing selected, for an object selected in a symbol
|
||||
//! instance, and when the fill or stroke item it would set is on type characters or missing. The
|
||||
//! setting is kept with the preferences (`ui.colorWheel`).
|
||||
|
||||
use egui::{Ui, UiBuilder, vec2};
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -20,7 +27,7 @@ use vectorcraft_color::{Color, Paint, hsb_to_rgb, rgb_to_hsb};
|
||||
use vectorcraft_doc::{ColorMode, NodeId};
|
||||
|
||||
use super::color::{Target, apply, wheel_target};
|
||||
use super::{pstate, set_pstate};
|
||||
use super::{live_run, pstate, set_pstate};
|
||||
use crate::VectorcraftApp;
|
||||
use crate::dialogs::color_picker::Channel;
|
||||
use crate::widgets::{self, FieldAxis, Live, SliderValue, menu_item};
|
||||
@@ -32,6 +39,8 @@ const MAX_WHEEL: f32 = 200.0;
|
||||
const STRIP: f32 = 22.0;
|
||||
/// The space between the box's field and its channel strip.
|
||||
const STRIP_GAP: f32 = 6.0;
|
||||
/// The width of the opacity row's percent field.
|
||||
const OPACITY_FIELD: f32 = 46.0;
|
||||
|
||||
/// What the panel shows right of the proxy: the wheel, or the box (a color field and a channel
|
||||
/// strip).
|
||||
@@ -67,6 +76,9 @@ pub struct Settings {
|
||||
pub view: View,
|
||||
#[serde(serialize_with = "serialize_channel", deserialize_with = "deserialize_channel")]
|
||||
pub channel: Channel,
|
||||
/// Show Opacity: the opacity row under the wheel or the box.
|
||||
#[serde(deserialize_with = "deserialize_flag")]
|
||||
pub opacity: bool,
|
||||
}
|
||||
|
||||
fn deserialize_view<'de, D: serde::Deserializer<'de>>(d: D) -> Result<View, D::Error> {
|
||||
@@ -83,6 +95,11 @@ fn deserialize_channel<'de, D: serde::Deserializer<'de>>(d: D) -> Result<Channel
|
||||
Ok(v.as_str().and_then(Channel::parse).unwrap_or_default())
|
||||
}
|
||||
|
||||
fn deserialize_flag<'de, D: serde::Deserializer<'de>>(d: D) -> Result<bool, D::Error> {
|
||||
let v = <Value as Deserialize>::deserialize(d)?;
|
||||
Ok(v.as_bool().unwrap_or_default())
|
||||
}
|
||||
|
||||
/// Serde reader for the saved settings ([`crate::UiState::color_wheel`]): a value that is not an
|
||||
/// object reads as the defaults, so it doesn't lose the rest of the preferences.
|
||||
pub fn deserialize_settings<'de, D: serde::Deserializer<'de>>(d: D) -> Result<Settings, D::Error> {
|
||||
@@ -90,11 +107,11 @@ 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?}`: show the wheel or the box, and pick the box's channel. Keys
|
||||
/// left out keep their values; params that are not an object, another key or a value off the list
|
||||
/// are an error and change nothing. → the settings.
|
||||
/// `ui.colorWheel {view?, channel?, opacity?}`: show the wheel or the box, pick the box's channel,
|
||||
/// and check or uncheck Show Opacity. Keys left out keep their values; params that are not an
|
||||
/// object, another key or a value off the list are an error and change nothing. → the settings.
|
||||
pub(crate) fn command(app: &mut VectorcraftApp, p: &Value) -> Result<Value, String> {
|
||||
const KEYS: [&str; 2] = ["view", "channel"];
|
||||
const KEYS: [&str; 3] = ["view", "channel", "opacity"];
|
||||
match p {
|
||||
Value::Null => {}
|
||||
Value::Object(o) => {
|
||||
@@ -113,11 +130,15 @@ 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("opacity") {
|
||||
None | Some(Value::Null) => {}
|
||||
Some(v) => set.opacity = v.as_bool().ok_or("`opacity` must be true or false")?,
|
||||
}
|
||||
app.ui.color_wheel = set;
|
||||
Ok(json!(app.ui.color_wheel))
|
||||
}
|
||||
|
||||
/// The panel menu: Wheel View and Box View, and Box Channel while the box shows.
|
||||
/// The panel menu: Wheel View and Box View, Box Channel while the box shows, and Show Opacity.
|
||||
pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
let set = app.ui.color_wheel.clone();
|
||||
for (label, view) in [(tl!("Wheel View"), View::Wheel), (tl!("Box View"), View::Box)] {
|
||||
@@ -134,6 +155,10 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
}
|
||||
});
|
||||
});
|
||||
ui.separator();
|
||||
if menu_item(ui, tl!("Show Opacity"), true, set.opacity) {
|
||||
command(app, &json!({ "opacity": !set.opacity })).ok();
|
||||
}
|
||||
}
|
||||
|
||||
/// The display values of HSB `hsb` in `ch`'s space, from 0 to 1: hue, saturation and brightness,
|
||||
@@ -205,6 +230,80 @@ fn show_box(ui: &mut Ui, ch: Channel, hsb: [f32; 3], marked: bool, size: f32) ->
|
||||
pick
|
||||
}
|
||||
|
||||
/// The opacity (0 to 1) the row shows for `tgt` and whether the row can set it: the selected
|
||||
/// gradient stop's or freeform point's (the first when none is selected, as [`wheel_target`]
|
||||
/// picks it), else that of the fill or stroke item
|
||||
/// ([`vectorcraft_engine::Session::proxy_opacity`]), which nothing selected and type characters
|
||||
/// do not have. A stop or point of a gradient on type characters belongs to the gradient, so the
|
||||
/// row sets it. With nothing selected the stop or point belongs to the defaults for new art, which
|
||||
/// the row leaves alone, and an object selected in a symbol instance has no opacity the row can set.
|
||||
fn shown_opacity(app: &VectorcraftApp, tgt: &Target) -> (f32, bool) {
|
||||
let stroke = !app.session.fill_active;
|
||||
let selected = app.session.active().is_some_and(|d| !d.selection.is_empty() && d.selection.symbol_part.is_none());
|
||||
let point = |index: usize| match super::active_paint(app) {
|
||||
Paint::Gradient(g) => super::gradient::shown_points(&g).points.get(index).map(|p| p.opacity),
|
||||
_ => None,
|
||||
};
|
||||
let found = match tgt {
|
||||
_ if !selected => None,
|
||||
Target::Stop { paint: Paint::Gradient(g), index, .. } => g.gradient.stops.get(*index).map(|s| s.opacity),
|
||||
Target::Point { index, .. } => point(*index),
|
||||
_ => app.session.proxy_opacity(stroke),
|
||||
};
|
||||
(found.unwrap_or(1.0), found.is_some())
|
||||
}
|
||||
|
||||
/// Set the opacity (0 to 1) of what the row edits for `tgt`: a stop through the Gradient panel's
|
||||
/// edit, a freeform point through `paint.freeform.setPoint`, else the fill or stroke item through
|
||||
/// `paint.setFill` or `paint.setStroke`. A drag previews and commits as one undo step.
|
||||
fn apply_opacity(app: &mut VectorcraftApp, tgt: &Target, o: f32, phase: Live) {
|
||||
let o = o.clamp(0.0, 1.0);
|
||||
match tgt {
|
||||
Target::Stop { paint: Paint::Gradient(g), index, .. } => {
|
||||
let mut stops = g.gradient.stops.clone();
|
||||
if let Some(s) = stops.get_mut(*index) {
|
||||
s.opacity = o;
|
||||
}
|
||||
super::gradient::set_stops_keeping_models(app, &stops, None, phase);
|
||||
}
|
||||
Target::Point { index, .. } => {
|
||||
let p = json!({"index": index, "opacity": o, "stroke": !app.session.fill_active});
|
||||
live_run(app, "Opacity", "paint.freeform.setPoint", p, phase);
|
||||
}
|
||||
_ => {
|
||||
let cmd = super::proxy_cmd(app, false);
|
||||
live_run(app, "Opacity", cmd, json!({"opacity": f64::from(o) * 100.0}), phase);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The Show Opacity row: the Transparency panel's icon, a slider whose track shows `color` from
|
||||
/// clear to solid, and a percent field. Gray when [`shown_opacity`] finds nothing to set.
|
||||
fn opacity_row(app: &mut VectorcraftApp, ui: &mut Ui, tgt: &Target, color: &Color) {
|
||||
let (o, live) = shown_opacity(app, tgt);
|
||||
let percent = f64::from(o) * 100.0;
|
||||
let mut edit: Option<(f32, Live)> = None;
|
||||
ui.add_enabled_ui(live, |ui| {
|
||||
ui.horizontal(|ui| {
|
||||
let t = crate::theme::Tokens::get(ui.ctx());
|
||||
crate::icons::icon(ui, "dc-transparency", 16.0, if live { t.icon } else { t.text_disabled }).on_hover_text(tl!("Opacity"));
|
||||
let width = (ui.available_width() - OPACITY_FIELD - ui.spacing().item_spacing.x).max(40.0);
|
||||
let shown = SliderValue::field(percent, 0.0..=100.0, "%", 0);
|
||||
match widgets::opacity_slider(ui, "color-wheel-opacity", tl!("Opacity"), Some(shown), o, width, super::c32(color)) {
|
||||
(Some(v), phase, _) => edit = Some((v, phase)),
|
||||
(None, _, Some(v)) => edit = Some(((v / 100.0) as f32, Live::Released)),
|
||||
_ => {}
|
||||
}
|
||||
if let Some(v) = widgets::plain_field_named(ui, "color-wheel-opacity-field", Some(tl!("Opacity")), percent, "%", 0, OPACITY_FIELD) {
|
||||
edit = Some(((v.clamp(0.0, 100.0) / 100.0) as f32, Live::Released));
|
||||
}
|
||||
});
|
||||
});
|
||||
if let Some((v, phase)) = edit.filter(|_| live) {
|
||||
apply_opacity(app, tgt, v, phase);
|
||||
}
|
||||
}
|
||||
|
||||
/// Panel state: the HSB picked last, its [`Owner`] and the display sRGB of the color it stored.
|
||||
const MEMORY: &str = "color-wheel-hsb";
|
||||
|
||||
@@ -344,6 +443,10 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
pick = Some(([hsb[0], x, 1.0 - y], field_phase));
|
||||
}
|
||||
});
|
||||
if app.ui.color_wheel.opacity {
|
||||
let shown = color.unwrap_or(app.session.last_solid);
|
||||
opacity_row(app, ui, &tgt, &shown);
|
||||
}
|
||||
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);
|
||||
|
||||
@@ -167,16 +167,16 @@ fn the_strip_takes_the_arrow_keys_and_screen_readers_actions() {
|
||||
#[test]
|
||||
fn ui_color_wheel_sets_and_reads_the_view_and_the_channel() {
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
assert_eq!(app.run("ui.colorWheel", json!({})).unwrap(), json!({"view": "wheel", "channel": "hue"}));
|
||||
assert_eq!(app.run("ui.colorWheel", json!({"view": "box"})).unwrap(), json!({"view": "box", "channel": "hue"}));
|
||||
assert_eq!(app.run("ui.colorWheel", json!({"channel": "green"})).unwrap(), json!({"view": "box", "channel": "green"}));
|
||||
assert_eq!(app.run("ui.colorWheel", json!({})).unwrap(), json!({"view": "wheel", "channel": "hue", "opacity": false}));
|
||||
assert_eq!(app.run("ui.colorWheel", json!({"view": "box"})).unwrap(), json!({"view": "box", "channel": "hue", "opacity": false}));
|
||||
assert_eq!(app.run("ui.colorWheel", json!({"channel": "green"})).unwrap(), json!({"view": "box", "channel": "green", "opacity": false}));
|
||||
let e = app.run("ui.colorWheel", json!({"view": "triangle"})).unwrap_err();
|
||||
assert_eq!(e, "`view` must be wheel or box");
|
||||
let e = app.run("ui.colorWheel", json!({"view": "wheel", "channel": 7})).unwrap_err();
|
||||
assert_eq!(e, "`channel` must be hue, saturation, brightness, red, green or blue");
|
||||
assert_eq!(app.ui.color_wheel, Settings { view: View::Box, channel: Channel::Green }, "an error changes nothing");
|
||||
assert_eq!(app.ui.color_wheel, Settings { view: View::Box, channel: Channel::Green, ..Default::default() }, "an error changes nothing");
|
||||
let ui = crate::control::inspect(&app, &egui::Context::default());
|
||||
assert_eq!(ui["ui"]["color_wheel"], json!({"view": "box", "channel": "green"}));
|
||||
assert_eq!(ui["ui"]["color_wheel"], json!({"view": "box", "channel": "green", "opacity": false}));
|
||||
}
|
||||
|
||||
/// The command's errors are translated in the catalogs that translate status and error messages,
|
||||
@@ -211,10 +211,10 @@ fn ui_color_wheel_rejects_other_params() {
|
||||
let e = app.run("ui.colorWheel", json!([1])).unwrap_err();
|
||||
assert_eq!(e, "the params must be an object, not [1]");
|
||||
let e = app.run("ui.colorWheel", json!({"veiw": "wheel"})).unwrap_err();
|
||||
assert_eq!(e, "unknown parameter `veiw`; the command takes: view, channel");
|
||||
assert_eq!(e, "unknown parameter `veiw`; the command takes: view, channel, opacity");
|
||||
let e = app.run("ui.colorWheel", json!({"view": "wheel", "chanel": "blue"})).unwrap_err();
|
||||
assert_eq!(e, "unknown parameter `chanel`; the command takes: view, channel");
|
||||
assert_eq!(app.ui.color_wheel, Settings { view: View::Box, channel: Channel::Red }, "an error changes nothing");
|
||||
assert_eq!(e, "unknown parameter `chanel`; the command takes: view, channel, opacity");
|
||||
assert_eq!(app.ui.color_wheel, Settings { view: View::Box, channel: Channel::Red, ..Default::default() }, "an error changes nothing");
|
||||
}
|
||||
|
||||
/// With None there is no color to edit: the strip reads 0 to screen readers, as the hue ring does,
|
||||
@@ -249,7 +249,11 @@ fn ui_color_wheel_answers_junk_params_without_a_panic() {
|
||||
/// not know reads as the key's default without losing the other preferences.
|
||||
#[test]
|
||||
fn the_settings_are_kept_and_read_leniently() {
|
||||
let ui = crate::UiState { color_wheel: Settings { view: View::Box, channel: Channel::Blue }, color_rgb_percent: true, ..Default::default() };
|
||||
let ui = crate::UiState {
|
||||
color_wheel: Settings { view: View::Box, channel: Channel::Blue, ..Default::default() },
|
||||
color_rgb_percent: true,
|
||||
..Default::default()
|
||||
};
|
||||
let saved = serde_json::to_value(&ui).unwrap();
|
||||
let back: crate::UiState = serde_json::from_value(saved.clone()).unwrap();
|
||||
assert_eq!(back.color_wheel, ui.color_wheel);
|
||||
@@ -262,11 +266,11 @@ fn the_settings_are_kept_and_read_leniently() {
|
||||
let mut odd = saved.clone();
|
||||
odd["color_wheel"] = json!({"view": "box", "channel": 7});
|
||||
let back: crate::UiState = serde_json::from_value(odd).unwrap();
|
||||
assert_eq!(back.color_wheel, Settings { view: View::Box, channel: Channel::default() });
|
||||
assert_eq!(back.color_wheel, Settings { view: View::Box, ..Default::default() });
|
||||
let mut odd = saved.clone();
|
||||
odd["color_wheel"] = json!({"view": "triangle", "channel": "blue"});
|
||||
let back: crate::UiState = serde_json::from_value(odd).unwrap();
|
||||
assert_eq!(back.color_wheel, Settings { view: View::Wheel, channel: Channel::Blue });
|
||||
assert_eq!(back.color_wheel, Settings { view: View::Wheel, channel: Channel::Blue, ..Default::default() });
|
||||
let mut odd = saved;
|
||||
odd["color_wheel"] = json!("box");
|
||||
let back: crate::UiState = serde_json::from_value(odd).unwrap();
|
||||
|
||||
@@ -0,0 +1,322 @@
|
||||
//! The Color Wheel panel's Show Opacity row drawn headless: the setting and `ui.colorWheel`, the
|
||||
//! slider on a fill, a gradient stop and a freeform point, the keys, screen readers, the percent
|
||||
//! field and the gray row.
|
||||
|
||||
use egui::accesskit::{Action, ActionData, ActionRequest, Role};
|
||||
use egui::{Event, Modifiers, PointerButton, Pos2, vec2};
|
||||
use egui_kittest::Harness;
|
||||
use egui_kittest::kittest::{NodeT, Queryable};
|
||||
use serde_json::json;
|
||||
use vectorcraft_color::Paint;
|
||||
use vectorcraft_engine::Session;
|
||||
|
||||
use super::color_wheel::{Settings, show};
|
||||
use crate::VectorcraftApp;
|
||||
|
||||
/// An app with a selected red rectangle and Show Opacity checked.
|
||||
fn app() -> VectorcraftApp {
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
app.run("file.new", json!({"width": 200, "height": 200})).unwrap();
|
||||
app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 50, "height": 50})).unwrap();
|
||||
app.run("paint.setFill", json!({"color": "#ff0000"})).unwrap();
|
||||
app.run("ui.colorWheel", json!({"opacity": true})).unwrap();
|
||||
app
|
||||
}
|
||||
|
||||
fn harness(app: VectorcraftApp) -> Harness<'static, VectorcraftApp> {
|
||||
let mut h = Harness::builder().with_size(vec2(260.0, 360.0)).build_ui_state(
|
||||
|ui, app: &mut VectorcraftApp| {
|
||||
show(app, ui);
|
||||
crate::shortcuts::handle(app, ui.ctx());
|
||||
},
|
||||
app,
|
||||
);
|
||||
h.run_steps(2);
|
||||
h
|
||||
}
|
||||
|
||||
fn click(h: &mut Harness<'static, VectorcraftApp>, pos: Pos2) {
|
||||
for pressed in [true, false] {
|
||||
h.event(Event::PointerMoved(pos));
|
||||
h.event(Event::PointerButton { pos, button: PointerButton::Primary, pressed, modifiers: Modifiers::NONE });
|
||||
h.run_steps(1);
|
||||
}
|
||||
h.run_steps(1);
|
||||
}
|
||||
|
||||
fn slider_rect(h: &Harness<'static, VectorcraftApp>) -> egui::Rect {
|
||||
h.get_by_role_and_label(Role::Slider, "Opacity").rect()
|
||||
}
|
||||
|
||||
/// The middle of the slider's bar (the rail draws its bar 4 points in from each side).
|
||||
fn middle(h: &Harness<'static, VectorcraftApp>) -> Pos2 {
|
||||
let r = slider_rect(h);
|
||||
Pos2::new(r.center().x, r.top() + 7.0)
|
||||
}
|
||||
|
||||
fn fill_opacity(app: &VectorcraftApp) -> f32 {
|
||||
app.session.proxy_opacity(false).expect("a fill item")
|
||||
}
|
||||
|
||||
fn undo_labels(app: &VectorcraftApp) -> Vec<String> {
|
||||
app.session.doc().unwrap().history.undo.iter().map(|e| e.label.clone()).collect()
|
||||
}
|
||||
|
||||
fn action(h: &mut Harness<'static, VectorcraftApp>, action: Action, data: Option<ActionData>) {
|
||||
let (target_node, target_tree) = h.get_by_role_and_label(Role::Slider, "Opacity").accesskit_node().locate();
|
||||
h.event(Event::AccessKitActionRequest(ActionRequest { target_node, target_tree, action, data }));
|
||||
h.run_steps(2);
|
||||
}
|
||||
|
||||
/// The panel menu's Show Opacity and `ui.colorWheel {opacity}` check and uncheck the row; a bad
|
||||
/// value is an error and changes nothing.
|
||||
#[test]
|
||||
fn show_opacity_is_a_setting_of_the_panel() {
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
assert_eq!(app.run("ui.colorWheel", json!({})).unwrap()["opacity"], json!(false));
|
||||
assert_eq!(app.run("ui.colorWheel", json!({"opacity": true})).unwrap()["opacity"], json!(true));
|
||||
let e = app.run("ui.colorWheel", json!({"opacity": "no"})).unwrap_err();
|
||||
assert_eq!(e, "`opacity` must be true or false");
|
||||
assert!(app.ui.color_wheel.opacity);
|
||||
assert_eq!(crate::control::inspect(&app, &egui::Context::default())["ui"]["color_wheel"]["opacity"], json!(true));
|
||||
let set = app.run("ui.colorWheel", json!({"view": "box"})).unwrap();
|
||||
assert_eq!(set["opacity"], json!(true), "another key keeps Show Opacity");
|
||||
app.run("ui.colorWheel", json!({"opacity": false})).unwrap();
|
||||
let h = harness({
|
||||
let mut app = self::app();
|
||||
app.run("ui.colorWheel", json!({"opacity": false})).unwrap();
|
||||
app
|
||||
});
|
||||
assert!(h.query_by_role_and_label(Role::Slider, "Opacity").is_none(), "no row while unchecked");
|
||||
}
|
||||
|
||||
/// The row also shows under the box, and a click at its middle sets the fill item's opacity there.
|
||||
#[test]
|
||||
fn the_row_shows_under_the_box_view() {
|
||||
let mut app = app();
|
||||
app.run("ui.colorWheel", json!({"view": "box"})).unwrap();
|
||||
let mut h = harness(app);
|
||||
assert!(h.query_by_label("Color box").is_some(), "the box shows");
|
||||
let at = middle(&h);
|
||||
click(&mut h, at);
|
||||
assert!((fill_opacity(h.state()) - 0.5).abs() < 0.03, "{}", fill_opacity(h.state()));
|
||||
}
|
||||
|
||||
/// A value this build does not read keeps the rest of the preferences and reads as the default.
|
||||
#[test]
|
||||
fn saved_settings_read_leniently() {
|
||||
let mut saved = serde_json::to_value(crate::UiState::default()).unwrap();
|
||||
saved["color_rgb_percent"] = json!(true);
|
||||
for bad in [json!("box"), json!({"opacity": "yes"}), json!(7)] {
|
||||
saved["color_wheel"] = bad.clone();
|
||||
let ui: crate::UiState = serde_json::from_value(saved.clone()).unwrap();
|
||||
assert_eq!(ui.color_wheel, Settings::default(), "{bad}");
|
||||
assert!(ui.color_rgb_percent, "{bad}");
|
||||
}
|
||||
saved["color_wheel"] = json!({"opacity": true, "later": 1});
|
||||
let ui: crate::UiState = serde_json::from_value(saved).unwrap();
|
||||
assert!(ui.color_wheel.opacity);
|
||||
}
|
||||
|
||||
/// A click at the middle of the track sets the fill item's opacity to about 50 % as one undo step
|
||||
/// named Opacity, the fill keeps its color, and → then adds 1 %.
|
||||
#[test]
|
||||
fn the_slider_sets_the_fill_opacity_and_takes_the_arrow_keys() {
|
||||
let mut h = harness(app());
|
||||
let undo = undo_labels(h.state()).len();
|
||||
let at = middle(&h);
|
||||
click(&mut h, at);
|
||||
let o = fill_opacity(h.state());
|
||||
assert!((o - 0.5).abs() < 0.02, "{o}");
|
||||
let labels = undo_labels(h.state());
|
||||
assert_eq!((labels.len(), labels.last().map(String::as_str)), (undo + 1, Some("Opacity")));
|
||||
assert_eq!(crate::panels::current_paints(h.state()).0.color().unwrap().to_hex(), "#ff0000");
|
||||
let before = (o * 100.0).round();
|
||||
h.key_press_modifiers(Modifiers::NONE, egui::Key::ArrowRight);
|
||||
h.run_steps(2);
|
||||
assert_eq!((fill_opacity(h.state()) * 100.0).round(), before + 1.0);
|
||||
}
|
||||
|
||||
/// Screen readers get a slider named Opacity with its percentage and its range, and can step it and
|
||||
/// set it.
|
||||
#[test]
|
||||
fn screen_readers_read_and_set_the_opacity() {
|
||||
let mut h = harness(app());
|
||||
let node = h.get_by_role_and_label(Role::Slider, "Opacity");
|
||||
let data = node.accesskit_node();
|
||||
assert!([Action::Increment, Action::Decrement, Action::SetValue].iter().all(|a| data.data().supports_action(*a)));
|
||||
assert_eq!(data.numeric_value(), Some(100.0));
|
||||
assert_eq!((data.min_numeric_value(), data.max_numeric_value()), (Some(0.0), Some(100.0)));
|
||||
action(&mut h, Action::SetValue, Some(ActionData::NumericValue(25.0)));
|
||||
assert!((fill_opacity(h.state()) - 0.25).abs() < 1e-6);
|
||||
action(&mut h, Action::Decrement, None);
|
||||
assert!((fill_opacity(h.state()) - 0.24).abs() < 1e-6);
|
||||
}
|
||||
|
||||
/// The stroke proxy in front: the row sets the stroke item's opacity and leaves the fill's.
|
||||
#[test]
|
||||
fn with_the_stroke_in_front_the_row_sets_the_stroke() {
|
||||
let mut app = app();
|
||||
app.run("paint.toggleActive", json!({})).unwrap();
|
||||
let mut h = harness(app);
|
||||
action(&mut h, Action::SetValue, Some(ActionData::NumericValue(40.0)));
|
||||
assert!((h.state().session.proxy_opacity(true).unwrap() - 0.4).abs() < 1e-6);
|
||||
assert_eq!(fill_opacity(h.state()), 1.0);
|
||||
}
|
||||
|
||||
/// A selected gradient stop takes the opacity, and the other stop keeps its own.
|
||||
#[test]
|
||||
fn a_selected_gradient_stop_takes_the_opacity() {
|
||||
let mut app = app();
|
||||
let stops = json!([{"offset": 0, "color": "#ff0000"}, {"offset": 1, "color": "#0000ff"}]);
|
||||
app.run("paint.setFill", json!({"gradient": {"stops": stops, "start": [10, 35], "end": [60, 35]}})).unwrap();
|
||||
app.select_tool("gradient");
|
||||
app.run("gradient.selectStop", json!({"index": 1})).unwrap();
|
||||
let mut h = harness(app);
|
||||
action(&mut h, Action::SetValue, Some(ActionData::NumericValue(30.0)));
|
||||
let Paint::Gradient(g) = crate::panels::current_paints(h.state()).0 else { panic!("still a gradient") };
|
||||
let o: Vec<f32> = g.gradient.stops.iter().map(|s| s.opacity).collect();
|
||||
assert!((o[0] - 1.0).abs() < 1e-6 && (o[1] - 0.3).abs() < 1e-6, "{o:?}");
|
||||
assert_eq!(fill_opacity(h.state()), 1.0, "the fill item keeps its opacity");
|
||||
}
|
||||
|
||||
/// With no stop selected, the first stop takes the opacity, as it takes a color pick.
|
||||
#[test]
|
||||
fn without_a_selected_stop_the_first_takes_the_opacity() {
|
||||
let mut app = app();
|
||||
let stops = json!([{"offset": 0, "color": "#ff0000"}, {"offset": 1, "color": "#0000ff"}]);
|
||||
app.run("paint.setFill", json!({"gradient": {"stops": stops, "start": [10, 35], "end": [60, 35]}})).unwrap();
|
||||
assert_eq!(app.session.selected_stop(), None);
|
||||
let mut h = harness(app);
|
||||
action(&mut h, Action::SetValue, Some(ActionData::NumericValue(30.0)));
|
||||
let Paint::Gradient(g) = crate::panels::current_paints(h.state()).0 else { panic!("still a gradient") };
|
||||
let o: Vec<f32> = g.gradient.stops.iter().map(|s| s.opacity).collect();
|
||||
assert!((o[0] - 0.3).abs() < 1e-6 && (o[1] - 1.0).abs() < 1e-6, "{o:?}");
|
||||
}
|
||||
|
||||
/// A drag across the slider previews and ends as one undo step named Opacity.
|
||||
#[test]
|
||||
fn a_drag_is_one_undo_step() {
|
||||
let mut h = harness(app());
|
||||
let undo = undo_labels(h.state()).len();
|
||||
let r = slider_rect(&h);
|
||||
let y = r.top() + 7.0;
|
||||
let (from, to) = (Pos2::new(r.left() + 10.0, y), Pos2::new(r.right() - 20.0, y));
|
||||
h.event(Event::PointerMoved(from));
|
||||
h.event(Event::PointerButton { pos: from, button: PointerButton::Primary, pressed: true, modifiers: Modifiers::NONE });
|
||||
h.run_steps(1);
|
||||
for k in 1..=6 {
|
||||
h.event(Event::PointerMoved(from + (to - from) * (k as f32 / 6.0)));
|
||||
h.run_steps(1);
|
||||
}
|
||||
h.event(Event::PointerButton { pos: to, button: PointerButton::Primary, pressed: false, modifiers: Modifiers::NONE });
|
||||
h.run_steps(2);
|
||||
let o = fill_opacity(h.state());
|
||||
assert!(o > 0.7 && o < 1.0, "{o}");
|
||||
let labels = undo_labels(h.state());
|
||||
assert_eq!((labels.len(), labels.last().map(String::as_str)), (undo + 1, Some("Opacity")));
|
||||
}
|
||||
|
||||
/// A selected object without a fill item beside one with a fill item: the row shows and sets the
|
||||
/// second one's opacity.
|
||||
#[test]
|
||||
fn an_object_without_a_fill_item_leaves_the_row_to_the_next() {
|
||||
let mut app = app();
|
||||
let first = app.session.doc().unwrap().selection.objects[0];
|
||||
app.run("appearance.removeItem", json!({"index": 0})).unwrap();
|
||||
app.run("shape.rectangle", json!({"x": 100, "y": 10, "width": 50, "height": 50})).unwrap();
|
||||
let second = app.session.doc().unwrap().selection.objects[0];
|
||||
app.run("select.set", json!({"ids": [first.0, second.0]})).unwrap();
|
||||
let mut h = harness(app);
|
||||
assert!(!h.get_by_role_and_label(Role::Slider, "Opacity").accesskit_node().is_disabled());
|
||||
action(&mut h, Action::SetValue, Some(ActionData::NumericValue(45.0)));
|
||||
let n = h.state().session.doc().unwrap().doc.node(second).unwrap().clone();
|
||||
assert!((n.appearance.fill().unwrap().opacity - 0.45).abs() < 1e-6);
|
||||
}
|
||||
|
||||
/// Type painted with a gradient: the row sets the gradient's stop, which belongs to the gradient.
|
||||
#[test]
|
||||
fn a_gradient_stop_on_type_takes_the_opacity() {
|
||||
let mut app = app();
|
||||
app.run("text.create", json!({"x": 10, "y": 150, "text": "Hi"})).unwrap();
|
||||
let stops = json!([{"offset": 0, "color": "#ff0000"}, {"offset": 1, "color": "#0000ff"}]);
|
||||
app.run("paint.setFill", json!({"gradient": {"stops": stops}})).unwrap();
|
||||
let mut h = harness(app);
|
||||
assert!(!h.get_by_role_and_label(Role::Slider, "Opacity").accesskit_node().is_disabled());
|
||||
action(&mut h, Action::SetValue, Some(ActionData::NumericValue(30.0)));
|
||||
let Paint::Gradient(g) = crate::panels::current_paints(h.state()).0 else { panic!("still a gradient") };
|
||||
assert!((g.gradient.stops[0].opacity - 0.3).abs() < 1e-6, "{:?}", g.gradient.stops);
|
||||
}
|
||||
|
||||
/// The selected freeform point takes the opacity.
|
||||
#[test]
|
||||
fn the_selected_freeform_point_takes_the_opacity() {
|
||||
let mut app = app();
|
||||
app.run("paint.setFill", json!({"gradient": {"kind": "freeform"}})).unwrap();
|
||||
let mut h = harness(app);
|
||||
action(&mut h, Action::SetValue, Some(ActionData::NumericValue(60.0)));
|
||||
let Paint::Gradient(g) = crate::panels::current_paints(h.state()).0 else { panic!("still a gradient") };
|
||||
let f = super::gradient::shown_points(&g);
|
||||
assert!((f.points[0].opacity - 0.6).abs() < 1e-6, "{:?}", f.points.iter().map(|p| p.opacity).collect::<Vec<_>>());
|
||||
}
|
||||
|
||||
/// The percent field takes a typed value.
|
||||
#[test]
|
||||
fn the_percent_field_takes_a_typed_value() {
|
||||
let mut h = harness(app());
|
||||
h.get_by_role_and_label(Role::TextInput, "Opacity").click();
|
||||
h.run_steps(1);
|
||||
h.get_by_role_and_label(Role::TextInput, "Opacity").type_text("35");
|
||||
h.run_steps(1);
|
||||
h.key_press(egui::Key::Enter);
|
||||
h.run_steps(2);
|
||||
assert!((fill_opacity(h.state()) - 0.35).abs() < 1e-6, "{}", fill_opacity(h.state()));
|
||||
}
|
||||
|
||||
/// With nothing selected, and with only type selected (its characters take the paint), the row is
|
||||
/// gray and screen readers cannot set it.
|
||||
#[test]
|
||||
fn the_row_is_gray_with_nothing_selected_and_on_type() {
|
||||
let mut app = app();
|
||||
app.run("select.none", json!({})).unwrap();
|
||||
let mut h = harness(app);
|
||||
assert!(h.get_by_role_and_label(Role::Slider, "Opacity").accesskit_node().is_disabled());
|
||||
let doc = h.state().session.doc().unwrap().doc.clone();
|
||||
action(&mut h, Action::SetValue, Some(ActionData::NumericValue(25.0)));
|
||||
assert_eq!(*h.state().session.doc().unwrap().doc, *doc);
|
||||
|
||||
let mut app = self::app();
|
||||
app.run("text.create", json!({"x": 10, "y": 150, "text": "Hi"})).unwrap();
|
||||
let h = harness(app);
|
||||
assert!(h.get_by_role_and_label(Role::Slider, "Opacity").accesskit_node().is_disabled());
|
||||
|
||||
// A gradient left as the default for new art: its stop is not the row's to change.
|
||||
let mut app = self::app();
|
||||
app.run("paint.setFill", json!({"gradient": {}})).unwrap();
|
||||
app.run("select.none", json!({})).unwrap();
|
||||
let mut h = harness(app);
|
||||
assert!(h.get_by_role_and_label(Role::Slider, "Opacity").accesskit_node().is_disabled());
|
||||
let defaults = h.state().session.paint.fill.clone();
|
||||
action(&mut h, Action::SetValue, Some(ActionData::NumericValue(25.0)));
|
||||
assert_eq!(h.state().session.paint.fill, defaults);
|
||||
|
||||
// An object with a gradient fill selected in a dynamic symbol instance.
|
||||
let mut app = self::app();
|
||||
app.run("paint.setFill", json!({"gradient": {}})).unwrap();
|
||||
let id = app.session.doc().unwrap().selection.objects[0].0;
|
||||
let inst = app.run("symbol.new", json!({"name": "One", "ids": [id], "type": "dynamic"})).unwrap()["id"].clone();
|
||||
app.run("symbol.instance.selectPart", json!({"id": inst, "path": []})).unwrap();
|
||||
let h = harness(app);
|
||||
assert!(h.get_by_role_and_label(Role::Slider, "Opacity").accesskit_node().is_disabled());
|
||||
}
|
||||
|
||||
/// `ui.colorWheel` answers every junk parameter, with and without a document, without a panic.
|
||||
#[test]
|
||||
fn ui_color_wheel_answers_junk_params_without_a_panic() {
|
||||
let doc = crate::menus::UI_COMMANDS.iter().find(|c| c.0 == "ui.colorWheel").expect("registered").3;
|
||||
for mut app in [app(), VectorcraftApp::new(Session::new(), Default::default())] {
|
||||
for p in vectorcraft_testkit::strategies::junk_params(doc, "/nonexistent").into_iter().chain(vectorcraft_testkit::strategies::junk_values()) {
|
||||
let _ = app.run("ui.colorWheel", p);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -734,7 +734,7 @@ pub struct UiState {
|
||||
/// of an RGB field, `ui.colorPanel`, [`crate::panels::color::deserialize_rgb_percent`]).
|
||||
#[serde(default, deserialize_with = "crate::panels::color::deserialize_rgb_percent")]
|
||||
pub color_rgb_percent: bool,
|
||||
/// Color Wheel panel: the wheel or the box, and the box's channel (`ui.colorWheel`,
|
||||
/// Color Wheel panel: the wheel or the box, the box's channel and Show Opacity (`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,
|
||||
|
||||
@@ -37,7 +37,7 @@ pub use chips::{ProxyClicks, chip_button, chip_button_named, fill_stroke_proxy,
|
||||
pub use color::{
|
||||
FieldAxis, Live, RingResponse, SliderValue, WheelResponse, channel_slider, channel_slider_named, channel_slider_stepped, channel_slider_valued,
|
||||
color_field, color_mesh, color_slider, color_slider_named, color_slider_stepped, color_slider_valued, harmony_wheel, hex_field, hex_field_named,
|
||||
hsb32, hue_ring, region_texture, ring_square, segment_color, segmented_wheel, stepped_area,
|
||||
hsb32, hue_ring, opacity_slider, region_texture, ring_square, segment_color, segmented_wheel, stepped_area,
|
||||
};
|
||||
pub(crate) use color::{HEX_FIELD_CHARS, hex_text, pointer_phase};
|
||||
pub use drag::{
|
||||
|
||||
@@ -90,18 +90,23 @@ pub(super) fn chip_grid(g: &vectorcraft_color::Gradient, width: f32, height: f32
|
||||
/// A white and light gray checkerboard filling `rect`, with cells a quarter of its shorter side
|
||||
/// (3 to 8 points).
|
||||
fn checkerboard(ui: &Ui, rect: Rect) {
|
||||
let p = ui.painter();
|
||||
p.rect_filled(rect, 0.0, Color32::WHITE);
|
||||
let cell = (rect.width().min(rect.height()) / 4.0).clamp(3.0, 8.0);
|
||||
ui.painter().extend(checkerboard_shapes(rect, cell));
|
||||
}
|
||||
|
||||
/// The shapes of a white and light gray checkerboard filling `rect`, with `cell` point cells.
|
||||
pub(super) fn checkerboard_shapes(rect: Rect, cell: f32) -> Vec<egui::Shape> {
|
||||
let mut shapes = vec![egui::Shape::rect_filled(rect, 0.0, Color32::WHITE)];
|
||||
let cols = (rect.width() / cell).ceil() as usize;
|
||||
let rows = (rect.height() / cell).ceil() as usize;
|
||||
for j in 0..rows {
|
||||
for i in (j % 2..cols).step_by(2) {
|
||||
let min = pos2(rect.left() + cell * i as f32, rect.top() + cell * j as f32);
|
||||
let square = Rect::from_min_size(min, Vec2::splat(cell)).intersect(rect);
|
||||
p.rect_filled(square, 0.0, Color32::from_gray(204));
|
||||
shapes.push(egui::Shape::rect_filled(square, 0.0, Color32::from_gray(204)));
|
||||
}
|
||||
}
|
||||
shapes
|
||||
}
|
||||
|
||||
/// The colours at the `(cols + 1) x (rows + 1)` grid points (row by row) of a `width` x `height`
|
||||
|
||||
@@ -145,6 +145,38 @@ pub fn color_slider_stepped(
|
||||
(picked, phase, stepped.filter(|_| picked.is_none()))
|
||||
}
|
||||
|
||||
/// [`color_slider_stepped`] for an opacity: its track shows `color` from clear at 0 to solid at 1
|
||||
/// over a checkerboard of 4 pt cells.
|
||||
pub fn opacity_slider(
|
||||
ui: &mut Ui,
|
||||
id: impl std::hash::Hash,
|
||||
name: &str,
|
||||
shown: Option<SliderValue>,
|
||||
value: f32,
|
||||
width: f32,
|
||||
color: Color32,
|
||||
) -> (Option<f32>, Live, Option<f64>) {
|
||||
let id = id_with(ui.scope_id(), id);
|
||||
// The checkerboard and the ramp go under the rail's thumb and border, which the rail draws.
|
||||
let under = ui.painter().add(egui::Shape::Noop);
|
||||
let (resp, picked, phase) = color_rail(ui, id, name, shown.clone(), value, width, &|_| Color32::TRANSPARENT);
|
||||
let bar = rail_bar(resp.rect, width);
|
||||
let mut shapes = super::chips::checkerboard_shapes(bar, 4.0);
|
||||
let [r, g, b, _] = color.to_srgba_unmultiplied();
|
||||
let mut ramp = egui::Mesh::default();
|
||||
let clear = Color32::from_rgba_unmultiplied(r, g, b, 0);
|
||||
let solid = Color32::from_rgb(r, g, b);
|
||||
for (p, c) in [(bar.left_top(), clear), (bar.right_top(), solid), (bar.right_bottom(), solid), (bar.left_bottom(), clear)] {
|
||||
ramp.colored_vertex(p, c);
|
||||
}
|
||||
ramp.add_triangle(0, 1, 2);
|
||||
ramp.add_triangle(0, 2, 3);
|
||||
shapes.push(egui::Shape::mesh(ramp));
|
||||
ui.painter().set(under, egui::Shape::Vec(shapes));
|
||||
let stepped = slider_keys(ui, &resp, shown);
|
||||
(picked, phase, stepped.filter(|_| picked.is_none()))
|
||||
}
|
||||
|
||||
/// A control that its caller draws and reads the pointer on (`resp`, from a click-and-drag
|
||||
/// [`Ui::interact`]), which screen readers get as a slider named `name` (already translated) with
|
||||
/// `shown`, and which takes the focus, the keys and the screen readers' actions as the rail of
|
||||
@@ -278,7 +310,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 = rail_bar(rect, width);
|
||||
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);
|
||||
@@ -296,6 +328,11 @@ fn color_rail(
|
||||
(resp, picked, phase)
|
||||
}
|
||||
|
||||
/// The bar of a rail `width` wide in `rect`, above its thumb.
|
||||
fn rail_bar(rect: Rect, width: f32) -> Rect {
|
||||
Rect::from_min_size(pos2(rect.left() + 4.0, rect.top() + 4.0), vec2(width - 8.0, 7.0))
|
||||
}
|
||||
|
||||
/// The pointer of a click or drag on `resp` and its phase (dragging, or released on click/drop).
|
||||
pub(crate) fn pointer_phase(resp: &Response) -> Option<(Pos2, Live)> {
|
||||
if !(resp.dragged() || resp.clicked() || resp.drag_stopped()) {
|
||||
|
||||
@@ -265,9 +265,10 @@ My Themes tab lists the saved themes; every action runs a command (`colorTheme.s
|
||||
Color Wheel panel (`window.panel {panel: "colorWheel"}`): a hue ring around a saturation and brightness square. A
|
||||
pick runs the commands the Color panel's sliders run: `paint.setFill` or `paint.setStroke` with `keepModel`,
|
||||
`paint.editGradient` for a gradient's selected stop, and `paint.freeform.setPoint` for a freeform gradient's selected
|
||||
point (the first stop or point when none is selected). `ui.colorWheel {view?, channel?}` shows the wheel or the box (a
|
||||
color field with a channel strip at its right) and picks the box's channel; it returns the settings, and `ui.inspect`
|
||||
reports them as `ui.color_wheel`.
|
||||
point (the first stop or point when none is selected). `ui.colorWheel {view?, channel?, opacity?}` shows the wheel or
|
||||
the box (a color field with a channel strip at its right), picks the box's channel and checks or unchecks Show Opacity
|
||||
(an opacity row under the wheel or the box); it returns the settings, and `ui.inspect` reports them as
|
||||
`ui.color_wheel`.
|
||||
|
||||
Edit Colors dialogs: `ui.colorBalanceDialog` opens Adjust Colors (`colorBalance`: fields `mode` `gray`/`rgb`/`cmyk`/
|
||||
`global`, the channels `r` `g` `b` / `c` `m` `y` `k` / `gray` / `tint` (global mode) from −100 to 100, `convert`, `fill`, `stroke`,
|
||||
|
||||
+13
-4
@@ -622,9 +622,13 @@ RGB fields in percent, as a double-click right of an RGB field does, and `false`
|
||||
and answers true when the fields show in percent.
|
||||
`ui.colorWheel {"view": "box", "channel": "red"}` shows the Color Wheel panel's box (a color field with the channel's
|
||||
strip at its right) in place of the wheel, as the panel menu's Box View and Box Channel do, and `"view": "wheel"`
|
||||
shows the wheel again. Keys left out keep their values. Params that are not an object, another key or a value off
|
||||
the list return an error and change nothing. The command returns `{view, channel}`, and both settings are kept with
|
||||
the preferences.
|
||||
shows the wheel again. `"opacity": true` checks Show Opacity, as the panel menu does: a row under the wheel or the
|
||||
box with a slider and a percent field sets the opacity of the fill or stroke row (`paint.setFill {opacity}`), the
|
||||
selected gradient stop or the selected freeform point (the first stop or point when none is selected), and `false`
|
||||
hides the row. The row is gray with nothing selected, for an object selected in a symbol instance, and when the fill
|
||||
or stroke row it would set is on type characters or missing. Keys left out keep their values.
|
||||
Params that are not an object, another key or a value off the list return an error and change nothing. The command
|
||||
returns `{view, channel, opacity}`, and the settings are kept with the preferences.
|
||||
|
||||
In remote desktop mode, `invoke_menu` with `{"command":"ui.sampleScreenColor","params":{}}` shows the system's
|
||||
screen color sampler and returns `null` before a color is picked: the system's sampler on macOS, the XDG desktop
|
||||
@@ -756,7 +760,12 @@ Cmd+Alt+/ runs `appearance.addStroke` (`press_key {key: "/", mods: {cmd: true, a
|
||||
`item` to edit one of them; `run_command appearance.setActiveItem {"index": n}` makes that row the target of later
|
||||
calls that omit `item` (as clicking the row in the Appearance panel does) until the selection changes; the proxy of
|
||||
its kind (`paint.proxies`) and the Gradient tool's annotator then show that row.
|
||||
`inspect_document` reports it as `paint.appearanceItem`. Live effects take the same `item` to apply to one fill or
|
||||
`inspect_document` reports it as `paint.appearanceItem`. `paint.setFill` and `paint.setStroke` also take `opacity`
|
||||
(0 to 100, a percentage as in `transparency.set`), which sets the opacity of the fill or stroke row they paint, with
|
||||
or without a new paint, as one undo step. An opacity that no target takes is an error and also leaves the paint
|
||||
undone. `paint.proxies` answers it as `fillOpacity` and `strokeOpacity`, from the first selected object that has
|
||||
that row. It answers null with nothing selected, for an object selected in a symbol instance, and when only type
|
||||
characters (which have no opacity of their own) or objects without that row are selected. Live effects take the same `item` to apply to one fill or
|
||||
stroke instead of the whole object: `run_command effect.apply {"effect": "path.offsetPath", "item": 0}`, and
|
||||
`effect.remove`, `effect.setParams` (`visible` toggles one) and `effect.duplicate` address that item's effects;
|
||||
`apply_effect` uses the active item. `effect.list` reports each object's item effects under `applied[].items`.
|
||||
|
||||
@@ -1503,6 +1503,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- **Missing library files:** a persistent swatch or graphic style library panel whose file is gone at startup reopens and stays in the preferences, showing the file's path with Locate Library… (`ui.libraryPanel.locate`), which reads the file from where it is now into the same panel.
|
||||
- **Swatch library and Recolor Artwork parameters:** the `swatch.library.*` commands, `swatch.resetDefaults`, the graphic style library save, load and add, the `recolor.*` commands and `color.harmony`'s `limitTo` refuse parameters of the wrong form, such as `names: "Grays"`, `limitTo: 5` or `includeImages: "false"`. Errors name the parameter, except that a `limitTo` that is not a string, such as `5`, gets an unknown-library error. A `null` counts as left out except for `recolor.apply`'s `model`, which must be a string when given.
|
||||
- **Color Wheel panel (part of #978):** Window › Color Wheel shows the Fill and Stroke proxy beside a hue ring around a square with saturation across and brightness up. It edits what the Color panel's sliders edit (the active proxy's color, the selected gradient stop or freeform point) through the same paint commands, and a drag is one undo step. Alt paints the other proxy, and Shift steps the ring by 45°. A pick goes from display sRGB into the working RGB space; an RGB, CMYK or Lab color keeps its model, and a Gray color or a tint of a global swatch becomes a process color in the document's color mode. A click gives the ring or the square the keyboard focus, and the arrow keys then step the color; both report their names and values to screen readers, and the Color Picker's color field takes the same keys. The panel menu's Box View puts a box in the wheel's place: a color field with a channel strip at its right for Hue, Saturation, Brightness, Red, Green or Blue (Box Channel), on the Color Picker's axes, kept with the preferences (`ui.colorWheel`); the strip and the Color Picker's channel slider take the arrow keys after a click. Scores and estimates are unchanged.
|
||||
VectorCraft's own Show Opacity in the Color Wheel panel menu (part of #978) adds a slider and a percent field that set the opacity of what the wheel edits: the fill or stroke row (`paint.setFill {opacity}`; fill and stroke opacity can differ, as [Apply transparency to artwork](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/apply-transparency-to-artwork.html) describes), the selected gradient stop or the selected freeform point (the first one when none is selected). The row is gray with nothing selected, for an object selected in a symbol instance, and when the fill or stroke row it would set is on type characters or missing. Scores and estimates are unchanged.
|
||||
- **Colour:** a Color Picker (colour field, H/S/B/R/G/B channel slider, HSB/RGB/Lab/CMYK fields, hex, web-only snapping, out-of-gamut correction); the Color panel shows a selected colour in its own model and, with nothing selected, the new-art defaults in the mode picked last, which it keeps between sessions; Alt-click paints the other proxy; proxies look through groups and show "?" for mixed paint; Invert, Complement, Apply Last Color (`,`) and Apply Last Gradient (`.`) keep the colour model; every paint command feeds the recent colours. The Color Guide has 21 harmony rules, Steps and Variation options and Limit to Library. Adjust Color Balance (its Global mode shifts tints) and Saturate preview live; Edit Colors and Recolor also reach meshes, images and patterns. Recolor Artwork has colour reduction, five recolour methods, presets, Limit to Library, a colour-wheel Edit tab and Edit Color Group; a local Color Themes panel saves five-colour themes. Fill/Stroke chips open swatch and mixer popovers (the Properties panel has the Control bar's Fill and Stroke chips, Stroke link and weight spinner, with nothing selected too), panels have Illustrator's Window menu keys (Align Shift+F7, Transform Shift+F8, Pathfinder Cmd+Shift+F9, Layers F7, Character Cmd+T…; every panel can be given one in Edit › Keyboard Shortcuts), and Eyedropper Options pick up and apply chosen attributes (Alt and Shift+Alt, image pixels). An ICC CMYK profile converts straight into the RGB working space (not through sRGB, so a wider space such as Wide Gamut RGB keeps colours sRGB can't hold) with the colour settings' black-point compensation, on the canvas and in RGB exports alike (the built-in Generic CMYK compensates both ways, so RGB black separated to a rich black displays as black again). Fills and strokes can overprint (Attributes panel, Overprint Black options), and CMYK documents blend in inks on screen, in PDF and when flattening. Document Color Mode converts the art, symbols, pattern tiles and swatches through the colour settings: Gray stays Gray, RGB grays separate into light grays in cyan, magenta and yellow only, darker four-color grays and a rich black, or go on the black plate only with `grays: "black"` (also for `document.open {colorMode}`).
|
||||
Plain Comma and Period, and also Shift+Comma and Shift+Period, apply the last solid color and the last gradient to the active Fill or Stroke proxy in VectorCraft ([Default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html), "Select color fill mode" and "Select gradient fill mode").
|
||||
Recent Colors keeps the last 30 solid colors applied, newest first and each once, and the list stays the same when another document is opened or made active; a 31st color drops the oldest ([Select colors using the Color panel](https://helpx.adobe.com/illustrator/desktop/manage-colors/select-and-adjust-colors/select-colors-using-the-color-panel.html)). The list lasts for the session. In the Color and Swatches panels the chips wrap onto further rows when the panel is too narrow for one row (`paint.recent`). Tests: `recent_colors_keep_thirty_colors_across_documents` in `crates/engine/src/tests/paintproxy.rs`, `all_thirty_recent_colors_wrap_into_a_narrow_panel` in `crates/ui-egui/src/panels/color/tests.rs`.
|
||||
|
||||
Reference in new issue
Block a user