Artwork Cleanup: Release All Containers takes apart every group, clipping mask and compound path

Object › Plug-ins › Artwork Cleanup › Release All Containers… (addon.cleanup.releaseAll)
takes apart every container in the selection, the objects named by ids or the whole
document, at every level of nesting, as one undo step, so that only the objects they held
are left. Groups are ungrouped, clipping groups are ungrouped and layers stop clipping
(their clipping paths stay as plain paths), and compound paths and paths of several
subpaths become one path per subpath. Each kind can be turned off; at least one must be on.

Objects keep the opacity of the groups and compound paths they were in, and a compound
path's paths take its paint. Live objects kept as groups or compound paths (compound
shapes, Live Paint groups, graphs, dimensions, Objects on Path, generated art and others)
and objects with an opacity mask stay whole, and the clipping path of a clipping group or
layer that stays is left as it is. From the selection or the document, locked and hidden
objects and objects on a locked artboard stay whole; named by ids, locked and hidden
containers are taken apart too, as Deep Ungroup does. Nothing released records no undo
step. The dialog previews on the canvas and turns OK off when no kind is ticked or when
Selection is chosen with nothing selected.

Docs: docs/mcp.md, docs/target-app-parity.md.
This commit is contained in:
dotCooCoo committed 2026-11-29 15:37:39 -08:00
1 parent da9c3947e2
commit 780fac72c5
13 files changed
+912 -7

No files matched your search

+5 -3
View File
@@ -1,9 +1,10 @@
//! Artwork Cleanup (`addon.cleanup.*`), a built-in add-on: Simplify Anchors (Keep Shape), the
//! Document Health Check (check, show and fix the issues it finds), Deep Ungroup and Rejoin Path
//! Pieces, and its text tools ([`text`]). Its panel and its submenu, Object › Plug-ins › Artwork
//! Cleanup, are the UI's.
//! Document Health Check (check, show and fix the issues it finds), Deep Ungroup, Release All
//! Containers ([`release`]) and Rejoin Path Pieces, and its text tools ([`text`]). Its panel and
//! its submenu, Object › Plug-ins › Artwork Cleanup, are the UI's.
mod checks;
mod release;
#[cfg(test)]
mod tests;
mod text;
@@ -87,6 +88,7 @@ pub fn specs() -> Vec<CommandSpec> {
rejoin
),
];
v.extend(release::specs());
v.extend(text::specs());
v
}
@@ -0,0 +1,344 @@
//! Artwork Cleanup's Release All Containers (`addon.cleanup.releaseAll`): every group, clipping
//! mask and compound path in the selection, the objects named or the whole document, taken apart
//! at every level of nesting as one undo step, so that only the objects they held are left.
#[cfg(test)]
mod tests;
use std::collections::{HashMap, HashSet};
use serde_json::{Value, json};
use vectorcraft_doc::{Document, Node, NodeId, NodeKind};
use vectorcraft_geom::PathData;
use vectorcraft_tools::builder::is_live_paint;
use super::checks::{MAX_OBJECTS, Scope};
use super::{named, retain_targets, scope_of};
use crate::cmd::{CommandSpec, bad, checked_ids_or_selection, cmd, has_doc, switch_or};
use crate::{EngineError, Result, Session};
/// The command.
const COMMAND: &str = "addon.cleanup.releaseAll";
pub(super) fn specs() -> Vec<CommandSpec> {
vec![cmd!(
"addon.cleanup.releaseAll",
"Release All Containers…",
["Object", "Plug-ins", "Artwork Cleanup"],
None,
"{scope?: \"selection\"|\"document\" (default: the selection, or the document while nothing is selected), ids?: [id…] (the objects, groups and layers to release in, instead of `scope`), groups?: bool (true: groups are ungrouped), clipGroups?: bool (true: clipping groups are ungrouped and layers stop clipping, their clipping paths kept as plain paths), compoundPaths?: bool (true: compound paths, and paths of several subpaths, become one path per subpath); at least one of the three} take apart every container of the kinds asked for, at every level of nesting, as one undo step when one goes; layers stay; each object keeps the opacity of the groups and compound paths it was in, and a compound path's paths take its paint; objects with an opacity mask, compound shapes, Live Paint groups, graphs, dimensions, flares, Objects on Path, generated art, Shaper Groups, Image Trace objects, blends, envelopes and other live objects stay whole, and the clipping path of a clipping group or layer that stays is left as it is, also when it is selected or named itself; from the selection or the document, locked and hidden objects, and objects on a locked artboard, stay whole; named by `ids`, locked and hidden ones are taken apart too (their objects become locked or hidden as they were), but not those on a locked artboard; the selection keeps what it held, each object taken apart replaced by what it left, locked and hidden objects left out → {scope (\"selection\", \"document\" or \"ids\"), ids (the objects selected), groups, clipGroups, compoundPaths (how many of each were released)}",
has_doc,
release_all
)]
}
/// The kinds of container a request takes apart.
#[derive(Clone, Copy)]
struct Kinds {
groups: bool,
clips: bool,
compounds: bool,
}
impl Kinds {
/// Whether a group is taken apart: a clipping group (`clip`) with `clips`, another with `groups`.
fn takes_group(self, clip: bool) -> bool {
if clip { self.clips } else { self.groups }
}
}
/// One run over the objects: what it takes apart and what it found.
struct Release<'a> {
kinds: Kinds,
/// Locked and hidden objects are taken apart too.
named: bool,
/// The containers on a locked artboard, which stay whole.
held: &'a HashSet<NodeId>,
/// Groups, clipping groups and layers, and compound paths released.
counts: [usize; 3],
/// Objects made from the containers taken apart.
made: usize,
/// Each container taken apart and the objects left in its place.
left: HashMap<NodeId, Vec<NodeId>>,
}
/// Whether `n` stays whole whatever is asked: a live object kept as a group or compound path
/// (a compound shape, Live Paint group, graph, dimension, flare, Objects on Path, generated art,
/// Shaper Group, Image Trace object, a clipping path's painted pieces) or one with an opacity mask,
/// whose contents would lose what it does to them.
fn live(n: &Node) -> bool {
let x = n.extras();
x.mask.is_some()
|| x.shaper.is_some()
|| x.trace.is_some()
|| x.graph.is_some()
|| x.dimension.is_some()
|| x.flare.is_some()
|| x.objects_on_path.is_some()
|| x.generated.is_some()
|| x.live_paint_gaps.is_some()
|| x.clip_pieces
|| n.is_compound_shape()
|| is_live_paint(n)
}
/// The containers under `roots` that a run could take apart, into `out`.
fn candidates(n: &Node, out: &mut Vec<NodeId>) {
match &n.kind {
NodeKind::Layer { children, .. } | NodeKind::Group { children, .. } | NodeKind::Compound { children, .. } => {
if !n.is_layer() {
out.push(n.id);
}
children.iter().for_each(|c| candidates(c, out));
}
NodeKind::Path { path, .. } if path.subpaths.len() > 1 => out.push(n.id),
_ => {}
}
}
impl Release<'_> {
fn total(&self) -> usize {
self.counts.iter().sum()
}
/// Whether `n` is left as it is: locked or hidden (unless named), on a locked artboard, or live.
fn keeps(&self, n: &Node) -> bool {
(!self.named && (n.locked || !n.visible)) || self.held.contains(&n.id) || live(n)
}
/// `n` with the containers in it released, into `out`; `member` counts what a container left.
fn node(&mut self, d: &mut Document, n: Node, member: bool, out: &mut Vec<Node>) -> Result<()> {
if self.keeps(&n) {
if member {
self.made(1)?;
}
out.push(n);
return Ok(());
}
match &n.kind {
NodeKind::Group { clip, .. } if self.kinds.takes_group(*clip) => {
let clip = *clip;
self.counts[usize::from(clip)] += 1;
self.take_apart(d, n, clip, false, out)
}
NodeKind::Compound { .. } if self.kinds.compounds => {
self.counts[2] += 1;
self.take_apart(d, n, false, true, out)
}
NodeKind::Path { path, clipping: false, guide: false, .. } if self.kinds.compounds && path.subpaths.len() > 1 => {
self.counts[2] += 1;
self.split(d, n, out)
}
NodeKind::Group { .. } | NodeKind::Layer { .. } => self.keep(d, n, member, out),
_ => {
if member {
self.made(1)?;
}
out.push(n);
Ok(())
}
}
}
/// Group or compound path `n` replaced by its members, released in turn. Members take on the
/// container's opacity, are hidden when it was hidden and locked when it was locked; a
/// compound path's take its paint; a clipping group's clipping path becomes a plain path.
fn take_apart(&mut self, d: &mut Document, n: Node, clip: bool, compound: bool, out: &mut Vec<Node>) -> Result<()> {
let Some(children) = n.children() else { return Ok(()) };
let mut parts = vec![];
for (k, c) in children.iter().enumerate() {
let mut c = (**c).clone();
if clip
&& k == 0
&& let NodeKind::Path { clipping, .. } = &mut c.kind
{
*clipping = false;
}
if compound {
c.appearance = n.appearance.clone();
if n.extras().pixel_aligned {
c.extras_mut().pixel_aligned = true;
}
}
c.opacity *= n.opacity;
c.visible &= n.visible;
c.locked |= n.locked;
self.node(d, c, true, &mut parts)?;
}
self.left.insert(n.id, parts.iter().map(|p| p.id).collect());
out.extend(parts);
Ok(())
}
/// Path `n` of several subpaths as one path per subpath with its paint, in the same stacking
/// order; the first keeps its id.
fn split(&mut self, d: &mut Document, n: Node, out: &mut Vec<Node>) -> Result<()> {
let Some(path) = n.path_data() else { return Ok(()) };
if self.made.saturating_add(path.subpaths.len()) > MAX_OBJECTS {
return Err(EngineError::Other("Release All Containers: too many objects to release at once".into()));
}
let mut template = n.clone();
if let NodeKind::Path { path, live, .. } = &mut template.kind {
(*path, *live) = (PathData::single(Default::default()), None);
}
let mut parts = Vec::with_capacity(path.subpaths.len());
for (k, sp) in path.subpaths.iter().enumerate() {
let mut c = if k == 0 { template.clone() } else { d.reid(&template) };
if let NodeKind::Path { path, live, .. } = &mut c.kind {
(*path, *live) = (PathData::single(sp.clone()), None);
}
parts.push(c);
}
self.made(parts.len())?;
self.left.insert(n.id, parts.iter().map(|p| p.id).collect());
out.extend(parts);
Ok(())
}
/// Group or layer `n` kept, with the containers in it released. A layer stops clipping when
/// clipping groups are released; the clipping path of a group or layer that still clips is
/// left as it is. Unchanged, `n` itself goes to `out`.
fn keep(&mut self, d: &mut Document, mut n: Node, member: bool, out: &mut Vec<Node>) -> Result<()> {
if member {
self.made(1)?;
}
let before = self.total();
let mut clips = n.clips();
if clips && n.is_layer() && self.kinds.clips {
self.counts[1] += 1;
n.set_clips(false);
clips = false;
if let Some(first) = n.children_mut().and_then(|c| c.first_mut())
&& let NodeKind::Path { clipping, .. } = &mut std::sync::Arc::make_mut(first).kind
{
*clipping = false;
}
}
let Some(children) = n.children().cloned() else {
out.push(n);
return Ok(());
};
let mut kept = Vec::with_capacity(children.len());
for (k, c) in children.into_iter().enumerate() {
if clips && k == 0 {
if member {
self.made(1)?;
}
kept.push((*c).clone());
} else {
self.node(d, (*c).clone(), member, &mut kept)?;
}
}
if self.total() != before
&& let Some(ch) = n.children_mut()
{
*ch = kept.into_iter().map(std::sync::Arc::new).collect();
}
out.push(n);
Ok(())
}
/// Counts the objects made, refusing a run that makes too many.
fn made(&mut self, count: usize) -> Result<()> {
self.made += count;
if self.made > MAX_OBJECTS {
return Err(EngineError::Other("Release All Containers: too many objects to release at once".into()));
}
Ok(())
}
/// `id`, or the objects left in its place when it was taken apart.
fn replaced(&self, id: NodeId, into: &mut Vec<NodeId>) {
match self.left.get(&id) {
Some(ids) => into.extend(ids),
None => into.push(id),
}
}
}
/// Whether `id` is the clipping path of the clipping group or layer it is in.
fn clips_its_parent(d: &Document, id: NodeId) -> bool {
d.parent_of(id).and_then(|p| d.node(p)).is_some_and(|p| p.clips() && p.children().and_then(|c| c.first()).is_some_and(|c| c.id == id))
}
fn release_all(s: &mut Session, p: &Value) -> Result<Value> {
let kinds = Kinds {
groups: switch_or(p, "groups", true, COMMAND)?,
clips: switch_or(p, "clipGroups", true, COMMAND)?,
compounds: switch_or(p, "compoundPaths", true, COMMAND)?,
};
if !(kinds.groups || kinds.clips || kinds.compounds) {
return Err(bad(COMMAND, "`groups`, `clipGroups` and `compoundPaths` are all false: there is nothing to release"));
}
let named = named(p);
if named && p.get("scope").is_some_and(|v| !v.is_null()) {
return Err(bad(COMMAND, "give `scope` or `ids`, not both"));
}
let (roots, name) = if named {
let mut roots = checked_ids_or_selection(s, p, COMMAND)?;
retain_targets(&s.doc()?.doc, &mut roots, true, |id| *id);
(roots, "ids")
} else {
match scope_of(s, p, COMMAND)? {
(Scope::Document, name) => (s.doc()?.doc.layers.iter().map(|l| l.id).collect(), name),
(Scope::Objects(mut roots), name) => {
retain_targets(&s.doc()?.doc, &mut roots, false, |id| *id);
(roots, name)
}
}
};
let st = s.doc()?;
let (mut d, mut sel) = ((*st.doc).clone(), st.selection.clone());
// The containers on a locked artboard, found while nothing is changed yet.
let held: HashSet<NodeId> = if d.artboards.iter().any(|a| a.locked) {
let mut found = vec![];
for n in roots.iter().filter_map(|id| d.node(*id)) {
candidates(n, &mut found);
}
let locks = d.locked_artboards();
found.into_iter().filter(|id| locks.holds_id(*id)).collect()
} else {
HashSet::new()
};
let mut run = Release { kinds, named, held: &held, counts: [0; 3], made: 0, left: HashMap::new() };
let mut items = vec![];
for id in roots {
// A clipping path picked inside the clipping group or layer it clips stays as it is, as it
// does when that group or layer is released in.
if clips_its_parent(&d, id) {
continue;
}
let Some(n) = d.node(id).cloned() else { continue };
let before = run.total();
let mut out = vec![];
run.node(&mut d, n, false, &mut out)?;
if run.total() != before {
items.push((id, out));
}
}
let [groups, clips, compounds] = run.counts;
// With nothing to release, the document, the selection and the undo history stay as they are.
if run.total() == 0 {
let ids: Vec<u64> = sel.objects.iter().map(|i| i.0).collect();
return Ok(json!({ "scope": name, "ids": ids, "groups": 0, "clipGroups": 0, "compoundPaths": 0 }));
}
d.insert_beside(items, true)?;
let mut ids = vec![];
for id in sel.objects.iter() {
run.replaced(*id, &mut ids);
}
// Locked and hidden objects, and those in locked or hidden groups, are not selected.
{
let editable = d.editable();
ids.retain(|id| editable(*id));
}
sel.set(ids.iter().copied());
sel.prune(&d);
let ids: Vec<u64> = sel.objects.iter().map(|i| i.0).collect();
s.edit("Release All Containers", |doc, selection| {
*doc = d;
*selection = sel;
Ok(())
})?;
Ok(json!({ "scope": name, "ids": ids, "groups": groups, "clipGroups": clips, "compoundPaths": compounds }))
}
@@ -0,0 +1,371 @@
//! Release All Containers: every level taken apart as one undo step, the kinds asked for only,
//! the selection, the document and named objects, clipping layers, what stays whole, and refusals.
use serde_json::{Value, json};
use vectorcraft_color::{Color, Paint};
use vectorcraft_doc::{Appearance, Node, NodeId, NodeKind};
use crate::Session;
const C: &str = "addon.cleanup.releaseAll";
fn session() -> Session {
let mut s = Session::new();
s.execute("file.new", &json!({"width": 400, "height": 300})).unwrap();
s
}
fn id_of(v: &Value) -> NodeId {
NodeId(v["id"].as_u64().unwrap())
}
fn rect(s: &mut Session, x: f64, y: f64) -> NodeId {
id_of(&s.execute("shape.rectangle", &json!({"x": x, "y": y, "width": 20, "height": 20})).unwrap())
}
fn node(s: &Session, id: NodeId) -> Option<Node> {
s.doc().unwrap().doc.node(id).cloned()
}
fn change(s: &mut Session, id: NodeId, f: impl FnOnce(&mut Node)) {
s.edit("t", |d, _| {
f(d.node_mut(id).unwrap());
Ok(())
})
.unwrap();
}
fn select(s: &mut Session, ids: &[NodeId]) {
s.select(|_, sel| sel.set(ids.iter().copied())).unwrap();
}
fn selected(s: &Session) -> Vec<NodeId> {
s.doc().unwrap().selection.objects.to_vec()
}
fn undo_steps(s: &Session) -> usize {
s.doc().unwrap().history.undo.len()
}
/// The objects directly in layer `k`.
fn layer(s: &Session, k: usize) -> Vec<NodeId> {
s.doc().unwrap().doc.layers[k].children().unwrap().iter().map(|n| n.id).collect()
}
fn group(s: &mut Session, ids: &[NodeId]) -> NodeId {
select(s, ids);
id_of(&s.execute("object.group", &json!({})).unwrap())
}
fn compound(s: &mut Session, ids: &[NodeId]) -> NodeId {
select(s, ids);
id_of(&s.execute("object.compoundPath.make", &json!({})).unwrap())
}
/// A clipping group of `ids`, the last of them the clipping path.
fn clip_group(s: &mut Session, ids: &[NodeId]) -> NodeId {
select(s, ids);
id_of(&s.execute("object.clippingMask.make", &json!({})).unwrap())
}
fn counts(r: &Value) -> (u64, u64, u64) {
(r["groups"].as_u64().unwrap(), r["clipGroups"].as_u64().unwrap(), r["compoundPaths"].as_u64().unwrap())
}
fn plain(s: &Session, id: NodeId) -> bool {
matches!(node(s, id).unwrap().kind, NodeKind::Path { clipping: false, ref path, .. } if path.subpaths.len() == 1)
}
fn red() -> Appearance {
Appearance::basic(Paint::solid(Color::rgb(1.0, 0.0, 0.0)), Paint::None, 1.0)
}
#[test]
fn release_all_takes_apart_every_level_as_one_step() {
let mut s = session();
let a = rect(&mut s, 10.0, 10.0);
let b = rect(&mut s, 40.0, 10.0);
let p = rect(&mut s, 70.0, 10.0);
let q = rect(&mut s, 75.0, 15.0);
let holes = compound(&mut s, &[p, q]);
change(&mut s, holes, |n| n.appearance = red().into());
let inner = group(&mut s, &[b, holes]);
change(&mut s, inner, |n| n.opacity = 0.5);
let clipped = rect(&mut s, 110.0, 10.0);
let clip = rect(&mut s, 105.0, 5.0);
let masked = clip_group(&mut s, &[clipped, clip]);
let outer = group(&mut s, &[a, inner, masked]);
select(&mut s, &[outer]);
let steps = undo_steps(&s);
let r = s.execute(C, &json!({})).unwrap();
assert_eq!(counts(&r), (2, 1, 1), "{r}");
assert_eq!(r["scope"], "selection");
assert_eq!(undo_steps(&s), steps + 1, "one undo step");
assert_eq!(s.doc().unwrap().history.undo.last().unwrap().label, "Release All Containers");
assert_eq!(layer(&s, 0), [a, b, p, q, clip, clipped], "only paths are left, in their stacking order");
assert!([a, b, p, q, clip, clipped].iter().all(|id| plain(&s, *id)), "the clipping path is a plain path");
assert!(node(&s, outer).is_none() && node(&s, inner).is_none() && node(&s, holes).is_none() && node(&s, masked).is_none());
assert_eq!((node(&s, b).unwrap().opacity, node(&s, p).unwrap().opacity), (0.5, 0.5), "members keep their groups' opacity");
assert_eq!(*node(&s, q).unwrap().appearance, red(), "a compound path's paths take its paint");
assert_eq!(selected(&s), [a, b, p, q, clip, clipped], "what the selected group left is selected");
assert_eq!(r["ids"], json!([a.0, b.0, p.0, q.0, clip.0, clipped.0]));
s.execute("edit.undo", &json!({})).unwrap();
assert_eq!(layer(&s, 0), [outer]);
}
#[test]
fn release_all_counts_each_object_left_once() {
let mut s = session();
let a = rect(&mut s, 10.0, 10.0);
let b = rect(&mut s, 40.0, 10.0);
let c = rect(&mut s, 70.0, 10.0);
let p = rect(&mut s, 100.0, 10.0);
let second = node(&s, p).unwrap().path_data().unwrap().subpaths[0].clone();
change(&mut s, p, |n| {
if let NodeKind::Path { path, .. } = &mut n.kind {
path.subpaths.push(second);
}
});
let inner = group(&mut s, &[a, b, c, p]);
change(&mut s, inner, |n| n.set_clips(true));
let middle = group(&mut s, &[inner]);
let outer = group(&mut s, &[middle]);
let held = std::collections::HashSet::new();
for clips in [true, false] {
let mut d = (*s.doc().unwrap().doc).clone();
let n = d.node(outer).unwrap().clone();
let mut run = super::Release {
kinds: super::Kinds { groups: true, clips, compounds: true },
named: false,
held: &held,
counts: [0; 3],
made: 0,
left: std::collections::HashMap::new(),
};
let mut out = vec![];
run.node(&mut d, n, false, &mut out).unwrap();
if clips {
assert_eq!(out.len(), 5);
assert_eq!(run.made, out.len(), "each path is counted once");
} else {
assert_eq!(out.len(), 1);
let children = out[0].children().unwrap();
assert_eq!(children.len(), 5);
assert_eq!(run.made, out.len() + children.len(), "the kept group and its paths are counted once");
}
}
}
#[test]
fn release_all_takes_only_the_kinds_asked_for() {
let mut s = session();
let p = rect(&mut s, 10.0, 10.0);
let q = rect(&mut s, 15.0, 15.0);
let holes = compound(&mut s, &[p, q]);
let clipped = rect(&mut s, 110.0, 10.0);
let e = rect(&mut s, 105.0, 5.0);
let f = rect(&mut s, 108.0, 8.0);
let clip = compound(&mut s, &[e, f]);
let masked = clip_group(&mut s, &[clipped, clip]);
let outer = group(&mut s, &[holes, masked]);
// Without groups, the group stays and what is inside it is still released, but for the
// clipping path of the clipping group that stays.
select(&mut s, &[outer]);
let r = s.execute(C, &json!({"groups": false, "clipGroups": false})).unwrap();
assert_eq!(counts(&r), (0, 0, 1), "{r}");
let d = &s.doc().unwrap().doc;
assert_eq!(d.parent_of(p), Some(outer));
assert!(d.node(holes).is_none() && d.node(clip).is_some() && d.node(masked).is_some());
assert_eq!(selected(&s), [outer]);
// Without compound paths, the groups go and the compound path stays.
let r = s.execute(C, &json!({"compoundPaths": false})).unwrap();
assert_eq!(counts(&r), (1, 1, 0), "{r}");
assert_eq!(layer(&s, 0), [p, q, clip, clipped]);
assert!(matches!(node(&s, clip).unwrap().kind, NodeKind::Compound { .. }));
// Then only compound paths: the clipping path's paths, unpainted as it was.
select(&mut s, &[clip]);
let r = s.execute(C, &json!({"groups": false, "clipGroups": false})).unwrap();
assert_eq!(counts(&r), (0, 0, 1), "{r}");
assert_eq!(layer(&s, 0), [p, q, e, f, clipped]);
}
#[test]
fn release_all_splits_paths_of_several_subpaths() {
let mut s = session();
let a = rect(&mut s, 10.0, 10.0);
let b = rect(&mut s, 40.0, 10.0);
let second = node(&s, b).unwrap().path_data().unwrap().subpaths[0].clone();
change(&mut s, a, |n| {
if let NodeKind::Path { path, .. } = &mut n.kind {
path.subpaths.push(second);
}
});
s.edit("t", |d, _| Ok(d.remove_many(&[b])?)).unwrap();
select(&mut s, &[a]);
let r = s.execute(C, &json!({})).unwrap();
assert_eq!(counts(&r), (0, 0, 1), "{r}");
let left = layer(&s, 0);
assert_eq!(left.len(), 2);
assert_eq!(left[0], a, "the first subpath keeps the path's id");
assert!(left.iter().all(|id| plain(&s, *id)));
assert_eq!(selected(&s), left);
assert_eq!(node(&s, left[1]).unwrap().appearance, node(&s, a).unwrap().appearance, "each part keeps the path's paint");
}
#[test]
fn release_all_runs_on_the_document_while_nothing_is_selected() {
let mut s = session();
let a = rect(&mut s, 10.0, 10.0);
let b = rect(&mut s, 40.0, 10.0);
let c = rect(&mut s, 70.0, 10.0);
let e = rect(&mut s, 100.0, 10.0);
let plain_group = group(&mut s, &[a]);
let locked = group(&mut s, &[b]);
change(&mut s, locked, |n| n.locked = true);
let hidden = group(&mut s, &[c]);
change(&mut s, hidden, |n| n.visible = false);
// A second layer that clips its art by its first path.
let second = id_of(&s.execute("layer.new", &json!({})).unwrap());
let mask = rect(&mut s, 0.0, 100.0);
let art = rect(&mut s, 10.0, 110.0);
let art_group = group(&mut s, &[art]);
s.edit("t", |d, _| {
let layer = d.node_mut(second).unwrap();
layer.set_clips(true);
if let Some(NodeKind::Path { clipping, .. }) = layer.children_mut().unwrap().first_mut().map(|c| &mut std::sync::Arc::make_mut(c).kind) {
*clipping = true;
}
Ok(())
})
.unwrap();
select(&mut s, &[]);
assert!(s.execute(C, &json!({"scope": "selection"})).is_err(), "nothing selected");
let steps = undo_steps(&s);
let r = s.execute(C, &json!({})).unwrap();
assert_eq!(r["scope"], "document");
assert_eq!(counts(&r), (2, 1, 0), "{r}");
assert_eq!(undo_steps(&s), steps + 1);
assert_eq!(layer(&s, 0), [a, locked, hidden, e], "locked and hidden groups stay whole");
assert!(node(&s, plain_group).is_none() && node(&s, art_group).is_none());
let d = &s.doc().unwrap().doc;
assert!(!d.node(second).unwrap().clips(), "the layer stays and stops clipping");
assert!(plain(&s, mask), "its clipping path is a plain path");
assert_eq!(layer(&s, 1), [mask, art]);
assert!(selected(&s).is_empty(), "nothing was selected");
// Asked for the document with a selection, the selection keeps what it held.
let g = group(&mut s, &[e]);
select(&mut s, &[g]);
let r = s.execute(C, &json!({"scope": "document"})).unwrap();
assert_eq!(counts(&r), (1, 0, 0), "{r}");
assert_eq!(selected(&s), [e]);
}
#[test]
fn release_all_takes_named_locked_and_hidden_containers() {
let mut s = session();
let a = rect(&mut s, 10.0, 10.0);
let b = rect(&mut s, 40.0, 10.0);
let locked = group(&mut s, &[a]);
change(&mut s, locked, |n| n.locked = true);
let hidden = group(&mut s, &[b]);
change(&mut s, hidden, |n| n.visible = false);
select(&mut s, &[locked, hidden]);
let steps = undo_steps(&s);
let r = s.execute(C, &json!({})).unwrap();
assert_eq!((counts(&r), undo_steps(&s)), ((0, 0, 0), steps), "from the selection, they stay whole");
let r = s.execute(C, &json!({"ids": [locked.0, hidden.0]})).unwrap();
assert_eq!(r["scope"], "ids");
assert_eq!(counts(&r), (2, 0, 0), "{r}");
assert_eq!(undo_steps(&s), steps + 1);
let (na, nb) = (node(&s, a).unwrap(), node(&s, b).unwrap());
assert!(na.locked && na.visible && !nb.visible && !nb.locked, "their objects become locked or hidden as they were");
assert!(selected(&s).is_empty(), "locked and hidden objects are not selected");
// On a locked artboard, a named group stays whole.
let c = rect(&mut s, 10.0, 200.0);
let on_board = group(&mut s, &[c]);
s.edit("Lock Artboard", |d, _| {
d.artboards[0].locked = true;
Ok(())
})
.unwrap();
let steps = undo_steps(&s);
let r = s.execute(C, &json!({"ids": [on_board.0]})).unwrap();
assert_eq!((counts(&r), undo_steps(&s)), ((0, 0, 0), steps));
assert!(node(&s, on_board).is_some());
// Nor does one inside a named layer.
let layer_id = s.doc().unwrap().doc.layers[0].id;
let r = s.execute(C, &json!({"ids": [layer_id.0]})).unwrap();
assert_eq!((counts(&r), undo_steps(&s)), ((0, 0, 0), steps));
}
#[test]
fn release_all_leaves_masked_groups_whole_and_changes_nothing_without_a_container() {
let mut s = session();
let a = rect(&mut s, 10.0, 10.0);
let b = rect(&mut s, 15.0, 15.0);
let held = group(&mut s, &[a, b]);
let m = rect(&mut s, 0.0, 0.0);
s.execute("transparency.makeOpacityMask", &json!({"ids": [held.0, m.0]})).unwrap();
let masked = layer(&s, 0)[0];
assert!(node(&s, masked).unwrap().extras().mask.is_some());
let c = rect(&mut s, 100.0, 10.0);
select(&mut s, &[masked, c]);
let steps = undo_steps(&s);
let r = s.execute(C, &json!({})).unwrap();
assert_eq!((counts(&r), undo_steps(&s)), ((0, 0, 0), steps), "no step when nothing is released");
assert_eq!(r["ids"], json!([masked.0, c.0]), "the selection stays");
assert_eq!(layer(&s, 0), [masked, c]);
// A compound shape is a group that stays whole too.
let e = rect(&mut s, 200.0, 10.0);
let f = rect(&mut s, 210.0, 15.0);
select(&mut s, &[e, f]);
s.execute("object.compoundShape.make", &json!({})).unwrap();
let shape = selected(&s)[0];
assert!(node(&s, shape).unwrap().is_compound_shape());
let steps = undo_steps(&s);
let r = s.execute(C, &json!({})).unwrap();
assert_eq!((counts(&r), undo_steps(&s)), ((0, 0, 0), steps));
assert!(node(&s, shape).unwrap().is_compound_shape());
}
#[test]
fn release_all_leaves_a_picked_clipping_path_of_a_clipping_group_that_stays() {
let mut s = session();
let clipped = rect(&mut s, 10.0, 10.0);
let e = rect(&mut s, 5.0, 5.0);
let f = rect(&mut s, 8.0, 8.0);
let clip = compound(&mut s, &[e, f]);
let masked = clip_group(&mut s, &[clipped, clip]);
let steps = undo_steps(&s);
for p in [json!({"ids": [clip.0]}), json!({"ids": [clip.0], "clipGroups": false})] {
let r = s.execute(C, &p).unwrap();
assert_eq!((counts(&r), undo_steps(&s)), ((0, 0, 0), steps), "{p}");
}
select(&mut s, &[clip]);
let r = s.execute(C, &json!({})).unwrap();
assert_eq!((counts(&r), undo_steps(&s)), ((0, 0, 0), steps));
let d = &s.doc().unwrap().doc;
assert_eq!(d.parent_of(clip), Some(masked));
assert!(matches!(d.node(clip).unwrap().kind, NodeKind::Compound { .. }));
}
#[test]
fn release_all_refuses_bad_params() {
let mut s = session();
let a = rect(&mut s, 10.0, 10.0);
let g = group(&mut s, &[a]);
select(&mut s, &[g]);
let steps = undo_steps(&s);
for bad in [
json!({"groups": false, "clipGroups": false, "compoundPaths": false}),
json!({"groups": "yes"}),
json!({"compoundPaths": 1}),
json!({"scope": "layer"}),
json!({"scope": "document", "ids": [g.0]}),
json!({"ids": [999_999]}),
] {
assert!(s.execute(C, &bad).is_err(), "{bad}");
}
assert_eq!(undo_steps(&s), steps);
assert!(node(&s, g).is_some());
}
@@ -20,6 +20,7 @@ pub(super) const ALLOWED: &[&str] = &[
"addon.cleanup.fix",
"addon.cleanup.joinText",
"addon.cleanup.rejoin",
"addon.cleanup.releaseAll",
"addon.cleanup.removeBreaks",
"addon.cleanup.replaceFonts",
"addon.cleanup.resetTextTransform",
@@ -521,6 +521,7 @@ fn ids_null_takes_the_selection_in_every_command_that_falls_back_to_it() {
("addon.arrange.sort", json!({"by": "area", "apply": "x"}), both),
("addon.cleanup.simplify", json!({}), rect),
("addon.cleanup.deepUngroup", json!({}), rect),
("addon.cleanup.releaseAll", json!({}), rect),
("addon.cleanup.rejoin", json!({}), rect),
("addon.color.nearestSwatch", json!({}), rect),
("addon.pathtools.cornerSet", json!({"radius": 2}), rect),
+1
View File
@@ -377,6 +377,7 @@ const NOT_LOCATIONS: &[&str] = &[
"emptyTextPaths",
"sortPaths",
"alterPaths",
"compoundPaths",
"includeLinkedFiles",
"linksFolder",
];
+5 -2
View File
@@ -2,7 +2,10 @@
//! Document Health Check on the selection, or the document while nothing is selected, lists what it
//! found, and shows or fixes the issues picked in the list (Fix All: every issue listed), each fix
//! one undo step. Below, the add-on's one-click tools open their options as their menu items do,
//! and its text tools, which the panel can hide, act on the selected type.
//! and its text tools, which the panel can hide, act on the selected type. Release All
//! Containers… opens its own dialog ([`release`]).
pub mod release;
use craft::behavior::{DisplayOrder, ItemSource, Selection};
use craft::keymap::Mods;
@@ -97,7 +100,7 @@ fn modified(id: &str, mut p: Value, held: Mods) -> Value {
pub fn menu() -> Vec<Node> {
let mut items = vec![cp("Document Health Check", "window.panel", json!({ "panel": ID })), Sep];
items.extend(tools().into_iter().map(|(label, id, p)| cp(label, id, p)));
items.extend([Sep, c("Fix All Issues", "addon.cleanup.fix"), Sep]);
items.extend([c("Release All Containers…", release::COMMAND), Sep, c("Fix All Issues", "addon.cleanup.fix"), Sep]);
let by = |b: &str| json!({ "by": b });
let align = |a: &str| json!({ "align": a });
items.extend([
@@ -0,0 +1,57 @@
//! Release All Containers in the interface: its dialog (where to release, the selection or the
//! whole document, and which containers: groups, clipping masks and compound paths), which
//! previews on the canvas and runs `addon.cleanup.releaseAll` on OK, one undo step. It opens on the
//! selection, or the document while nothing is selected, with every kind ticked.
use craft::ui::contract::Bind;
use craft::ui::patterns::form_dialogs::{DialogFields, Param, ParamDialog, ParamKind};
use serde_json::{Value, json};
use crate::VectorcraftApp;
use crate::addons::dialogs::{self, Spec};
use crate::dialogs::form;
/// The command.
pub const COMMAND: &str = "addon.cleanup.releaseAll";
/// Where it releases, as the command's `scope` names it, and the labels.
const SCOPES: [(&str, &str); 2] = [("selection", "Selection"), ("document", "Document")];
/// The kinds of container, as the command names them, and their labels.
const KINDS: [(&str, &str); 3] = [("groups", "Groups"), ("clipGroups", "Clipping Masks"), ("compoundPaths", "Compound Paths")];
/// How the dialog's values reach the command.
pub(crate) static SPEC: Spec = Spec { command: COMMAND, params, found: None };
/// The dialog's rows.
fn rows() -> Vec<Param> {
let scopes = SCOPES.iter().map(|&(id, label)| (id.to_string(), tl!(label).into())).collect();
let mut rows = vec![Param::new("scope", tl!("Release In:"), ParamKind::choice(scopes, Some(SCOPES[0].0.into())))];
rows.extend(KINDS.iter().map(|&(key, label)| Param::new(key, tl!(label), ParamKind::bool(true))));
rows
}
/// The command's parameters from the dialog's fields.
pub(crate) fn params(fields: &DialogFields) -> Value {
Value::Object(form::json_of(&rows(), fields))
}
/// Opens the dialog on the selection, or the document while nothing is selected, with every kind
/// of container ticked.
pub(crate) fn open(app: &mut VectorcraftApp) -> Result<Value, String> {
let selected = !app.session.active().ok_or("no document open")?.selection.is_empty();
let scope = if selected { "selection" } else { "document" };
let opening = json!({ "scope": scope, "groups": true, "clipGroups": true, "compoundPaths": true });
let fields = form::fields_of(&rows(), opening.as_object().ok_or("no options")?);
dialogs::open(app, &SPEC, fields, move |fields| {
let any = KINDS.iter().any(|(key, _)| fields.bool(key).unwrap_or(true));
let somewhere = selected || fields.text("scope") != Some("selection");
let reason = if any { tl!("Nothing is selected.") } else { tl!("Tick at least one kind of container.") };
ParamDialog::new(COMMAND, tl!("Release All Containers"), rows())
.previews(true)
.ok_enabled(any && somewhere)
.ok_reason(reason.into())
.values(Bind::bound(fields))
})
}
#[cfg(test)]
mod tests;
@@ -0,0 +1,99 @@
use serde_json::json;
use vectorcraft_doc::{NodeId, NodeKind};
use vectorcraft_engine::Session;
use crate::VectorcraftApp;
use crate::addons::dialogs::tests as host;
use crate::tests::panel_harness::Panel as Harness;
/// An app with a window and a selected group holding a rectangle and a compound path of two; the
/// group, the rectangle and the compound path.
fn app() -> (VectorcraftApp, NodeId, NodeId, NodeId) {
let mut app = crate::testing::windowed(VectorcraftApp::new(Session::new(), Default::default()));
app.run("file.new", json!({"width": 400, "height": 300})).unwrap();
let mut rect = |x| NodeId(app.run("shape.rectangle", json!({"x": x, "y": 10, "width": 20, "height": 20})).unwrap()["id"].as_u64().unwrap());
let (a, p, q) = (rect(10), rect(50), rect(55));
app.run("select.set", json!({"ids": [p.0, q.0]})).unwrap();
let holes = NodeId(app.run("object.compoundPath.make", json!({})).unwrap()["id"].as_u64().unwrap());
app.run("select.set", json!({"ids": [a.0, holes.0]})).unwrap();
let group = NodeId(app.run("object.group", json!({})).unwrap()["id"].as_u64().unwrap());
(app, group, a, holes)
}
/// The objects directly in the first layer.
fn top(app: &VectorcraftApp) -> Vec<NodeId> {
app.session.doc().unwrap().doc.layers[0].children().unwrap().iter().map(|n| n.id).collect()
}
fn undo_len(app: &VectorcraftApp) -> usize {
app.session.doc().unwrap().history.undo.len()
}
#[test]
fn release_all_previews_keyboard_choices_cancels_and_commits_one_step() {
let (app, group, a, holes) = app();
let mut panel = Harness::new(app, crate::tests::picks::dialogs);
let undo = undo_len(&panel.app());
host::open_item(&mut panel.app(), "Artwork Cleanup", "Release All Containers…");
panel.frame();
let id = host::dialog_id(&panel.app());
assert_eq!(host::read(&panel.app(), id, |f| f.text("scope").map(str::to_string)), Some("selection".into()), "opens on the selection");
assert_eq!(top(&panel.app()).len(), 3, "the preview shows the rectangle and the compound path's two paths");
// Compound Paths unticked with the keyboard: the compound path stays in the preview.
panel.focus("Compound Paths");
panel.key(egui::Key::Space, egui::Modifiers::NONE);
panel.frame();
assert_eq!(host::read(&panel.app(), id, |f| f.bool("compoundPaths")), Some(false));
assert_eq!(top(&panel.app()), [a, holes], "the group is released and the compound path stays");
panel.click("Cancel");
panel.frame();
assert_eq!(top(&panel.app()), [group], "rolled back");
assert_eq!(undo_len(&panel.app()), undo);
host::open_item(&mut panel.app(), "Artwork Cleanup", "Release All Containers…");
panel.frame();
panel.click("OK");
panel.frame();
let app = panel.app();
assert!(!app.any_dialog_open());
assert_eq!(undo_len(&app), undo + 1, "one undo step");
let left = top(&app);
assert_eq!(left.len(), 3);
let doc = &app.session.doc().unwrap().doc;
assert!(left.iter().all(|id| matches!(doc.node(*id).unwrap().kind, NodeKind::Path { .. })), "only paths are left");
}
#[test]
fn release_all_turns_ok_off_with_nothing_to_release_in() {
let (app, group, ..) = app();
let mut panel = Harness::new(app, crate::tests::picks::dialogs);
host::open_item(&mut panel.app(), "Artwork Cleanup", "Release All Containers…");
panel.frame();
for label in ["Groups", "Clipping Masks", "Compound Paths"] {
panel.focus(label);
panel.key(egui::Key::Space, egui::Modifiers::NONE);
panel.frame();
}
assert!(!panel.enabled("OK"), "no kind of container ticked");
assert_eq!(top(&panel.app()), [group], "nothing previewed");
panel.focus("Groups");
panel.key(egui::Key::Space, egui::Modifiers::NONE);
panel.frame();
assert!(panel.enabled("OK"));
panel.click("Cancel");
panel.frame();
// With nothing selected, it opens on the document, and Selection turns OK off.
panel.app().run("select.set", json!({"ids": []})).unwrap();
host::open_item(&mut panel.app(), "Artwork Cleanup", "Release All Containers…");
panel.frame();
let id = host::dialog_id(&panel.app());
assert_eq!(host::read(&panel.app(), id, |f| f.text("scope").map(str::to_string)), Some("document".into()));
assert!(panel.enabled("OK"));
host::set(&panel.app(), id, "scope", json!("selection"));
panel.frame();
assert!(!panel.enabled("OK"), "nothing is selected");
host::set(&panel.app(), id, "scope", json!("document"));
panel.frame();
panel.click("OK");
panel.frame();
assert_eq!(top(&panel.app()).len(), 3, "the document's containers are released");
}
+2 -1
View File
@@ -98,8 +98,9 @@ pub(crate) fn open(
/// The dialog the menu item of command `id` opens, with no params; `None` for another command.
pub(crate) fn open_from_menu(app: &mut VectorcraftApp, id: &str) -> Option<Result<Value, String>> {
use super::{color, pathtools, select, typetools};
use super::{cleanup, color, pathtools, select, typetools};
let open: fn(&mut VectorcraftApp) -> Result<Value, String> = match id {
cleanup::release::COMMAND => cleanup::release::open,
pathtools::set_corners::COMMAND => pathtools::set_corners::open,
pathtools::dashes::COMMAND => pathtools::dashes::open,
pathtools::bridge::COMMAND => pathtools::bridge::open,
+19
View File
@@ -16581,6 +16581,25 @@ apart the locked and hidden groups the ids name and the groups inside the groups
stays a layer), but not groups on a locked artboard; an object of a hidden group becomes hidden, and an object of a
locked group becomes locked. Locked and hidden objects stay locked or hidden and are left out of the selection.
`addon.cleanup.releaseAll {scope?, ids?, groups?, clipGroups?, compoundPaths?}` (Object › Plug-ins › Artwork Cleanup ›
Release All Containers…) takes apart every container at every level of nesting as one undo step, so that only the
objects they held are left. `scope` is `"selection"` or `"document"`; by default it is the selection, or the document
while nothing is selected. `ids` names the objects, groups and layers to release in instead of `scope`; giving both is
an error. `groups` ungroups groups, `clipGroups` ungroups clipping groups and makes layers stop clipping (their
clipping paths stay as plain paths), and `compoundPaths` turns compound paths, and paths of several subpaths, into one
path per subpath. Each is true by default, and at least one must be true. Layers stay. Objects keep the opacity of
the groups and compound paths they were in, and the paths of a compound path take its paint. Objects with an opacity
mask, compound shapes, Live Paint groups, graphs, dimensions, flares, Objects on Path, generated art, Shaper Groups,
Image Trace objects, blends, envelopes and other live objects stay whole, and the clipping path of a clipping group or
layer that stays is left as it is, also when it is selected or named itself. From the selection or the document, locked and hidden objects
and objects on a locked artboard stay whole. With `ids`, the locked and hidden containers it names, or that are in what
it names, are taken apart too and their objects become locked or hidden as the containers were, but containers on a
locked artboard stay whole. The selection keeps what it held, with each object taken apart replaced by the objects
left in its place, and locked and hidden objects left out. With nothing to release, the document, the selection and the
undo history stay as they are. It replies `{scope ("selection", "document" or "ids"), ids, groups, clipGroups,
compoundPaths}`, the last three counting what it released. The dialog previews on the canvas and turns OK off when no
kind is ticked, or when Selection is chosen with nothing selected.
`addon.cleanup.rejoin {gap?, ids?}` welds the selected open paths whose ends lie within `gap` (0 to 6 pt, 0.1 by
default) back into paths. Each end joins one other end: where several are in reach, the one the path turns least to go
on into. Pieces may run either way, and a chain whose ends meet closes. Each new path takes the place and paint of its
+6
View File
@@ -2998,6 +2998,12 @@ alike in being hidden and in being locked, and the objects of a group Deep Ungro
state. Tests: `simplify_named_locked_and_hidden_paths`, `deep_ungroup_named_locked_and_hidden_groups` and
`rejoin_named_locked_and_hidden_pieces` in `cmd::addons::cleanup::tests`.
Release All Containers… (`addon.cleanup.releaseAll`) takes apart every group, clipping group and compound path in the
selection, the objects named or the whole document, at every level of nesting, as one undo step; layers stay and stop
clipping, and paths of several subpaths split into one path per subpath. Its dialog previews on the canvas and picks
where to release and which kinds (VectorCraft's own tool). Tests: `cmd::addons::cleanup::release::tests` in
`vectorcraft-engine` and `addons::cleanup::release::tests` in `vectorcraft-ui-egui`.
## Path Precision Tools add-on (2026-10-30)
A VectorCraft addition, not a feature of the reference app, so no area score moves. Object › Plug-ins › Path Precision Tools,
+1 -1
View File
@@ -592,7 +592,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po
| Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools selects its six tools (Anchor Eraser Brush, Extend Path, Measure & Inspect, Parametric Shape, Corner Tool, Slide Anchor Along Path), which the All Tools drawer lists under their own heading but neither toolbar shows as shipped, opens the Anchor Inspector panel (the selected anchor's X/Y and handle lengths and angles as fields; Make Smooth, Make Corner, Equalize Handles, Remove Points Keep Shape, Add Points, the three ways to close) and the Parametric Shape panel (kind, count, W/H, rotation, the kind's own values and corner radius of the selected parametric shape, or of the tool's next one), and runs Add Points at / Split at Crossings and Convert to Parametric Shape; the Parametric Shape Tool draws ten re-editable kinds from the centre (↑/↓ and ←/→ change their numbers while dragging) and edits a selected one with handles; the Corner Tool cuts editable corners on any path (hover shows the anchor, a click uses its radius and kind, a drag sizes the corner, Shift whole values; a corner's marker selects it and loads its values, drags to resize, to 0 or double-clicked removes it; never past what fits; Alt-marquee cuts every anchor inside) with a Corners section in the Anchor Inspector (radius, kind, selected count, Apply to Selected Anchors); Slide Anchor Along Path drags an anchor along its curve with the segments beside it refitted, Shift snapping where the tangent is a multiple of 45°; a double-click on the brush or Extend Path tool opens its options | done | `addon.pathtools.*`, `crates/tools/src/addons/`, `crates/ui-egui/src/addons/pathtools.rs`, `crates/ui-egui/src/addons/pathtools/` and their tests; not a feature of the reference app, so it is not scored |
| Smart Pen add-on (VectorCraft addition): Object › Plug-ins › Smart Pen selects the Smart Pen Tool (also in the Pen tool's group in both shipped toolbars, after the Quick Pen; the All Tools drawer lists it under Draw; a toolbar edited before keeps its saved layout until Reset Toolbar; no shortcut), and opens the Smart Pen panel (next segment straight or curved; Remove Points Keep Shape, Make Smooth, Make Corner, Retract Handles, Close or Join). The tool draws (click: straight or curved segment, a curve after a straight one tangent; drag: smooth anchor, Alt breaks the handle, Shift 45°, Space moves it; Tab switches a segment; rubber band; close, join, continue) and edits without switching tools (click selects a point, drag moves it, Alt-click removes it keeping the shape, Shift+Alt-click deletes it, double-click toggles smooth/corner; handle drags with Shift and Alt; segment drags reshape, Alt-click adds a point); an Alt-drag away from paths selects the points inside a marquee | done | `addon.pen.*`, `crates/tools/src/addons/smart_pen.rs`, `crates/ui-egui/src/addons/pen.rs` and their tests; not a feature of the reference app, so it is not scored |
| Path Precision Tools add-on (VectorCraft addition): Object › Plug-ins › Path Precision Tools selects its three tools (Anchor Eraser Brush, Extend Path, Measure & Inspect), which the All Tools drawer lists under their own heading but neither toolbar shows as shipped, opens the Anchor Inspector panel (the selected anchor's X/Y and handle lengths and angles as fields; Make Smooth, Make Corner, Equalize Handles, Remove Points Keep Shape, Add Points, the three ways to close) and runs Add Points at / Split at Crossings; a double-click on the brush or Extend Path tool opens its options | done | `addon.pathtools.*`, `crates/tools/src/addons/`, `crates/ui-egui/src/addons/pathtools.rs` and their tests; not a feature of the reference app, so it is not scored |
| Artwork Cleanup add-on (VectorCraft addition): Object › Plug-ins › Artwork Cleanup opens its panel, which checks the selection or the document for 16 kinds of issue, lists them with counts, and shows or fixes the picked rows or all of them, each fix one undo step; Simplify Anchors (Keep Shape), Rejoin Path Pieces and Deep Ungroup open their options first | done | `addon.cleanup.*`, `crates/ui-egui/src/addons/cleanup.rs` and its tests; not a feature of the reference app, so it is not scored |
| Artwork Cleanup add-on (VectorCraft addition): Object › Plug-ins › Artwork Cleanup opens its panel, which checks the selection or the document for 16 kinds of issue, lists them with counts, and shows or fixes the picked rows or all of them, each fix one undo step; Simplify Anchors (Keep Shape), Rejoin Path Pieces and Deep Ungroup open their options first; Release All Containers… takes apart every group, clipping mask and compound path in the selection or the document as one undo step | done | `addon.cleanup.*`, `crates/ui-egui/src/addons/cleanup.rs` and its tests; not a feature of the reference app, so it is not scored |
| Artwork Cleanup add-on text tools (VectorCraft addition): the panel's Text row, which the panel can hide, and Object › Plug-ins › Artwork Cleanup set the alignment of point type keeping its place, break type into lines (Shift-click: paragraphs), words or glyphs, split type at the cursor, reset a text transform (Alt-click: and its horizontal scale), combine point type, remove line or paragraph breaks and replace missing fonts, each one undo step | done | `addon.cleanup.*` text commands, `crates/ui-egui/src/addons/cleanup.rs` and its tests; a VectorCraft addition, so it is not scored |
| Color Effects add-on (VectorCraft addition): live Exposure, Desaturate and Invert Colors in Effect › Color Effects and Object › Plug-ins › Color Effects; its panel picks a colour adjustment and its values and adds it as a live effect or applies it as a filter, into the colours, as one undo step; Select by Color Kind selects the objects that use spot colours, carry colour effects, or are RGB, CMYK or grayscale images; Vector Halftone draws an object as halftone dots live (the dots Object › Vector Halftone makes), which Expand Appearance and the exporters write as paths; Duotone prints each colour's tone with one to four inks (a tint of a spot tone's swatch, or the CMYK mix of several), live or as a filter, its dialog a row per tone and the picked tone's curve; Print Ink Fixes (a CMYK document's ink limit, white overprint removed, black overprint set) opens its options from the submenu and the panel's Inks | done | `addon.color.*`, `crates/ui-egui/src/addons/color.rs` and its tests; not a feature of the reference app, so it is not scored |
| Color Effects add-on (VectorCraft addition): Object › Plug-ins › Color Effects › Find Nearest Swatch… picks a Library (Document Swatches, a built-in library, or a library or colour book the user saved or loaded) and Fill and Stroke, lists each colour of the selection with its three closest swatches (chip, name, ΔE 2000), and Apply gives each colour its nearest swatch (global and spot swatches linked; a library's swatches added to the document first), one undo step | done | #4923; `addon.color.nearestSwatch`, `addon.color.applyNearestSwatch`, `crates/engine/src/cmd/addons/color/nearest.rs`, `crates/ui-egui/src/addons/color/nearest.rs` and their tests; not a feature of the reference app, so it is not scored |