Merge main into pencil-redraw-extend

This commit is contained in:
FredApps committed 2026-11-20 09:36:37 +01:00
commit 3c4fb3c8fa
71 files changed
+2568 -458

No files matched your search

+1
View File
@@ -155,6 +155,7 @@ Generated-in-code art is original and has no file to list. This covers the defau
| `assets/icons/dc-draw-inside.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-draw-normal.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-ellipse.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-fill-area.svg` | VectorCraft contributors | Original work, drawn for VectorCraft: three crossing lines with the triangle they enclose filled | MIT OR Apache-2.0 | |
| `assets/icons/dc-fill-none.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-filter.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-flare.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
Generated
+12 -2
View File
@@ -1048,6 +1048,11 @@ dependencies = [
"thiserror 2.0.21",
]
[[package]]
name = "craft-eps"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=cfcc86242d56fe68117cd5dc2e5dd3b7a0e5b0ec#cfcc86242d56fe68117cd5dc2e5dd3b7a0e5b0ec"
[[package]]
name = "craft-eps"
version = "0.1.0"
@@ -1248,10 +1253,15 @@ dependencies = [
[[package]]
name = "craft-ps"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
source = "git+https://github.com/storytold/craft-libs?rev=cfcc86242d56fe68117cd5dc2e5dd3b7a0e5b0ec#cfcc86242d56fe68117cd5dc2e5dd3b7a0e5b0ec"
dependencies = [
"craft-eps 0.1.0 (git+https://github.com/storytold/craft-libs?rev=cfcc86242d56fe68117cd5dc2e5dd3b7a0e5b0ec)",
"flate2",
"kurbo 0.13.1",
"miniz_oxide 0.8.9",
"pdf-writer",
"skrifa 0.47.0",
"weezl 0.1.12",
]
[[package]]
@@ -6866,7 +6876,7 @@ dependencies = [
name = "vectorcraft-eps"
version = "0.24.1"
dependencies = [
"craft-eps",
"craft-eps 0.1.0 (git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0)",
"craft-image-codecs",
"craft-pdf",
"craft-ps",
+1 -1
View File
@@ -41,7 +41,7 @@ craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb
craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0", default-features = false, features = ["write"] }
craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "cfcc86242d56fe68117cd5dc2e5dd3b7a0e5b0ec", default-features = false, features = ["read", "write"] }
craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M7 9h10l-5 8.7z" fill="currentColor" stroke="none"/><path d="M3 9h18"/><path d="M5 5.5 14.5 22"/><path d="M19 5.5 9.5 22"/></svg>

After

Width:  |  Height:  |  Size: 321 B

+48
View File
@@ -178,6 +178,7 @@ pub const BUILTIN: &[BuiltinBrushLibrary] = &[
BuiltinBrushLibrary { id: "paint", name: "Paint", make: paint },
BuiltinBrushLibrary { id: "pattern-borders", name: "Pattern Borders", make: pattern_borders },
BuiltinBrushLibrary { id: "decorative", name: "Decorative", make: decorative },
BuiltinBrushLibrary { id: "ornamental", name: "Ornamental", make: ornamental },
BuiltinBrushLibrary { id: "scatter-shapes", name: "Scatter Shapes", make: scatter_shapes },
BuiltinBrushLibrary { id: "stipple", name: "Stipple", make: stipple },
BuiltinBrushLibrary { id: "game-trails", name: "Game Trails", make: game_trails },
@@ -733,6 +734,53 @@ fn decorative() -> BrushLibrary {
)
}
/// Ornamental: one-pass flourishes and arrow accents that stretch with the path rather than
/// repeating a pattern tile. Every shape is original filled vector art.
fn ornamental() -> BrushLibrary {
let scrollwork = group(vec![
black(band(100.0, 1.2, 64, |x| 2.6 * (x / 100.0 * std::f64::consts::TAU).sin())),
ring(Point::new(7.0, 0.0), 4.0, 2.0),
ring(Point::new(93.0, 0.0), 4.0, 2.0),
black(polygon(&[(28.0, 1.0), (34.0, -5.0), (40.0, -3.0), (33.0, 2.0)])),
black(polygon(&[(60.0, 3.0), (66.0, 5.0), (72.0, -1.0), (67.0, -2.0)])),
]);
let arrow = group(vec![
// The shaft runs into the head's notch at x = 85 so the two overlap.
black(shapes::rectangle(Rect::new(4.0, -0.7, 86.0, 0.7))),
black(polygon(&[(80.0, -6.5), (100.0, 0.0), (80.0, 6.5), (85.0, 0.0)])),
ring(Point::new(7.0, 0.0), 4.0, 1.7),
black(polygon(&[(25.0, -0.4), (31.0, -4.4), (37.0, -2.0), (31.0, 0.8)])),
black(polygon(&[(43.0, 0.4), (49.0, 4.4), (55.0, 2.0), (49.0, -0.8)])),
]);
let mut petals = vec![black(band(100.0, 1.0, 48, |x| 1.8 * (x / 100.0 * std::f64::consts::PI).sin()))];
for x in [19.0, 43.0, 67.0, 87.0] {
let y = 1.8 * (x / 100.0 * std::f64::consts::PI).sin();
petals.push(black(shapes::ellipse(Rect::new(x - 4.5, y - 7.5, x + 4.5, y - 0.3))));
petals.push(black(shapes::ellipse(Rect::new(x - 3.5, y + 0.3, x + 3.5, y + 5.5))));
}
let petal_sweep = group(petals);
let twin_curl = group(vec![
black(band(100.0, 0.9, 64, |x| -3.8 + 1.6 * (x / 100.0 * 2.0 * std::f64::consts::TAU).sin())),
black(band(100.0, 0.9, 64, |x| 3.8 - 1.6 * (x / 100.0 * 2.0 * std::f64::consts::TAU).sin())),
ring(Point::new(8.0, -3.8), 3.0, 1.5),
ring(Point::new(92.0, 3.8), 3.0, 1.5),
]);
let ornament = |name: &str, art: Node| Brush {
name: name.into(),
kind: BrushKind::Art(ArtBrush { art, width: 300.0, colorization: Colorization::Tints, ..Default::default() }),
};
built(
"Ornamental",
Document::new(100.0, 100.0),
vec![
ornament("Scrollwork", scrollwork),
ornament("Filigree Arrow", arrow),
ornament("Petal Sweep", petal_sweep),
ornament("Twin Curl", twin_curl),
],
)
}
fn scatter(name: &str, art: Node, s: Scatter) -> Brush {
Brush { name: name.into(), kind: BrushKind::Scatter(Scatter { art, ..s }) }
}
+19 -4
View File
@@ -40,7 +40,7 @@ mod trace;
pub use live_paint::live_paint_gaps;
pub(crate) use live_paint::{LivePaintMove, check_part_name, clear_part_name, isolated_live_paints, merge_drawn_in_isolation};
use live_paint::{lp_expand, lp_fill, lp_gap_options, lp_info, lp_make, lp_merge, lp_release, lp_stroke_edge};
use shape_builder::{sb_merge, sb_regions};
use shape_builder::{sb_copy_region, sb_merge, sb_regions};
pub(crate) use trace::TracePresetChanges;
pub use trace::{
TRACE_PRESET_EXTS, TRACE_PRESET_FORMAT, TRACE_PRESET_MAX_BYTES, TracePreset, TracePresetChange, TraceRun, Traced, image_trace_target,
@@ -72,6 +72,15 @@ pub fn specs() -> Vec<CommandSpec> {
has_selection_or_ids,
sb_regions
),
cmd!(
"shapeBuilder.copyRegion",
"Fill Area",
[],
None,
"{point: [x,y], ids?|id?: [id…] (the objects or layers whose paths bound areas; default: every layer, nothing needs to be selected), gap?: pt (0–72; 0: Gap Detection off; out of range is an error), openFilledAsClosed?: true (as shapeBuilder.merge), fill?, stroke?: \"#rrggbb\" | {color|swatch|gradient|none} (default: the current fill and stroke, with the current stroke weight)} add a new closed path of the area under point that the visible, unlocked paths enclose (the region of shapeBuilder.regions holding it: areas a shape already fills and areas open paths bound count too), directly above the front-most object along the area (its outline touches the area's outline, or it covers the area; when a group, Live Paint group, Shaper group or clipping group holds that path, above the outermost group in its layer, never inside it), and select it; in isolation mode only the paths of the isolated layer or group bound areas (with ids, only the paths of the listed objects that are in it), and the new path goes inside it, directly above the object in it that holds that path; no area is found while the isolated object is not a layer or group (a path or compound path), is a Live Paint group, compound shape, Shaper group, graph, Image Trace result, dimension, flare or Objects on Path group, is a layer or group with a live effect or a clipping mask, or lies inside one of these or inside an envelope; the paths around the area are not changed; a point in no enclosed area is an error and changes nothing (no undo step); when the paths together have more than 65,536 segments, only an area the paths near the point enclose is found → {id, above (the object the new path went above)}",
has_doc,
sb_copy_region
),
cmd!(
"livePaint.make",
"Make",
@@ -285,12 +294,18 @@ fn stroke_only(paint: Paint, width: f64) -> Appearance {
// ---------- Shape Builder ----------
fn fill_param(s: &Session, p: &Value, cmd: &str) -> Result<Option<Paint>> {
match p.get("fill") {
paint_param(s, p, "fill", cmd)
}
/// The paint `p` gives for `key` (`"#rrggbb"` or `{color|swatch|gradient|none}`), as `fill` is read.
fn paint_param(s: &Session, p: &Value, key: &str, cmd: &str) -> Result<Option<Paint>> {
match p.get(key) {
None | Some(Value::Null) => Ok(None),
Some(v @ Value::Object(o)) if o.contains_key("color") || o.contains_key("swatch") || o.contains_key("gradient") || o.contains_key("none") => {
paint_from(s, v)
// A paint key whose value is not a paint, such as `{"swatch": 123}`, gives no paint.
paint_from(s, v)?.map(Some).ok_or_else(|| bad(cmd, format!("bad {key} {v}")))
}
Some(v) => color_value(v).map(|c| Some(Paint::solid(super::paint::new_color(s, p, c)))).ok_or_else(|| bad(cmd, format!("bad fill {v}"))),
Some(v) => color_value(v).map(|c| Some(Paint::solid(super::paint::new_color(s, p, c)))).ok_or_else(|| bad(cmd, format!("bad {key} {v}"))),
}
}
@@ -1,7 +1,7 @@
use super::{
Arc, Beside, BuilderMap, EngineError, FillRule, Node, NodeId, PathData, Point, Rect, Result, Session, Touched, Value, b, bad, check_numbers,
f64_or, fill_param, finite, gap_param, ids_json, json, marquee_param, po, points_param, remnant, replace_leaves, replace_with_pieces, root_ids,
shape_node, switch_or,
f64_or, fill_param, finite, gap_param, ids_json, json, marquee_param, named_ids, number_or, outermost, paint_param, po, point_param,
points_param, remnant, replace_leaves, replace_with_pieces, root_ids, shape_node, switch_or,
};
pub(super) fn sb_merge(s: &mut Session, p: &Value) -> Result<Value> {
@@ -183,6 +183,49 @@ pub(super) fn sb_merge(s: &mut Session, p: &Value) -> Result<Value> {
Ok(out)
}
pub(super) fn sb_copy_region(s: &mut Session, p: &Value) -> Result<Value> {
const C: &str = "shapeBuilder.copyRegion";
let pt = point_param(p, "point").filter(|q| finite(*q)).ok_or_else(|| bad(C, "missing point [x,y]"))?;
let open_filled_as_closed = switch_or(p, "openFilledAsClosed", true, C)?;
let gap = number_or(p, "gap", 0.0, C)?;
if !(0.0..=po::SHAPE_BUILDER_MAX_GAP).contains(&gap) {
return Err(bad(C, format!("gap must be 0 to {} pt, not {gap}", po::SHAPE_BUILDER_MAX_GAP)));
}
let fill = paint_param(s, p, "fill", C)?.unwrap_or_else(|| s.paint.fill.clone());
let stroke = paint_param(s, p, "stroke", C)?.unwrap_or_else(|| s.paint.stroke.clone());
let look = s.new_art_look(fill, stroke, s.paint.stroke_width);
let area = {
let st = s.doc()?;
let d = &st.doc;
let named = match named_ids(p)? {
Some(ids) => {
if let Some(bad_id) = ids.iter().find(|i| d.node(**i).is_none()) {
return Err(EngineError::NoNode(*bad_id));
}
// An object listed with a layer or group that holds it counts once.
Some(outermost(d, ids))
}
None => None,
};
// In isolation mode only the isolated layer or group's paths bound areas, and the new path
// goes inside it.
b::fill_area_roots(d, st.isolation, named.as_deref())
.and_then(|(roots, scope)| b::AreaFinder::new(d, &roots, scope, gap, open_filled_as_closed).find(pt))
};
let Some(area) = area else { return Err(EngineError::Other("Fill Area: no enclosed area under the pointer".into())) };
let id = s.edit("Fill Area", |d, sel| {
let mut n = shape_node(d, area.path.clone(), None);
look.apply(d, &mut n);
let id = n.id;
let mut above = Beside::above(d, &[area.above]);
above.put(d, area.above, vec![n])?;
above.finish(d)?;
sel.set([id]);
Ok(id)
})?;
Ok(json!({ "id": id.0, "above": area.above.0 }))
}
pub(super) fn sb_regions(s: &mut Session, p: &Value) -> Result<Value> {
let open_filled_as_closed = switch_or(p, "openFilledAsClosed", true, "shapeBuilder.regions")?;
check_numbers(p, &["gap"], "shapeBuilder.regions")?;
@@ -574,6 +574,7 @@ pub(super) const ALLOWED: &[&str] = &[
"shape.spiral",
"shape.star",
"shape.threePointArc",
"shapeBuilder.copyRegion",
"shapeBuilder.merge",
"shapeBuilder.regions",
"shaper.expand",
+1 -1
View File
@@ -531,7 +531,7 @@ impl Line {
continue;
}
if t < 0.0 && !paints_as_one(&self) {
return self;
continue;
}
let mut tracked = self.clone();
tracked.tracking = t;
+25
View File
@@ -1106,6 +1106,31 @@ fn tracking_near_a_whole_number_is_kept_as_measured_when_rounding_moves_glyphs()
assert_same_places(&before, &text_of(&s, r["ids"][0].as_u64().unwrap()));
}
#[test]
fn a_tracking_translucent_glyphs_cannot_take_keeps_the_tracking_that_fits() {
// The first three glyphs are tracked 50 and the last 150 further on. A tracking tighter than
// zero is not tried for glyphs that cannot be one object, and the tracked prefix is kept.
let mut s = session();
let id = s.execute("text.create", &json!({"x": 40, "y": 100, "text": "MMMM", "size": 30})).unwrap()["id"].as_u64().unwrap();
s.execute("text.setRangeStyle", &json!({"id": id, "start": 0, "end": 2, "tracking": 50})).unwrap();
s.execute("text.setRangeStyle", &json!({"id": id, "start": 2, "end": 3, "tracking": 150})).unwrap();
s.execute("select.set", &json!({"ids": [id]})).unwrap();
let g = s.execute("type.createOutlines", &json!({})).unwrap()["ids"][0].as_u64().unwrap();
let kids = children_of(&s, g);
s.edit("test", |d, _| {
for k in &kids {
d.node_mut(NodeId(*k)).unwrap().opacity = 0.5;
}
Ok(())
})
.unwrap();
s.execute("select.set", &json!({"ids": [g]})).unwrap();
let r = s.execute("type.retype", &json!({})).unwrap();
let texts: Vec<&str> = r["texts"].as_array().unwrap().iter().map(|t| t.as_str().unwrap()).collect();
assert_eq!(texts.concat(), "MMMM", "{r}");
assert!(texts.iter().any(|t| t.len() > 1), "the tracked glyphs stay one object: {r}");
}
#[test]
fn overlapping_translucent_glyphs_are_not_tracked_into_one_object() {
let mut s = session();
+86
View File
@@ -170,6 +170,7 @@ pub const BUILTIN: &[BuiltinSymbolLibrary] = &[
BuiltinSymbolLibrary { id: "inventory-icons", name: "Inventory Icons", make: inventory_icons },
BuiltinSymbolLibrary { id: "skill-icons", name: "Skill Icons", make: skill_icons },
BuiltinSymbolLibrary { id: "weather-icons", name: "Weather Icons", make: weather_icons },
BuiltinSymbolLibrary { id: "nature-icons", name: "Nature Icons", make: nature_icons },
BuiltinSymbolLibrary { id: "media-controls", name: "Media Controls", make: media_controls },
];
@@ -503,6 +504,91 @@ fn weather_icons() -> SymbolLibrary {
SymbolLibrary { name: "Weather Icons".into(), doc }
}
/// Nature Icons: five original silhouettes for diagrams and reusable artwork.
fn nature_icons() -> SymbolLibrary {
let poly = |coords: &[(f64, f64)]| {
let points: Vec<Point> = coords.iter().map(|&(x, y)| Point::new(x, y)).collect();
SubPath::polyline(&points, true)
};
let leaf = PathData::new(vec![
poly(&[(0.0, -20.0), (12.0, -13.0), (17.0, -2.0), (12.0, 10.0), (0.0, 19.0), (-12.0, 10.0), (-17.0, -2.0), (-12.0, -13.0)]),
poly(&[(-1.0, -13.0), (1.0, -13.0), (1.0, 20.0), (-1.0, 20.0)]),
]);
let mut flower_parts = shapes::ellipse(Rect::new(-6.0, -6.0, 6.0, 6.0)).subpaths;
for i in 0..6 {
let angle = i as f64 * std::f64::consts::PI / 3.0;
let (sin, cos) = angle.sin_cos();
let x = 12.0 * cos;
let y = 12.0 * sin;
flower_parts.extend(shapes::ellipse(Rect::new(x - 5.5, y - 5.5, x + 5.5, y + 5.5)).subpaths);
}
let flower = PathData::new(flower_parts);
let tree = PathData::new(vec![
poly(&[(-3.0, 6.0), (3.0, 6.0), (3.0, 20.0), (-3.0, 20.0)]),
poly(&[
(0.0, -21.0),
(12.0, -8.0),
(8.0, -8.0),
(17.0, 4.0),
(11.0, 4.0),
(18.0, 12.0),
(-18.0, 12.0),
(-11.0, 4.0),
(-17.0, 4.0),
(-8.0, -8.0),
(-12.0, -8.0),
]),
]);
let mountain = PathData::new(vec![
poly(&[(-21.0, 17.0), (-6.0, -17.0), (2.0, 0.0), (8.0, -11.0), (21.0, 17.0)]),
poly(&[(-12.0, -4.0), (-6.0, -17.0), (0.0, -4.0), (-5.0, -7.0), (-8.0, -3.0)]),
]);
let wave = PathData::new(
(0..3)
.map(|row| {
let y = row as f64 * 9.0 - 10.0;
poly(&[
(-20.0, y),
(-14.0, y - 4.0),
(-8.0, y - 4.0),
(-2.0, y),
(4.0, y + 4.0),
(10.0, y + 4.0),
(16.0, y),
(20.0, y),
(20.0, y + 3.0),
(16.0, y + 3.0),
(10.0, y + 7.0),
(4.0, y + 7.0),
(-2.0, y + 3.0),
(-8.0, y - 1.0),
(-14.0, y - 1.0),
(-20.0, y + 3.0),
])
})
.collect(),
);
let icons = [
("Leaf", leaf, "#4f9d59"),
("Flower", flower, "#d977a7"),
("Tree", tree, "#287c53"),
("Mountain", mountain, "#768899"),
("Wave", wave, "#388fb8"),
];
let mut doc = Document::new(100.0, 100.0);
for (name, path, hex) in icons {
let fill = Color::from_hex(hex).unwrap_or(Color::BLACK);
let edge = fill.lerp(&Color::BLACK, 0.35);
let id = doc.alloc_id();
let art = Node::path(id, path, Appearance::basic(Paint::solid(fill), Paint::solid(edge), 1.25));
let Ok((art, size, _)) = normalize(art) else { continue };
doc.symbols.push(Symbol { dynamic: false, name: name.into(), art: Arc::new(art) });
set_natural_size(&mut doc, name, Some(size));
}
doc.title = "Nature Icons".into();
SymbolLibrary { name: "Nature Icons".into(), doc }
}
/// Media Controls: play, pause, stop, skip next, shuffle and repeat for audio/video UI art (original, no 9-slice).
fn media_controls() -> SymbolLibrary {
// 1. Play: Right-pointing equilateral triangle.
+1
View File
@@ -67,6 +67,7 @@ mod expand_symbols;
mod eyedropper;
mod file;
mod fileinfo;
mod fill_area;
mod flatpresets;
mod flatpreview;
mod flatten;
+53
View File
@@ -115,6 +115,7 @@ fn the_builtin_libraries_are_original_brushes_generated_in_code() {
"paint",
"pattern-borders",
"decorative",
"ornamental",
"scatter-shapes",
"stipple",
"game-trails",
@@ -197,6 +198,7 @@ fn every_builtin_library_brush_has_its_kind_and_draws() {
("paint", "art"),
("pattern-borders", "pattern"),
("decorative", "pattern"),
("ornamental", "art"),
("scatter-shapes", "scatter"),
("stipple", "scatter"),
("game-trails", "art"),
@@ -661,6 +663,57 @@ fn decorative_brushes_repeat_distinct_art_and_survive_a_saved_library() {
assert_eq!(vectorcraft_brush::library(&reopened), lib.brushes);
}
#[test]
fn ornamental_brushes_draw_flourishes_and_survive_a_saved_library() {
let mut s = session();
let (_, lib) = cmd::brushlib::library(&s, "Ornamental").unwrap();
let names = ["Scrollwork", "Filigree Arrow", "Petal Sweep", "Twin Curl"];
assert_eq!(lib.brushes.iter().map(|b| b.name.as_str()).collect::<Vec<_>>(), names);
let path = run(&mut s, "shape.line", json!({"x1": 10, "y1": 40, "x2": 190, "y2": 40}))["id"].as_u64().unwrap();
let mut curve = line_to(20.0);
curve.curve_to((60.0, -25.0), (140.0, 25.0), (180.0, 0.0));
for b in &lib.brushes {
let BrushKind::Art(art) = &b.kind else { panic!("{} is not an art brush", b.name) };
assert_eq!(art.colorization, vectorcraft_brush::Colorization::Tints);
assert_eq!(art.width, 300.0);
for line in [line_to(2.0), line_to(180.0), curve.clone()] {
let pieces = vectorcraft_brush::stroke_pieces(&lib.doc, b, &line, &black_stroke());
let points = anchors(&pieces.iter().collect::<Vec<_>>());
assert!(!points.is_empty() && points.iter().all(|p| p.x.is_finite() && p.y.is_finite()), "{}", b.name);
}
let before = undo_len(&s);
let added = run(&mut s, "brush.addFromLibrary", json!({"library": "ornamental", "name": b.name, "apply": true, "ids": [path]}));
assert_eq!(strs(&added["added"]), [b.name.as_str()]);
assert_eq!(added["applied"], json!([path]));
assert_eq!(undo_len(&s), before + 1);
assert_eq!(doc(&s).node(NodeId(path)).unwrap().appearance.stroke().unwrap().brush.as_deref(), Some(b.name.as_str()));
}
let saved = run(&mut s, "brush.saveLibrary", json!({"names": names}));
let bytes = vectorcraft_format::base64_decode(saved["dataBase64"].as_str().unwrap()).unwrap();
let reopened = vectorcraft_format::load(&bytes).unwrap();
assert_eq!(vectorcraft_brush::library(&reopened), lib.brushes);
}
/// Filigree Arrow's shaft runs into its head with no gap, so a straight stroke draws one arrow.
#[test]
fn the_filigree_arrow_shaft_meets_its_head() {
let s = session();
let (_, lib) = cmd::brushlib::library(&s, "Ornamental").unwrap();
let BrushKind::Art(art) = &lib.brush("Filigree Arrow").unwrap().kind else { panic!("Filigree Arrow is not an art brush") };
let mut parts = vec![];
art.art.walk(&mut |c| {
if c.path_data().is_some() {
parts.push(c.contains_fn());
}
});
for y in [-0.6, 0.0, 0.6] {
for i in 0..=930 {
let p = vectorcraft_geom::Point::new(4.05 + 0.1 * f64::from(i), y);
assert!(parts.iter().any(|inside| inside(p)), "gap at {p:?}");
}
}
}
#[test]
fn pressure_sensitive_brushes_widen_with_pen_pressure_and_survive_a_saved_library() {
let mut s = session();
+827
View File
@@ -0,0 +1,827 @@
//! Tests for Fill Area (`shapeBuilder.copyRegion` and the `fillArea` tool).
use serde_json::{Value, json};
use vectorcraft_color::{Color, Paint};
use vectorcraft_doc::Node;
use vectorcraft_geom::{FillRule, PathData, Point};
use vectorcraft_tools::{Cursor, Mods, Overlay, PointerEvent, PointerKind};
use crate::*;
fn session() -> Session {
let mut s = Session::new();
s.execute("file.new", &json!({"width": 800, "height": 600})).unwrap();
s
}
fn id_of(v: &Value) -> NodeId {
NodeId(v["id"].as_u64().unwrap())
}
fn node(s: &Session, id: NodeId) -> Node {
s.doc().unwrap().doc.node(id).cloned().unwrap()
}
fn outline(s: &Session, id: NodeId) -> (PathData, FillRule) {
vectorcraft_tools::builder::node_outline(&node(s, id)).expect("path")
}
fn area(s: &Session, id: NodeId) -> f64 {
let (p, r) = outline(s, id);
vectorcraft_pathops::area(&p, r)
}
fn line(s: &mut Session, a: (f64, f64), b: (f64, f64)) -> NodeId {
id_of(&s.execute("shape.line", &json!({"x1": a.0, "y1": a.1, "x2": b.0, "y2": b.1})).unwrap())
}
fn rect(s: &mut Session, x: f64, y: f64, w: f64, h: f64) -> NodeId {
id_of(&s.execute("shape.rectangle", &json!({"x": x, "y": y, "width": w, "height": h})).unwrap())
}
/// Two diagonals and a crossbar: they enclose a triangle of 900 pt² above the crossbar.
fn triangle(s: &mut Session) -> [NodeId; 3] {
[line(s, (0.0, 0.0), (100.0, 100.0)), line(s, (100.0, 0.0), (0.0, 100.0)), line(s, (-10.0, 80.0), (110.0, 80.0))]
}
/// The ids of the default layer's children, back to front.
fn stack(s: &Session) -> Vec<NodeId> {
let d = &s.doc().unwrap().doc;
d.children(d.default_layer()).map(|c| c.iter().map(|n| n.id).collect()).unwrap_or_default()
}
fn undo_len(s: &Session) -> usize {
s.doc().unwrap().history.undo.len()
}
fn deselect(s: &mut Session) {
s.execute("select.set", &json!({"ids": []})).unwrap();
}
/// Four circles in a 2×2 grid, each touching its neighbors, enclose a diamond nothing fills. With
/// nothing selected, a click in it adds the diamond and leaves the circles as they were.
#[test]
fn fill_area_adds_the_diamond_four_circles_enclose_and_keeps_them() {
let mut s = session();
let mut circles = vec![];
for (x, y) in [(0.0, 0.0), (100.0, 0.0), (0.0, 100.0), (100.0, 100.0)] {
circles.push(id_of(&s.execute("shape.ellipse", &json!({"x": x, "y": y, "width": 100, "height": 100})).unwrap()));
}
deselect(&mut s);
let before: Vec<_> = circles.iter().map(|c| outline(&s, *c)).collect();
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [100, 100]})).unwrap();
let new = id_of(&r);
assert!((area(&s, new) - 2146.0).abs() < 10.0, "{}", area(&s, new));
assert_eq!(stack(&s).len(), 5, "the four circles and the diamond");
let after: Vec<_> = circles.iter().map(|c| outline(&s, *c)).collect();
assert_eq!(after, before, "the circles keep their geometry");
assert_eq!(s.doc().unwrap().selection.objects, vec![new], "the new path is selected");
}
/// The overlap of two filled squares is an area too: the new path covers it, and both squares stay
/// whole (a Shape Builder merge there cuts it out of them).
#[test]
fn fill_area_copies_the_overlap_of_two_filled_squares() {
let mut s = session();
let a = rect(&mut s, 0.0, 0.0, 100.0, 100.0);
let b = rect(&mut s, 50.0, 0.0, 100.0, 100.0);
deselect(&mut s);
let (oa, ob) = (outline(&s, a), outline(&s, b));
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [75, 50]})).unwrap();
let new = id_of(&r);
assert!((area(&s, new) - 5000.0).abs() < 1.0, "{}", area(&s, new));
assert_eq!((outline(&s, a), outline(&s, b)), (oa, ob));
assert_eq!(stack(&s), vec![a, b, new], "above the front-most square");
assert_eq!(r["above"], json!(b.0));
}
/// Three lines bound a triangle; the new path has the current fill and stroke.
#[test]
fn fill_area_fills_the_triangle_three_lines_bound_with_the_current_paint() {
let mut s = session();
let lines = triangle(&mut s);
deselect(&mut s);
s.execute("paint.setFill", &json!({"color": "#336699"})).unwrap();
s.execute("paint.setStroke", &json!({"color": "#993300"})).unwrap();
let (fill, stroke) = (s.paint.fill.clone(), s.paint.stroke.clone());
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).unwrap();
let new = id_of(&r);
assert!((area(&s, new) - 900.0).abs() < 1e-6, "{}", area(&s, new));
let n = node(&s, new);
assert_eq!(n.appearance.fill_paint(), fill);
assert_eq!(n.appearance.stroke_paint(), stroke);
assert_eq!(stack(&s), vec![lines[0], lines[1], lines[2], new]);
// `fill` and `stroke` override the current paint.
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70], "fill": "#00ff00", "stroke": {"none": true}})).unwrap();
let n = node(&s, id_of(&r));
assert_eq!(n.appearance.fill_paint(), Paint::solid(Color::rgb(0.0, 1.0, 0.0)));
assert_eq!(n.appearance.stroke_paint(), Paint::None);
}
/// The new path takes the current stroke weight.
#[test]
fn fill_area_takes_the_current_stroke_weight() {
let mut s = session();
triangle(&mut s);
deselect(&mut s);
s.execute("paint.setStroke", &json!({"color": "#993300"})).unwrap();
s.paint.stroke_width = 4.0;
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).unwrap();
assert_eq!(node(&s, id_of(&r)).appearance.stroke_width(), 4.0);
}
/// `ids` names the objects or layers whose paths bound areas: without the crossbar the triangle is
/// open, and naming the layer takes every path in it.
#[test]
fn fill_area_ids_limit_the_paths_that_bound_areas() {
let mut s = session();
let lines = triangle(&mut s);
deselect(&mut s);
let two = json!({"point": [50, 70], "ids": [lines[0].0, lines[1].0]});
assert!(s.execute("shapeBuilder.copyRegion", &two).is_err());
let all = json!({"point": [50, 70], "ids": [lines[0].0, lines[1].0, lines[2].0]});
let r = s.execute("shapeBuilder.copyRegion", &all).unwrap();
assert!((area(&s, id_of(&r)) - 900.0).abs() < 1e-6);
let layer = s.doc().unwrap().doc.default_layer().unwrap();
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70], "ids": [layer.0]})).unwrap();
assert!((area(&s, id_of(&r)) - 900.0).abs() < 1e-6);
}
/// The new path goes above the group, Live Paint group or clipping group that holds the paths
/// along the area, never inside it, and the group keeps its members.
#[test]
fn fill_area_stacks_above_the_group_that_holds_the_paths() {
let mut s = session();
let lines = triangle(&mut s);
let ids: Vec<u64> = lines.iter().map(|l| l.0).collect();
s.execute("select.set", &json!({"ids": ids})).unwrap();
let g = id_of(&s.execute("object.group", &json!({})).unwrap());
deselect(&mut s);
let members = |s: &Session, g: NodeId| -> Vec<NodeId> { node(s, g).children().unwrap().iter().map(|n| n.id).collect() };
let before = members(&s, g);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).unwrap();
assert_eq!(stack(&s), vec![g, id_of(&r)]);
assert_eq!(r["above"], json!(g.0));
assert_eq!(members(&s, g), before);
let mut s = session();
let a = rect(&mut s, 0.0, 0.0, 100.0, 100.0);
let b = rect(&mut s, 50.0, 0.0, 100.0, 100.0);
let lp = id_of(&s.execute("livePaint.make", &json!({"ids": [a.0, b.0]})).unwrap());
deselect(&mut s);
let before = members(&s, lp);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [75, 50]})).unwrap();
assert!((area(&s, id_of(&r)) - 5000.0).abs() < 1.0, "{}", area(&s, id_of(&r)));
assert_eq!(stack(&s), vec![lp, id_of(&r)]);
assert_eq!(members(&s, lp), before);
let mut s = session();
let lines = triangle(&mut s);
let mask = rect(&mut s, -20.0, -20.0, 140.0, 140.0);
let ids: Vec<u64> = lines.iter().map(|l| l.0).chain([mask.0]).collect();
s.execute("select.set", &json!({"ids": ids})).unwrap();
s.execute("object.clippingMask.make", &json!({})).unwrap();
let clip = s.doc().unwrap().selection.objects[0];
deselect(&mut s);
let before = members(&s, clip);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).unwrap();
assert_eq!(stack(&s), vec![clip, id_of(&r)]);
assert_eq!(members(&s, clip), before);
}
/// In isolation mode only the isolated group's paths bound areas, for the command and the tool: a
/// click in an area that art outside the group encloses adds nothing, and the new path goes inside
/// the group, above the path along the area.
#[test]
fn fill_area_stays_inside_the_isolated_group() {
let mut s = session();
let outside =
[line(&mut s, (200.0, 0.0), (300.0, 100.0)), line(&mut s, (300.0, 0.0), (200.0, 100.0)), line(&mut s, (190.0, 80.0), (310.0, 80.0))];
let lines = triangle(&mut s);
let ids: Vec<u64> = lines.iter().map(|l| l.0).collect();
s.execute("select.set", &json!({"ids": ids})).unwrap();
let g = id_of(&s.execute("object.group", &json!({})).unwrap());
s.execute("object.isolate", &json!({"id": g.0})).unwrap();
deselect(&mut s);
let members = |s: &Session| -> Vec<NodeId> { node(s, g).children().unwrap().iter().map(|n| n.id).collect() };
let (undo, kids) = (undo_len(&s), stack(&s));
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [250, 70]})).is_err(), "art outside the isolated group");
let named: Vec<u64> = outside.iter().map(|l| l.0).collect();
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [250, 70], "ids": named})).is_err(), "named art outside it");
assert_eq!((undo_len(&s), stack(&s), members(&s)), (undo, kids.clone(), lines.to_vec()));
let v = ViewInfo::default();
s.select_tool("fillArea", v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Move, 250.0, 70.0), v).unwrap();
assert!(
!s.overlays(v).iter().any(|o| matches!(o, Overlay::Path { color: [0xff, 0x2a, 0x2a], .. })),
"no area outside the isolated group is outlined"
);
s.pointer(&PointerEvent::new(PointerKind::Down, 250.0, 70.0), v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Up, 250.0, 70.0), v).unwrap();
assert_eq!((undo_len(&s), stack(&s), members(&s)), (undo, kids.clone(), lines.to_vec()));
s.pointer(&PointerEvent::new(PointerKind::Move, 50.0, 70.0), v).unwrap();
let red = s.overlays(v).into_iter().filter(|o| matches!(o, Overlay::Path { color: [0xff, 0x2a, 0x2a], .. })).count();
assert_eq!(red, 1, "the isolated group's area is outlined");
s.pointer(&PointerEvent::new(PointerKind::Down, 50.0, 70.0), v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Up, 50.0, 70.0), v).unwrap();
let new = s.doc().unwrap().selection.objects[0];
assert_eq!(s.doc().unwrap().doc.parent_of(new), Some(g));
assert_eq!(members(&s), [lines.as_slice(), &[new]].concat());
assert_eq!(stack(&s), kids);
assert!((area(&s, new) - 900.0).abs() < 1.0, "{}", area(&s, new));
// An isolated object that no longer exists counts as no isolation, for the tool as for the
// command: the area outside the group fills.
s.doc_mut().unwrap().isolation = Some(NodeId(999_999));
s.pointer(&PointerEvent::new(PointerKind::Move, 250.0, 70.0), v).unwrap();
let red = s.overlays(v).into_iter().filter(|o| matches!(o, Overlay::Path { color: [0xff, 0x2a, 0x2a], .. })).count();
assert_eq!(red, 1, "the area outside the group is outlined");
s.pointer(&PointerEvent::new(PointerKind::Down, 250.0, 70.0), v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Up, 250.0, 70.0), v).unwrap();
let new = s.doc().unwrap().selection.objects[0];
assert_eq!(s.doc().unwrap().doc.parent_of(new), s.doc().unwrap().doc.default_layer());
}
/// While a compound path is isolated, Fill Area finds no area, for the command and the tool, and
/// changes nothing: the compound path cannot hold the new path. The same goes for an isolated
/// Objects on Path group, a group with a Transform effect and a group that is a clipping mask.
#[test]
fn fill_area_finds_nothing_while_a_compound_path_is_isolated() {
let mut s = session();
let outer = rect(&mut s, 0.0, 0.0, 100.0, 100.0);
let inner = rect(&mut s, 25.0, 25.0, 50.0, 50.0);
s.execute("select.set", &json!({"ids": [outer.0, inner.0]})).unwrap();
let c = id_of(&s.execute("object.compoundPath.make", &json!({})).unwrap());
deselect(&mut s);
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [10, 10]})).is_ok(), "the ring fills outside isolation");
s.execute("edit.undo", &json!({})).unwrap();
s.doc_mut().unwrap().isolation = Some(c);
let (undo, kids) = (undo_len(&s), stack(&s));
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [10, 10]})).is_err());
let v = ViewInfo::default();
s.select_tool("fillArea", v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Move, 10.0, 10.0), v).unwrap();
assert!(!s.overlays(v).iter().any(|o| matches!(o, Overlay::Path { color: [0xff, 0x2a, 0x2a], .. })));
s.pointer(&PointerEvent::new(PointerKind::Down, 10.0, 10.0), v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Up, 10.0, 10.0), v).unwrap();
assert_eq!((undo_len(&s), stack(&s)), (undo, kids));
// An Objects on Path group moves its members along the path, so a new path in it would not
// stay where the area is.
let mut s = session();
let a = rect(&mut s, 0.0, 0.0, 40.0, 40.0);
let b = rect(&mut s, 100.0, 0.0, 40.0, 40.0);
let path = line(&mut s, (0.0, 200.0), (300.0, 200.0));
s.execute("select.set", &json!({"ids": [a.0, b.0]})).unwrap();
let g = id_of(&s.execute("object.objectsOnPath.attach", &json!({"path": path.0})).unwrap());
deselect(&mut s);
let c = s.doc().unwrap().doc.node(a).unwrap().geometric_bounds().unwrap().center();
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [c.x, c.y]})).is_ok(), "the square fills outside isolation");
s.execute("edit.undo", &json!({})).unwrap();
s.doc_mut().unwrap().isolation = Some(g);
let (undo, kids) = (undo_len(&s), stack(&s));
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [c.x, c.y]})).is_err());
assert_eq!((undo_len(&s), stack(&s)), (undo, kids));
// A group with a Transform effect moves what is in it, so a new path in it would not be drawn
// where the area is.
let mut s = session();
let lines = triangle(&mut s);
let ids: Vec<u64> = lines.iter().map(|l| l.0).collect();
s.execute("select.set", &json!({"ids": ids})).unwrap();
let g = id_of(&s.execute("object.group", &json!({})).unwrap());
s.execute("effect.apply", &json!({"effect": "distort.transform", "params": {"moveH": 100}, "ids": [g.0], "item": null})).unwrap();
deselect(&mut s);
s.doc_mut().unwrap().isolation = Some(g);
let (undo, kids) = (undo_len(&s), stack(&s));
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).is_err());
assert_eq!((undo_len(&s), stack(&s), node(&s, g).children().unwrap().len()), (undo, kids, 3));
// A group that is a clipping mask clips and is not painted, so it takes no new path.
let mut s = session();
let back = rect(&mut s, -20.0, -20.0, 140.0, 140.0);
let edge = rect(&mut s, 0.0, 0.0, 100.0, 100.0);
s.execute("select.set", &json!({"ids": [back.0, edge.0]})).unwrap();
let clip = id_of(&s.execute("object.clippingMask.make", &json!({})).unwrap());
s.execute("select.set", &json!({"ids": [edge.0]})).unwrap();
let mask = id_of(&s.execute("object.group", &json!({})).unwrap());
// A filled square drawn in the mask group bounds an area of its own.
s.doc_mut().unwrap().isolation = Some(mask);
let square = rect(&mut s, 10.0, 10.0, 80.0, 80.0);
assert_eq!(s.doc().unwrap().doc.parent_of(square), Some(mask));
deselect(&mut s);
let first = node(&s, clip).children().unwrap()[0].id;
assert_eq!(first, mask, "the group is the clipping mask");
let (undo, kids) = (undo_len(&s), stack(&s));
let members = node(&s, mask).children().unwrap().len();
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).is_err());
assert_eq!((undo_len(&s), stack(&s), node(&s, mask).children().unwrap().len()), (undo, kids, members));
// The clipping group itself, and a group of the art it clips, take no new path either: the
// mask would hide or cut it.
s.doc_mut().unwrap().isolation = None;
s.execute("select.set", &json!({"ids": [back.0]})).unwrap();
let clipped = id_of(&s.execute("object.group", &json!({})).unwrap());
assert_eq!(s.doc().unwrap().doc.parent_of(clipped), Some(clip));
deselect(&mut s);
for iso in [clip, clipped] {
s.doc_mut().unwrap().isolation = Some(iso);
let (undo, kids) = (undo_len(&s), stack(&s));
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [5, 5]})).is_err(), "{iso:?}");
assert_eq!((undo_len(&s), stack(&s)), (undo, kids), "{iso:?}");
}
}
/// The new path goes directly above the front-most object along the area, not above art that
/// lies elsewhere, and paths on other layers bound areas too.
#[test]
fn fill_area_takes_paths_on_every_layer_and_stacks_above_the_area() {
let mut s = session();
let first = s.doc().unwrap().doc.default_layer();
let l1 = line(&mut s, (0.0, 0.0), (100.0, 100.0));
let l2 = line(&mut s, (100.0, 0.0), (0.0, 100.0));
let far = rect(&mut s, 400.0, 400.0, 50.0, 50.0);
let other = id_of(&s.execute("layer.new", &json!({"name": "Other"})).unwrap());
let l3 = line(&mut s, (-10.0, 80.0), (110.0, 80.0));
let top = rect(&mut s, 500.0, 400.0, 50.0, 50.0);
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).unwrap();
let new = id_of(&r);
let d = &s.doc().unwrap().doc;
assert_eq!(d.parent_of(new), Some(other));
let kids: Vec<NodeId> = d.children(Some(other)).unwrap().iter().map(|n| n.id).collect();
assert_eq!(kids, vec![l3, new, top]);
let kids: Vec<NodeId> = d.children(first).unwrap().iter().map(|n| n.id).collect();
assert_eq!(kids, vec![l1, l2, far]);
}
/// An area far larger than the paths near the point: four long lines bound a 400 pt square whose
/// middle no path's bounds hold, and a small triangle inside it is a hole in the area.
#[test]
fn fill_area_finds_an_area_that_reaches_far_from_the_point() {
let mut s = session();
line(&mut s, (-20.0, 0.0), (420.0, 0.0));
line(&mut s, (-20.0, 400.0), (420.0, 400.0));
line(&mut s, (0.0, -20.0), (0.0, 420.0));
line(&mut s, (400.0, -20.0), (400.0, 420.0));
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [200, 200]})).unwrap();
assert!((area(&s, id_of(&r)) - 160_000.0).abs() < 1.0, "{}", area(&s, id_of(&r)));
for (a, b) in [((150.0, 250.0), (250.0, 350.0)), ((250.0, 250.0), (150.0, 350.0)), ((140.0, 330.0), (260.0, 330.0))] {
line(&mut s, a, b);
}
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 50]})).unwrap();
assert!((area(&s, id_of(&r)) - (160_000.0 - 900.0)).abs() < 1.0, "the square less the triangle: {}", area(&s, id_of(&r)));
}
/// Distant art with more segments than one Shape Builder map takes does not stop four lines from
/// bounding the square between them: the search maps the lines near the point first, and a window
/// that reaches the distant art leaves it out.
#[test]
fn fill_area_finds_a_nearby_area_beside_a_huge_distant_path() {
for (at, huge_x) in [(0.0, 20_000.0), (100.0, 1_300.0)] {
let mut s = session();
let (lo, hi) = (at, at + 800.0);
line(&mut s, (lo - 20.0, lo), (hi + 20.0, lo));
line(&mut s, (lo - 20.0, hi), (hi + 20.0, hi));
line(&mut s, (lo, lo - 20.0), (lo, hi + 20.0));
line(&mut s, (hi, lo - 20.0), (hi, hi + 20.0));
let n = vectorcraft_pathops::SHAPE_BUILDER_MAX_SEGMENTS;
let pts: Vec<Point> = (0..=n).map(|k| Point::new(huge_x + 400.0 * k as f64 / n as f64, 500.0 + (k % 2) as f64)).collect();
let look = vectorcraft_doc::Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 1.0);
s.edit("t", |d, _| {
let id = d.alloc_id();
let top = d.children(d.default_layer()).map_or(0, |c| c.len());
d.insert(d.default_layer(), top, Node::path(id, PathData::single(vectorcraft_geom::SubPath::polyline(&pts, false)), look))?;
Ok(id)
})
.unwrap();
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [at + 400.0, at + 400.0]})).unwrap();
assert!((area(&s, id_of(&r)) - 640_000.0).abs() < 1.0, "{huge_x}: {}", area(&s, id_of(&r)));
}
}
/// A path with too many segments near a long, flat area stays out of the map, and the area's far
/// ends still bound it.
#[test]
fn fill_area_finds_a_long_area_beside_a_huge_path() {
let mut s = session();
line(&mut s, (-10.0, -20.0), (810.0, -20.0));
line(&mut s, (-10.0, 20.0), (810.0, 20.0));
line(&mut s, (0.0, -30.0), (0.0, 30.0));
line(&mut s, (800.0, -30.0), (800.0, 30.0));
line(&mut s, (-10.0, 0.0), (810.0, 0.0));
let n = vectorcraft_pathops::SHAPE_BUILDER_MAX_SEGMENTS;
let pts: Vec<Point> = (0..=n).map(|k| Point::new(300.0 + 200.0 * k as f64 / n as f64, 60.0 + (k % 2) as f64 * 0.5)).collect();
let look = vectorcraft_doc::Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 1.0);
s.edit("t", |d, _| {
let id = d.alloc_id();
let top = d.children(d.default_layer()).map_or(0, |c| c.len());
d.insert(d.default_layer(), top, Node::path(id, PathData::single(vectorcraft_geom::SubPath::polyline(&pts, false)), look))?;
Ok(id)
})
.unwrap();
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [400, 0.5]})).unwrap();
assert!((area(&s, id_of(&r)) - 16_000.0).abs() < 1.0, "{}", area(&s, id_of(&r)));
}
/// A path with too many segments that crosses the area cannot be left out, and the paths together
/// are past the segment limit: the square it cuts is not filled across it, whether four lines or one
/// filled rectangle bound the square.
#[test]
fn fill_area_does_not_fill_across_a_huge_path_it_left_out() {
for closed in [false, true] {
let mut s = session();
if closed {
rect(&mut s, 0.0, 0.0, 400.0, 400.0);
} else {
line(&mut s, (-20.0, 0.0), (420.0, 0.0));
line(&mut s, (-20.0, 400.0), (420.0, 400.0));
line(&mut s, (0.0, -20.0), (0.0, 420.0));
line(&mut s, (400.0, -20.0), (400.0, 420.0));
}
let n = vectorcraft_pathops::SHAPE_BUILDER_MAX_SEGMENTS;
let pts: Vec<Point> = (0..=n).map(|k| Point::new(-20.0 + 440.0 * k as f64 / n as f64, 300.0)).collect();
let look = vectorcraft_doc::Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 1.0);
s.edit("t", |d, _| {
let id = d.alloc_id();
let top = d.children(d.default_layer()).map_or(0, |c| c.len());
d.insert(d.default_layer(), top, Node::path(id, PathData::single(vectorcraft_geom::SubPath::polyline(&pts, false)), look))?;
Ok(id)
})
.unwrap();
deselect(&mut s);
let (undo, kids) = (undo_len(&s), stack(&s));
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [200, 100]})).is_err(), "closed: {closed}");
assert_eq!((undo_len(&s), stack(&s)), (undo, kids));
}
}
/// A path with too many segments whose box holds the square, but no segment of it comes near: its
/// subpaths lie far apart on either side of the square, or one curve arcs around the square and its
/// box holds the square. It is left out and the square is filled.
#[test]
fn fill_area_fills_an_area_that_a_left_out_paths_box_holds_but_its_segments_miss() {
// A cubic from (-1000, 1500) up over the square to (1400, 1500); at its top it is at y -750.
let mut arc = vectorcraft_geom::SubPath::polyline(&[Point::new(-1000.0, 1500.0), Point::new(1400.0, 1500.0)], false);
arc.anchors[0].h_out = Point::new(-1000.0, -1500.0);
arc.anchors[1].h_in = Point::new(1400.0, -1500.0);
let far = vectorcraft_geom::SubPath::polyline(&[Point::new(2000.0, 1500.0), Point::new(2100.0, 1500.0)], false);
for second in [far, arc] {
let mut s = session();
line(&mut s, (-20.0, 0.0), (420.0, 0.0));
line(&mut s, (-20.0, 400.0), (420.0, 400.0));
line(&mut s, (0.0, -20.0), (0.0, 420.0));
line(&mut s, (400.0, -20.0), (400.0, 420.0));
let n = vectorcraft_pathops::SHAPE_BUILDER_MAX_SEGMENTS;
let pts: Vec<Point> = (0..=n).map(|k| Point::new(-2000.0 + 400.0 * k as f64 / n as f64, -1000.0 + (k % 2) as f64)).collect();
let path = PathData::new(vec![vectorcraft_geom::SubPath::polyline(&pts, false), second.clone()]);
let look = vectorcraft_doc::Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 1.0);
s.edit("t", |d, _| {
let id = d.alloc_id();
let top = d.children(d.default_layer()).map_or(0, |c| c.len());
d.insert(d.default_layer(), top, Node::path(id, path, look))?;
Ok(id)
})
.unwrap();
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [200, 200]})).unwrap();
assert!((area(&s, id_of(&r)) - 160_000.0).abs() < 1.0, "{second:?}: {}", area(&s, id_of(&r)));
}
}
/// Puts `path` with `look` in front on the current layer.
fn insert_path(s: &mut Session, path: PathData, look: vectorcraft_doc::Appearance) -> NodeId {
s.edit("t", |d, _| {
let id = d.alloc_id();
let top = d.children(d.default_layer()).map_or(0, |c| c.len());
d.insert(d.default_layer(), top, Node::path(id, path, look))?;
Ok(id)
})
.unwrap()
}
/// A path with too many segments in the empty corner of a filled L, well clear of both arms, is
/// left out and does not stop the L from being filled, though the L's box holds it.
#[test]
fn fill_area_fills_an_l_whose_empty_corner_holds_a_left_out_path() {
let mut s = session();
let l = [(0.0, 0.0), (400.0, 0.0), (400.0, 100.0), (100.0, 100.0), (100.0, 400.0), (0.0, 400.0)].map(|(x, y)| Point::new(x, y));
let solid = vectorcraft_doc::Appearance::basic(Paint::solid(Color::BLACK), Paint::None, 0.0);
insert_path(&mut s, PathData::single(vectorcraft_geom::SubPath::polyline(&l, true)), solid);
let n = vectorcraft_pathops::SHAPE_BUILDER_MAX_SEGMENTS;
let pts: Vec<Point> = (0..=n).map(|k| Point::new(250.0 + 100.0 * k as f64 / n as f64, 250.0 + (k % 2) as f64)).collect();
let look = vectorcraft_doc::Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 1.0);
insert_path(&mut s, PathData::single(vectorcraft_geom::SubPath::polyline(&pts, false)), look);
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 50]})).unwrap();
assert!((area(&s, id_of(&r)) - 70_000.0).abs() < 1.0, "{}", area(&s, id_of(&r)));
}
/// A filled contour with too many segments on a higher layer surrounds a small square, its outline
/// far from it: it is left out of the map, and the new path still goes above it, since it covers
/// the area.
#[test]
fn fill_area_stacks_above_a_left_out_path_that_covers_the_area() {
let mut s = session();
let layer = s.doc().unwrap().doc.default_layer();
rect(&mut s, 0.0, 0.0, 100.0, 100.0);
let over = id_of(&s.execute("layer.new", &json!({"name": "Over"})).unwrap());
let n = vectorcraft_pathops::SHAPE_BUILDER_MAX_SEGMENTS + 1;
let pts: Vec<Point> = (0..n)
.map(|k| {
let a = k as f64 * std::f64::consts::TAU / n as f64;
Point::new(50.0 + 3000.0 * a.cos(), 50.0 + 3000.0 * a.sin())
})
.collect();
let solid = vectorcraft_doc::Appearance::basic(Paint::solid(Color::BLACK), Paint::None, 0.0);
let contour = insert_path(&mut s, PathData::single(vectorcraft_geom::SubPath::polyline(&pts, true)), solid);
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 50]})).unwrap();
assert!((area(&s, id_of(&r)) - 10_000.0).abs() < 1.0, "{}", area(&s, id_of(&r)));
assert_eq!(r["above"], json!(contour.0));
let d = &s.doc().unwrap().doc;
assert_eq!(d.parent_of(id_of(&r)), Some(over));
assert_ne!(d.parent_of(id_of(&r)), layer);
}
/// With Gap Detection off, a long line on a higher layer 0.75 pt from a square's edge neither
/// touches nor covers the square, so the new path stays above the square.
#[test]
fn fill_area_does_not_stack_above_a_line_that_does_not_touch_the_area() {
let mut s = session();
let layer = s.doc().unwrap().doc.default_layer();
let square = rect(&mut s, 0.0, 0.0, 100.0, 100.0);
id_of(&s.execute("layer.new", &json!({"name": "Other"})).unwrap());
line(&mut s, (-5000.0, -0.75), (5000.0, -0.75));
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 50]})).unwrap();
assert_eq!(r["above"], json!(square.0));
assert_eq!(s.doc().unwrap().doc.parent_of(id_of(&r)), layer);
}
/// With Gap Detection on, a square on a higher layer within the gap of the area's corners does not
/// bound the area, so the new path stays above the square that does.
#[test]
fn fill_area_gap_does_not_stack_above_a_nearby_path() {
let mut s = session();
let first = rect(&mut s, 0.0, 0.0, 100.0, 100.0);
let layer = s.doc().unwrap().doc.default_layer();
let other = id_of(&s.execute("layer.new", &json!({"name": "Other"})).unwrap());
rect(&mut s, 102.0, 0.0, 100.0, 100.0);
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 50], "gap": 3})).unwrap();
let d = &s.doc().unwrap().doc;
assert_eq!(d.parent_of(id_of(&r)), layer);
assert_ne!(d.parent_of(id_of(&r)), Some(other));
assert_eq!(r["above"], json!(first.0));
}
/// An object listed in `ids` with the layer that holds it counts once, so the new path still goes
/// above the front-most of two overlapping squares.
#[test]
fn fill_area_ids_count_an_object_and_its_layer_once() {
let mut s = session();
let back = rect(&mut s, 0.0, 0.0, 100.0, 100.0);
let front = rect(&mut s, 50.0, 0.0, 100.0, 100.0);
deselect(&mut s);
let layer = s.doc().unwrap().doc.default_layer().unwrap();
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [75, 50], "ids": [layer.0, back.0]})).unwrap();
assert_eq!(stack(&s), vec![back, front, id_of(&r)]);
}
/// A flat window that reaches a path with too many segments leaves that path out and grows to the
/// paths it had not picked: a crossbar that no path near the point leads to still splits the area.
#[test]
fn fill_area_keeps_paths_a_capped_window_had_not_picked() {
let mut s = session();
// Four lines bound a box; a line through the point and a crossbar higher up cut it.
line(&mut s, (50.0, -60.0), (50.0, 410.0));
line(&mut s, (350.0, -60.0), (350.0, 410.0));
line(&mut s, (40.0, -50.0), (360.0, -50.0));
line(&mut s, (40.0, 400.0), (360.0, 400.0));
line(&mut s, (0.0, 100.0), (400.0, 100.0));
line(&mut s, (40.0, 30.0), (360.0, 30.0));
let n = vectorcraft_pathops::SHAPE_BUILDER_MAX_SEGMENTS;
let pts: Vec<Point> = (0..=n).map(|k| Point::new(380.0 + 20.0 * k as f64 / n as f64, 100.0 + (k % 2) as f64 * 0.5)).collect();
let look = vectorcraft_doc::Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 1.0);
s.edit("t", |d, _| {
let id = d.alloc_id();
let top = d.children(d.default_layer()).map_or(0, |c| c.len());
d.insert(d.default_layer(), top, Node::path(id, PathData::single(vectorcraft_geom::SubPath::polyline(&pts, false)), look))?;
Ok(id)
})
.unwrap();
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [200, 99.5]})).unwrap();
assert!((area(&s, id_of(&r)) - 21_000.0).abs() < 1.0, "between the crossbar and the line: {}", area(&s, id_of(&r)));
}
/// Two diagonals and a crossbar about 3 pt short of each: the area closes only with a gap of 3 pt
/// or more, and a gap out of 0 to 72 pt is an error.
#[test]
fn fill_area_gap_closes_small_gaps() {
let mut s = session();
line(&mut s, (0.0, 0.0), (100.0, 100.0));
line(&mut s, (100.0, 0.0), (0.0, 100.0));
line(&mut s, (24.0, 80.0), (76.0, 80.0));
deselect(&mut s);
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).is_err());
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70], "gap": 2})).is_err());
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70], "gap": 3})).unwrap();
let a = area(&s, id_of(&r));
assert!(a > 850.0 && a < 900.0, "the triangle and its two bridges: {a}");
for gap in [json!(-1), json!(73), json!("3")] {
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70], "gap": gap})).is_err(), "{gap}");
}
}
/// Locked and hidden paths do not bound an area: the triangle fills while its crossbar is unlocked
/// and visible, and not once the crossbar is locked or hidden.
#[test]
fn fill_area_skips_locked_and_hidden_paths() {
for how in ["object.lock", "object.hide"] {
let mut s = session();
let lines = triangle(&mut s);
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).unwrap();
assert!((area(&s, id_of(&r)) - 900.0).abs() < 1e-6, "{how}");
s.execute("edit.undo", &json!({})).unwrap();
s.execute(how, &json!({"ids": [lines[2].0]})).unwrap();
deselect(&mut s);
let (undo, kids) = (undo_len(&s), stack(&s));
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).is_err(), "{how}");
assert_eq!((undo_len(&s), stack(&s)), (undo, kids), "{how}");
}
}
/// A point in no enclosed area changes nothing and records no undo step; bad params are errors. A
/// point inside the triangle fills it.
#[test]
fn fill_area_outside_every_area_changes_nothing() {
let mut s = session();
triangle(&mut s);
deselect(&mut s);
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).is_ok());
s.execute("edit.undo", &json!({})).unwrap();
let (undo, kids) = (undo_len(&s), stack(&s));
for p in [json!({"point": [500, 500]}), json!({"point": [50, 90]}), json!({"point": [-500, -500]})] {
assert!(s.execute("shapeBuilder.copyRegion", &p).is_err(), "{p}");
}
for p in [json!({}), json!({"point": [50]}), json!({"point": [50, 70], "fill": "nope"}), json!({"point": [50, 70], "stroke": 3})] {
assert!(s.execute("shapeBuilder.copyRegion", &p).is_err(), "{p}");
}
for paint in [json!({"swatch": 123}), json!({"color": 5}), json!({"color": "nope"})] {
for key in ["fill", "stroke"] {
let p = json!({"point": [50, 70], key: paint});
assert!(s.execute("shapeBuilder.copyRegion", &p).is_err(), "{p}");
}
}
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70], "ids": [999_999]})).is_err());
assert_eq!((undo_len(&s), stack(&s)), (undo, kids));
}
/// The tool outlines the area under the pointer, shows the bucket over it, and a click adds the
/// path; a click outside every area records nothing. It uses the Shape Builder's Gap Detection.
#[test]
fn fill_area_tool_drives_the_command() {
let mut s = session();
line(&mut s, (0.0, 0.0), (100.0, 100.0));
line(&mut s, (100.0, 0.0), (0.0, 100.0));
line(&mut s, (24.0, 80.0), (76.0, 80.0));
deselect(&mut s);
let v = ViewInfo::default();
s.select_tool("fillArea", v).unwrap();
assert_eq!(s.tool_id(), "fillArea");
s.pointer(&PointerEvent::new(PointerKind::Move, 50.0, 70.0), v).unwrap();
assert!(s.overlays(v).is_empty(), "the gap leaves the triangle open");
assert_eq!(s.cursor(Point::new(50.0, 70.0), Mods::default(), v), Cursor::LivePaintBucket);
let (undo, kids) = (undo_len(&s), stack(&s));
s.pointer(&PointerEvent::new(PointerKind::Down, 50.0, 70.0), v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Up, 50.0, 70.0), v).unwrap();
assert_eq!((undo_len(&s), stack(&s)), (undo, kids), "nothing to fill");
// The Shape Builder's options reach the active Fill Area tool.
s.set_tool_option_cmd(&json!({"tool": "shapeBuilder", "values": {"gapDetection": true, "gapLength": 3}})).unwrap();
assert_eq!(s.tool_options_of("fillArea")["gapLength"], json!(3.0));
s.pointer(&PointerEvent::new(PointerKind::Move, 50.0, 70.0), v).unwrap();
let red: Vec<_> = s.overlays(v).into_iter().filter(|o| matches!(o, Overlay::Path { color: [0xff, 0x2a, 0x2a], .. })).collect();
assert_eq!(red.len(), 1, "the area is outlined in red");
assert_eq!(s.cursor(Point::new(50.0, 70.0), Mods::default(), v), Cursor::LivePaintBucketFace);
s.pointer(&PointerEvent::new(PointerKind::Down, 50.0, 70.0), v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Up, 50.0, 70.0), v).unwrap();
assert_eq!(s.journal.last().unwrap().0, "shapeBuilder.copyRegion");
assert_eq!(stack(&s).len(), 4);
assert_eq!(undo_len(&s), undo + 1);
assert_eq!(s.tool_id(), "fillArea");
assert!(s.set_tool_option_cmd(&json!({"tool": "fillArea", "values": {"highlightColor": "#ff0000"}})).is_err());
assert!(s.set_tool_option_cmd(&json!({"tool": "fillArea", "values": {"gapLength": "wide"}})).is_err());
// Setting them on Fill Area sets them for the Shape Builder too.
s.set_tool_option_cmd(&json!({"tool": "fillArea", "values": {"gapLength": 5, "openFilledAsClosed": false}})).unwrap();
let opts = s.tool_options_of("shapeBuilder");
assert_eq!((opts["gapLength"].clone(), opts["openFilledAsClosed"].clone()), (json!(5.0), json!(false)));
}
/// The hover search for a document of more than 128 segments runs on another thread: nothing is
/// outlined until the tool is polled, and a click finds the area at once.
#[test]
fn fill_area_tool_hovers_a_large_document_on_another_thread() {
let mut s = session();
s.execute("shape.polygon", &json!({"cx": 300, "cy": 300, "radius": 100, "sides": 200})).unwrap();
deselect(&mut s);
let v = ViewInfo::default();
s.select_tool("fillArea", v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Move, 300.0, 300.0), v).unwrap();
assert!(s.tool_waiting());
assert!(s.overlays(v).is_empty());
// The pointer moves on inside the area before the search is done: its result still serves.
s.pointer(&PointerEvent::new(PointerKind::Move, 305.0, 300.0), v).unwrap();
s.tool_poll(v, false).unwrap();
s.tool_poll(v, true).unwrap();
assert!(!s.tool_waiting());
assert_eq!(s.overlays(v).len(), 1, "the polygon is outlined");
// Leaving the area takes the outline away at once, while the next search runs.
s.pointer(&PointerEvent::new(PointerKind::Move, 500.0, 500.0), v).unwrap();
assert!(s.overlays(v).is_empty());
s.tool_poll(v, true).unwrap();
assert!(s.overlays(v).is_empty());
s.pointer(&PointerEvent::new(PointerKind::Move, 300.0, 300.0), v).unwrap();
s.tool_poll(v, true).unwrap();
assert_eq!(s.overlays(v).len(), 1);
// A click while a search runs waits for it: the pointer leaves the area, which starts a
// search, and the press inside the area comes before any poll.
s.pointer(&PointerEvent::new(PointerKind::Move, 500.0, 500.0), v).unwrap();
assert!(s.tool_waiting());
let undo = undo_len(&s);
s.pointer(&PointerEvent::new(PointerKind::Down, 310.0, 300.0), v).unwrap();
assert!(!s.tool_waiting(), "the press waited for the search");
s.pointer(&PointerEvent::new(PointerKind::Up, 310.0, 300.0), v).unwrap();
assert_eq!(undo_len(&s), undo + 1);
}
/// A press that is dropped before the release (a long or canceled touch) takes the new path back
/// and records no undo step.
#[test]
fn fill_area_tool_dropped_press_adds_nothing() {
let mut s = session();
triangle(&mut s);
deselect(&mut s);
let v = ViewInfo::default();
s.select_tool("fillArea", v).unwrap();
let (undo, kids) = (undo_len(&s), stack(&s));
s.pointer(&PointerEvent::new(PointerKind::Down, 50.0, 70.0), v).unwrap();
assert_eq!(stack(&s).len(), kids.len() + 1, "the path shows during the press");
s.drop_tool_press(v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Up, 50.0, 70.0), v).unwrap();
assert_eq!((undo_len(&s), stack(&s)), (undo, kids));
}
/// The outline under a still pointer goes when the document changes, and the canvas hovers the
/// tool again then.
#[test]
fn fill_area_tool_drops_a_hover_the_document_no_longer_has() {
let mut s = session();
rect(&mut s, 0.0, 0.0, 100.0, 100.0);
let v = ViewInfo::default();
s.select_tool("fillArea", v).unwrap();
assert!(s.tool_wants_rehover());
s.pointer(&PointerEvent::new(PointerKind::Move, 50.0, 50.0), v).unwrap();
assert_eq!(s.overlays(v).len(), 1);
s.execute("edit.clear", &json!({})).unwrap();
assert!(s.overlays(v).is_empty());
assert_eq!(s.cursor(Point::new(50.0, 50.0), Mods::default(), v), Cursor::LivePaintBucket);
}
/// Moving the pointer from an area with a hole into the area that fills the hole outlines the
/// inner area instead.
#[test]
fn fill_area_tool_hover_moves_from_an_area_into_its_hole() {
let mut s = session();
line(&mut s, (-20.0, 0.0), (420.0, 0.0));
line(&mut s, (-20.0, 400.0), (420.0, 400.0));
line(&mut s, (0.0, -20.0), (0.0, 420.0));
line(&mut s, (400.0, -20.0), (400.0, 420.0));
for (a, b) in [((150.0, 250.0), (250.0, 350.0)), ((250.0, 250.0), (150.0, 350.0)), ((140.0, 330.0), (260.0, 330.0))] {
line(&mut s, a, b);
}
deselect(&mut s);
let v = ViewInfo::default();
s.select_tool("fillArea", v).unwrap();
let outlined = |s: &mut Session| -> Vec<f64> {
s.overlays(v)
.into_iter()
.filter_map(|o| match o {
Overlay::Path { path, .. } => Some(kurbo::Shape::bounding_box(&path).width()),
_ => None,
})
.collect()
};
s.pointer(&PointerEvent::new(PointerKind::Move, 50.0, 50.0), v).unwrap();
let w = outlined(&mut s);
assert!(w.len() == 1 && (w[0] - 400.0).abs() < 1e-6, "the square: {w:?}");
s.pointer(&PointerEvent::new(PointerKind::Move, 200.0, 320.0), v).unwrap();
let w = outlined(&mut s);
assert!(w.len() == 1 && (w[0] - 60.0).abs() < 1e-6, "the triangle in its hole: {w:?}");
}
+34 -1
View File
@@ -84,7 +84,7 @@ fn the_builtin_library_is_original_art_generated_in_code() {
let mut s = Session::new();
let list = run(&mut s, "symbol.libraries", json!({}));
let libs = list["libraries"].as_array().unwrap();
assert_eq!(libs.len(), 7, "{libs:?}");
assert_eq!(libs.len(), 8, "{libs:?}");
assert_eq!((libs[0]["id"].as_str(), libs[0]["category"].as_str()), (Some("basic-shapes"), Some("builtIn")));
assert_eq!(
(libs[1]["id"].as_str(), libs[1]["name"].as_str(), libs[1]["category"].as_str()),
@@ -108,6 +108,10 @@ fn the_builtin_library_is_original_art_generated_in_code() {
);
assert_eq!(
(libs[6]["id"].as_str(), libs[6]["name"].as_str(), libs[6]["category"].as_str()),
(Some("nature-icons"), Some("Nature Icons"), Some("builtIn"))
);
assert_eq!(
(libs[7]["id"].as_str(), libs[7]["name"].as_str(), libs[7]["category"].as_str()),
(Some("media-controls"), Some("Media Controls"), Some("builtIn"))
);
let lib = run(&mut s, "symbol.library", json!({"library": "basic shapes"}));
@@ -249,6 +253,35 @@ fn weather_icons_library_lists_and_places() {
}
}
#[test]
fn nature_icons_library_places_and_survives_save() {
let mut s = session();
let listed = run(&mut s, "symbol.libraries", json!({}));
let entry = listed["libraries"].as_array().unwrap().iter().find(|l| l["id"] == "nature-icons").unwrap();
assert_eq!((entry["name"].as_str(), entry["count"].as_u64()), (Some("Nature Icons"), Some(5)));
let library = run(&mut s, "symbol.library", json!({"library": "nature-icons"}));
let names: Vec<&str> = library["symbols"].as_array().unwrap().iter().map(|x| x["name"].as_str().unwrap()).collect();
assert_eq!(names, ["Leaf", "Flower", "Tree", "Mountain", "Wave"]);
for (i, name) in names.iter().enumerate() {
let symbol = &library["symbols"][i];
let size = symbol["size"].as_array().unwrap();
assert!(size.iter().all(|n| n.as_f64().is_some_and(|n| n.is_finite() && n > 0.0)), "{name}");
let added = run(
&mut s,
"symbol.addFromLibrary",
json!({"library": "nature-icons", "name": name, "place": true, "x": 100.0 + 80.0 * i as f64, "y": 100.0}),
);
assert_eq!(added["added"], json!([name]));
let id = NodeId(added["placed"].as_u64().unwrap());
assert!(matches!(doc(&s).node(id).map(|n| &n.kind), Some(NodeKind::SymbolInstance { symbol, .. }) if symbol == *name));
assert_eq!(doc(&s).symbol_nine_slice(name), None);
}
let saved = run(&mut s, "symbol.saveLibrary", json!({"names": ["Leaf", "Flower", "Tree", "Mountain", "Wave"]}));
let bytes = vectorcraft_format::base64_decode(saved["dataBase64"].as_str().unwrap()).unwrap();
let reopened = vectorcraft_format::load(&bytes).unwrap();
assert_eq!(reopened.symbols.iter().map(|s| s.name.as_str()).collect::<Vec<_>>(), names);
}
#[test]
fn media_controls_library_lists_and_places() {
let mut s = session();
+8 -20
View File
@@ -3,8 +3,6 @@
//! Format Specification, version 7.0, §5.3, §5.4 and §6), and the colors they write in place of
//! the paint they can't hold.
use std::fmt::Write;
use vectorcraft_color::{Color, Gradient};
use vectorcraft_doc::{LAYER_COLORS, LayerColor, LineCap, LineJoin, StrokeLayer};
use vectorcraft_geom::{Affine, Anchor, AnchorKind, PathData, Point, Shape, SubPath};
@@ -184,25 +182,15 @@ pub(crate) fn window_samples(samples: &[u8], w: u32, channels: usize, [x0, y0, x
/// The stroke's width, cap, join, miter limit and dashes: `w J j M d`.
pub(crate) fn line_style(s: &mut String, st: &StrokeLayer) {
let cap = match st.cap {
LineCap::Butt => 0,
LineCap::Round => 1,
LineCap::Square => 2,
LineCap::Butt => ps::LineCap::Butt,
LineCap::Round => ps::LineCap::Round,
LineCap::Square => ps::LineCap::Square,
};
let join = match st.join {
LineJoin::Miter => 0,
LineJoin::Round => 1,
LineJoin::Bevel => 2,
LineJoin::Miter => ps::LineJoin::Miter,
LineJoin::Round => ps::LineJoin::Round,
LineJoin::Bevel => ps::LineJoin::Bevel,
};
ps::push_num(s, st.width);
let _ = write!(s, " w {cap} J {join} j ");
ps::push_num(s, if st.miter_limit.is_finite() { st.miter_limit.max(1.0) } else { 10.0 });
s.push_str(" M [");
let dash = st.dash.as_ref().filter(|d| d.is_dashed());
if let Some(d) = dash {
ps::push_nums(s, &d.pattern);
s.pop();
}
s.push_str("] ");
ps::push_num(s, dash.map_or(0.0, |d| d.offset));
s.push_str(" d\n");
let dash = st.dash.as_ref().filter(|d| d.is_dashed()).map(|d| (d.pattern.as_slice(), d.offset));
ps::push_line_style(s, st.width, cap, join, st.miter_limit, dash);
}
+60 -298
View File
@@ -1,253 +1,17 @@
//! The scanner: PostScript source into objects (numbers, names, strings, procedures), with the
//! position the program's own data (`currentfile`) is read from.
//!
//! Backed by `craft_ps::read::lex`.
use std::rc::Rc;
use craft_ps::read::lex::{LexError, Number, Token};
use super::obj::{Obj, PsError, Res};
use crate::ps;
/// Deepest procedure nesting the scanner reads.
const MAX_NESTING: usize = 256;
pub(crate) use craft_ps::read::lex::{IMMEDIATE, hex_decode};
pub(crate) struct Lexer<'a> {
src: &'a [u8],
pos: usize,
/// The whitespace character that ended the last token is still unread (data the program
/// reads from itself starts after it).
fresh: bool,
/// The last object read has immediately evaluated names (`//name`) in it, read as executable
/// names starting with [`IMMEDIATE`] for the interpreter to replace by their values.
pub immediate: bool,
}
/// How an immediately evaluated name (`//name`) is read, until the interpreter replaces it.
pub(crate) const IMMEDIATE: &str = "//";
fn is_space(b: u8) -> bool {
matches!(b, b' ' | b'\t' | b'\r' | b'\n' | b'\x0c' | b'\0')
}
fn is_delim(b: u8) -> bool {
matches!(b, b'(' | b')' | b'<' | b'>' | b'[' | b']' | b'{' | b'}' | b'/' | b'%')
}
fn syntax<T>(what: &str) -> Res<T> {
Err(PsError::Ps("syntaxerror", what.to_string()))
}
impl<'a> Lexer<'a> {
pub fn new(src: &'a [u8]) -> Self {
Self { src, pos: 0, fresh: false, immediate: false }
}
/// What is left to read.
pub fn rest(&self) -> &'a [u8] {
self.src.get(self.pos..).unwrap_or_default()
}
/// What is left to read as data: after the whitespace that ended the last token (a CR LF
/// pair counts as one).
pub fn data(&mut self) -> &'a [u8] {
if std::mem::take(&mut self.fresh) {
match self.peek() {
Some(b'\r') => {
self.pos += 1;
if self.peek() == Some(b'\n') {
self.pos += 1;
}
}
Some(b) if is_space(b) => self.pos += 1,
_ => {}
}
}
self.rest()
}
/// Skip `n` bytes (the data a filter or `readstring` took).
pub fn advance(&mut self, n: usize) {
self.fresh = false;
self.pos = self.pos.saturating_add(n).min(self.src.len());
}
fn peek(&self) -> Option<u8> {
self.src.get(self.pos).copied()
}
fn skip_space(&mut self) {
while let Some(b) = self.peek() {
if is_space(b) {
self.pos += 1;
} else if b == b'%' {
while let Some(c) = self.peek() {
if c == b'\n' || c == b'\r' {
break;
}
self.pos += 1;
}
} else {
break;
}
}
}
/// The next object at the top level (`None` at the end of the file).
pub fn next(&mut self) -> Res<Option<Obj>> {
self.immediate = false;
let t = self.token(0);
self.fresh = true;
t
}
fn token(&mut self, depth: usize) -> Res<Option<Obj>> {
self.skip_space();
let Some(b) = self.peek() else { return Ok(None) };
self.pos += 1;
Ok(Some(match b {
b'(' => Obj::string(self.string()?),
b'<' => match self.peek() {
Some(b'<') => {
self.pos += 1;
Obj::Exec(Rc::from("<<"))
}
Some(b'~') => {
self.pos += 1;
Obj::string(self.ascii85()?)
}
_ => Obj::string(self.hex()?),
},
b'>' => {
if self.peek() != Some(b'>') {
return syntax(">");
}
self.pos += 1;
Obj::Exec(Rc::from(">>"))
}
b'[' => Obj::Exec(Rc::from("[")),
b']' => Obj::Exec(Rc::from("]")),
b'{' => {
if depth >= MAX_NESTING {
return Err(PsError::Limit("procedures nested too deeply"));
}
let mut items = vec![];
loop {
self.skip_space();
match self.peek() {
None => return syntax("{"),
Some(b'}') => {
self.pos += 1;
break;
}
_ => match self.token(depth + 1)? {
Some(o) => items.push(o),
None => return syntax("{"),
},
}
}
Obj::proc(items)
}
b'}' | b')' => return syntax(&char::from(b).to_string()),
b'/' => {
// `//name` stands for the name's value when it is read.
let immediate = self.peek() == Some(b'/');
if immediate {
self.pos += 1;
self.immediate = true;
}
let name = self.word();
if immediate { Obj::Exec(Rc::from(format!("{IMMEDIATE}{name}").as_str())) } else { Obj::Name(Rc::from(name.as_str())) }
}
_ => {
self.pos -= 1;
let w = self.word();
number(&w).unwrap_or_else(|| Obj::Exec(Rc::from(w.as_str())))
}
}))
}
/// A regular token's characters.
fn word(&mut self) -> String {
let start = self.pos;
while let Some(b) = self.peek() {
if is_space(b) || is_delim(b) {
break;
}
self.pos += 1;
}
String::from_utf8_lossy(self.src.get(start..self.pos).unwrap_or_default()).into_owned()
}
/// A literal string after its `(`.
fn string(&mut self) -> Res<Vec<u8>> {
let mut out = vec![];
let mut depth = 0usize;
loop {
let Some(b) = self.peek() else { return syntax("(") };
self.pos += 1;
match b {
b'(' => {
depth += 1;
out.push(b);
}
b')' if depth == 0 => return Ok(out),
b')' => {
depth -= 1;
out.push(b);
}
b'\\' => {
let Some(e) = self.peek() else { return syntax("(") };
self.pos += 1;
match e {
b'n' => out.push(b'\n'),
b'r' => out.push(b'\r'),
b't' => out.push(b'\t'),
b'b' => out.push(8),
b'f' => out.push(12),
b'\r' => {
if self.peek() == Some(b'\n') {
self.pos += 1;
}
}
b'\n' => {}
b'0'..=b'7' => {
let mut v = u32::from(e - b'0');
for _ in 0..2 {
match self.peek() {
Some(d @ b'0'..=b'7') => {
v = v * 8 + u32::from(d - b'0');
self.pos += 1;
}
_ => break,
}
}
out.push((v & 0xff) as u8);
}
other => out.push(other),
}
}
_ => out.push(b),
}
}
}
/// A hexadecimal string after its `<`.
fn hex(&mut self) -> Res<Vec<u8>> {
let end = self.rest().iter().position(|b| *b == b'>').ok_or(PsError::Ps("syntaxerror", "<".into()))?;
let body = self.rest().get(..end).unwrap_or_default();
let out = hex_decode(body).ok_or(PsError::Ps("syntaxerror", "<".into()))?;
self.advance(end + 1);
Ok(out)
}
/// An ASCII85 string after its `<~`.
fn ascii85(&mut self) -> Res<Vec<u8>> {
let end = find(self.rest(), b"~>").ok_or(PsError::Ps("syntaxerror", "<~".into()))?;
let text = String::from_utf8_lossy(self.rest().get(..end + 2).unwrap_or_default()).into_owned();
self.advance(end + 2);
ps::ascii85_decode(&text).ok_or(PsError::Ps("syntaxerror", "<~".into()))
}
}
/// Where `needle` first starts in `hay`.
/// Where `needle` first starts in `hay` (uses `memmem` so large inputs stay linear-time).
pub(crate) fn find(hay: &[u8], needle: &[u8]) -> Option<usize> {
if needle.is_empty() {
return Some(0);
@@ -255,39 +19,66 @@ pub(crate) fn find(hay: &[u8], needle: &[u8]) -> Option<usize> {
memchr::memmem::find(hay, needle)
}
/// Hexadecimal digits (whitespace ignored, an odd last digit padded with 0); `None` on others.
pub(crate) fn hex_decode(body: &[u8]) -> Option<Vec<u8>> {
// Callers pass an already-delimited body. Do not let the filter decoder's EOD
// handling silently accept a stray terminator or discard bytes after it.
if body.contains(&b'>') {
return None;
pub(crate) struct Lexer<'a> {
inner: craft_ps::read::lex::Lexer<'a>,
/// The last object read has immediately evaluated names (`//name`) in it, read as executable
/// names starting with [`IMMEDIATE`] for the interpreter to replace by their values.
pub immediate: bool,
}
impl<'a> Lexer<'a> {
pub fn new(src: &'a [u8]) -> Self {
Self { inner: craft_ps::read::lex::Lexer::new(src), immediate: false }
}
/// What is left to read.
pub fn rest(&self) -> &'a [u8] {
self.inner.rest()
}
/// What is left to read as data: after the whitespace that ended the last token (a CR LF
/// pair counts as one).
pub fn data(&mut self) -> &'a [u8] {
self.inner.data()
}
/// Skip `n` bytes (the data a filter or `readstring` took).
pub fn advance(&mut self, n: usize) {
self.inner.advance(n);
}
/// The next object at the top level (`None` at the end of the file).
pub fn next(&mut self) -> Res<Option<Obj>> {
let res = self.inner.next().map(|opt| opt.map(into_obj)).map_err(into_err);
self.immediate = self.inner.immediate;
res
}
}
fn into_err(err: LexError) -> PsError {
match err {
LexError::Syntax(what) => PsError::Ps("syntaxerror", what),
LexError::Limit(msg) => PsError::Limit(msg),
}
}
fn into_obj(tok: Token) -> Obj {
match tok {
Token::Int(i) => Obj::Int(i),
Token::Real(r) => Obj::Real(r),
Token::Name(n) => Obj::Name(Rc::from(n.as_str())),
Token::Exec(n) => Obj::Exec(Rc::from(n.as_str())),
Token::Str(s) => Obj::string(s),
Token::Proc(items) => Obj::proc(items.into_iter().map(into_obj).collect()),
}
craft_stream_codecs::asciihex::decode(body, body.len().div_ceil(2)).ok()
}
/// A number token (`12`, `-3.5`, `.5`, `1e-3`, `16#ff`), or `None`.
pub(crate) fn number(w: &str) -> Option<Obj> {
let first = w.bytes().next()?;
if !(first.is_ascii_digit() || matches!(first, b'+' | b'-' | b'.')) {
return None;
match craft_ps::read::lex::number(w)? {
Number::Int(i) => Some(Obj::Int(i)),
Number::Real(r) => Some(Obj::Real(r)),
}
if let Ok(i) = w.parse::<i64>() {
return Some(Obj::Int(i));
}
if let Some((base, digits)) = w.split_once('#') {
let base: u32 = base.parse().ok().filter(|b| (2..=36).contains(b))?;
// `from_str_radix` accepts a leading sign; a PostScript radix number has digits only.
if digits.starts_with(['+', '-']) {
return None;
}
return i64::from_str_radix(digits, base).ok().map(Obj::Int);
}
// Rust reads `inf` and `nan`; PostScript doesn't.
if w.bytes().any(|b| b.is_ascii_alphabetic() && !matches!(b, b'e' | b'E')) {
return None;
}
let v: f64 = w.parse().ok()?;
v.is_finite().then_some(Obj::Real(v))
}
#[cfg(test)]
@@ -300,33 +91,4 @@ mod tests {
assert!(number("16#-ff").is_none());
assert!(matches!(number("16#ff"), Some(Obj::Int(255))));
}
#[test]
fn shared_hex_decode_keeps_body_boundaries_and_odd_nibbles() {
assert_eq!(hex_decode(b" 4\t1\n4\r2\x0c4\0"), Some(vec![0x41, 0x42, 0x40]));
assert_eq!(hex_decode(b""), Some(vec![]));
for invalid in [b"41>42".as_slice(), b">", b"4g", b"4\x0b1", b"\xff"] {
assert_eq!(hex_decode(invalid), None);
}
// Every byte pairs with each possible nibble, including all whitespace
// and invalid-byte combinations; this is the former body-only contract.
for first in 0..=255u8 {
for second in 0..=255u8 {
let input = [first, second];
let mut digits = Vec::new();
let mut valid = true;
for b in input {
if is_space(b) {
continue;
}
match char::from(b).to_digit(16) {
Some(d) => digits.push(d as u8),
None => valid = false,
}
}
let expected =
if !valid { None } else { Some(digits.chunks(2).map(|pair| (pair[0] << 4) | pair.get(1).copied().unwrap_or(0)).collect()) };
assert_eq!(hex_decode(&input), expected, "{input:?}");
}
}
}
}
+31 -36
View File
@@ -5,9 +5,6 @@
use vectorcraft_doc::{Document, ImageBlob, ImageObject, Node, NodeKind};
use vectorcraft_geom::{Affine, Rect};
/// Largest EPSI bitmap side read (pixels).
const MAX_EPSI: usize = 8192;
/// A preview's document and how the user is told about it.
pub(super) struct Preview {
pub document: Document,
@@ -89,41 +86,39 @@ fn metafile_doc(wmf: &[u8], frame: Rect) -> Option<Document> {
/// The EPSI preview in `ps`'s comments (`%%BeginPreview: width height depth lines`, hex rows,
/// 0 white and the largest value black).
/// The shared decoder intentionally tolerates blank preview lines and CR-only line endings;
/// unlike the former local parser, neither changes the decoded samples.
fn epsi(ps: &[u8]) -> Option<image::RgbaImage> {
let text = String::from_utf8_lossy(ps);
let mut lines = text.lines();
let head = lines.find_map(|l| l.strip_prefix("%%BeginPreview:"))?;
let n: Vec<usize> = head.split_whitespace().map_while(|w| w.parse().ok()).collect();
let [w, h, depth, ..] = n[..] else { return None };
if !(1..=MAX_EPSI).contains(&w) || !(1..=MAX_EPSI).contains(&h) || ![1, 2, 4, 8].contains(&depth) {
return None;
let bitmap = craft_eps::epsi(ps)?;
let rgba = bitmap.gray.into_iter().flat_map(|g| [g, g, g, 255]).collect();
image::RgbaImage::from_raw(bitmap.width, bitmap.height, rgba)
}
#[cfg(test)]
mod tests {
use super::epsi;
#[test]
fn shared_epsi_depths_keep_row_padding_and_opaque_grayscale() {
for (depth, row, gray) in [(1, "40", [255, 0, 255]), (2, "18", [255, 170, 85]), (4, "05a0", [255, 170, 85]), (8, "0055aa", [255, 170, 85])] {
let source = format!("%%BeginPreview: 3 2 {depth} 2\n% {row}\n% {row}\n%%EndPreview\n");
let image = epsi(source.as_bytes()).expect("ordinary EPSI preview");
assert_eq!(image.dimensions(), (3, 2));
let expected: Vec<u8> = gray.into_iter().cycle().take(6).flat_map(|g| [g, g, g, 255]).collect();
assert_eq!(image.as_raw(), &expected, "depth {depth}");
}
}
let row = (w * depth).div_ceil(8);
let mut hex = Vec::with_capacity((row * h * 2).min(ps.len()));
for l in lines {
if l.starts_with("%%EndPreview") || hex.len() >= row * h * 2 {
break;
#[test]
fn shared_epsi_intentionally_accepts_blank_and_cr_only_lines() {
let ordinary = "%%BeginPreview: 3 2 2 2\n% 18\n% e4\n%%EndPreview\n";
let expected = epsi(ordinary.as_bytes()).expect("ordinary preview");
for source in [ordinary.replace('\n', "\r"), ordinary.replace("% e4", "\n% e4")] {
let image = epsi(source.as_bytes()).expect("documented shared decoder tolerance");
assert_eq!(image, expected);
}
hex.extend(l.strip_prefix('%')?.bytes().filter(u8::is_ascii_hexdigit));
}
hex.truncate(row * h * 2);
// A trailing half byte would decode padded with zero: the preview is cut short, so none.
if hex.len() % 2 != 0 {
return None;
}
let bytes = super::lex::hex_decode(&hex)?;
// A preview with its samples missing is none, not a blank image of the size it claims.
if bytes.len() < row * h {
return None;
}
let max = (1u32 << depth) - 1;
let mut img = image::RgbaImage::new(w as u32, h as u32);
for (x, y, px) in img.enumerate_pixels_mut() {
let bit = y as usize * row * 8 + x as usize * depth;
let byte = u32::from(bytes.get(bit / 8).copied().unwrap_or(0));
let v = (byte >> (8 - depth - bit % 8)) & max;
let grey = (255 - v * 255 / max) as u8;
*px = image::Rgba([grey, grey, grey, 255]);
let gray = [255, 170, 85, 0, 85, 170];
let rgba: Vec<u8> = gray.into_iter().flat_map(|g| [g, g, g, 255]).collect();
assert_eq!(expected.as_raw(), &rgba);
}
Some(img)
}
+30 -1
View File
@@ -3,7 +3,10 @@
use vectorcraft_geom::{BezPath, FillRule};
pub(crate) use craft_ps::write::{bytes, deflate, inflate, matrix, num, push_num, push_num_places, push_nums, string, written};
pub(crate) use craft_ps::write::{
LineCap, LineJoin, ShadingKind, bytes, deflate, inflate, matrix, num, push_image_array_ref, push_inline_image, push_line_style, push_num,
push_num_places, push_nums, push_reusable_image_ref, push_reusable_image_resource, push_shading, string, written,
};
/// The procedures the page uses, in `VCdict`.
pub(crate) const PROLOG: &str = "/VCdict 64 dict def
@@ -121,4 +124,30 @@ mod tests {
assert_eq!(places(2.5, 7), "2.5");
assert_eq!(places(f64::NAN, 7), "0");
}
#[test]
fn shared_scene_syntax_preserves_vc_names_and_shading() {
let mut line = String::new();
super::push_line_style(&mut line, 3.0, super::LineCap::Square, super::LineJoin::Round, 4.0, Some((&[5.0, 1.5], 0.5)));
assert_eq!(line, "3 w 2 J 1 j 4 M [5 1.5] 0.5 d\n");
let mut shading = String::new();
super::push_shading(
&mut shading,
super::ShadingKind::Axial,
"/DeviceCMYK",
&[0.0, 0.0, 100.0, 0.0],
4,
&[(0.0, vec![0.0, 1.0, 1.0, 0.0]), (1.0, vec![1.0, 0.0, 1.0, 0.0])],
);
assert!(shading.contains("/ShadingType 2 /ColorSpace /DeviceCMYK"));
assert!(shading.ends_with(">> shfill\n"));
let mut inline = String::new();
super::push_inline_image(&mut inline, "VCsrc", "", "<< /ImageType 1", "/FlateDecode", "image", "~>\n");
assert_eq!(
inline,
"{ /VCsrc currentfile /ASCII85Decode filter def\n<< /ImageType 1\n/DataSource VCsrc /FlateDecode filter >> image\nVCsrc flushfile } exec\n~>\n"
);
}
}
+12 -63
View File
@@ -50,8 +50,6 @@ const SPREAD_CAPPED: &str =
"gradients that repeat or reflect are written with at most 256 runs of their stops (at most 16384 stops); they pad past those";
/// Wedges a conic gradient is written as: one a degree.
const CONIC_WEDGE_COUNT: usize = 360;
/// Decimals of a smooth shading's stitching function bounds (stop offsets, 0 to 1).
const BOUNDS_PLACES: u32 = 7;
/// The most colorants a DeviceN color space may have (PostScript's limit).
const MAX_DEVICE_N: usize = 32;
const MISSING_PATTERN: &str = "missing patterns are written as mid-grey";
@@ -63,8 +61,6 @@ const MAX_BODY: usize = 256 << 20;
/// Most compressed bytes in one string of an image's samples at Level 2 (under PostScript's
/// 65,535-byte string limit).
const IMAGE_CHUNK: usize = 48 << 10;
/// The start of the procedure that reads an image's data from the lines after it.
const INLINE_SOURCE: &str = "{ /VCsrc currentfile /ASCII85Decode filter def\n";
/// An image as written: what sets up its color, its image dictionary and its compressed samples.
/// Placed once, it is written where it is drawn, its data following the operators that read it.
@@ -108,33 +104,20 @@ impl ImageCode {
/// The operators and data that draw the image where it is placed.
fn push_inline(&self, s: &mut String) {
s.push_str(&self.prelude);
s.push_str(INLINE_SOURCE);
s.push_str(&self.dict);
s.push_str(&self.inline_read());
s.push_str(&self.ascii);
}
/// The end of the procedure [`ImageCode::push_inline`] writes. The procedure is read whole
/// before it runs: the image data follows it, and flushing the ASCII85 filter afterwards reads
/// past its end marker.
fn inline_read(&self) -> String {
format!("\n/DataSource VCsrc {} filter >> {}\nVCsrc flushfile }} exec\n", self.filter, self.op)
ps::push_inline_image(s, "VCsrc", &self.prelude, &self.dict, self.filter, self.op, &self.ascii);
}
/// The operators that draw the image `VCim<i>` holds, for an image placed more than once.
fn reference(&self, i: usize, level: Level) -> String {
let mut s = String::new();
let name = format!("VCim{i}");
match level {
// The stream is read again from its start.
Level::Three => {
format!("{}VCim{i} resetfile\n{}\n/DataSource VCim{i} {} filter >> {}\n", self.prelude, self.dict, self.filter, self.op)
}
Level::Three => ps::push_reusable_image_ref(&mut s, &name, &self.prelude, &self.dict, self.filter, self.op),
// A procedure gives the strings in turn, then an empty string: the end of the data.
Level::Two => format!(
"{}/VCi 0 def\n{}\n/DataSource {{VCi VCim{i} length lt {{VCim{i} VCi get /VCi VCi 1 add def}} {{()}} ifelse}} {} filter >> {}\n",
self.prelude, self.dict, self.filter, self.op
),
Level::Two => ps::push_image_array_ref(&mut s, "VCi", &name, &self.prelude, &self.dict, self.filter, self.op),
}
s
}
/// The setup's definition of `VCim<i>`: the image's compressed samples, once.
@@ -145,11 +128,7 @@ impl ImageCode {
// The stream reads all of its data when it is made, so the data follows the
// procedure that makes it.
let intent = if self.op == "imagemask" { 1 } else { 0 };
let _ = writeln!(
s,
"{{ /VCsrc currentfile /ASCII85Decode filter def\n/VCim{i} VCsrc << /Intent {intent} /AsyncRead false /CloseSource false >> /ReusableStreamDecode filter def\nVCsrc flushfile }} exec"
);
s.push_str(&self.ascii);
ps::push_reusable_image_resource(&mut s, "VCsrc", &format!("VCim{i}"), intent, &self.ascii);
}
Level::Two => {
let _ = writeln!(s, "/VCim{i} [");
@@ -1489,44 +1468,12 @@ impl<'a> Scene<'a> {
/// A Level 3 smooth shading of `kind` (2 axial, 3 radial) at `coords`, extended both ways.
fn shading(&mut self, kind: u8, space: &GradientSpace, coords: &[f64], stops: &[(f64, Vec<f32>)]) {
let n = space.n();
let comps = |c: &[f32]| -> String {
let mut s = String::from("[");
push_nums(&mut s, &c.iter().take(n).map(|v| f64::from(*v)).collect::<Vec<_>>());
s.pop();
s.push(']');
s
};
let segments: Vec<_> = stops.windows(2).filter(|w| w[1].0 > w[0].0).collect();
let interp = |w: &&[(f64, Vec<f32>)]| format!("<< /FunctionType 2 /Domain [0 1] /C0 {} /C1 {} /N 1 >>", comps(&w[0].1), comps(&w[1].1));
let function = match segments.as_slice() {
[one] => interp(one),
many => {
let mut f = String::from("<< /FunctionType 3 /Domain [0 1] /Functions [\n");
for w in many {
f.push_str(&interp(w));
f.push('\n');
}
f.push_str("] /Bounds [");
// Seven decimals: a gradient's stops repeated hundreds or thousands of times
// (`Gradient::padded_over`) keep their places in each run.
for w in many.iter().skip(1) {
ps::push_num_places(&mut f, w[0].0, BOUNDS_PLACES);
f.push(' ');
}
f.push_str("] /Encode [");
f.push_str(&"0 1 ".repeat(many.len()));
f.push_str("] >>");
f
}
};
let kind = if kind == 3 { ps::ShadingKind::Radial } else { ps::ShadingKind::Axial };
let name = match space {
GradientSpace::Process(s) => s.name(),
GradientSpace::Inks(name, _) => name,
};
let _ = write!(self.body, "<< /ShadingType {kind} /ColorSpace {name} /Coords [");
push_nums(&mut self.body, coords);
let _ = writeln!(self.body, "] /Extend [true true]\n/Function {function} >> shfill");
ps::push_shading(&mut self.body, kind, name, coords, space.n(), stops);
}
/// The bands of each stretch between stops: how many, for colours `a` to `b` over `length`
@@ -2090,7 +2037,9 @@ impl<'a> Scene<'a> {
/// `data`, not yet placed.
fn image_code(prelude: String, dict: String, filter: &'static str, op: &'static str, data: Vec<u8>) -> ImageCode {
let mut code = ImageCode { prelude, dict, filter, op, ascii: ps::ascii85(&data), data, uses: 0, inline_len: 0, ref_len: 0 };
code.inline_len = code.prelude.len() + INLINE_SOURCE.len() + code.dict.len() + code.inline_read().len() + code.ascii.len();
let mut inline = String::new();
ps::push_inline_image(&mut inline, "VCsrc", &code.prelude, &code.dict, code.filter, code.op, "");
code.inline_len = inline.len() + code.ascii.len();
code
}
+1 -1
View File
@@ -1175,7 +1175,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
"tool.options",
"Tool Options…",
"",
"{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's To Line truncated
"{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's To Line truncated
),
(
"ui.colorGuideOptions",
+15 -7
View File
@@ -1,7 +1,7 @@
//! Shape Builder (Shift+M), Live Paint Bucket (K) and Live Paint Selection (Shift+L).
//! Shape Builder (Shift+M), Live Paint Bucket (K), Fill Area and Live Paint Selection (Shift+L).
//!
//! The tools only emit commands (`shapeBuilder.merge`, `livePaint.fill`, `livePaint.strokeEdge`,
//! `select.*`); the planar arrangement comes from `vectorcraft_pathops::shape_builder` (Shape
//! The tools only emit commands (`shapeBuilder.merge`, `shapeBuilder.copyRegion`, `livePaint.fill`,
//! `livePaint.strokeEdge`, `select.*`); the planar arrangement comes from `vectorcraft_pathops::shape_builder` (Shape
//! Builder) and `vectorcraft_pathops::live_paint` (Live Paint).
//!
//! **Live Paint groups** are ordinary groups (no special node kind): the group's name starts with
@@ -28,11 +28,13 @@ use crate::{Action, Cursor, Mods, Overlay, PointerEvent, PointerKind, Tool, Tool
pub use po::SHAPE_BUILDER_MAX_GAP;
mod cache;
mod fill_area;
mod live_paint;
mod lookup;
mod map;
use cache::{BACKGROUND_SEGMENTS, CacheKey, RegionCache};
pub use fill_area::{AreaFinder, EnclosedArea, FillAreaTool, every_layer, fill_area_roots};
#[cfg(test)]
use live_paint::LpHover;
pub use live_paint::{
@@ -868,11 +870,16 @@ impl Tool for ShapeBuilderTool {
/// is not true or false, a `pickColorFrom` other than `artwork` or `swatches`, a `selection` other
/// than `freeform` or `straightLine`, a `highlightColor` that is not an RGB color without an alpha
/// part and a `gapLength` that is not a finite number are errors. A finite gap length out of 0 to
/// [`SHAPE_BUILDER_MAX_GAP`] is not an error: the tool clamps it. The Live Paint tools are checked
/// by [`check_live_paint_options`]; Ok for every other tool. Saved settings go to the tools'
/// `set_option` instead, which skips a value it cannot read.
/// [`SHAPE_BUILDER_MAX_GAP`] is not an error: the tool clamps it. `fillArea` takes only
/// `gapDetection`, `gapLength` and `openFilledAsClosed`, checked the same way. The Live Paint tools
/// are checked by [`check_live_paint_options`]; Ok for every other tool. Saved settings go to the
/// tools' `set_option` instead, which skips a value it cannot read.
pub fn check_builder_options(tool: &str, values: &serde_json::Map<String, Value>) -> Result<(), String> {
if tool != "shapeBuilder" {
if tool == "fillArea" {
if let Some(key) = values.keys().find(|k| !matches!(k.as_str(), "gapDetection" | "gapLength" | "openFilledAsClosed")) {
return Err(format!("unknown Fill Area option `{key}`"));
}
} else if tool != "shapeBuilder" {
return check_live_paint_options(tool, values);
}
let one_of = |key: &str, v: &Value, names: &[&str]| {
@@ -902,6 +909,7 @@ pub fn create(id: &str) -> Option<Box<dyn Tool>> {
"shapeBuilder" => Box::new(ShapeBuilderTool::default()),
"livePaintBucket" => Box::new(LivePaintBucketTool::default()),
"livePaintSelection" => Box::new(LivePaintSelectionTool::default()),
"fillArea" => Box::new(FillAreaTool::new()),
_ => return None,
})
}
+701
View File
@@ -0,0 +1,701 @@
//! The Fill Area tool: a click inside an area that visible, unlocked paths enclose adds a new
//! closed path of that area with the current fill and stroke (`shapeBuilder.copyRegion`). The
//! paths around the area stay as they are, and nothing needs to be selected.
use vectorcraft_geom::path::segment_bounds;
use vectorcraft_geom::{ParamCurve, PathSeg};
use super::lookup::path_contains;
use super::*;
/// The area [`AreaFinder::find`] finds under a point.
#[derive(Clone, Debug, PartialEq)]
pub struct EnclosedArea {
/// The area's outline, as a Shape Builder merge of that one region makes it.
pub path: PathData,
/// The object directly in a layer that holds the front-most path along the area (its outline
/// touches the area's outline, or it covers the area), or in isolation mode the object directly
/// in the isolated object: the new path goes directly above it, so it never goes inside a group,
/// a Live Paint group, a Shaper group or a clipping group other than the isolated one.
pub above: NodeId,
}
/// How many times [`AreaFinder::find`] widens the part of the document it maps before it maps
/// every path.
const WINDOW_ROUNDS: usize = 24;
/// The side (pt) of the first window [`AreaFinder::find`] maps around a point that no path's bounds
/// hold.
const FIRST_WINDOW: f64 = 32.0;
/// How many times [`AreaFinder::find`] makes the window four times larger when the paths in it hold
/// no area under the point, before it maps every path: a 32 pt window reaches 8,192 pt.
const NEAR_ROUNDS: usize = 4;
/// Finds the area under a point among the paths of some objects, mapping only the paths near the
/// point first: an area that lies inside a window is bounded by the paths whose bounds reach the
/// window, so the paths outside it cannot change it. When the maps of [`NEAR_ROUNDS`] larger windows
/// have no area under the point, or the area does not fit after [`WINDOW_ROUNDS`] widenings, the
/// finder maps every path. When a window's paths have more segments than one Shape Builder map
/// takes, the paths with the most segments are left out until the rest fit, and an area is taken
/// only when no path left out crosses it or comes within the gap of it; a path left out that
/// covers it still counts for where the new path goes. When every path together has more segments than that,
/// an area no window finds is not found. The map of every path, once a search has needed it, is
/// kept for the next search.
pub struct AreaFinder {
/// The inputs back → front, as [`shape_builder_shapes`] gives them, with their bounds and the
/// object directly in a layer that holds each one ([`outermost`]).
inputs: Vec<(po::Shape, Rect, NodeId)>,
/// The bounds of every input.
total: Option<Rect>,
gap: f64,
/// The segments of all the inputs.
segments: usize,
/// Whether all the inputs fit the segment limit of one Shape Builder map. Past it a map keeps
/// only the filled areas and loses the lines between them, so no map of every input is made.
fits: bool,
/// The map of every input, with the index of each of its shapes in `inputs`.
full: Option<(BuilderMap, Vec<usize>)>,
}
/// Does `r` hold `p`, edges included?
fn holds(r: &Rect, p: Point) -> bool {
p.x >= r.x0 && p.x <= r.x1 && p.y >= r.y0 && p.y <= r.y1
}
/// Do `a` and `b` overlap or touch?
fn meet(a: &Rect, b: &Rect) -> bool {
a.x0 <= b.x1 && b.x0 <= a.x1 && a.y0 <= b.y1 && b.y0 <= a.y1
}
/// The area a path left out of a window's map may cut: its outline, the same as a closed path
/// (`bez`), and the box (`zone`) its outline reaches with the gap.
struct Reach<'a> {
face: &'a PathData,
bez: &'a vectorcraft_geom::kurbo::BezPath,
zone: Rect,
/// How close (pt) to the outline a path may come and still change the area: the gap and 1 pt.
reach: f64,
}
/// Does a segment of `path` (closing segments included) lie inside the area or come within its
/// reach of the area's outline? A path in the box of the area may still lie wholly outside the
/// area, in the empty corner of an L or around it, and such a path does not change it. `budget`
/// counts the work (pieces checked times the outline's segments); when it runs out, the path
/// counts as cutting the area.
fn cuts(path: &PathData, area: &Reach, budget: &mut usize) -> bool {
let bez = path.to_bezpath();
let cost = area.face.subpaths.iter().map(|sp| sp.segment_count()).sum::<usize>().max(1);
vectorcraft_geom::kurbo::segments(bez.elements().iter().copied()).any(|seg| segment_cuts(seg, area, cost, budget, 0))
}
/// How many times [`segment_cuts`] halves a segment: a piece of 1/2^24 of a segment near the area
/// counts as cutting it.
const REACH_SPLITS: u32 = 24;
/// The side (pt) below which a piece of a segment that may come within reach of the area counts as
/// cutting it.
const REACH_TOLERANCE: f64 = 0.01;
/// How much work [`cuts`] does for one area before it takes a path as cutting it: pieces checked
/// times the segments of the area's outline.
const CUT_BUDGET: usize = 1 << 24;
/// Does `seg` lie inside the area or come within its reach of the area's outline? A piece whose
/// box misses the area's zone does not; a piece whose middle is inside the area or within reach of
/// its outline does; a piece farther from the outline than its box is wide does not, since every
/// point of it is then out of reach and on the same side. The rest is halved.
fn segment_cuts(seg: PathSeg, area: &Reach, cost: usize, budget: &mut usize, depth: u32) -> bool {
let b = segment_bounds(seg);
if !meet(&b, &area.zone) {
return false;
}
let Some(left) = budget.checked_sub(cost) else { return true };
*budget = left;
let mid = seg.eval(0.5);
if area.bez.winding(mid) != 0 {
return true;
}
let Some((.., d)) = area.face.nearest(mid) else { return true };
if d <= area.reach {
return true;
}
let wide = b.width().hypot(b.height());
if d - area.reach > wide {
return false;
}
if depth >= REACH_SPLITS || wide < REACH_TOLERANCE {
return true;
}
segment_cuts(seg.subsegment(0.0..0.5), area, cost, budget, depth + 1) || segment_cuts(seg.subsegment(0.5..1.0), area, cost, budget, depth + 1)
}
/// How far (pt) an anchor of an area's outline may lie from a path's outline, with Gap Detection
/// off, and still count as on it: the least snap distance [`outline_snap`] gives, five times the
/// 0.01 pt precision the Shape Builder's map works to.
const CONTACT: f64 = 0.05;
/// Does the filled area of the closed subpaths of `s` hold `p`?
fn covers(s: &po::Shape, p: Point) -> bool {
let closed = PathData::new(s.path.subpaths.iter().filter(|sp| sp.closed).cloned().collect());
path_contains(&closed, s.rule, p)
}
/// Does `outer` hold all of `inner`?
fn within(inner: &Rect, outer: &Rect) -> bool {
inner.x0 >= outer.x0 && inner.x1 <= outer.x1 && inner.y0 >= outer.y0 && inner.y1 <= outer.y1
}
/// The object directly in `scope` (the isolated object in isolation mode), or else directly in a
/// layer (or sublayer), that holds `id`: `id` itself when `scope` or a layer holds it, or when `id`
/// is `scope`.
fn outermost(doc: &Document, id: NodeId, scope: Option<NodeId>) -> NodeId {
let Some(line) = doc.ancestry(id) else { return id };
let k = match scope {
Some(s) => line.iter().rposition(|a| *a == s),
None => line.iter().rposition(|a| doc.node(*a).is_some_and(|n| n.is_layer())),
};
k.and_then(|k| line.get(k + 1)).copied().unwrap_or(id)
}
/// Does `n` make, move or combine the art in it itself, so that a new path in it would not stay as
/// Fill Area adds it: a Live Paint group, a compound shape, a Shaper group, a graph, an Image Trace
/// result, a dimension, a flare or an Objects on Path group.
fn managed(n: &Node) -> bool {
let e = n.extras();
super::lookup::is_live_paint(n)
|| n.is_compound_shape()
|| e.shaper.is_some()
|| e.graph.is_some()
|| e.trace.is_some()
|| e.dimension.is_some()
|| e.flare.is_some()
|| e.objects_on_path.is_some()
}
/// The roots the Fill Area tool and `shapeBuilder.copyRegion` find areas among, with the isolated
/// object the new path goes into ([`AreaFinder::new`]'s `scope`), for `isolation` (the document's
/// isolated object) and `named` (the objects or layers named; None: every layer). In isolation mode
/// only the isolated layer or group's paths count: of `named`, the ones inside it, with the
/// isolated object in place of one that holds it. An isolated object that no longer exists counts
/// as no isolation. None while an object that is not a layer or a group is isolated (a compound
/// path or a single path), a layer or group with a live effect, a group that is [`managed`], a
/// clipping group or clipped layer, or one inside such an object or inside another object that is
/// not a layer or a group (an envelope): no area is found then.
pub fn fill_area_roots(doc: &Document, isolation: Option<NodeId>, named: Option<&[NodeId]>) -> Option<(Vec<NodeId>, Option<NodeId>)> {
let Some(iso) = isolation.filter(|i| doc.node(*i).is_some()) else {
return Some((named.map_or_else(|| every_layer(doc), <[NodeId]>::to_vec), None));
};
let line = doc.ancestry(iso)?;
// Every object from the layer down to the isolated one is a layer or a plain group: an
// envelope, a blend or another object that draws its contents its own way does not hold
// the new path as drawn.
// A layer or group with a live effect (a Transform effect moves what is in it) draws the new
// path elsewhere than the area.
let plain =
|a: &Node| (a.is_layer() || (matches!(a.kind, NodeKind::Group { .. }) && !managed(a))) && !a.appearance.effects.iter().any(|e| e.visible);
if !line.iter().all(|a| doc.node(*a).is_some_and(plain)) {
return None;
}
// A clipping group or clipped layer's mask clips and is not painted, and its mask hides or cuts
// a new path among the art it clips.
if line.iter().any(|a| doc.node(*a).is_some_and(Node::clips)) {
return None;
}
let Some(named) = named else { return Some((vec![iso], Some(iso))) };
let mut out = vec![];
for r in named {
if line.contains(r) {
out.push(iso);
} else if doc.ancestry(*r).is_some_and(|a| a.contains(&iso)) {
out.push(*r);
}
}
Some((out, Some(iso)))
}
impl AreaFinder {
/// The finder over the paths of `roots` (layers or objects) that the Shape Builder takes:
/// visible, unlocked paths, compound paths and Live Paint faces and edges that draw, not on a
/// locked artboard. Gaps up to `gap` close, and with `open_filled_as_closed` a filled open path
/// bounds an area as if an invisible edge closed it. With `scope` (the isolated object in
/// isolation mode), an area's new path goes directly above the object in `scope` that holds the
/// front-most path along it, so it stays inside the isolated object.
pub fn new(doc: &Document, roots: &[NodeId], scope: Option<NodeId>, gap: f64, open_filled_as_closed: bool) -> Self {
let roots = sorted_roots(doc, roots);
let (shapes, leaves) = shape_builder_shapes(doc, &roots, open_filled_as_closed);
let editable = doc.editable();
let inputs: Vec<(po::Shape, Rect, NodeId)> = shapes
.into_iter()
.zip(leaves)
.filter(|(_, l)| editable(l.id))
.filter_map(|(s, l)| {
let b = s.path.bounds()?;
Some((s, b, outermost(doc, l.id, scope)))
})
.collect();
let total = inputs.iter().map(|(_, b, _)| *b).reduce(|a, b| a.union(b));
let gap = if gap.is_finite() { gap.clamp(0.0, SHAPE_BUILDER_MAX_GAP) } else { 0.0 };
let segments: usize = inputs.iter().flat_map(|(s, ..)| &s.path.subpaths).map(|sp| sp.segment_count()).sum();
Self { inputs, total, gap, segments, fits: segments <= po::SHAPE_BUILDER_MAX_SEGMENTS, full: None }
}
/// The area under `p`: the smallest region of the map of the paths that holds `p`. None when
/// `p` is in no enclosed area.
pub fn find(&mut self, p: Point) -> Option<EnclosedArea> {
if let Some((map, picked)) = &self.full {
return self.area_in(map, picked, &[], p);
}
let total = self.total?;
// A gap bridge reaches at most `gap` past a path, so a window takes in every path within
// that of it.
let reach = self.gap + 1.0;
if !holds(&total.inflate(reach, reach), p) {
return None;
}
let mut window = self
.inputs
.iter()
.filter(|(_, b, _)| holds(&b.inflate(reach, reach), p))
.map(|(_, b, _)| *b)
.reduce(|a, b| a.union(b))
.unwrap_or_else(|| Rect::from_center_size(p, (FIRST_WINDOW, FIRST_WINDOW)));
let mut near = 0;
let mut every_path = false;
// The paths left out of the windows' maps to keep them within the segment limit, by index.
let mut left_out = vec![false; self.inputs.len()];
let mut any_left_out = false;
for round in 0..=WINDOW_ROUNDS {
let last = every_path || round == WINDOW_ROUNDS;
if last && !self.fits {
return None;
}
let zone = window.inflate(reach, reach);
let mut picked: Vec<usize> = (0..self.inputs.len())
.filter(|&i| last || (!left_out.get(i).is_some_and(|o| *o) && self.inputs.get(i).is_some_and(|(_, b, _)| meet(b, &zone))))
.collect();
// Past the segment limit a map keeps only the filled areas, so the paths with the most
// segments stay out of the window's map.
if !last {
for i in self.over_limit(&picked) {
if let Some(o) = left_out.get_mut(i) {
*o = true;
any_left_out = true;
}
}
picked.retain(|&i| !left_out.get(i).is_some_and(|o| *o));
}
let every = picked.len() == self.inputs.len();
let shapes: Vec<po::Shape> = picked.iter().filter_map(|&i| self.inputs.get(i).map(|(s, ..)| s.clone())).collect();
let map = BuilderMap::of_shapes(shapes, false, self.gap);
let face = map.region_at(p).and_then(|k| map.regions.get(k));
let bounds = face.map(|(.., rb)| *rb);
if every {
let area = self.area_in(&map, &picked, &[], p);
self.full = Some((map, picked));
return area;
}
let before = window;
match bounds {
// A path left out that crosses the area or comes within its reach could cut it, and
// only the map of every path holds both.
Some(rb) if within(&rb, &window) => {
let reached = rb.inflate(reach, reach);
let mut budget = CUT_BUDGET;
let cut = any_left_out
&& face.is_none_or(|(region, bez, _)| {
let area = Reach { face: &region.path, bez, zone: reached, reach };
self.inputs.iter().zip(&left_out).any(|((s, b, _), out)| *out && meet(b, &reached) && cuts(&s.path, &area, &mut budget))
});
if !cut {
return self.area_in(&map, &picked, &left_out, p);
}
every_path = true;
}
Some(rb) => window = window.union(rb),
// No area of the paths near the point holds it: an area that does is bounded by
// paths farther away. The window grows four times over a few rounds, and then the
// next round maps every path.
None if near < NEAR_ROUNDS => {
near += 1;
let (w, h) = (window.width().max(FIRST_WINDOW) * 4.0, window.height().max(FIRST_WINDOW) * 4.0);
window = window.union(Rect::from_center_size(window.center(), (w, h)));
}
None => window = total,
}
// A window that did not grow would give the same map again.
if window == before {
every_path = true;
}
}
None
}
/// The inputs among `picked` to leave out of a map so that the rest fit the segment limit of
/// one Shape Builder map: the ones with the most segments first. Empty when all of `picked` fit.
fn over_limit(&self, picked: &[usize]) -> Vec<usize> {
let segments = |i: usize| self.inputs.get(i).map_or(0, |(s, ..)| s.path.subpaths.iter().map(|sp| sp.segment_count()).sum::<usize>());
let mut sum: usize = picked.iter().map(|&i| segments(i)).sum();
let mut by_size: Vec<(usize, usize)> = picked.iter().map(|&i| (segments(i), i)).collect();
by_size.sort_by_key(|(n, _)| std::cmp::Reverse(*n));
let mut out = vec![];
for (n, i) in by_size {
if sum <= po::SHAPE_BUILDER_MAX_SEGMENTS {
break;
}
sum -= n;
out.push(i);
}
out
}
/// The area under `p` in `map`, made of the inputs `picked` (in its order). `left_out` marks
/// the inputs left out of the map, by index, none of which comes near the area: the front-most
/// of them that covers the area decides where the new path goes when it is in front of the
/// shape the map gives.
fn area_in(&self, map: &BuilderMap, picked: &[usize], left_out: &[bool], p: Point) -> Option<EnclosedArea> {
let (region, ..) = map.region_at(p).and_then(|k| map.regions.get(k))?;
let path = po::FaceMerger::with_gap(&map.shapes, self.gap).merge(&[region]);
if path.is_empty() {
return None;
}
let anchors: Vec<Point> = region.path.subpaths.iter().flat_map(|sp| sp.anchors.iter().map(|a| a.p)).collect();
// The front-most shape that covers the area or that an anchor of its outline lies on. A
// shape within the gap of an anchor counts only when no shape is along the area itself,
// so a path near the area that bounds none of it does not decide where the new path goes.
// Without a gap, an anchor is on a shape's outline within [`CONTACT`].
let along = |gap: f64| {
map.shapes.iter().enumerate().rev().find(|(i, s)| {
let tol = if gap > 0.0 { outline_snap(&s.path) + gap } else { CONTACT };
region.sources.contains(i)
|| s.path.bounds().is_some_and(|b| {
let b = b.inflate(tol, tol);
anchors.iter().any(|q| holds(&b, *q) && s.path.nearest(*q).is_some_and(|(.., d)| d <= tol))
})
})
};
let k = along(0.0).or_else(|| along(self.gap)).map_or(map.shapes.len().checked_sub(1)?, |(i, _)| i);
let mapped = *picked.get(k)?;
// A path left out comes near no part of the area, so it covers all of it or none of it.
let covering =
left_out.iter().enumerate().rev().find(|(i, out)| **out && *i > mapped && self.inputs.get(*i).is_some_and(|(s, ..)| covers(s, p)));
let front = covering.map_or(mapped, |(i, _)| i);
let above = self.inputs.get(front).map(|(.., id)| *id)?;
Some(EnclosedArea { path, above })
}
}
/// The paths the Fill Area tool finds areas among: every layer's.
pub fn every_layer(doc: &Document) -> Vec<NodeId> {
doc.layers.iter().map(|l| l.id).collect()
}
/// Fill Area (in the Live Paint Bucket's group): a click inside an area that visible, unlocked
/// paths on any layer enclose adds a new closed path of that area with the current fill and stroke
/// (`shapeBuilder.copyRegion`), directly above the front-most object along it. The paths stay as
/// they are and nothing needs to be selected. The area under the pointer is outlined while it
/// hovers. Gap Detection and Consider Open Filled Paths as Closed are the Shape Builder's options.
#[derive(Default)]
pub struct FillAreaTool {
gap_detection: bool,
gap_length: f64,
/// Consider Open Filled Paths as Closed turned off: a filled open path cuts areas as a line
/// does.
open_filled_cuts: bool,
/// The finder for the document as it is, with the key it was made for. Away while a search
/// runs on another thread.
finder: Option<(FinderKey, AreaFinder)>,
/// The area under the pointer, with the key of the finder that found it.
hover: Option<(FinderKey, EnclosedArea)>,
/// Where the pointer last moved over the canvas.
at: Option<Point>,
/// A hover search running on another thread.
job: Option<HoverJob>,
/// The key whose search on another thread failed: hovering does not search it again.
failed: Option<FinderKey>,
/// A press added the path as a preview, which the release keeps.
pressing: bool,
}
/// The document revision, the gap, the open-filled rule and the isolated object an [`AreaFinder`]
/// was made with.
type FinderKey = ((u64, u64), f64, bool, Option<NodeId>);
/// A search for the area under `p` on another thread, which hands back the finder it took.
struct HoverJob {
key: FinderKey,
p: Point,
done: std::sync::mpsc::Receiver<(AreaFinder, Option<EnclosedArea>)>,
}
#[cfg(not(target_arch = "wasm32"))]
thread_local! {
/// The hover searches this thread has started on other threads ([`hover_searches_started`]).
static HOVER_SEARCHES: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
}
/// How many hover searches this thread has started on other threads, for tests that count them.
#[cfg(all(test, not(target_arch = "wasm32")))]
pub(super) fn hover_searches_started() -> usize {
HOVER_SEARCHES.with(std::cell::Cell::get)
}
/// Runs `finder.find(p)` on another thread; gives the finder back when no thread starts.
#[cfg(not(target_arch = "wasm32"))]
fn spawn_find(finder: AreaFinder, p: Point) -> Result<std::sync::mpsc::Receiver<(AreaFinder, Option<EnclosedArea>)>, Box<AreaFinder>> {
HOVER_SEARCHES.with(|n| n.set(n.get() + 1));
let (tx, done) = std::sync::mpsc::channel();
let (back_tx, back) = std::sync::mpsc::channel();
let spawned = std::thread::Builder::new().name("vectorcraft-fill-area".into()).spawn(move || {
// The finder comes in through a channel, so a thread that does not start leaves it here.
if let Ok(mut f) = back.recv() {
let area = AreaFinder::find(&mut f, p);
// The tool may have dropped the receiver meanwhile (another tool, a new revision).
let _ = tx.send((f, area));
}
});
match spawned {
Ok(_) => match back_tx.send(finder) {
Ok(()) => Ok(done),
Err(e) => Err(Box::new(e.0)),
},
Err(_) => Err(Box::new(finder)),
}
}
/// The web build has no threads.
#[cfg(target_arch = "wasm32")]
fn spawn_find(finder: AreaFinder, _p: Point) -> Result<std::sync::mpsc::Receiver<(AreaFinder, Option<EnclosedArea>)>, Box<AreaFinder>> {
Err(Box::new(finder))
}
impl FillAreaTool {
/// A tool with the Shape Builder's default options.
pub fn new() -> Self {
Self { gap_length: GAP_LENGTHS[0], ..Self::default() }
}
fn gap(&self) -> f64 {
if self.gap_detection { self.gap_length } else { 0.0 }
}
fn open_filled_as_closed(&self) -> bool {
!self.open_filled_cuts
}
fn finder_key(&self, cx: &ToolContext) -> FinderKey {
(cx.revision, self.gap(), self.open_filled_as_closed(), cx.isolation)
}
/// The finder for the document as `cx` has it, made again when the key changed. In isolation
/// mode it takes only the isolated object's paths, as the command does.
fn take_finder(&mut self, cx: &ToolContext) -> AreaFinder {
let key = self.finder_key(cx);
match self.finder.take() {
Some((k, f)) if k == key => f,
_ => {
// An isolated object Fill Area does not work in gives a finder of no paths.
let (roots, scope) = fill_area_roots(cx.doc, key.3, None).unwrap_or_default();
AreaFinder::new(cx.doc, &roots, scope, key.1, key.2)
}
}
}
/// The hover area when it is current and holds `p`.
fn hover_holding(&self, cx: &ToolContext, p: Point) -> Option<&EnclosedArea> {
self.hover.as_ref().filter(|(k, a)| *k == self.finder_key(cx) && path_contains(&a.path, FillRule::NonZero, p)).map(|(_, a)| a)
}
/// The area under `p`, found here and now (a click). A search running on another thread is
/// waited for first, so its finder is not made again; no search starts for where the pointer
/// moved meanwhile.
fn area_at(&mut self, cx: &ToolContext, p: Point) -> Option<EnclosedArea> {
if let Some(a) = self.hover_holding(cx, p) {
return Some(a.clone());
}
self.settle(cx, true, false);
let key = self.finder_key(cx);
let mut finder = self.take_finder(cx);
let area = finder.find(p);
self.finder = Some((key, finder));
area
}
/// Looks for the area under `p` for the hover. A search of more than [`BACKGROUND_SEGMENTS`]
/// segments runs on another thread, and [`Tool::poll`] takes its result; while one runs, a new
/// position waits for it.
fn hover_at(&mut self, cx: &ToolContext, p: Point) {
self.at = Some(p);
if self.hover_holding(cx, p).is_some() {
return;
}
// The outline of an area the pointer left goes at once, while the next search runs.
self.hover = None;
if self.job.is_some() {
return;
}
let key = self.finder_key(cx);
if self.failed == Some(key) {
self.hover = None;
return;
}
let mut finder = self.take_finder(cx);
if finder.segments > BACKGROUND_SEGMENTS {
match spawn_find(finder, p) {
Ok(done) => {
self.job = Some(HoverJob { key, p, done });
return;
}
Err(f) => finder = *f,
}
}
self.hover = finder.find(p).map(|a| (key, a));
self.finder = Some((key, finder));
}
/// Takes the result of the hover search on another thread when it is done (`wait`: waits for
/// it), and with `follow` starts the search for where the pointer moved meanwhile.
fn settle(&mut self, cx: &ToolContext, wait: bool, follow: bool) {
let Some(job) = self.job.take() else { return };
let got = if wait {
job.done.recv().ok()
} else {
match job.done.try_recv() {
Ok(v) => Some(v),
Err(std::sync::mpsc::TryRecvError::Empty) => {
self.job = Some(job);
return;
}
Err(std::sync::mpsc::TryRecvError::Disconnected) => None,
}
};
let Some((finder, area)) = got else {
// The search failed (a bug in the planar map): hovering does not search it again, and
// a click searches here, which reports the failure.
self.failed = Some(job.key);
self.hover = None;
return;
};
let current = job.key == self.finder_key(cx);
if current {
self.finder = Some((job.key, finder));
}
// The area found serves wherever the pointer moved meanwhile, as long as it holds it.
let at = self.at;
self.hover = area.filter(|a| current && at.is_some_and(|p| path_contains(&a.path, FillRule::NonZero, p))).map(|a| (job.key, a));
if follow
&& let Some(p) = at
&& self.hover.is_none()
&& (p != job.p || !current)
{
self.hover_at(cx, p);
}
}
}
impl Tool for FillAreaTool {
fn id(&self) -> &'static str {
"fillArea"
}
fn pointer(&mut self, cx: &ToolContext, ev: &PointerEvent) -> Vec<Action> {
match ev.kind {
PointerKind::Move => {
self.hover_at(cx, ev.pos);
vec![]
}
PointerKind::Down => {
// A click in no enclosed area does nothing.
let found = self.area_at(cx, ev.pos).is_some();
self.hover = None;
if !found {
return vec![];
}
let mut params = json!({ "point": [ev.pos.x, ev.pos.y], "gap": self.gap() });
if !self.open_filled_as_closed() {
params["openFilledAsClosed"] = json!(false);
}
// The path shows at once and is kept on the release; a press that is dropped (a
// long or canceled touch, a second finger) or Escape before the release takes it
// back.
self.pressing = true;
vec![Action::Begin("Fill Area".into()), Action::Preview("shapeBuilder.copyRegion".into(), params)]
}
PointerKind::Up if std::mem::take(&mut self.pressing) => vec![Action::Commit],
_ => vec![],
}
}
fn key(&mut self, _cx: &ToolContext, key: ToolKey, _mods: Mods) -> Vec<Action> {
if key == ToolKey::Escape && std::mem::take(&mut self.pressing) { vec![Action::Cancel] } else { vec![] }
}
fn busy(&self) -> bool {
self.pressing
}
fn overlays(&self, cx: &ToolContext) -> Vec<Overlay> {
self.hover
.iter()
.filter(|(k, _)| *k == self.finder_key(cx))
.map(|(_, a)| Overlay::Path { path: a.path.to_bezpath(), color: HIGHLIGHT_RED, width: 3.0, dashed: false })
.collect()
}
fn cursor(&self, cx: &ToolContext, p: Point, _m: Mods) -> Cursor {
if self.hover_holding(cx, p).is_some() { Cursor::LivePaintBucketFace } else { Cursor::LivePaintBucket }
}
fn hover_ended(&mut self, _cx: &ToolContext) {
self.hover = None;
self.at = None;
}
/// The area under a still pointer changes with the document and the view.
fn wants_rehover(&self) -> bool {
true
}
fn waiting(&self) -> bool {
self.job.is_some()
}
fn poll(&mut self, cx: &ToolContext, wait: bool) -> Vec<Action> {
self.settle(cx, wait, true);
while wait && self.job.is_some() {
self.settle(cx, true, true);
}
vec![]
}
/// The Shape Builder's Gap Detection, Gap Length and Consider Open Filled Paths as Closed,
/// which the tool shares.
fn options(&self) -> Value {
json!({
"gapDetection": self.gap_detection,
"gapLength": self.gap_length,
"openFilledAsClosed": self.open_filled_as_closed(),
})
}
fn set_option(&mut self, key: &str, v: &Value) {
match key {
"gapDetection" => self.gap_detection = v.as_bool().unwrap_or(self.gap_detection),
"gapLength" => {
if let Some(n) = v.as_f64().filter(|n| n.is_finite()) {
self.gap_length = n.clamp(0.0, SHAPE_BUILDER_MAX_GAP);
}
}
"openFilledAsClosed" => {
if let Some(b) = v.as_bool() {
self.open_filled_cuts = !b;
}
}
_ => {}
}
self.hover = None;
}
fn check_option(&self, key: &str, v: &Value) -> Result<(), String> {
check_builder_options(self.id(), &serde_json::Map::from_iter([(key.to_string(), v.clone())]))
}
}
+29
View File
@@ -3767,6 +3767,35 @@ fn live_paint_selection_options_set_the_highlight() {
assert_eq!(t.options()["width"], json!(LP_SELECT_WIDTH_RANGE.0));
}
/// A press while a Fill Area hover search runs on another thread waits for that search only: no
/// search starts for where the pointer moved meanwhile, and the press finds its own area.
#[cfg(not(target_arch = "wasm32"))]
#[test]
fn fill_area_press_does_not_search_a_hover_position_it_passed() {
let mut d = Document::new(800.0, 600.0);
let l = d.layers[0].id;
let pts: Vec<Point> = (0..200)
.map(|k| {
let a = k as f64 * std::f64::consts::TAU / 200.0;
Point::new(300.0 + 100.0 * a.cos(), 300.0 + 100.0 * a.sin())
})
.collect();
let poly = d.alloc_id();
d.insert(Some(l), 0, Node::path(poly, PathData::single(SubPath::polyline(&pts, true)), Appearance::default_art())).unwrap();
let s = Selection::default();
let p = paint();
let cx = ToolContext { revision: (1, 1), ..cx(&d, &s, &p) };
let mut t = FillAreaTool::new();
let started = super::fill_area::hover_searches_started();
t.pointer(&cx, &ev(PointerKind::Move, 500.0, 500.0));
assert!(t.waiting());
t.pointer(&cx, &ev(PointerKind::Move, 510.0, 500.0));
let acts = t.pointer(&cx, &ev(PointerKind::Down, 300.0, 300.0));
assert!(matches!(acts.as_slice(), [Action::Begin(_), Action::Preview(id, _)] if id == "shapeBuilder.copyRegion"), "{acts:?}");
assert!(!t.waiting());
assert_eq!(super::fill_area::hover_searches_started() - started, 1, "only the search that was running");
}
#[test]
fn create_builds_the_three_tools() {
for id in ["shapeBuilder", "livePaintBucket", "livePaintSelection"] {
+1
View File
@@ -103,6 +103,7 @@ pub const TOOL_GROUPS: &[&[ToolInfo]] = &[
&[
t("shapeBuilder", "Shape Builder Tool", Some("Shift+M"), "tool-shape-builder"),
t("livePaintBucket", "Live Paint Bucket", Some("K"), "tool-bucket"),
t("fillArea", "Fill Area Tool", None, "tool-fill-area"),
t("livePaintSelection", "Live Paint Selection Tool", Some("Shift+L"), "tool-live-select"),
],
&[
+2
View File
@@ -524,6 +524,7 @@ id = "LivePaintBucket"
group = "Colour and gradient"
shown_when = [
"The Live Paint Bucket where a click paints nothing: away from Live Paint groups and the selected paths' regions, or over a part the Paint Fills and Paint Strokes options (and Shift) leave unpainted.",
"The Fill Area tool outside every area that visible, unlocked paths enclose, where a click adds nothing.",
"With Use Precise Cursors on, the crosshair shows instead.",
]
hotspot = "The drop the paint pours onto."
@@ -534,6 +535,7 @@ id = "LivePaintBucketFace"
group = "Colour and gradient"
shown_when = [
"The Live Paint Bucket over a face of a Live Paint group, or a region of the selected paths, that a click fills.",
"The Fill Area tool over an enclosed area, where a click adds a path of that area.",
"With Use Precise Cursors on, the crosshair shows instead.",
]
hotspot = "The drop the paint pours onto."
+2
View File
@@ -98,6 +98,8 @@ const ROWS: &[Row] = &[
"highlightColor",
],
),
// Fill Area uses the Shape Builder's Gap Detection and open-filled-path options.
(&["fillArea"], Some("shapeBuilder"), &["openFilledAsClosed", "gapDetection", "gapLength"]),
// Objects on Path Tool Options: the Pivot and Rotate of the objects attached next.
(&["objectsOnPath"], None, &["pivot", "rotate"]),
(&["artboard"], None, &["moveArt", "scaleArt"]),
@@ -159,6 +159,22 @@ mod tests {
assert_eq!(opts["openFilledAsClosed"], true);
}
/// Double-clicking the Fill Area tool opens the Shape Builder Tool Options, whose Gap
/// Detection the active Fill Area tool takes on OK.
#[test]
fn the_fill_area_tool_opens_the_shape_builder_options() {
let mut a = app();
a.select_tool("fillArea");
let r = a.run("tool.options", json!({"tool": "fillArea"})).unwrap();
assert_eq!(r["dialog"], json!(KIND));
let d = a.ui.dialog.as_mut().unwrap();
d.fields.insert("gapDetection".into(), json!(true));
d.fields.insert("gapLength".into(), json!(6));
super::super::confirm(&mut a).unwrap();
let opts = a.session.tool_options_of("fillArea");
assert_eq!((opts["gapDetection"].clone(), opts["gapLength"].clone()), (json!(true), json!(6.0)));
}
#[test]
fn double_clicking_the_tool_opens_its_options_and_ok_keeps_them() {
let mut app = app();
+12
View File
@@ -2075,6 +2075,8 @@ font-technology Variable Променливи
List Workspaces Извеждане на работни пространства
Live Paint Динамично оцветяване
Live Paint Bucket Кофа за динамично оцветяване
Fill Area Запълване на област
Fill Area Tool Инструмент „Запълване на област“
Live Paint Bucket (Stroke) Кофа за динамично оцветяване (Щрих)
Live Paint Info Информация за динамично оцветяване
Live Paint Selection Tool Инструмент за селекция на динамично оцветяване
@@ -4785,6 +4787,7 @@ axis Both И двете
@msg Saved {path} Записано: {path}
@msg Select text or click into text with the Type tool to insert glyphs Изберете текст или щракнете в текста с инструмента „Текст“, за да вмъкнете глифи
@msg Shape Builder: no region under the pointer Инструмент за създаване на форми: няма област под показалеца
@msg Fill Area: no enclosed area under the pointer Запълване на област: няма затворена област под показалеца
@msg Shape Builder: select paths or compound paths Инструмент за създаване на форми: изберете пътища или съставни пътища
@msg Show All Hidden Attributes: nothing is hidden Показване на всички скрити атрибути: нищо не е скрито
@msg Split Into Grid: select paths large enough for the grid Разделяне на мрежа: изберете пътища, достатъчно големи за мрежата
@@ -7930,6 +7933,15 @@ breakText Glyphs Глифи
@msg A joint does not close by {gap} pt. Една връзка не се затваря с {gap} pt.
@msg Two panels pass through each other. Два панела минават един през друг.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer трябва да е "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine"
Nature Icons Природни икони
Flower Цвете
Tree Дърво
Mountain Планина
Ornamental Орнаментални
Scrollwork Завитък
Filigree Arrow Филигранна стрела
Petal Sweep Венчелистен замах
Twin Curl Двоен завитък
Vector Packs Векторни пакети
Compass Rose Роза на компаса
Botanical Sprig Ботаническо клонче
Can't render this file because it is too large.
+12
View File
@@ -3701,6 +3701,8 @@ theme Appearance Izgled
Symbolism Tool Alat simbolizam
Image Trace Presets Predlošci praćenja slike
Live Paint Bucket Kanta za živo bojenje
Fill Area Popuni područje
Fill Area Tool Alat za popunjavanje područja
Live Paint Bucket (Stroke) Kanta za živo bojenje (potez)
Live Paint Info Informacije o živom bojenju
Shape Builder Graditelj oblika
@@ -5190,6 +5192,7 @@ imageTrace Outline Obris
@msg Saved {path} Sačuvano: {path}
@msg Select text or click into text with the Type tool to insert glyphs Odaberite tekst ili kliknite u tekst alatom za tekst da umetnete glifove
@msg Shape Builder: no region under the pointer Graditelj oblika: nema regije ispod pokazivača
@msg Fill Area: no enclosed area under the pointer Popuni područje: nema zatvorenog područja ispod pokazivača
@msg Shape Builder: select paths or compound paths Graditelj oblika: odaberite putanje ili složene putanje
@msg Show All Hidden Attributes: nothing is hidden Prikaži sve skrivene atribute: ništa nije skriveno
@msg Split Into Grid: select paths large enough for the grid Podijeli u mrežu: odaberite putanje dovoljno velike za mrežu
@@ -7985,6 +7988,15 @@ shape Open Otvoren
@msg A joint does not close by {gap} pt. Spoj se ne zatvara za {gap} pt.
@msg Two panels pass through each other. Dva panela prolaze jedan kroz drugi.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer mora biti "singleLine", "everyLine", "standardSingleLine" ili "standardEveryLine"
Nature Icons Ikone prirode
Flower Cvijet
Tree Drvo
Mountain Planina
Ornamental Ornamentalno
Scrollwork Ukrasni zavoj
Filigree Arrow Filigranska strelica
Petal Sweep Potez latica
Twin Curl Dvostruki zavoj
Vector Packs Vektorski paketi
Compass Rose Ruža kompasa
Botanical Sprig Botanička grančica
Can't render this file because it contains an unexpected character in line 2 and column 73.
+12
View File
@@ -2689,6 +2689,8 @@ digits Malayalam Malaiàlam
Live curve fitting Ajustament de corbes en directe
Live Paint Pintura interactiva
Live Paint Bucket Galleda de pintura interactiva
Fill Area Emplena l'àrea
Fill Area Tool Eina Emplena l'àrea
Live Paint Bucket (Stroke) Galleda de pintura interactiva (traç)
Live Paint Info Informació de pintura interactiva
Live Paint Selection Tool Eina de selecció de pintura interactiva
@@ -7228,6 +7230,7 @@ liquify-list-end {0}, {1} {0} i {1}
@msg shadings of more than 4096 patches or triangles were left out els ombrejats de més de 4096 pedaços o triangles s’han omès
@msg shadings whose functions are of an unknown type are filled with their middle colour els ombrejats les funcions dels quals són d’un tipus desconegut s’omplen amb el seu color central
@msg Shape Builder: no region under the pointer Constructor de formes: no hi ha cap regió sota el punter
@msg Fill Area: no enclosed area under the pointer Emplena l'àrea: no hi ha cap àrea tancada sota el punter
@msg Shape Builder: select all paths you want to merge Constructor de formes: selecciona tots els traçats que vulguis combinar
@msg Shape Builder: select paths or compound paths Constructor de formes: selecciona traçats o traçats compostos
@msg shortcut for `{k}` must be a string la drecera de `{k}` ha de ser una cadena
@@ -8975,6 +8978,15 @@ breakText Glyphs Glifs
@msg A joint does not close by {gap} pt. Una unió no es tanca per {gap} pt.
@msg Two panels pass through each other. Dos panells es travessen l’un a l’altre.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer ha de ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine"
Nature Icons Icones de natura
Flower Flor
Tree Arbre
Mountain Muntanya
Ornamental Ornamental
Scrollwork Voluta
Filigree Arrow Fletxa de filigrana
Petal Sweep Traç de pètals
Twin Curl Voluta doble
Vector Packs Paquets vectorials
Compass Rose Rosa dels vents
Botanical Sprig Branqueta botànica
Can't render this file because it is too large.
+12
View File
@@ -3802,6 +3802,8 @@ theme Appearance Motiv
Symbolism Tool Nástroj symbolů
Image Trace Presets Přednastavení vektorizace obrazu
Live Paint Bucket Kbelík živé malby
Fill Area Vyplnit oblast
Fill Area Tool Nástroj Vyplnit oblast
Live Paint Bucket (Stroke) Kbelík živé malby (tah)
Live Paint Info Informace o živé malbě
Shape Builder Tvorba tvarů
@@ -5481,6 +5483,7 @@ liquify-list-end {0}, {1} {0} a {1}
@msg Saved {path} Uloženo: {path}
@msg Select text or click into text with the Type tool to insert glyphs Glyfy vložíte, když vyberete text nebo do něj kliknete nástrojem Text
@msg Shape Builder: no region under the pointer Tvorba tvarů: pod ukazatelem není žádná oblast
@msg Fill Area: no enclosed area under the pointer Vyplnit oblast: pod ukazatelem není žádná uzavřená oblast
@msg Shape Builder: select all paths you want to merge Tvorba tvarů: vyberte všechny cesty, které chcete sloučit
@msg Shape Builder: select paths or compound paths Tvorba tvarů: vyberte cesty nebo složené cesty
@msg Show All Hidden Attributes: nothing is hidden Zobrazit všechny skryté atributy: nic není skryto
@@ -10799,6 +10802,15 @@ breakText Glyphs Glyfy
@msg A panel is not joined to the rest by a crease. Panel není se zbytkem spojen žádnou linií bigu.
@msg A fold line is on a non-printing layer. Linie skladu je na netisknutelné vrstvě.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panely: {panels}, panty: {hinges}, chyby: {errors}, upozornění: {warnings}
Nature Icons Ikony přírody
Flower Květina
Tree Strom
Mountain Hora
Ornamental Ornamentální
Scrollwork Rozvilina
Filigree Arrow Filigránový šíp
Petal Sweep Tah okvětních lístků
Twin Curl Dvojitá rozvilina
Vector Packs Vektorové balíčky
Compass Rose Směrová růžice
Botanical Sprig Botanická větvička
Can't render this file because it is too large.
+12
View File
@@ -6282,6 +6282,8 @@ theme Appearance Udseende
Symbolism Tool Symbolværktøj
Image Trace Presets Forudindstillinger til billedsporing
Live Paint Bucket Live Paint-spand
Fill Area Udfyld område
Fill Area Tool Værktøjet Udfyld område
Live Paint Bucket (Stroke) Live Paint-spand (kontur)
Live Paint Info Live Paint-info
Shape Builder Formbygger
@@ -7735,6 +7737,7 @@ imageTrace Outline Kontur
@msg Saved {path} Gemte {path}
@msg Select text or click into text with the Type tool to insert glyphs Markér tekst, eller klik i tekst med tekstværktøjet, for at indsætte glyffer
@msg Shape Builder: no region under the pointer Figurbygger: intet område under markøren
@msg Fill Area: no enclosed area under the pointer Udfyld område: intet lukket område under markøren
@msg Shape Builder: select all paths you want to merge Figurbygger: markér alle kurver, du vil flette
@msg Shape Builder: select paths or compound paths Figurbygger: markér kurver eller sammensatte kurver
@msg Show All Hidden Attributes: nothing is hidden Vis alle skjulte attributter: intet er skjult
@@ -10861,6 +10864,15 @@ breakText Glyphs Glyffer
@msg A joint does not close by {gap} pt. En samling lukker ikke med {gap} pt.
@msg Two panels pass through each other. To paneler går gennem hinanden.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer skal være "singleLine", "everyLine", "standardSingleLine" eller "standardEveryLine"
Nature Icons Naturikoner
Flower Blomst
Tree Træ
Mountain Bjerg
Ornamental Ornamentik
Scrollwork Slyngværk
Filigree Arrow Filigranpil
Petal Sweep Kronbladssvirp
Twin Curl Dobbelt slyng
Vector Packs Vektorpakker
Compass Rose Kompasrose
Botanical Sprig Botanisk kvist
Can't render this file because it is too large.
+12
View File
@@ -2169,6 +2169,8 @@ file-filter Templates Vorlagen
List Workspaces Arbeitsbereiche auflisten
Live Paint Interaktiv malen
Live Paint Bucket Interaktiv-malen-Werkzeug
Fill Area Fläche füllen
Fill Area Tool Fläche-füllen-Werkzeug
Live Paint Bucket (Stroke) Interaktiv-malen-Werkzeug (Kontur)
Live Paint Info Informationen zu „Interaktiv malen“
Live Paint Selection Tool Interaktiv-malen-Auswahlwerkzeug
@@ -5057,6 +5059,7 @@ liquify-list-end {0}, {1} {0} und {1}
@msg Saved {path} {path} gespeichert
@msg Select text or click into text with the Type tool to insert glyphs Wählen Sie Text aus oder klicken Sie mit dem Text-Werkzeug in einen Text, um Glyphen einzufügen
@msg Shape Builder: no region under the pointer Formerstellung: kein Bereich unter dem Zeiger
@msg Fill Area: no enclosed area under the pointer Fläche füllen: kein geschlossener Bereich unter dem Zeiger
@msg Shape Builder: select all paths you want to merge Formerstellung: Wählen Sie alle Pfade aus, die Sie zusammenfügen möchten
@msg Shape Builder: select paths or compound paths Formerstellung: Wählen Sie Pfade oder zusammengesetzte Pfade aus
@msg Show All Hidden Attributes: nothing is hidden Alle ausgeblendeten Attribute einblenden: Es ist nichts ausgeblendet
@@ -10441,6 +10444,15 @@ breakText Glyphs Glyphen
@msg A panel is not joined to the rest by a crease. Ein Feld ist durch keine Rilllinie mit den übrigen verbunden.
@msg A fold line is on a non-printing layer. Eine Faltlinie liegt auf einer nicht druckbaren Ebene.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Felder: {panels}, Scharniere: {hinges}, Fehler: {errors}, Warnungen: {warnings}
Nature Icons Natursymbole
Flower Blume
Tree Baum
Mountain Berg
Ornamental Ornamental
Scrollwork Schnörkel
Filigree Arrow Filigranpfeil
Petal Sweep Blütenblattschwung
Twin Curl Doppelschnörkel
Vector Packs Vektorpakete
Compass Rose Kompassrose
Botanical Sprig Botanischer Zweig
Can't render this file because it is too large.
+12
View File
@@ -2896,6 +2896,7 @@ liquify-list-end {0}, {1} {0} και {1}
@msg Saved {path} Αποθηκεύτηκε το {path}
@msg Select text or click into text with the Type tool to insert glyphs Επιλέξτε κείμενο ή κάντε κλικ μέσα σε κείμενο με το εργαλείο κειμένου για εισαγωγή γλύφων
@msg Shape Builder: no region under the pointer Δημιουργία σχημάτων: δεν υπάρχει περιοχή κάτω από τον δείκτη
@msg Fill Area: no enclosed area under the pointer Γέμισμα περιοχής: δεν υπάρχει κλειστή περιοχή κάτω από τον δείκτη
@msg Shape Builder: select all paths you want to merge Δημιουργία σχημάτων: επιλέξτε όλες τις διαδρομές που θέλετε να συγχωνεύσετε
@msg Shape Builder: select paths or compound paths Δημιουργία σχημάτων: επιλέξτε διαδρομές ή σύνθετες διαδρομές
@msg Show All Hidden Attributes: nothing is hidden Εμφάνιση όλων των κρυφών χαρακτηριστικών: δεν υπάρχουν κρυφά χαρακτηριστικά
@@ -3306,6 +3307,8 @@ theme Appearance Εμφάνιση
List View Προβολή λίστας
List Workspaces Λίστα χώρων εργασίας
Live Paint Bucket Κουβάς δυναμικής βαφής
Fill Area Γέμισμα περιοχής
Fill Area Tool Εργαλείο γεμίσματος περιοχής
Live Paint Bucket (Stroke) Κουβάς δυναμικής βαφής (περίγραμμα)
Live Paint Info Πληροφορίες δυναμικής βαφής
Live Paint Selection Tool Επιλογή δυναμικής βαφής (Live Paint Selection Tool)
@@ -8948,6 +8951,15 @@ breakText Glyphs Γλύφοι
@msg A joint does not close by {gap} pt. Μια ένωση δεν κλείνει κατά {gap} pt.
@msg Two panels pass through each other. Δύο πάνελ διαπερνούν το ένα το άλλο.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" το composer πρέπει να είναι "singleLine", "everyLine", "standardSingleLine" ή "standardEveryLine"
Nature Icons Εικονίδια φύσης
Flower Λουλούδι
Tree Δέντρο
Mountain Βουνό
Ornamental Διακοσμητικά μοτίβα
Scrollwork Σπείρα
Filigree Arrow Φιλιγκράν βέλος
Petal Sweep Καμπύλη πετάλων
Twin Curl Διπλή σπείρα
Vector Packs Διανυσματικά πακέτα
Compass Rose Ρόδο πυξίδας
Botanical Sprig Βοτανικό κλαδάκι
Can't render this file because it is too large.
+12
View File
@@ -2167,6 +2167,8 @@ font-technology Variable Variables
List Workspaces Enumerar espacios de trabajo
Live Paint Pintura interactiva
Live Paint Bucket Bote de pintura interactiva
Fill Area Rellenar área
Fill Area Tool Herramienta Rellenar área
Live Paint Bucket (Stroke) Bote de pintura interactiva (trazo)
Live Paint Info Información de pintura interactiva
Live Paint Selection Tool Herramienta Selección de pintura interactiva
@@ -5168,6 +5170,7 @@ liquify-list-end {0}, {1} {0}, {1}
@msg Saved {path} Se guardó {path}
@msg Select text or click into text with the Type tool to insert glyphs Selecciona texto o haz clic dentro del texto con la herramienta Texto para insertar glifos
@msg Shape Builder: no region under the pointer Generador de formas: no hay ninguna región bajo el puntero
@msg Fill Area: no enclosed area under the pointer Rellenar área: no hay ninguna área cerrada bajo el puntero
@msg Shape Builder: select all paths you want to merge Generador de formas: selecciona todos los trazados que quieras combinar
@msg Shape Builder: select paths or compound paths Generador de formas: selecciona trazados o trazados compuestos
@msg Show All Hidden Attributes: nothing is hidden Mostrar todos los atributos ocultos: no hay nada oculto
@@ -10692,6 +10695,15 @@ breakText Glyphs Glifos
@msg A joint does not close by {gap} pt. Una unión no cierra por {gap} pt.
@msg Two panels pass through each other. Dos paneles se atraviesan entre sí.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer debe ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine"
Nature Icons Iconos de naturaleza
Flower Flor
Tree Árbol
Mountain Montaña
Ornamental Ornamental
Scrollwork Voluta
Filigree Arrow Flecha de filigrana
Petal Sweep Trazo de pétalos
Twin Curl Voluta doble
Vector Packs Paquetes vectoriales
Compass Rose Rosa de los vientos
Botanical Sprig Ramita botánica
Can't render this file because it is too large.
+12
View File
@@ -3739,6 +3739,8 @@ theme Appearance Ulkoasu
Symbolism Tool Symbolityökalu
Image Trace Presets Kuvan jäljityksen esiasetukset
Live Paint Bucket Elävän maalauksen ämpäri
Fill Area Täytä alue
Fill Area Tool Alueen täyttötyökalu
Live Paint Bucket (Stroke) Elävän maalauksen ämpäri (viiva)
Live Paint Info Elävän maalauksen tiedot
Shape Builder Muodonmuodostin
@@ -5409,6 +5411,7 @@ liquify-list-end {0}, {1} {0} ja {1}
@msg Saved {path} Tallennettiin {path}
@msg Select text or click into text with the Type tool to insert glyphs Valitse tekstiä tai napsauta tekstiin tekstityökalulla, niin voit lisätä merkkejä
@msg Shape Builder: no region under the pointer Muodonmuodostin: osoittimen alla ei ole aluetta
@msg Fill Area: no enclosed area under the pointer Täytä alue: osoittimen alla ei ole suljettua aluetta
@msg Shape Builder: select all paths you want to merge Muodonmuodostin: valitse kaikki polut, jotka haluat yhdistää
@msg Shape Builder: select paths or compound paths Muodonmuodostin: valitse polkuja tai yhdistelmäpolkuja
@msg Show All Hidden Attributes: nothing is hidden Näytä kaikki piilotetut attribuutit: mitään ei ole piilotettu
@@ -9031,6 +9034,15 @@ breakText Glyphs Merkit
@msg A joint does not close by {gap} pt. Liitos ei sulkeudu, rako {gap} pt.
@msg Two panels pass through each other. Kaksi paneelia kulkee toistensa läpi.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer on oltava "singleLine", "everyLine", "standardSingleLine" tai "standardEveryLine"
Nature Icons Luontokuvakkeet
Flower Kukka
Tree Puu
Mountain Vuori
Ornamental Koristekuviot
Scrollwork Kiemura
Filigree Arrow Filigraanin nuoli
Petal Sweep Terälehtipyyhkäisy
Twin Curl Kaksoiskiemura
Vector Packs Vektoripaketit
Compass Rose Kompassiruusu
Botanical Sprig Kasvinoksa
Can't render this file because it is too large.
+12
View File
@@ -2157,6 +2157,8 @@ font-technology Variable Variables
List Workspaces Lister les espaces de travail
Live Paint Peinture dynamique
Live Paint Bucket Pot de peinture dynamique
Fill Area Remplir la zone
Fill Area Tool Outil Remplir la zone
Live Paint Bucket (Stroke) Pot de peinture dynamique (contour)
Live Paint Info Informations sur la peinture dynamique
Live Paint Selection Tool Outil Sélection de peinture dynamique
@@ -5126,6 +5128,7 @@ liquify-list-end {0}, {1} {0} et {1}
@msg Saved to User Defined: {_1} Enregistré dans Défini par l’utilisateur : {_1}
@msg Saved {path} {path} enregistré
@msg Select text or click into text with the Type tool to insert glyphs Sélectionnez du texte ou cliquez dans un texte avec l’outil Texte pour insérer des glyphes
@msg Fill Area: no enclosed area under the pointer Remplir la zone : aucune zone fermée sous le pointeur
@msg Shape Builder: no region under the pointer Concepteur de forme : aucune zone sous le pointeur
@msg Shape Builder: select all paths you want to merge Concepteur de forme : sélectionnez tous les tracés à fusionner
@msg Shape Builder: select paths or compound paths Concepteur de forme : sélectionnez des tracés ou des tracés transparents
@@ -10762,6 +10765,15 @@ breakText Glyphs Glyphes
@msg A joint does not close by {gap} pt. Un joint ne se ferme pas, avec un écart de {gap} pt.
@msg Two panels pass through each other. Deux panneaux se traversent.
@msg {_1} × {_2} pixels is too large for GIF (at most 65535 pixels a side): lower the resolution {_1} × {_2} pixels, c’est trop grand pour le GIF (65535 pixels par côté au plus) : réduisez la résolution
Nature Icons Icônes de nature
Flower Fleur
Tree Arbre
Mountain Montagne
Ornamental Ornemental
Scrollwork Volute
Filigree Arrow Flèche filigrane
Petal Sweep Courbe de pétales
Twin Curl Double volute
Vector Packs Packs vectoriels
Compass Rose Rose des vents
Botanical Sprig Rameau botanique
Can't render this file because it is too large.
+11
View File
@@ -2180,6 +2180,8 @@
List Workspaces વર્કસ્પેસની યાદી
Live Paint લાઇવ પેઇન્ટ
Live Paint Bucket લાઇવ પેઇન્ટ બકેટ
Fill Area વિસ્તાર ભરો
Fill Area Tool વિસ્તાર ભરો ટૂલ
Live Paint Bucket (Stroke) લાઇવ પેઇન્ટ બકેટ (સ્ટ્રોક)
Live Paint Info લાઇવ પેઇન્ટ માહિતી
Live Paint Selection Tool લાઇવ પેઇન્ટ પસંદગી ટૂલ
@@ -5669,6 +5671,15 @@ swatch [Registration] [રજિસ્ટ્રેશન]
Standard Single-line Composer સ્ટાન્ડર્ડ સિંગલ-લાઇન કમ્પોઝર
Standard Every-line Composer સ્ટાન્ડર્ડ એવરી-લાઇન કમ્પોઝર
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer આમાંથી એક હોવું જોઈએ: "singleLine", "everyLine", "standardSingleLine" અથવા "standardEveryLine"
Nature Icons પ્રકૃતિ ચિહ્નો
Flower ફૂલ
Tree વૃક્ષ
Mountain પર્વત
Ornamental અલંકારિક
Scrollwork વળાંકવાળી સજાવટ
Filigree Arrow નાજુક કોતરણીવાળું તીર
Petal Sweep પાંખડીઓનો વળાંક
Twin Curl બેવડો વળાંક
Vector Packs વેક્ટર પૅક
Compass Rose દિશાસૂચક ગુલાબ
Botanical Sprig વનસ્પતિ ડાળી
Can't render this file because it contains an unexpected character in line 72 and column 5.
+12
View File
@@ -3195,6 +3195,8 @@ arrowhead Feather पंख
Live curve fitting लाइव वक्र फिटिंग
Live Paint लाइव पेंट
Live Paint Bucket लाइव पेंट बकेट
Fill Area क्षेत्र भरें
Fill Area Tool क्षेत्र भरें टूल
Live Paint Bucket (Stroke) लाइव पेंट बाल्टी (स्ट्रोक)
Live Paint Info लाइव पेंट जानकारी
Live Paint Selection Tool लाइव पेंट सिलेक्शन टूल
@@ -9090,6 +9092,7 @@ liquify-list-end {0}, {1} {0} और {1}
@msg shadings of more than 4096 patches or triangles were left out 4096 से अधिक पैच या त्रिकोणों के छायांकन को छोड़ दिया गया था
@msg shadings whose functions are of an unknown type are filled with their middle colour छायांकन जिसका कार्य अज्ञात प्रकार के होते हैं, उनके मध्य रंग से भरे होते हैं
@msg Shape Builder: no region under the pointer आकृति बिल्डर: सूचक के तहत कोई क्षेत्र नहीं
@msg Fill Area: no enclosed area under the pointer क्षेत्र भरें: सूचक के तहत कोई बंद क्षेत्र नहीं
@msg Shape Builder: select all paths you want to merge आकृति बिल्डर: वे सभी पाथ सिलेक्ट करें जिन्हें आप मर्ज करना चाहते हैं
@msg Shape Builder: select paths or compound paths आकृति बिल्डर: पाथ या मिश्रित पाथ सिलेक्ट करें
@msg Shaper needs 1–64 source paths शेपर के लिए 1–64 स्रोत पाथ चाहिए
@@ -10405,6 +10408,15 @@ theme Appearance अपीयरेंस
@msg A panel is not joined to the rest by a crease. कोई पैनल किसी क्रीज़ लाइन से बाकी से जुड़ा नहीं है।
@msg A fold line is on a non-printing layer. एक फ़ोल्ड लाइन नॉन-प्रिंटिंग लेयर पर है।
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} पैनल: {panels}, हिंज: {hinges}, एरर: {errors}, वॉर्निंग: {warnings}
Nature Icons प्रकृति चिह्न
Flower फूल
Tree पेड़
Mountain पर्वत
Ornamental अलंकरण
Scrollwork अलंकारी घुमाव
Filigree Arrow जालीदार तीर
Petal Sweep पंखुड़ियों का घुमाव
Twin Curl दोहरा घुमाव
Vector Packs वेक्टर पैक
Compass Rose दिशासूचक गुलाब
Botanical Sprig वनस्पति टहनी
Can't render this file because it is too large.
+12
View File
@@ -2681,6 +2681,8 @@ file-filter Templates Sablonok
List Workspaces Munkaterületek listázása
Live Paint Élő festés
Live Paint Bucket Élő festékesvödör
Fill Area Terület kitöltése
Fill Area Tool Területkitöltő eszköz
Live Paint Bucket (Stroke) Élő festékesvödör (körvonal)
Live Paint Info Élő festés adatai
Live Paint Selection Tool Élőfestés-kijelölés
@@ -6466,6 +6468,7 @@ liquify-list-end {0}, {1} {0} és {1}
@msg shadings of more than 4096 patches or triangles were left out kimaradtak a 4096-nál több foltból vagy háromszögből álló árnyalások
@msg shadings whose functions are of an unknown type are filled with their middle colour az ismeretlen típusú függvényt használó árnyalások a középső színükkel kitöltve jelennek meg
@msg Shape Builder: no region under the pointer Alakzatépítő: a mutató alatt nincs terület
@msg Fill Area: no enclosed area under the pointer Terület kitöltése: a mutató alatt nincs zárt terület
@msg Shape Builder: select all paths you want to merge Alakzatépítő: jelöld ki az összes egyesítendő útvonalat
@msg Shape Builder: select paths or compound paths Alakzatépítő: jelölj ki útvonalakat vagy összetett útvonalakat
@msg shortcut for `{k}` must be a string `{k}` billentyűparancsa csak szöveg lehet
@@ -10788,6 +10791,15 @@ breakText Glyphs Glifák
@msg A panel is not joined to the rest by a crease. Egy panelt egyetlen bigvonal sem köt a többihez.
@msg A fold line is on a non-printing layer. Egy hajtásvonal nem nyomtatható rétegen van.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panelek: {panels}, zsanérok: {hinges}, hibák: {errors}, figyelmeztetések: {warnings}
Nature Icons Természetikonok
Flower Virág
Tree Fa
Mountain Hegy
Ornamental Díszítőmotívumok
Scrollwork Kacskaringó
Filigree Arrow Filigrán nyíl
Petal Sweep Sziromív
Twin Curl Kettős kacskaringó
Vector Packs Vektorcsomagok
Compass Rose Iránytűrózsa
Botanical Sprig Növényi ágacska
Can't render this file because it is too large.
+12
View File
@@ -4150,6 +4150,8 @@ theme Appearance Tampilan
Symbolism Tool Alat simbolisme
Image Trace Presets Preset telusur gambar
Live Paint Bucket Ember Live Paint
Fill Area Isi Area
Fill Area Tool Alat Isi Area
Live Paint Bucket (Stroke) Ember Live Paint (guratan)
Live Paint Info Info Live Paint
Shape Builder Pembangun bentuk
@@ -5599,6 +5601,7 @@ imageTrace Outline Kontur
@msg Saved {path} Berhasil menyimpan {path}
@msg Select text or click into text with the Type tool to insert glyphs Pilih teks atau klik di dalam teks dengan alat Teks untuk menyisipkan glif
@msg Shape Builder: no region under the pointer Pembangun Bentuk: tidak ada area di bawah penunjuk
@msg Fill Area: no enclosed area under the pointer Isi Area: tidak ada area tertutup di bawah penunjuk
@msg Shape Builder: select paths or compound paths Pembangun Bentuk: pilih jalur atau jalur majemuk
@msg Show All Hidden Attributes: nothing is hidden Tampilkan semua atribut tersembunyi: tidak ada yang tersembunyi
@msg Split Into Grid: select paths large enough for the grid Bagi menjadi kisi: pilih jalur yang cukup besar untuk kisi
@@ -8633,6 +8636,15 @@ breakText Glyphs Glif
@msg A joint does not close by {gap} pt. Sebuah sambungan tidak menutup sejauh {gap} pt.
@msg Two panels pass through each other. Dua panel saling menembus.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer harus "singleLine", "everyLine", "standardSingleLine", atau "standardEveryLine"
Nature Icons Ikon Alam
Flower Bunga
Tree Pohon
Mountain Gunung
Ornamental Ornamental
Scrollwork Sulur Hias
Filigree Arrow Panah Filigran
Petal Sweep Sapuan Kelopak
Twin Curl Sulur Ganda
Vector Packs Paket Vektor
Compass Rose Mawar Kompas
Botanical Sprig Ranting Botani
Can't render this file because it is too large.
+12
View File
@@ -2209,6 +2209,8 @@ file-filter Templates Modelli
List Workspaces Elenca aree di lavoro
Live Paint Pittura dinamica
Live Paint Bucket Secchiello pittura dinamica
Fill Area Riempi area
Fill Area Tool Strumento Riempi area
Live Paint Bucket (Stroke) Secchiello pittura dinamica (traccia)
Live Paint Info Informazioni pittura dinamica
Live Paint Selection Tool Strumento Selezione pittura dinamica
@@ -5195,6 +5197,7 @@ liquify-list-end {0}, {1} {0} e {1}
@msg Saved {path} Salvato {path}
@msg Select text or click into text with the Type tool to insert glyphs Seleziona del testo o fai clic nel testo con lo strumento Testo per inserire glifi
@msg Shape Builder: no region under the pointer Generatore forme: nessuna regione sotto il puntatore
@msg Fill Area: no enclosed area under the pointer Riempi area: nessuna area chiusa sotto il puntatore
@msg Shape Builder: select all paths you want to merge Generatore forme: seleziona tutti i tracciati da unire
@msg Shape Builder: select paths or compound paths Generatore forme: seleziona tracciati o tracciati composti
@msg Show All Hidden Attributes: nothing is hidden Mostra tutti gli attributi nascosti: non c'è nulla di nascosto
@@ -10475,6 +10478,15 @@ breakText Glyphs Glifi
@msg A panel is not joined to the rest by a crease. Un pannello non è unito al resto da alcuna linea di cordonatura.
@msg A fold line is on a non-printing layer. Una linea di piega si trova su un livello non stampabile.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Pannelli: {panels}, cerniere: {hinges}, errori: {errors}, avvisi: {warnings}
Nature Icons Icone della natura
Flower Fiore
Tree Albero
Mountain Montagna
Ornamental Ornamentale
Scrollwork Voluta
Filigree Arrow Freccia filigranata
Petal Sweep Tratto a petali
Twin Curl Doppia voluta
Vector Packs Pacchetti vettoriali
Compass Rose Rosa dei venti
Botanical Sprig Rametto botanico
Can't render this file because it is too large.
+12
View File
@@ -2479,6 +2479,8 @@ antiAlias Sharp シャープ
List View リスト表示
List Workspaces ワークスペースの一覧
Live Paint Bucket ライブペイントツール
Fill Area 領域を塗りつぶし
Fill Area Tool 領域塗りつぶしツール
Live Paint Bucket (Stroke) ライブペイントツール (線)
Live Paint Info ライブペイント情報
Live Paint Selection Tool ライブペイント選択ツール
@@ -5026,6 +5028,7 @@ swatch Bright Violet ビビッドバイオレット
@msg Live Paint: select paths or compound paths ライブペイント: パスまたは複合パスを選択してください
@msg Live Paint: these paths are too degenerate to paint ライブペイント: これらのパスは形状がつぶれすぎていてペイントできません
@msg Shape Builder: no region under the pointer シェイプ形成ツール: ポインターの下に領域がありません
@msg Fill Area: no enclosed area under the pointer 領域を塗りつぶし: ポインターの下に閉じた領域がありません
@msg Shape Builder: select all paths you want to merge シェイプ形成ツール: 結合するパスをすべて選択してください
@msg Shape Builder: select paths or compound paths シェイプ形成ツール: パスまたは複合パスを選択してください
@msg image data `{_1}` is missing 画像データ `{_1}` が見つかりません
@@ -10538,6 +10541,15 @@ breakText Glyphs 字形
@msg A panel is not joined to the rest by a crease. パネルがどの筋入れ線でも他とつながっていません。
@msg A fold line is on a non-printing layer. 折り線が印刷しないレイヤーにあります。
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} パネル: {panels}、ヒンジ: {hinges}、エラー: {errors}、警告: {warnings}
Nature Icons 自然アイコン
Flower 花
Tree 木
Mountain 山
Ornamental 装飾模様
Scrollwork スクロール装飾
Filigree Arrow フィリグリーの矢
Petal Sweep 花びらの流線
Twin Curl 二重カール
Vector Packs ベクターパック
Compass Rose 羅針盤のバラ
Botanical Sprig 植物の小枝
Can't render this file because it is too large.
+12
View File
@@ -5560,6 +5560,8 @@ theme Appearance იერსახე
Symbolism Tool სიმბოლოების ხელსაწყო
Image Trace Presets გამოსახულების ვექტორიზაციის პრესეტები
Live Paint Bucket ცოცხალი შეღებვის სათლი
Fill Area არის შევსება
Fill Area Tool არის შევსების ხელსაწყო
Live Paint Bucket (Stroke) ცოცხალი შეღებვის სათლი (კონტური)
Live Paint Info ცოცხალი შეღებვის ინფორმაცია
Shape Builder ფიგურების კონსტრუქტორი
@@ -6965,6 +6967,7 @@ font-technology Variable ცვლადი
@msg Saved {path} შენახულია: {path}
@msg Select text or click into text with the Type tool to insert glyphs გლიფების ჩასასმელად მონიშნეთ ტექსტი ან ტექსტის ხელსაწყოთი დაწკაპეთ ტექსტში
@msg Shape Builder: no region under the pointer ფიგურების კონსტრუქტორი: მაჩვენებლის ქვეშ არე არ არის
@msg Fill Area: no enclosed area under the pointer არის შევსება: მაჩვენებლის ქვეშ დახურული არე არ არის
@msg Shape Builder: select all paths you want to merge ფიგურების კონსტრუქტორი: მონიშნეთ ყველა ტრაექტორია, რომლის გაერთიანებაც გსურთ
@msg Shape Builder: select paths or compound paths ფიგურების კონსტრუქტორი: მონიშნეთ ტრაექტორიები ან შედგენილი ტრაექტორიები
@msg Show All Hidden Attributes: nothing is hidden ყველა დამალული ატრიბუტის ჩვენება: დამალული არაფერია
@@ -11085,6 +11088,15 @@ font-script Japanese იაპონური
@msg A joint does not close by {gap} pt. შეერთება არ იხურება {gap} pt-ით.
@msg Two panels pass through each other. ორი პანელი ერთმანეთში გადის.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer უნდა იყოს "singleLine", "everyLine", "standardSingleLine" ან "standardEveryLine"
Nature Icons ბუნების ხატულები
Flower ყვავილი
Tree ხე
Mountain მთა
Ornamental ორნამენტული
Scrollwork ხვეული
Filigree Arrow ფილიგრანული ისარი
Petal Sweep ფურცლების რკალი
Twin Curl ორმაგი ხვეული
Vector Packs ვექტორული პაკეტები
Compass Rose კომპასის ვარდი
Botanical Sprig ბოტანიკური ტოტი
Can't render this file because it is too large.
+12
View File
@@ -2469,6 +2469,8 @@ antiAlias Sharp 날카롭게
List View 목록 보기
List Workspaces 작업 영역 목록
Live Paint Bucket 라이브 페인트 통
Fill Area 영역 채우기
Fill Area Tool 영역 채우기 도구
Live Paint Bucket (Stroke) 라이브 페인트 통 (선)
Live Paint Info 라이브 페인트 정보
Live Paint Selection Tool 라이브 페인트 선택 도구
@@ -4955,6 +4957,7 @@ theme Appearance 외관
@msg Live Paint: select paths or compound paths 라이브 페인트: 패스 또는 컴파운드 패스를 선택하세요
@msg Live Paint: these paths are too degenerate to paint 라이브 페인트: 이 패스는 퇴화되어 칠할 수 없습니다
@msg Shape Builder: no region under the pointer 모양 빌더: 포인터 아래에 영역이 없습니다
@msg Fill Area: no enclosed area under the pointer 영역 채우기: 포인터 아래에 닫힌 영역이 없습니다
@msg Shape Builder: select all paths you want to merge 모양 빌더: 병합할 패스를 모두 선택하세요
@msg Shape Builder: select paths or compound paths 모양 빌더: 패스 또는 컴파운드 패스를 선택하세요
@msg image data `{_1}` is missing 이미지 데이터 `{_1}`이(가) 없습니다
@@ -10438,6 +10441,15 @@ breakText Glyphs 글리프
@msg A panel is not joined to the rest by a crease. 패널이 어떤 오시선으로도 나머지와 연결되어 있지 않습니다.
@msg A fold line is on a non-printing layer. 접는 선이 인쇄되지 않는 레이어에 있습니다.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} 패널: {panels}, 힌지: {hinges}, 오류: {errors}, 경고: {warnings}
Nature Icons 자연 아이콘
Flower 꽃
Tree 나무
Mountain 산
Ornamental 장식 문양
Scrollwork 소용돌이 장식
Filigree Arrow 세공 화살표
Petal Sweep 꽃잎 곡선
Twin Curl 이중 소용돌이
Vector Packs 벡터 팩
Compass Rose 나침반 장미
Botanical Sprig 식물 가지
Can't render this file because it is too large.
+12
View File
@@ -4148,6 +4148,8 @@ theme Appearance Vormgeving
Symbolism Tool Symbolisatiegereedschap
Image Trace Presets Voorinstellingen voor afbeeldingtracering
Live Paint Bucket Live Paint-emmer
Fill Area Gebied vullen
Fill Area Tool Gereedschap Gebied vullen
Live Paint Bucket (Stroke) Live Paint-emmer (streek)
Live Paint Info Live Paint-info
Shape Builder Vormopbouw
@@ -5602,6 +5604,7 @@ imageTrace Outline Contour
@msg Saved {path} {path} opgeslagen
@msg Select text or click into text with the Type tool to insert glyphs Selecteer tekst of klik met het tekstgereedschap in tekst om glyphs in te voegen
@msg Shape Builder: no region under the pointer Vormbouwer: geen gebied onder de aanwijzer
@msg Fill Area: no enclosed area under the pointer Gebied vullen: geen gesloten gebied onder de aanwijzer
@msg Shape Builder: select all paths you want to merge Vormbouwer: selecteer alle paden die je wilt samenvoegen
@msg Shape Builder: select paths or compound paths Vormbouwer: selecteer paden of samengestelde paden
@msg Show All Hidden Attributes: nothing is hidden Alle verborgen kenmerken tonen: er is niets verborgen
@@ -10838,6 +10841,15 @@ breakText Glyphs Glyphs
@msg A panel is not joined to the rest by a crease. Een paneel is door geen rillijn met de rest verbonden.
@msg A fold line is on a non-printing layer. Een vouwlijn staat op een laag die niet wordt afgedrukt.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panelen: {panels}, scharnieren: {hinges}, fouten: {errors}, waarschuwingen: {warnings}
Nature Icons Natuurpictogrammen
Flower Bloem
Tree Boom
Mountain Berg
Ornamental Ornamentaal
Scrollwork Krulwerk
Filigree Arrow Filigraanpijl
Petal Sweep Bloemblaadjeszwaai
Twin Curl Dubbele krul
Vector Packs Vectorpakketten
Compass Rose Kompasroos
Botanical Sprig Botanisch takje
Can't render this file because it is too large.
+12
View File
@@ -3681,6 +3681,8 @@ theme Appearance Wygląd
Symbolism Tool Narzędzie symboli
Image Trace Presets Ustawienia obrysu obrazu
Live Paint Bucket Wiadro aktywnego malowania
Fill Area Wypełnij obszar
Fill Area Tool Narzędzie Wypełnij obszar
Live Paint Bucket (Stroke) Wiadro aktywnego malowania (obrys)
Live Paint Info Informacje o aktywnym malowaniu
Shape Builder Kreator kształtów
@@ -5300,6 +5302,7 @@ liquify-list-end {0}, {1} {0} i {1}
@msg Saved {path} Zapisano {path}
@msg Select text or click into text with the Type tool to insert glyphs Zaznacz tekst lub kliknij w tekst narzędziem Tekst, aby wstawić glify
@msg Shape Builder: no region under the pointer Kreator kształtów: brak obszaru pod wskaźnikiem
@msg Fill Area: no enclosed area under the pointer Wypełnij obszar: brak zamkniętego obszaru pod wskaźnikiem
@msg Shape Builder: select all paths you want to merge Kreator kształtów: zaznacz wszystkie ścieżki, które chcesz scalić
@msg Shape Builder: select paths or compound paths Kreator kształtów: zaznacz ścieżki lub ścieżki złożone
@msg Show All Hidden Attributes: nothing is hidden Pokaż wszystkie ukryte atrybuty: nic nie jest ukryte
@@ -10664,6 +10667,15 @@ breakText Glyphs Glify
@msg A panel is not joined to the rest by a crease. Panel nie jest połączony z resztą żadną linią bigowania.
@msg A fold line is on a non-printing layer. Linia zgięcia znajduje się na warstwie niedrukowanej.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panele: {panels}, zawiasy: {hinges}, błędy: {errors}, ostrzeżenia: {warnings}
Nature Icons Ikony natury
Flower Kwiat
Tree Drzewo
Mountain Góra
Ornamental Ornamentalne
Scrollwork Zawijas
Filigree Arrow Filigranowa strzałka
Petal Sweep Smuga płatków
Twin Curl Podwójny zawijas
Vector Packs Pakiety wektorowe
Compass Rose Róża wiatrów
Botanical Sprig Gałązka botaniczna
Can't render this file because it is too large.
+12
View File
@@ -1829,6 +1829,8 @@ antiAlias Sharp Nítido
List Workspaces Listar Espaços de Trabalho
Live Paint Pintura ao Vivo
Live Paint Bucket Balde de Pintura ao Vivo
Fill Area Preencher área
Fill Area Tool Ferramenta Preencher Área
Live Paint Bucket (Stroke) Balde de Pintura ao Vivo (Traçado)
Live Paint Info Informações da Pintura ao Vivo
Live Paint Selection Tool Ferramenta Seleção de Pintura ao Vivo
@@ -4450,6 +4452,7 @@ axis Both Ambos
@msg Saved {path} {path} salvo
@msg Select text or click into text with the Type tool to insert glyphs Selecione texto ou clique em um texto com a ferramenta Texto para inserir glifos
@msg Shape Builder: no region under the pointer Criador de formas: nenhuma região sob o ponteiro
@msg Fill Area: no enclosed area under the pointer Preencher área: nenhuma área fechada sob o ponteiro
@msg Shape Builder: select all paths you want to merge Criador de formas: selecione todos os traçados que deseja mesclar
@msg Shape Builder: select paths or compound paths Criador de formas: selecione traçados ou traçados compostos
@msg Show All Hidden Attributes: nothing is hidden Mostrar todos os atributos ocultos: nada está oculto
@@ -10871,6 +10874,15 @@ swatch Yellow Green Verde-amarelado
@msg A panel is not joined to the rest by a crease. Um painel não está unido ao restante por nenhuma linha de vinco.
@msg A fold line is on a non-printing layer. Uma linha de dobra está em uma camada não imprimível.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Painéis: {panels}, dobradiças: {hinges}, erros: {errors}, avisos: {warnings}
Nature Icons Ícones da natureza
Flower Flor
Tree Árvore
Mountain Montanha
Ornamental Ornamental
Scrollwork Voluta
Filigree Arrow Seta filigranada
Petal Sweep Traço de pétalas
Twin Curl Voluta dupla
Vector Packs Pacotes vetoriais
Compass Rose Rosa dos ventos
Botanical Sprig Ramo botânico
Can't render this file because it is too large.
+12
View File
@@ -2195,6 +2195,8 @@ file-filter Templates Шаблоны
List Workspaces Перечислить рабочие среды
Live Paint Быстрая заливка
Live Paint Bucket Быстрая заливка (ведро)
Fill Area Заливка области
Fill Area Tool Инструмент «Заливка области»
Live Paint Bucket (Stroke) Быстрая заливка (обводка)
Live Paint Info Сведения о быстрой заливке
Live Paint Selection Tool Инструмент «Выделение быстрой заливки»
@@ -5190,6 +5192,7 @@ liquify-list-end {0}, {1} {0} и {1}
@msg Saved {path} Сохранено: {path}
@msg Select text or click into text with the Type tool to insert glyphs Выделите текст или щёлкните внутри текста инструментом «Текст», чтобы вставить глифы
@msg Shape Builder: no region under the pointer Создание фигур: под указателем нет области
@msg Fill Area: no enclosed area under the pointer Заливка области: под указателем нет замкнутой области
@msg Shape Builder: select all paths you want to merge Создание фигур: выделите все контуры, которые нужно объединить
@msg Shape Builder: select paths or compound paths Создание фигур: выделите контуры или составные контуры
@msg Show All Hidden Attributes: nothing is hidden Показать все скрытые атрибуты: ничего не скрыто
@@ -10855,6 +10858,15 @@ shape Open Открытый
@msg Two panels pass through each other. Две панели проходят друг сквозь друга.
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} пикселей — слишком большой размер для PSD (не более {MAX_SIDE} пикселей по стороне): уменьшите разрешение
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer должен быть "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine"
Nature Icons Значки природы
Flower Цветок
Tree Дерево
Mountain Гора
Ornamental Орнаментальные
Scrollwork Завиток
Filigree Arrow Филигранная стрела
Petal Sweep Лепестковый росчерк
Twin Curl Двойной завиток
Vector Packs Векторные наборы
Compass Rose Роза ветров
Botanical Sprig Ботаническая ветвь
Can't render this file because it is too large.
+12
View File
@@ -2097,6 +2097,8 @@ font-technology Variable Variabla
List Workspaces Lista arbetslayouter
Live Paint Direktmålning
Live Paint Bucket Direktmålningshink
Fill Area Fyll område
Fill Area Tool Verktyget Fyll område
Live Paint Bucket (Stroke) Direktmålningshink (kontur)
Live Paint Info Direktmålningsinfo
Live Paint Selection Tool Markeringsverktyg för direktmålning
@@ -5065,6 +5067,7 @@ liquify-list-end {0}, {1} {0} och {1}
@msg Saved {path} Sparade {path}
@msg Select text or click into text with the Type tool to insert glyphs Markera text eller klicka i text med textverktyget för att infoga glyfer
@msg Shape Builder: no region under the pointer Formbyggare: inget område under pekaren
@msg Fill Area: no enclosed area under the pointer Fyll område: inget slutet område under pekaren
@msg Shape Builder: select all paths you want to merge Formbyggare: markera alla banor du vill sammanfoga
@msg Shape Builder: select paths or compound paths Formbyggare: markera banor eller sammansatta banor
@msg Show All Hidden Attributes: nothing is hidden Visa alla dolda attribut: ingenting är dolt
@@ -10892,6 +10895,15 @@ digits Hindi Hindi
@msg A joint does not close by {gap} pt. En fog sluter inte med {gap} pt.
@msg Two panels pass through each other. Två paneler går igenom varandra.
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} pixlar är för stort för PSD (högst {MAX_SIDE} pixlar per sida): sänk upplösningen
Nature Icons Naturikoner
Flower Blomma
Tree Träd
Mountain Berg
Ornamental Ornament
Scrollwork Snirkel
Filigree Arrow Filigranpil
Petal Sweep Kronbladssvep
Twin Curl Dubbel snirkel
Vector Packs Vektorpaket
Compass Rose Kompassros
Botanical Sprig Botanisk kvist
Can't render this file because it is too large.
+11 -1
View File
@@ -573,6 +573,16 @@ fn objects_on_path_detach_strings_are_in_complete_catalogs() {
}
}
/// The Nature Icons library and its symbols display in each complete UI language.
#[test]
fn nature_symbol_library_names_are_in_complete_catalogs() {
for lang in LANGUAGES.iter().filter(|lang| lang.complete_menus) {
for name in ["Nature Icons", "Leaf", "Flower", "Tree", "Mountain", "Wave"] {
assert!(lang.catalog().plain(name).is_some(), "{} is missing {name}", lang.code);
}
}
}
/// The errors of Perspective Distort and Free Distort on an image, and of the image commands that
/// refuse a distorted image, are in every complete-message catalog.
#[test]
@@ -842,7 +852,7 @@ fn built_in_library_symbol_names_are_in_complete_catalogs() {
.flat_map(|(_, lib)| lib.doc.symbols.iter().map(|s| s.name.clone()).collect::<Vec<_>>())
.collect(),
);
assert_eq!(names.len(), 38, "{names:?}");
assert_eq!(names.len(), 43, "{names:?}");
let bad = lacking(&names, |c, n| c.plain(n).is_some());
assert!(bad.is_empty(), "{}", bad.join("\n"));
}
+12
View File
@@ -1990,6 +1990,8 @@ font-technology Variable Değişken
List Workspaces Çalışma Alanlarını Listeleme
Live Paint Canlı Boyama
Live Paint Bucket Canlı Boyama Kovası
Fill Area Alanı Doldur
Fill Area Tool Alan Doldurma Aracı
Live Paint Bucket (Stroke) Canlı Boya Kovası (Strok)
Live Paint Info Canlı Boyama Bilgisi
Live Paint Selection Tool Canlı Boyama Seçim Aracı
@@ -4900,6 +4902,7 @@ liquify-list-end {0}, {1} {0} ve {1}
@msg Saved {path} {path} kaydedildi
@msg Select text or click into text with the Type tool to insert glyphs Glif eklemek için metni seçin veya Yazım aracıyla metne tıklayın
@msg Shape Builder: no region under the pointer Şekil Oluşturucu: işaretçinin altında bölge yok
@msg Fill Area: no enclosed area under the pointer Alanı Doldur: işaretçinin altında kapalı alan yok
@msg Shape Builder: select all paths you want to merge Şekil Oluşturucu: birleştirmek istediğiniz tüm yolları seçin
@msg Shape Builder: select paths or compound paths Şekil Oluşturucu: yolları veya bileşik yolları seçin
@msg Show All Hidden Attributes: nothing is hidden Tüm Gizli Özellikleri Göster: hiçbir şey gizli değildir
@@ -10757,6 +10760,15 @@ breakText Glyphs Glifler
@msg A panel is not joined to the rest by a crease. Bir panel geri kalanlara hiçbir pilyaj çizgisiyle bağlı değil.
@msg A fold line is on a non-printing layer. Bir katlama çizgisi yazdırılmayan bir katmanda.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneller: {panels}, menteşeler: {hinges}, hatalar: {errors}, uyarılar: {warnings}
Nature Icons Doğa simgeleri
Flower Çiçek
Tree Ağaç
Mountain Dağ
Ornamental Süslemeli
Scrollwork Kıvrım süsü
Filigree Arrow Telkari ok
Petal Sweep Yaprakçık kıvrımı
Twin Curl Çift kıvrım
Vector Packs Vektör Paketleri
Compass Rose Pusula Gülü
Botanical Sprig Botanik Dal
Can't render this file because it is too large.
+12
View File
@@ -2203,6 +2203,8 @@ file-filter Templates Шаблони
List Workspaces Перелічити робочі середовища
Live Paint Швидка заливка
Live Paint Bucket Швидка заливка (відро)
Fill Area Заливка області
Fill Area Tool Інструмент «Заливка області»
Live Paint Bucket (Stroke) Швидка заливка (обведення)
Live Paint Info Відомості про швидку заливку
Live Paint Selection Tool Інструмент «Виділення швидкої заливки»
@@ -5179,6 +5181,7 @@ liquify-list-end {0}, {1} {0} і {1}
@msg Saved {path} Збережено: {path}
@msg Select text or click into text with the Type tool to insert glyphs Виділіть текст або клацніть всередині тексту інструментом «Текст», щоб вставити гліфи
@msg Shape Builder: no region under the pointer Створення фігур: під вказівником немає області
@msg Fill Area: no enclosed area under the pointer Заливка області: під вказівником немає замкненої області
@msg Shape Builder: select all paths you want to merge Створення фігур: виділіть усі контури, які потрібно об’єднати
@msg Shape Builder: select paths or compound paths Створення фігур: виділіть контури або складені контури
@msg Show All Hidden Attributes: nothing is hidden Показати всі приховані атрибути: нічого не приховано
@@ -10451,6 +10454,15 @@ breakText Glyphs Гліфи
@msg A panel is not joined to the rest by a crease. Панель не з’єднана з рештою жодною лінією біговки.
@msg A fold line is on a non-printing layer. Лінія згину лежить на шарі, що не друкується.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Панелі: {panels}, шарніри: {hinges}, помилки: {errors}, попередження: {warnings}
Nature Icons Значки природи
Flower Квітка
Tree Дерево
Mountain Гора
Ornamental Орнаментальні
Scrollwork Завиток
Filigree Arrow Філігранна стріла
Petal Sweep Пелюстковий розчерк
Twin Curl Подвійний завиток
Vector Packs Векторні набори
Compass Rose Роза вітрів
Botanical Sprig Ботанічна гілочка
Can't render this file because it is too large.
+12
View File
@@ -2519,6 +2519,8 @@ digits Hindi Hindi
List Workspaces Liệt kê không gian làm việc
Live Paint Tô trực tiếp
Live Paint Bucket Xô Tô trực tiếp
Fill Area Tô vùng
Fill Area Tool Công cụ Tô vùng
Live Paint Bucket (Stroke) Xô Tô trực tiếp (Nét)
Live Paint Info Thông tin Tô trực tiếp
Live Paint Selection Tool Công cụ Chọn Tô trực tiếp
@@ -6169,6 +6171,7 @@ liquify-list-end {0}, {1} {0} và {1}
@msg shadings of more than 4096 patches or triangles were left out các vùng tô có hơn 4096 mảnh hoặc tam giác đã bị bỏ qua
@msg shadings whose functions are of an unknown type are filled with their middle colour các vùng tô có hàm loại không xác định được tô bằng màu giữa
@msg Shape Builder: no region under the pointer Xây dựng hình dạng: không có vùng nào dưới con trỏ
@msg Fill Area: no enclosed area under the pointer Tô vùng: không có vùng kín nào dưới con trỏ
@msg Shape Builder: select all paths you want to merge Xây dựng hình dạng: chọn tất cả đường dẫn bạn muốn hợp nhất
@msg Shape Builder: select paths or compound paths Xây dựng hình dạng: chọn đường dẫn hoặc đường dẫn phức
@msg shortcut for `{k}` must be a string phím tắt cho `{k}` phải là chuỗi
@@ -8648,6 +8651,15 @@ breakText Glyphs Glyph
@msg {width} × {height} pixels is too large for Targa (at most 65535 pixels a side): lower the resolution {width} × {height} điểm ảnh quá lớn cho Targa (tối đa 65535 điểm ảnh mỗi cạnh): hãy giảm độ phân giải
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} điểm ảnh quá lớn cho PSD (tối đa {MAX_SIDE} điểm ảnh mỗi cạnh): hãy giảm độ phân giải
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer phải là "singleLine", "everyLine", "standardSingleLine" hoặc "standardEveryLine"
Nature Icons Biểu tượng thiên nhiên
Flower Hoa
Tree Cây
Mountain Núi
Ornamental Hoa văn
Scrollwork Nét cuộn
Filigree Arrow Mũi tên hoa văn
Petal Sweep Nét cánh hoa
Twin Curl Nét cuộn đôi
Vector Packs Bộ cọ véc-tơ
Compass Rose Hoa la bàn
Botanical Sprig Cành cây
Can't render this file because it is too large.
+12
View File
@@ -2079,6 +2079,8 @@ file-filter Templates 模板
List Workspaces 列出工作区
Live Paint 实时上色
Live Paint Bucket 实时上色工具
Fill Area 填充区域
Fill Area Tool 填充区域工具
Live Paint Bucket (Stroke) 实时上色工具 (描边)
Live Paint Info 实时上色信息
Live Paint Selection Tool 实时上色选择工具
@@ -4736,6 +4738,7 @@ imageTrace Outline 轮廓
@msg Live Paint: select paths or compound paths 实时上色:请选择路径或复合路径
@msg Live Paint: these paths are too degenerate to paint 实时上色:这些路径过于退化,无法上色
@msg Shape Builder: no region under the pointer 形状生成器:指针下方没有区域
@msg Fill Area: no enclosed area under the pointer 填充区域:指针下方没有封闭区域
@msg Shape Builder: select all paths you want to merge 形状生成器:请选择要合并的所有路径
@msg Shape Builder: select paths or compound paths 形状生成器:请选择路径或复合路径
@msg image data `{_1}` is missing 缺少图像数据 `{_1}`
@@ -10642,6 +10645,15 @@ breakText Glyphs 字形
@msg A joint does not close by {gap} pt. 有一处接缝相差 {gap} pt 未闭合。
@msg Two panels pass through each other. 两个面板相互穿插。
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} 像素对 PSD 而言过大 (每边最多 {MAX_SIDE} 像素):请降低分辨率
Nature Icons 自然图标
Flower 花朵
Tree 树木
Mountain 山脉
Ornamental 装饰纹样
Scrollwork 卷饰
Filigree Arrow 花丝箭头
Petal Sweep 花瓣曲线
Twin Curl 双重卷饰
Vector Packs 矢量画笔包
Compass Rose 罗盘玫瑰
Botanical Sprig 植物枝条
Can't render this file because it is too large.
+12
View File
@@ -2083,6 +2083,7 @@ file-filter Templates 範本
@msg Live Paint: select paths or compound paths 即時上色:請選取路徑或複合路徑
@msg Live Paint: these paths are too degenerate to paint 即時上色:這些路徑過度退化,無法上色
@msg Shape Builder: no region under the pointer 形狀建立:指標下方沒有區域
@msg Fill Area: no enclosed area under the pointer 填滿區域:指標下方沒有封閉區域
@msg Shape Builder: select all paths you want to merge 形狀建立:請選取要合併的所有路徑
@msg Shape Builder: select paths or compound paths 形狀建立:請選取路徑或複合路徑
@msg image data `{_1}` is missing 找不到影像資料 `{_1}`
@@ -3477,6 +3478,8 @@ liquify-list-end {0}, {1} {0}和{1}
List Workspaces 列出工作區
Live Paint 即時上色
Live Paint Bucket 即時上色油漆桶
Fill Area 填滿區域
Fill Area Tool 填滿區域工具
Live Paint Bucket (Stroke) 即時上色油漆桶 (筆畫)
Live Paint Info 即時上色資訊
Live Paint Selection Tool 即時上色選取工具
@@ -10458,6 +10461,15 @@ breakText Glyphs 字符
@msg A joint does not close by {gap} pt. 有一處接縫相差 {gap} pt 未閉合。
@msg Two panels pass through each other. 兩個面板相互穿插。
@msg {what} would print on more than {MAX_TILES} tiles: scale it down {what} 會列印在超過 {MAX_TILES} 個拼貼上:請縮小
Nature Icons 自然圖示
Flower 花朵
Tree 樹木
Mountain 山脈
Ornamental 裝飾紋樣
Scrollwork 卷飾
Filigree Arrow 花絲箭頭
Petal Sweep 花瓣曲線
Twin Curl 雙重卷飾
Vector Packs 向量筆刷包
Compass Rose 羅盤玫瑰
Botanical Sprig 植物枝條
Can't render this file because it is too large.
+1
View File
@@ -85,6 +85,7 @@ pub static ICONS: &[(&str, &[u8])] = &[
("dc-draw-inside", include_bytes!("../../../assets/icons/dc-draw-inside.svg")),
("dc-draw-normal", include_bytes!("../../../assets/icons/dc-draw-normal.svg")),
("dc-ellipse", include_bytes!("../../../assets/icons/dc-ellipse.svg")),
("dc-fill-area", include_bytes!("../../../assets/icons/dc-fill-area.svg")),
("dc-fill-none", include_bytes!("../../../assets/icons/dc-fill-none.svg")),
("dc-filter", include_bytes!("../../../assets/icons/dc-filter.svg")),
("dc-flare", include_bytes!("../../../assets/icons/dc-flare.svg")),
+1
View File
@@ -81,6 +81,7 @@ pub fn tool_icon(name: &str) -> &'static str {
"tool-puppet" => "dc-puppet",
"tool-shape-builder" => "dc-shape-builder",
"tool-bucket" => "dc-live-bucket",
"tool-fill-area" => "dc-fill-area",
"tool-live-select" => "dc-live-select",
"tool-perspective" => "dc-perspective",
"tool-perspective-select" => "dc-perspective",
+1 -1
View File
@@ -1176,7 +1176,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
"tool.options",
"Tool Options…",
"",
"{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's To Line truncated
"{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's To Line truncated
),
(
"ui.colorGuideOptions",
+27 -6
View File
@@ -926,8 +926,28 @@ fn shows_targeted(view: &View, n: &Node, is_sel: bool) -> bool {
}
}
/// The target circle of `n`'s row at `c`: a ring, doubled while `n` is targeted, filled when `n`
/// has an appearance or transparency of its own. Its response is clicked to target `n`; dragging
/// The radius of the inner ring of a targeted item's target circle (the double ring); the outer
/// ring's radius is 5.
pub(super) const TARGET_RING: f32 = 2.8;
/// The width of the inner ring.
pub(super) const TARGET_STROKE: f32 = 1.0;
/// The radius of the dot filling the circle of an item that has an appearance of its own and is
/// not targeted.
pub(super) const TARGET_DOT: f32 = 3.2;
/// The radius of that dot inside a targeted item's inner ring: clear of the ring, so a targeted
/// item with an appearance of its own shows both (#8711).
pub(super) const TARGET_DOT_IN_RING: f32 = 1.5;
/// The marks inside a target circle's outer ring: the inner ring's radius when the item is
/// `targeted`, and the appearance dot's radius when it is `styled` (has an appearance of its own).
/// Each of the four combinations looks different, as the Layers panel's target icons do.
pub(super) fn target_marks(targeted: bool, styled: bool) -> (Option<f32>, Option<f32>) {
let dot = if targeted { TARGET_DOT_IN_RING } else { TARGET_DOT };
(targeted.then_some(TARGET_RING), styled.then_some(dot))
}
/// The target circle of `n`'s row at `c`: a ring, doubled while `n` is targeted, with a dot when
/// `n` has an appearance or transparency of its own ([`target_marks`]). Its response is clicked to target `n`; dragging
/// it carries `n`'s appearance ([`PanelDrag::Appearance`]) onto another row's circle (Alt
/// copies it) or the trash.
fn target_circle(ui: &mut Ui, n: &Node, c: egui::Pos2, h: f32, targeted: bool, actions: &mut Vec<(String, Value)>, t: &Tokens) -> egui::Response {
@@ -946,11 +966,12 @@ fn target_circle(ui: &mut Ui, n: &Node, c: egui::Pos2, h: f32, targeted: bool, a
}
let ring = if held { t.accent } else { t.icon };
ui.painter().circle_stroke(c, 5.0, Stroke::new(if held { 1.5 } else { 1.0 }, ring));
if targeted {
ui.painter().circle_stroke(c, 2.8, Stroke::new(1.0, t.icon));
let (inner, dot) = target_marks(targeted, has_styled_target(n));
if let Some(r) = inner {
ui.painter().circle_stroke(c, r, Stroke::new(TARGET_STROKE, t.icon));
}
if has_styled_target(n) {
ui.painter().circle_filled(c, 3.2, t.icon);
if let Some(r) = dot {
ui.painter().circle_filled(c, r, t.icon);
}
if resp.dragged_by(egui::PointerButton::Primary) {
ui.ctx().set_cursor_icon(egui::CursorIcon::Grabbing);
+58 -2
View File
@@ -7,7 +7,8 @@ use super::*;
fn filled_targets(app: &mut VectorcraftApp, ctx: &egui::Context) -> usize {
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| show(app, ui));
out.textures_delta.clear();
out.shapes.iter().filter(|c| matches!(&c.shape, egui::Shape::Circle(cs) if cs.radius == 3.2 && cs.fill != Color32::TRANSPARENT)).count()
let dot = |r: f32| r == rows::TARGET_DOT || r == rows::TARGET_DOT_IN_RING;
out.shapes.iter().filter(|c| matches!(&c.shape, egui::Shape::Circle(cs) if dot(cs.radius) && cs.fill != Color32::TRANSPARENT)).count()
}
/// A generated `<Kind>` name is translated where painted; an unnamed text object's text never
@@ -417,12 +418,67 @@ fn targeted_rows(app: &mut VectorcraftApp, ctx: &egui::Context) -> Vec<usize> {
let rings: Vec<egui::Pos2> = out
.shapes
.iter()
.filter(|c| matches!(&c.shape, egui::Shape::Circle(cs) if cs.radius == 2.8))
.filter(|c| matches!(&c.shape, egui::Shape::Circle(cs) if cs.radius == rows::TARGET_RING))
.map(|c| c.shape.visual_bounding_rect().center())
.collect();
circles.iter().enumerate().filter(|(_, c)| rings.iter().any(|r| r.distance(**c) < 0.5)).map(|(i, _)| i).collect()
}
/// The marks one headless frame paints inside the outer ring of each target circle, top row
/// first: per circle, its (radius, fill, stroke width) circles, sorted by radius.
fn target_marks_painted(app: &mut VectorcraftApp, ctx: &egui::Context) -> Vec<Vec<(f32, bool, f32)>> {
let (circles, _) = frame(app, ctx, vec![], false);
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| show(app, ui));
out.textures_delta.clear();
circles
.iter()
.map(|c| {
let mut marks: Vec<(f32, bool, f32)> = out
.shapes
.iter()
.filter_map(|s| match &s.shape {
egui::Shape::Circle(cs) if cs.radius < 5.0 && cs.center.distance(*c) < 0.01 => {
Some((cs.radius, cs.fill != Color32::TRANSPARENT, cs.stroke.width))
}
_ => None,
})
.collect();
marks.sort_by(|a, b| a.0.total_cmp(&b.0));
marks
})
.collect()
}
/// A targeted item with an appearance of its own keeps its inner ring in view: the appearance
/// dot sits inside the ring with a gap, so the four looks (neither, targeted, with an appearance,
/// both) differ, as the target icons the Appearance attributes help describes do (#8711).
#[test]
fn a_targeted_circle_with_an_appearance_shows_both_ring_and_dot() {
let (mut app, _layer, [a, b]) = two_rects();
app.session.execute("transparency.set", &json!({"ids": [a.0], "opacity": 30})).unwrap();
let ctx = egui::Context::default();
// Rows top down: the layer, b, a.
let marks = target_marks_painted(&mut app, &ctx);
assert_eq!(marks.len(), 3);
let (neither, styled) = (marks[1].clone(), marks[2].clone());
app.session.execute("layer.target", &json!({"id": b.0})).unwrap();
let targeted = target_marks_painted(&mut app, &ctx)[1].clone();
app.session.execute("layer.target", &json!({"id": a.0})).unwrap();
let both = target_marks_painted(&mut app, &ctx)[2].clone();
// The inner ring is painted, and nothing filled reaches its inner edge.
let ring = both.iter().find(|m| m.0 == rows::TARGET_RING && !m.1).expect("the inner ring");
let inner_edge = ring.0 - ring.2 / 2.0;
let dot = both.iter().find(|m| m.1).expect("the appearance dot");
assert!(dot.0 + dot.2 / 2.0 < inner_edge - 0.5, "the dot {dot:?} covers the ring {ring:?}");
let looks = [&neither, &targeted, &styled, &both];
for (i, x) in looks.iter().enumerate() {
for y in &looks[i + 1..] {
assert_ne!(x, y, "two states look the same: {looks:?}");
}
}
assert_eq!(neither, vec![]);
}
/// A layer added to the selection from its target circle shows as targeted, as an object added
/// the same way does (#8646): with nothing targeted, a layer's circle shows its inner ring while
/// all of its visible, unlocked art is selected, and not while only part of it is.
@@ -200,6 +200,7 @@ fn the_window_menu_and_the_brushes_panel_open_brush_libraries() {
json!("paint"),
json!("pattern-borders"),
json!("decorative"),
json!("ornamental"),
json!("scatter-shapes"),
json!("stipple"),
json!("game-trails"),
@@ -257,6 +258,17 @@ fn the_window_menu_and_the_brushes_panel_open_brush_libraries() {
click(&mut app, &ctx, "Compass Rose", Modifiers::NONE, 4.0);
assert!(has(&app, "Compass Rose") && !has(&app, "Facet Diamond"));
assert_eq!(undo_len(&app), undo + 1);
let r = app.run("window.brushLibrary", json!({"library": "Ornamental"})).unwrap();
assert_eq!((r["open"].as_str(), r["count"].as_u64()), (Some("ornamental"), Some(4)));
let path = app.run("shape.line", json!({"x1": 10, "y1": 100, "x2": 180, "y2": 100})).unwrap()["id"].as_u64().unwrap();
let undo = undo_len(&app);
click(&mut app, &ctx, "Scrollwork", Modifiers::NONE, 5.0);
assert!(has(&app, "Scrollwork") && !has(&app, "Twin Curl"));
assert_eq!(undo_len(&app), undo + 1);
assert_eq!(
app.session.doc().unwrap().doc.node(vectorcraft_doc::NodeId(path)).unwrap().appearance.stroke().unwrap().brush.as_deref(),
Some("Scrollwork")
);
// Without brushes there is nothing to save.
let all: Vec<String> = vectorcraft_brush::library(&app.session.doc().unwrap().doc).into_iter().map(|b| b.name).collect();
app.run("brush.delete", json!({ "names": all })).unwrap();
@@ -153,6 +153,7 @@ fn the_window_menu_and_the_symbols_panel_open_symbol_libraries() {
json!("inventory-icons"),
json!("skill-icons"),
json!("weather-icons"),
json!("nature-icons"),
json!("media-controls"),
]
);
+3 -2
View File
@@ -58,7 +58,7 @@ pub const BASIC: &[(&str, &[&[&str]])] = &[
&[
&["width", "warp", "twirl", "pucker", "bloat", "scallop", "crystallize", "wrinkle"],
&["rotate", "reflect", "scale", "shear", "reshape", "freeTransform", "puppetWarp"],
&["shapeBuilder", "livePaintBucket", "livePaintSelection", "blend"],
&["shapeBuilder", "livePaintBucket", "fillArea", "livePaintSelection", "blend"],
&["dimension"],
],
),
@@ -469,7 +469,8 @@ pub fn open_options(app: &mut VectorcraftApp, tool: &str) -> Result<serde_json::
crate::dialogs::perspective_options::open(app);
Ok(json!({ "dialog": crate::dialogs::perspective_options::KIND }))
}
"shapeBuilder" => Ok(crate::dialogs::shape_builder_options::open(app)),
// Fill Area uses the Shape Builder's Gap Detection and open-filled-path options.
"shapeBuilder" | "fillArea" => Ok(crate::dialogs::shape_builder_options::open(app)),
// The Objects on Path tool: the Pivot and Rotate of the objects it attaches next.
"objectsOnPath" => Ok(crate::dialogs::objects_on_path_options::open(app)),
// The Line Segment, Arc and grid tools: their Tool Options, the options of their next
+9
View File
@@ -764,6 +764,15 @@ fn menu_access_stationary_pointer_repeat_and_rerun_do_not_retarget_or_double_inv
assert_eq!(s.app.ui.view.rulers, !before, "one Text/Key pair invokes exactly once across passes");
s.end_access();
// Wait for any background font scan and ensure > 20 families even on minimal runners.
let db = vectorcraft_text::FontDb::global();
let _ = db.families();
for i in 0..24 {
if db.menu_family_list_now().len() > 20 {
break;
}
db.add_font(vectorcraft_testkit::fonts::renamed(&format!("Menu Test Font {i:02}")));
}
let text = s.app.run("text.create", json!({"x": 250, "y": 200, "text": "Menu", "font": "Inter", "size": 12})).unwrap()["id"].clone();
s.app.run("select.set", json!({"ids": [text]})).unwrap();
let size = vec2(640.0, 420.0);
+2 -1
View File
@@ -713,7 +713,8 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi
Libraries Menu open each library in a library panel of its own (seven original libraries generated in code,
Basic Shapes, UI Frames with default 9-slice guides on Panel, Button and Bar, Map Markers with Pin,
Flag, Crosshair and Checkpoint, Inventory Icons with Sword, Shield, Potion, Key and Gem, Skill Icons with
Attack, Defend, Heal, Buff and Ult, Weather Icons with Sun, Moon, Cloud, Rain, Thunder and Snow, and Media Controls with
Attack, Defend, Heal, Buff and Ult, Weather Icons with Sun, Moon, Cloud, Rain, Thunder and Snow, Nature Icons with Leaf, Flower, Tree,
Mountain and Wave, and Media Controls with
Play, Pause, Stop, Skip Next, Shuffle and Repeat; User Defined; Other
Library… reads the symbols of any document VectorCraft opens); a click
adds a symbol to the document's Symbols with its Symbol Options and the resources it uses, as one undo
+32 -3
View File
@@ -2388,7 +2388,7 @@ and `type.fractionalWidths`; `flip` in `type.dynamicTextPreset`; `remove` and `o
`swatch.addUsedColors`; `visible` in `appearance.setItem`; `copy` in `appearance.transfer`; `reverse` and `append` in
`appearance.copyFrom`; `reverse` and `stroke` in `paint.editGradient`; `stroke` in `paint.setGradientGeom` and in
`paint.freeform.addPoint`, `setPoint`, `deletePoint`, `addLine`, `splitLine` and `get`; `erase`,
`openFilledAsClosed` and `splitStroke` in `shapeBuilder.merge`; `openFilledAsClosed` in `shapeBuilder.regions`; `closeGaps` in `livePaint.gapOptions`; and
`openFilledAsClosed` and `splitStroke` in `shapeBuilder.merge`; `openFilledAsClosed` in `shapeBuilder.regions` and `shapeBuilder.copyRegion`; `closeGaps` in `livePaint.gapOptions`; and
`enhanced` in `imageTrace.make` and `imageTrace.makeAndExpand`. A null is read as a key left out.
These commands refuse a string or another value that is not a number with `` `radius` must be a number, not "2" ``,
@@ -2409,7 +2409,7 @@ and `fitMinPercent` in `text.areaOptions`; `x` and `y` in `symbol.place`; `radiu
`symbol.spray`; `radius` and `intensity` in `symbol.adjust`; `to` in `swatch.move`; `weight` and `opacity` in
`appearance.setItem`; `r`, `g`, `b`, `c`, `m`, `y`, `k`, `gray` and `tint` in `edit.colors.adjustBalance`; `steps`
and `amount` in `color.harmony`; `angle` in `paint.editGradient` and in the `gradient` of a command that takes a paint; `t` in
`paint.freeform.splitLine`; `tolerance` and `gap` in `shapeBuilder.merge`; `gap` in `shapeBuilder.regions`; and
`paint.freeform.splitLine`; `tolerance` and `gap` in `shapeBuilder.merge`; `gap` in `shapeBuilder.regions` and `shapeBuilder.copyRegion`; and
`width` and `tolerance` in `livePaint.strokeEdge`. A null is read as a key left out. A gradient stop that names a
swatch refuses a `tint` that is not a number with `` stop 0: `tint` must be a number ``.
@@ -5875,7 +5875,7 @@ left out.
## Symbol libraries
Symbol libraries are read-only sets of symbols: seven generated in code (Basic Shapes, UI Frames, Map Markers,
Inventory Icons, Skill Icons, Weather Icons, Media Controls), the `.vectorcraft` files in
Inventory Icons, Skill Icons, Weather Icons, Nature Icons with Leaf, Flower, Tree, Mountain and Wave, Media Controls), the `.vectorcraft` files in
the user library folder of the desktop app (User Defined) and the symbols of any document loaded with
`symbol.loadLibrary`. `symbol.libraries` lists them (`id`, `name`, `category`: `builtIn`, `user` or `loaded`, `count`)
and `symbol.library {library}` returns one's symbols (`name`, `size`, `registration`, `exportType`; `library` is an
@@ -13565,6 +13565,35 @@ a stroke when it has `rect`. With both `rect` and `points`, the command also tou
{"name":"run_command","arguments":{"command":"shapeBuilder.merge","params":{"rect":[50,50,200,200]}}}
```
The Fill Area tool (`fillArea`, in the Live Paint Bucket's group) adds a new closed path of the area under a click
and leaves the paths around it as they are. Nothing needs to be selected: the visible, unlocked paths on every layer
bound areas, filled or not, open paths included, and the overlap of two filled shapes is an area of its own. While the
pointer hovers an area, the tool outlines it in red and the pointer shows the bucket with paint; elsewhere the pointer
shows the empty bucket, and a click there does nothing. The new path appears on the press and is kept on the release;
Escape or a canceled touch before the release takes it back. In a document of more than 128 path segments the tool looks
for the hovered area on another thread, and the outline appears when that search is done. The tool sends `shapeBuilder.copyRegion` with `point`, the Shape Builder's gap
length (`gap`, 0 with Gap Detection off) and its `openFilledAsClosed`: the two tools share `gapDetection`, `gapLength`
and `openFilledAsClosed`, so `tool.setOption` on either one sets them for both, and `fillArea` has no other options.
Double-clicking the Fill Area tool opens the Shape Builder Tool Options (`tool.options {tool: "fillArea"}`, dialog
`shapeBuilderOptions`).
The new path takes the current fill, stroke and stroke weight (`fill` and `stroke` override the paints), goes directly
above the front-most object along the area (one whose outline touches the area's outline, or that covers it) and is
selected. When a group, Live Paint group, Shaper group or clipping group holds that object, the new path goes above the
outermost group in its layer, not inside it, and the group keeps its members. In isolation mode only the paths in
the isolated layer or group bound areas, for the tool's hover and click and for the command (with `ids`, only the
paths of the listed objects that are in it), and the new path goes inside the isolated layer or group, directly above
the object in it that holds that path. No area is found while the isolated object is not a layer or group (a path
or compound path), is a Live Paint group, compound shape, Shaper group, graph, Image Trace result, dimension, flare or
Objects on Path group, is a layer or group with a live effect or a clipping mask, or lies inside one of these or
inside an envelope. A point in no enclosed area is the error "Fill Area: no enclosed area under the pointer" and records no undo
step; a `gap` outside 0 to 72 is an error. It returns `{id, above}`. The command looks for the area among the paths
near the point first. When the paths together have more than 65,536 segments and the paths near the point do not
enclose it, the point counts as in no enclosed area.
```json
{"name":"run_command","arguments":{"command":"shapeBuilder.copyRegion","params":{"point":[50,70],"gap":3}}}
```
## Perspective grid
The grid is document data (`perspective.grid.set` edits the model directly). `perspective.grid.get` reads it:
+3 -2
View File
@@ -1,6 +1,6 @@
# Roadmap: milestones and what's next
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (M11: Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: M5: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame (an edit that changes more than half of the frame, or a change of more than the view and the document, still renders it whole at once), and edits that go on once the view is still don't put off its render (#8688); scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); M11: a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: M4: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: M4: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, #8200; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: M4: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, #8128; scores and estimates unchanged; previously: import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: M1: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: PDF export writes the document language as the catalog's `/Lang`, #3644; M1: an Alt-drag in the Layers panel copies a row above or below its own place, #8237; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regresLine truncated
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (M1: Layers: a targeted item with an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the target circle's four looks differ, #8711; scores and estimates unchanged; previously: M11: Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: M5: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame (an edit that changes more than half of the frame, or a change of more than the view and the document, still renders it whole at once), and edits that go on once the view is still don't put off its render (#8688); scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); M11: a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: M4: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: M4: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, #8200; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: M4: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, #8128; scores and estimates unchanged; previously: import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: M1: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: PDF export writes the document language as the catalog's `/Lang`, #3644; M1: an Alt-drag in the Layers panel copies a row above or below its own place, #8237; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a Line truncated
>
> Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865).
>
@@ -178,7 +178,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule
| # | Milestone | Status | Est. remaining, one agent (h) |
|---|---|---|---|
| M0 | Skeleton + vertical slice | ✅ done | — |
| M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (path and compound-path interior selection follows enabled fill rows (#6625); a marquee leaves locked or hidden guide paths out inside groups, as clicks do (#8538); hidden-fill and no-fill stroke cap/join CPU regressions passed; document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them) | 4–6 |
| M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (a targeted Layers item with an appearance of its own shows its inner ring around a smaller appearance dot (#8711); path and compound-path interior selection follows enabled fill rows (#6625); a marquee leaves locked or hidden guide paths out inside groups, as clicks do (#8538); hidden-fill and no-fill stroke cap/join CPU regressions passed; document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them) | 4–6 |
| M2 | Drawing tools + smart guides | ✅ mostly done (Eraser preserves fill outside fixed and varied tip sweeps and Alt-drag marquees on fill-only open paths and keeps their compound holes; clipping masks retain surviving contours or empty geometry in the same node; ordinary Group/Layer paints and evaluated gradient placements are preserved when the stored paint reproduces their appearance; hidden Rasterize and Along/Across stroke rows do not block visible gradients; replacement-art effects, plug-ins/Rasterize, along/across-stroke gradients and placements that cannot be reproduced keep their existing fitting; stroked open paths retain main behavior (#6582); #3380 deletion creates independent selected path pieces and keeps bounds-fitted gradients in place; endpoint highlighting remains open; Polygon/Star exact-size count persistence, with repeated-drag, tool-switch and Cancel regression coverage; Curvature point markers without direction handles (#1236, in part); Direct Selection segment click/Delete preserves neighboring edges, #1278; Flare, Reshape, Live Corners widget dragging and per-corner radii and kinds landed, on any path's corners; Shaper rough-shape recognition and orientation steps, the remaining Pen modifier nuances; Shaper Groups with editable sources and separate fill/stroke edits landed; custom ruler origin with drag preview, active-artboard reset, relative X/Y fields and native round-trip (#1212); construction widget/refinements pending); a shape just drawn moves by its centre point and turns from the zone outside a corner with its tool still active (#5477); Tangent and straight-segment perpendicular snapping use saved Smart Guides Geometric Guides preferences and Control bar quick access (#2537), including the existing Snap to Glyph and Alignment Guides toggles (#6164); no View submenu; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123); Scissors hover and cuts use the Pen's path/align/intersect/anchor snaps, with Alt Add Anchor and cut endpoint selection retained (#6470); Scissors previews the current anchor or curve cut point (#8655) | 12–18 |
| M3 | Paint & appearance (swatches, color, gradient, stroke, appearance, transparency, styles) | ✅ done (M3.7–M3.98): swatches, groups, libraries, tints, Lab spots and Registration; Eyedropper copies transformed character dimensions (#6404) and styles highlighted text only (atomic transparency rejection); Eyedropper reads visible locked and outside-isolation sources (#1251); Color Picker, Color panel (its spectrum grows with a resized panel, #8005), Color Guide, Color Themes, Edit Colors and Recolor Artwork (screen-bounded Edit chip list, #3416; native Lab entry and swatch libraries in the picker, Assign-row menus, #8031/#4028); gradients that follow every transform, the annotator, linked stops, freeform gradients, focal points, gradients on strokes and Expand; visible strokes when paint is added to inherited None/zero-width art (#1253); stroke geometry, arrowheads, dashes fitted to corners, stroke on type, width profiles and the Width tool (Shift-double-click enables adjoining adjustment in Width Point Edit; finite-arithmetic follow-up regressions and full CI passed ([Validation evidence](target-app-parity.md#evidence-what-ships-today-by-area))), Scale Strokes and preview bounds; Appearance targeting, container appearance, target circles, Expand Appearance; knockout, isolation, blend accuracy, CMYK blending, overprint, Attributes, masks and clipping, Flatten Transparency; graphic styles, links and libraries; CSS library export preserves fractional linear and radial gradient stop positions. Left: freeform gradients in SVG/PDF, mixed spot/process gradients in SVG and PDF gradients mixing a spot color with RGB or Lab stops export as stops or process colors; PDF export writes dithered gradient fills with spot stops, and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, as images in process colors; confirm the Scale Strokes & Effects default; Recolor model selection is available through the engine and MCP only (#2520); the dialog retains its existing controls; Library panels' lists (swatch, Color Book, brush, symbol and graphic style libraries) fill a taller panel above its footer (#2992; scores and estimates unchanged); Graphic Styles list fills a taller panel above its footer (#2992; scores and estimates unchanged); Swatches list fills a taller panel above its footer (#1638; `the_list_fills_a_tall_panel_above_its_footer`; scores and estimates unchanged); | 4–8 |
| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths (#8128; estimates unchanged); Production Preflight checks fonts, overflow, links and image resolution with clickable findings and automatic rechecking (VectorCraft addition; estimates unchanged); PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; a `TJ` over more than 65 lines (the 64 its fill pass finished, kept back, and the open one) stays a filled object and a stroked one for each part (#8543; estimates unchanged); PDF import: type filled and stroked after a page of type filled only (more than 64 lines) comes in as one filled and stroked type object again, with or without a path between, and a `TJ` over more lines than are kept with a glyph kept as an outline still stays a filled object and a stroked one for each part (#8549 follow-up; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding Line truncated
@@ -235,6 +235,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours
| Date | Change | Summary |
|---|---|---|
| 2026-11-19 | minor | M1: Layers: a target circle whose item is targeted and has an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the four looks (not targeted, targeted, with an appearance, both) differ (#8711). Scores and estimates unchanged. |
| 2026-11-19 | minor | M11: View › Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid; a ruler drag or double-click makes no guide meanwhile (#8363). Scores and estimates unchanged |
| 2026-11-19 | minor | Scissors previews its actual anchor or curve cut point with a native point marker while hovering, retaining existing snapping, Alt Add Anchor and cut behavior (#8655). Scores and estimates unchanged. |
| 2026-11-19 | minor | M5: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame (an edit that changes more than half of the frame, or a change of more than the view and the document, still renders it whole at once), and edits that go on once the view is still don't put off its render (#8688). Scores and estimates unchanged. |
+7 -2
View File
@@ -1,6 +1,6 @@
# Parity with Adobe Illustrator
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (Pencil: Edit Selected Paths follows strokes lifted away, carves, loops, closes and redraws compound paths (#3793), scores unchanged; previously: Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: G12: Brushes panel: item right-click context menu (Brush Options, Duplicate Brush, Delete Brush) with selection handling; scores and estimates unchanged; previously: Graphic Styles panel: right-click item context menu for tiles and rows with Options, Duplicate, Delete, Redefine, Break Link; scores and estimates unchanged; previously: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame, and edits that go on once the view is still don't put off its render (#8688); scores and estimates unchanged; previously: G12: Links panel row context menu (Relink…, Go To Link, Update Link, Edit Original, Show in Folder, Embed Image / Unembed…) with selection handling; scores and estimates unchanged; previously: Artboard tool: Shift held once a move or Alt-copy drag is under way keeps it to the level, upright or 45° line, #8580; scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: #8200: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, its tints linked to the swatch; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: SVG export preserves document units on root width/height for physical units, #864; G11 estimate 8–15 → 6–13 h; previously: Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: #8128: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, so the compound clipping path clips its clipping group; scores and estimates unchanged; previously: import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#Line truncated
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (Pencil Edit Selected Paths follows lifted strokes, carves, loops, closes and redraws compound paths; Layers: a targeted item with an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the target circle's four looks differ, #8711; scores and estimates unchanged; previously: Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: G12: Brushes panel: item right-click context menu (Brush Options, Duplicate Brush, Delete Brush) with selection handling; scores and estimates unchanged; previously: Graphic Styles panel: right-click item context menu for tiles and rows with Options, Duplicate, Delete, Redefine, Break Link; scores and estimates unchanged; previously: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame, and edits that go on once the view is still don't put off its render (#8688); scores and estimates unchanged; previously: G12: Links panel row context menu (Relink…, Go To Link, Update Link, Edit Original, Show in Folder, Embed Image / Unembed…) with selection handling; scores and estimates unchanged; previously: Artboard tool: Shift held once a move or Alt-copy drag is under way keeps it to the level, upright or 45° line, #8580; scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: #8200: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, its tints linked to the swatch; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: SVG export preserves document units on root width/height for physical units, #864; G11 estimate 8–15 → 6–13 h; previously: Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: #8128: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, so the compound clipping path clips its clipping group; scores and estimates unchanged; previously: import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group wLine truncated
>
> Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5).
>
@@ -75,6 +75,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard
| Date | Change | Summary |
|---|---|---|
| 2026-11-19 | minor | Layers: a target circle whose item is targeted and has an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the four looks (not targeted, targeted, with an appearance, both) differ (#8711). Scores and estimates unchanged. |
| 2026-11-19 | minor | G12: Brushes panel item right-click context menu offering Brush Options…, Duplicate Brush, and Delete Brush (disabled if the last remaining brush); right-clicking an unselected brush selects it first, and right-clicking within a multi-selection preserves it offering Duplicate Brushes / Delete Brushes; headless tests in `crates/ui-egui/src/panels/brushes/tests.rs`; scores and estimates unchanged. |
| 2026-11-19 | minor | G12: Links panel row context menu (Relink…, Go To Link, Update Link, Edit Original, Show in Folder, Embed Image / Unembed…); right-clicking an unselected link row selects it first, and right-clicking within a multi-selection preserves it; headless tests in `crates/ui-egui/src/panels/tests_links.rs`; scores and estimates unchanged. |
| 2026-11-19 | minor | PDF import (#8549 follow-up): type filled and stroked after a page of type filled only came in as a filled object and a stroked one: since #8549 lines filled only are kept for a stroke pass too, and the glyphs of the lines finished past the 64 kept were remembered until the next stroke, so `2 Tr (Title) Tj` after more than 64 lines of type filled only took its first stroke for the start of a stroke pass over them, always once more than 4,096 glyphs had been finished so. Those glyphs are now forgotten when anything else is drawn (a path, an image, a Type 3 glyph's art, a change of blend mode or soft mask: nothing is drawn between an operator's fill pass and its stroke pass), and past the first 4,096 glyphs none are remembered instead of every stroke matching. A `TJ` over more lines than are kept still comes in as a filled object and a stroked one for each part, also when it ends where it began, and when a glyph kept as an outline comes before that (the line it starts keeps the glyphs of the lines finished). Remaining: with nothing drawn between them, type filled and stroked at exactly the place, font, size and text of a glyph filled only on a line finished so still comes in as a filled object and a stroked one, as the device can't tell its stroke pass from the start of one over that glyph. Tests: `type_filled_and_stroked_after_a_dense_page_of_filled_type_is_filled_and_stroked`, `type_filled_and_stroked_over_a_finished_glyph_after_a_path_is_filled_and_stroked`, `an_outline_glyph_in_a_tj_over_more_lines_than_are_kept_leaves_fill_and_stroke_apart`; scores and estimates unchanged. |
@@ -756,6 +757,7 @@ since 2026-10-01.
- **Large Shift-marquee selections and Select › Inverse:** `select.toggle` and `select.add` with many ids (a Shift-drag marquee sends them together) go through the selection once instead of once per id, and Select › Inverse looks each object up in a set of the selected ones. The resulting selection, its order and the reply are the same as before. With 50,000 objects the selection step of toggling every object off took 528 to 655 ms before and 2.5 to 4.6 ms after in 7 runs, wall clock on a machine that was running other builds (`cargo run --release -p vectorcraft-engine --example selection_bench`). Regression tests: `add_all_does_what_adding_each_does` and `toggle_all_does_what_toggling_each_does` in `crates/doc/src/selection/tests.rs`, and `toggle_and_add_handle_each_listed_id_in_order` in `crates/engine/tests/it/selection_commands.rs`.
- **Shift-click in the Layers panel's selection column on a large layer:** `layer.selectAll {id, add: true}` checks whether the row's art is all selected with a set of the selected objects, and removes or adds that art in one pass instead of once per object. The resulting selection, its order, the reply and the highlighted rows are the same as before. On a layer of 50,000 objects the whole command took a median of 733 ms before and 6.9 ms after when all of the layer's art was selected, and 369 ms before and 24 ms after when every other object was, in 7 runs each, wall clock on Linux while other builds were running (`cargo run --release -p vectorcraft-engine --example layer_select_bench`). Regression test: `a_shift_click_in_the_selection_column_matches_adding_or_removing_each_id` in `crates/engine/src/tests/layers.rs`.
- **Layers added to the selection from their target circles show as targeted (#8646):** with several items picked from their circles (nothing targeted), a layer or sublayer's circle shows its inner ring while all of its visible, unlocked art is selected, as an object's circle does while the object is selected. A layer is never selected itself, only its art, so its circle used to keep a single ring. Regression test: `a_layer_added_from_its_target_circle_shows_as_targeted` in `crates/ui-egui/src/panels/layers/tests.rs`.
- **A targeted item with an appearance of its own shows both marks (#8711):** its target circle keeps the inner ring of a targeted item, with the appearance dot drawn smaller inside it and a gap between them, so not targeted, targeted, with an appearance and both look different, as the target icons in [Appearance attributes](https://helpx.adobe.com/illustrator/using/appearance-attributes.html) do. The dot used to cover the ring. Regression test: `a_targeted_circle_with_an_appearance_shows_both_ring_and_dot` in `crates/ui-egui/src/panels/layers/tests.rs`.
- **Selection passes through raster effects:** clicks with the Selection, Direct Selection and Group Selection tools (Group Selection's repeated click included), the Selection tool's pointer and marquee, Direct Selection's marquee, pointer and anchor highlight, and Group Selection's marquee (E for enclosed objects included) leave out the area that a drop shadow, a glow, a blur or another raster effect paints beyond an object. A click on a shadow selects the object under it, or nothing over an empty canvas, a repeated Group Selection click there adds the groups of the object under it, and a press on the shadow of a selected object does not move it ([the help page](https://helpx.adobe.com/illustrator/using/selecting-objects.html)). Over a shadow, Direct Selection highlights only the anchors of the object under it, and Group Selection keeps its own pointer and highlights no anchor, as it does everywhere (VectorCraft's own rule). No setting changes this. This covers paths, groups, type, symbol instances and images. Regression tests: `crates/engine/src/tests/select_effects.rs`.
- **Symbol instances are selected where their art draws past their box:** a click or a marquee selects a symbol instance where a clipping path in its art, moved or reshaped by its live geometry effects, shows the art past the instance's box, as it selects a group of the same art; a click also selects it where a stroke in its art paints past the box ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-objects/select-objects/select-objects.html)). The rest is VectorCraft's own rule: inside the box the instance is selected as before; in Outline view and below a layer whose Preview is off only the box counts; hidden art and the area a raster effect paints are left out. This covers instances in groups, nested in other symbols' art, moved and scaled. Regression tests: `a_symbol_instance_is_hit_where_a_moved_clipping_path_in_its_art_shows_the_art` and `a_symbol_instance_is_hit_on_the_stroke_of_its_art_past_its_box` in `crates/doc/src/hit/tests.rs`.
- **Selection follows geometry effects:** a click or a marquee with the selection tools selects a path or compound path where its live geometry effects (Transform, Offset Path, Roughen, Zig Zag and the other effects that reshape a path, on the object or on its fills and strokes) draw it, the copies a Transform effect makes included, and not where its own geometry no longer paints. The members of a group or layer whose own geometry effects move or reshape them are selected where they are drawn, at the depth each tool selects, and a locked member there lets the click through to what is below and is listed there in the Unlock submenu. A group's own fills and strokes are clicked where they paint its members, and a clipping path inside such a group is taken on its drawn outline before the art it clips. A compound path keeps its holes, Object Selection by Path Only takes the drawn outline and not its fill, and stacking order is kept. The selection tools select objects by clicking or by a marquee ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-objects/select-objects/select-objects.html)), and the effects leave the art they reshape editable ([the help page](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/apply-and-modify-effects.html)); where clicks land on the reshaped art is VectorCraft's own rule. In Outline view clicks and marquees use the plain paths, and in a layer with Preview off they take outlines only. The area a raster effect paints is still left out. Regression tests: `a_*_shifted_art_*`, `a_click_hits_a_paths_copy_and_evaluates_its_art_once_until_it_changes`, `a_groups_own_effect_moves_where_its_members_are_hit`, `a_layers_own_effect_moves_where_its_art_is_hit`, `a_preview_off_sublayer_of_an_effected_layer_is_clicked_in_outline`, `a_painted_group_around_an_effected_symbols_instance_is_hit_where_its_art_is_drawn`, `an_intertwine_group_in_a_layers_drawn_art_is_hit_in_its_woven_order`, `a_click_in_a_plain_group_evaluates_only_its_member_with_effects`, `a_clip_groups_own_effect_moves_where_its_mask_outline_is_hit`, `an_isolated_clip_group_with_its_own_effect_is_marqueed_by_its_members_own_geometry` and `a_clip_groups_art_is_hit_when_its_drawn_art_holds_only_the_clipping_path` in `crates/doc/src/hit/tests.rs`, and `a_click_and_a_marquee_select_art_where_its_transform_effect_draws_it`, `a_click_selects_a_group_where_its_own_fill_paints_a_moved_member`, `a_marquee_takes_an_inner_groups_own_fill_inside_a_painted_group` and `a_marquee_takes_a_groups_own_fill_inside_a_painted_layer` in `crates/engine/src/tests/select_effects.rs`.
@@ -1219,7 +1221,8 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- macOS: Finder opens every format File › Open reads with VectorCraft (double-click, Open With, a drop on the Dock icon, `open -a`), at launch or while it runs; the release and `cargo xtask bundle` apps share one `Info.plist` that declares those document types, owning only VectorCraft's own formats. The DMG opens on a designed Finder window, VectorCraft.app beside the `Applications` link over a background with the app icon (#493).
- Swatch and graphic style libraries, Libraries panel files, presets and plug-ins open wherever they are dropped on the window, as File › Open opens them.
- File › Open has a filter for each kind of file it opens other than a document, Graphic Style Libraries (`.vcstyles`, after Swatch libraries) and Perspective grid presets (`.vcperspective`, after Print presets) among them, and Other Library… lists its library filter once. Graph designs are stored in the document, with no file type or filter of their own. Tests: `open_exts_cover_every_readable_format`, `library_open_filters_list_library_formats_first`.
- **Symbol libraries** ([public source](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/create-or-import-symbol-libraries.html)): Window › Symbol Libraries and the Symbols panel's Symbol Libraries Menu open each library in a library panel of its own, as swatch and graphic style libraries do. The built-in libraries, Basic Shapes, UI Frames (Panel, Button and Bar with default 9-slice guides), Map Markers (Pin, Flag, Crosshair and Checkpoint, no default 9-slice), Inventory Icons (Sword, Shield, Potion, Key and Gem, no default 9-slice), Skill Icons (Attack, Defend, Heal, Buff and Ult, no default 9-slice), Weather Icons (Sun, Moon, Cloud, Rain, Thunder and Snow, no default 9-slice) and Media Controls (Play, Pause, Stop, Skip Next, Shuffle and Repeat, no default 9-slice), are original art generated in code (`crates/engine/src/cmd/symbollib.rs`). A click on a symbol adds it to the document's Symbols as one undo step, with its Symbol Options (size, registration, export type, 9-slice guides) and every resource it uses (the symbols it nests, patterns, swatches, brushes, graphic styles, images), and makes it the current symbol; a symbol the document already has is not added again and another symbol of the same name keeps its name, the library's comes in numbered. Thumbnails, in the library panels and the Symbols panel, draw a symbol with the symbols it nests and the patterns and images it uses. Dragging a library symbol onto the canvas also places an instance there, in the same step ([placing from a library](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/create-and-place-symbols.html)). Save Symbols (the library menu) and Save Symbol Library… (the Symbols panel menu) write the document's symbols as a `.vectorcraft` document holding only them, into the user library folder (listed under User Defined) or a file; Other Library… reads the symbols of any document VectorCraft opens; a file it can't read is an error and opens no panel. Tests: `crates/engine/src/tests/symbollib.rs`, `crates/ui-egui/src/panels/tests_symbol_libraries.rs`, `panels::symbols::tests::thumbnails_show_the_symbols_a_symbol_nests`, `canvas::tests::a_library_symbol_dropped_on_the_canvas_is_added_and_placed_there_in_one_step`.
- **Symbol libraries** ([public source](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/create-or-import-symbol-libraries.html)): Window › Symbol Libraries and the Symbols panel's Symbol Libraries Menu open each library in a library panel of its own, as swatch and graphic style libraries do. The built-in libraries, Basic Shapes, UI Frames (Panel, Button and Bar with default 9-slice guides), Map Markers (Pin, Flag, Crosshair and Checkpoint, no default 9-slice), Inventory Icons (Sword, Shield, Potion, Key and Gem, no default 9-slice), Skill Icons (Attack, Defend, Heal, Buff and Ult, no default 9-slice), Weather Icons (Sun, Moon, Cloud, Rain, Thunder and Snow, no default 9-slice), Nature Icons (Leaf, Flower, Tree, Mountain and Wave, no default 9-slice) and Media Controls (Play, Pause, Stop, Skip Next, Shuffle and Repeat, no default 9-slice), are original art generated in code (`crates/engine/src/cmd/symbollib.rs`). A click on a symbol adds it to the document's Symbols as one undo step, with its Symbol Options (size, registration, export type, 9-slice guides) and every resource it uses (the symbols it nests, patterns, swatches, brushes, graphic styles, images), and makes it the current symbol; a symbol the document already has is not added again and another symbol of the same name keeps its name, the library's comes in numbered. Thumbnails, in the library panels and the Symbols panel, draw a symbol with the symbols it nests and the patterns and images it uses. Dragging a library symbol onto the canvas also places an instance there, in the same step ([placing from a library](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/create-and-place-symbols.html)). Save Symbols (the library menu) and Save Symbol Library… (the Symbols panel menu) write the document's symbols as a `.vectorcraft` document holding only them, into the user library folder (listed under User Defined) or a file; Other Library… reads the symbols of any document VectorCraft opens; a file it can't read is an error and opens no panel. Tests: `crates/engine/src/tests/symbollib.rs`, `crates/ui-egui/src/panels/tests_symbol_libraries.rs`, `panels::symbols::tests::thumbnails_show_the_symbols_a_symbol_nests`, `canvas::tests::a_library_symbol_dropped_on_the_canvas_is_added_and_placed_there_in_one_step`.
- **Nature Icons library:** Leaf, Flower, Tree, Mountain and Wave are five original procedural vector symbols. Each has a finite natural size, can be added and placed through the symbol library controls, and survives saving to a library file; no 9-slice guides are assigned by default.
- **9-slice scaling** ([public source](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/maintain-proportions-while-scaling-symbols.html)): a scaled instance of a symbol with Enable Guides for 9-Slice Scaling on stays an instance and keeps the parts of its art outside the guides at their size. New guides sit a quarter of the symbol's width and height in from each edge ([reference](https://help.adobe.com/archive/en/illustrator/cs6/illustrator_reference.pdf), Use 9-slice scaling section); saved guides keep their values. The rest is VectorCraft's own rule: the corners keep both sizes, the top and bottom edges stretch in width, the left and right edges in height and the center in both; an instance smaller than its two outer cells on an axis shrinks them in proportion and leaves the center empty; the cells are sized along the symbol's axes before the instance's rotation, shear or reflection. A path with solid paint that crosses a guide is cut there and stays one path, its stroke at its weight with Scale Strokes & Effects on or off; type, images, live objects and gradient or pattern paint that cross a guide are drawn in each cell they reach, clipped to it, except those that draw symbol art (a nested instance, type with an inline graphic, a placed document, a brushed stroke, or a pattern whose tile draws one of these), which are placed by the cell their center is in; an object in one cell is placed by that cell and stays as it is. The canvas, bounds, the Eyedropper, Break Link to Symbol and the PDF, EPS, DXF, EMF/WMF and SVG exports place the art the same way; SVG writes such an instance as its placed art instead of a `<use>`, and DXF and WMF, which do not clip, cut every path that crosses a guide and place other such objects by the cell their center is in. Tests: `symbol_nine_slice::tests` in `crates/doc`, `crates/engine/src/tests/symbol_nine_slice.rs`, `a_scaled_nine_slice_instance_keeps_its_corners` (PDF), `a_scaled_nine_slice_instance_is_written_as_the_canvas_draws_it` (SVG), `a_scaled_nine_slice_instance_is_sampled_as_it_is_drawn` (Eyedropper).
- **Symbol editing mode** ([Edit symbols](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/edit-symbols.html), [Symbols panel options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbols-panel-options.html)): a double-click on a symbol instance, the Control bar's Edit Symbol button, a double-click on a symbol in the Symbols panel and the panel menu's Edit Symbol (`symbol.edit`) open the symbol's art on a temporary isolated layer, where the instance shows it (from the panel: centered on the active artboard, or in the view in a document without artboards), with the rest of the document dimmed. Each edit there changes every instance at once; the instances keep their own transforms and stay linked (Break Link to Symbol still expands one), and a dynamic symbol's instances keep their appearance changes to the objects the art still has. Escape, the isolation bar's back button, the Control bar's Exit Symbol Editing Mode and a double-click outside the art leave the mode (`symbol.exitEditing`); leaving without an edit adds no undo step. Saving leaves the editing layer out. Tests: `crates/engine/src/tests/symboledit.rs`, `select::tests::a_double_click_on_a_symbol_instance_edits_its_symbol`, `panels::symbols::tests::edit_symbol_from_the_panel_centers_the_art_on_the_active_artboard_or_the_view`.
- **Dynamic symbol appearance follows what an object draws** (VectorCraft's own rule): `symbol.instance.setAppearance` refuses a fill or stroke for an object of the art that does not draw it (a guide, blend, envelope, Repeat, Intertwine group, gradient mesh or placed document; a nested symbol instance's stroke, and its fill unless a solid color or none, which stains its art; an image's fill or stroke without a Convert to Shape or Outline Object effect) with an error that names the key and the object, and the call changes nothing. Opacity, blend and `null`, which takes a stored change back, are taken for every object. Tests: `crates/engine/src/tests/dynamic_symbols.rs`.
@@ -1548,6 +1551,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
With Pick Color From Artwork, a merged shape takes the appearance, opacity and blending mode of the object where the drag starts, else of the object where it ends, else of the front-most selected object, as the [Shape Builder combine page](https://web.archive.org/web/20251006211643/https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/combine-shapes-with-shape-builder-tool.html) describes. A click in an area that no selected object covers, such as a hole other shapes enclose, takes the front-most selected object's look (`shapeBuilder.merge` `points`: the first point is where the drag starts, and the last point is where it ends).
A Shift-drag with the Shape Builder tool draws a rectangular marquee for merging many paths at once, as [Combine shapes with the Shape Builder tool](https://web.archive.org/web/20251006211643/https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/combine-shapes-with-shape-builder-tool.html) describes: the regions it reaches are shaded while it is drawn and merge into one shape on release, or with Alt they are deleted. The marquee reaches each region whose outline crosses it or has an anchor inside it, and the region that holds the whole marquee; this rule is VectorCraft's own. For Pick Color From Artwork, the marquee's starting corner is where the drag starts and the opposite corner is where it ends (`shapeBuilder.merge` `rect`).
The Shape Builder works on the selected paths, as [Combine shapes with the Shape Builder tool](https://web.archive.org/web/20251006211643/https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/combine-shapes-with-shape-builder-tool.html) describes. As VectorCraft's own rule, a click or drag that builds nothing says why in the status bar when it is released: "Shape Builder: select paths or compound paths" when nothing is selected or the selection holds no unlocked, visible path; "Shape Builder: select all paths you want to merge" when the release is over a path or compound path that is not selected; and "Shape Builder: no region under the pointer" otherwise. The document, the selection and the undo history stay as they were, and the next gesture that builds something clears the message. Regression tests: `shape_builder_with_nothing_selected_says_what_to_select`, `shape_builder_names_the_unselected_path_under_a_release_that_built_nothing` and `shape_builder_replayed_gesture_over_nothing_gives_its_status_once` in `builder/tests.rs`, and `tests::build::shape_builder_click_that_builds_nothing_shows_why`.
As VectorCraft's own tool, Fill Area (in the Live Paint Bucket's group) adds a new closed path of the area under a click with the current fill and stroke, directly above the front-most object along it, and leaves the paths around it as they are. It needs no selection: the visible, unlocked paths on every layer bound areas, open paths and the overlap of filled shapes included, and it uses the Shape Builder's Gap Detection (`shapeBuilder.copyRegion`). In isolation mode only the isolated layer or group's paths bound areas and the new path goes inside it. It finds no area while the isolated object is not a layer or group, is a group that makes, moves or combines its own art (Live Paint, compound shapes, Shaper groups, graphs, Image Trace results, dimensions, flares, Objects on Path), is a layer or group with a live effect or a clipping mask, or lies inside one of these or inside an envelope. Regression tests: `tests::fill_area::*`.
Shape Builder pieces on dense hatches (lines at exact 0.25 or 0.5 pt steps across another line) come back one per stretch between crossings, with no speck where the sweep cut a line's two passes a rounding error apart: the planar map contracts the stub between such cuts into one vertex, bounded by each cluster's extent so a run of tiny level segments keeps its length (`crates/pathops/src/planar.rs` tests `a_dense_hatch_at_exact_binary_steps_cuts_each_line_once_per_crossing`, `a_run_of_tiny_level_segments_is_not_contracted_as_stubs`, `a_line_crossed_where_its_two_passes_part_is_cut_once`).
The Shape Builder's gray hatch over the region under the pointer and the regions a drag has touched is drawn by a sweep that tests each hatch line only against the region's edges that span it, instead of every edge on every line. The hatch lines are the same, coordinate for coordinate; on a 2,000-sided region 1,000 hatches take about 83 ms of CPU time instead of 356 ms (release build, median of 7 alternating runs), and on a region of 40 sides the time is about the same, so the gain is on large, complex regions such as traced art (`crates/tools/src/builder/tests.rs` tests `hatch_matches_testing_every_edge`, `hatch_tests_only_the_edges_spanning_each_line` and `hatch_sweep_finds_the_crossings_of_every_edge`; timing: `hatch_perf`).
The planar map's edge-source grid stays linear in memory on any input: a segment is filed once per cell it crosses, and the grid holds at most a budget of cell references (a few dozen per item plus a few rows' worth), past which the remaining items go to a short scanned list and are still found, so thousands of coincident segments cannot make the index quadratic (`crates/pathops/src/planar.rs` test `rect_index_holds_a_bounded_number_of_references`).
@@ -3141,6 +3145,7 @@ Edit › Copy and Cut put the selected ruler guides on the clipboard, with the s
| Date | Change | Summary |
|---|---|---|
| 2026-11-19 | minor | Layers: a target circle whose item is targeted and has an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the four looks (not targeted, targeted, with an appearance, both) differ (#8711). Scores and estimates unchanged. |
| 2026-11-19 | minor | Guides, grids, smart guides, snapping, rulers: View › Trim View hides the ruler guides, guide paths and the grid while it is on and greys out their Show/Hide items; a ruler drag or double-click makes no guide meanwhile (#8363). Scores and estimates unchanged. |
| 2026-11-19 | minor | Scissors previews its actual anchor or curve cut point with a native point marker while hovering, retaining existing snapping, Alt Add Anchor and cut behavior (#8655). Scores and estimates unchanged. |
| 2026-11-19 | minor | Performance: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame, and edits that go on once the view is still don't put off its render (#8688). Evidence added; scores and estimates unchanged. |
+2 -1
View File
@@ -1,6 +1,6 @@
# UI and interaction parity
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (Pencil Edit Selected Paths: strokes lifted away, carving, loops, closing over open ends, compound paths, a preview of the stroke as drawn (#3793); scores and estimates unchanged; previously: Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: Graphic Styles panel: right-click item context menu for tiles and rows with Options, Duplicate, Delete, Redefine, Break Link; scores and estimates unchanged; previously: Artboard tool: Shift held once a move or Alt-copy drag is under way keeps it to the level, upright or 45° line, #8580; scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); Canvas context menu: a right-click on a path offers Simplify… next to Smooth…, opening the Simplify slider, or the Simplify dialog kept for next time, as Object › Path › Simplify… does, #8344; scores and estimates unchanged; previously: a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: : selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: Layersselected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); scores and estimates unchanged; previously: Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: Layers panel: an Alt-drag copies a row above or below itself, so the top layer dragged up, the bottom layer dragged down and a lone layer are copied, #8237; scores and estimates unchanged; previously: Layers panel: Alt over the list shows the copy cursor while rows or the selected-art square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: Eraser review: hidden Rasterize and Along/Across stroke rows do not block preserving visible gradients; scores and estimates unchanged; previously: Eraser review: ordinary Group/Layer paints and reproducible evaluated gradient placements are preserved; other placements retain existing fitting; scores and estimates unchanged; previously: Eraser: shared fill-only area cutting for fixed and varied tips and the Alt-drag marquee, #6582; scores and estimates unchanged; previously: #80Line truncated
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (Pencil Edit Selected Paths follows lifted strokes, carves, loops, closes and redraws compound paths; Layers: a targeted item with an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the target circle's four looks differ, #8711; scores and estimates unchanged; previously: Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: Graphic Styles panel: right-click item context menu for tiles and rows with Options, Duplicate, Delete, Redefine, Break Link; scores and estimates unchanged; previously: Artboard tool: Shift held once a move or Alt-copy drag is under way keeps it to the level, upright or 45° line, #8580; scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); Canvas context menu: a right-click on a path offers Simplify… next to Smooth…, opening the Simplify slider, or the Simplify dialog kept for next time, as Object › Path › Simplify… does, #8344; scores and estimates unchanged; previously: a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: : selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: Layersselected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); scores and estimates unchanged; previously: Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: Layers panel: an Alt-drag copies a row above or below itself, so the top layer dragged up, the bottom layer dragged down and a lone layer are copied, #8237; scores and estimates unchanged; previously: Layers panel: Alt over the list shows the copy cursor while rows or the selected-art square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: Eraser review: hidden Rasterize and Along/Across stroke rows do not block preserving visible gradients; scores and estimates unchanged; previously: Eraser review: ordinary Group/Layer paints and reproducible evaluated gradient placements are preserved; other placements retain existing fitting; scores and estimates unchanged; previously: Eraser: shared fill-only Line truncated
>
> Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5).
>
@@ -626,6 +626,7 @@ before release (#6373). [Paint faces and edges](https://helpx.adobe.com/illustra
| Date | Change | Summary |
|---|---|---|
| 2026-11-19 | minor | Layers: a target circle whose item is targeted and has an appearance of its own keeps its inner ring visible, with a smaller appearance dot inside it and a gap between them, so not targeted, targeted, with an appearance and both look different, as the target icons in [Appearance attributes](https://helpx.adobe.com/illustrator/using/appearance-attributes.html) (Targeting items for appearance attributes) do. Before, the dot covered the ring and a targeted item with an appearance looked untargeted, #8711. Scores and estimates unchanged. |
| 2026-11-19 | minor | View › Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid until it is off; the choices come back as they were and the rulers stay, though dragging or double-clicking them makes no guide meanwhile (#8363). Scores and estimates unchanged. |
| 2026-11-19 | minor | Scissors previews its actual anchor or curve cut point with a native point marker while hovering, retaining existing snapping, Alt Add Anchor and cut behavior (#8655). Scores and estimates unchanged. |
| 2026-11-19 | minor | Artboard tool: Shift held once a move or an Alt-drag copy of an artboard is under way keeps it to the level, upright or 45° line from General › Constrain Angle, and snaps slide it along that line; a Shift-press still draws an artboard inside another or marquee-selects (#2497), #8580. Scores and estimates unchanged. |