mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-04 21:12:57 -05:00
Merge main into fix/selection-tool-anchor-size
This commit is contained in:
commit
2da87a43bd
31 files changed
+1217
-42
No files matched your search
@@ -271,6 +271,7 @@ The full earlier record of what landed is kept in [docs/roadmap.md](docs/roadmap
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-26 | minor | Show Missing Links in View and the Links panel marks missing linked images and placed documents on the canvas; the link watcher scans them in the background, so turning it on never waits on a file; transient overlays stay out of artwork, export and undo history; command API controls and lists markers (#5547). Scores and estimates unchanged. |
|
||||
| 2026-11-20 | minor | Color conversion indexes global swatch bases and linked-paint lookups (#8804); scores, estimates and measured budgets unchanged. |
|
||||
| 2026-11-22 | minor | Upcoming: the G11 item names what is left, the unit preference reverting to points (#864; SVG export units are fixed) and a Transform effect in a fill's or stroke's own effects (#885), instead of Shape Builder regions and Asset Export borders, which are fixed (#937, #983 / #1037); its estimate follows docs/roadmap.md and docs/gaps.md, 8–15 → 6–13 h, #8314. The Essentials readiness row's Shape Builder item names what its 4–8 h still covers (checking #937's fix on the reporter's file, still unconfirmed). Headline numbers unchanged. |
|
||||
| 2026-11-15 | minor | Graphic Styles: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); G5 estimate unchanged (3–13 h). |
|
||||
|
||||
@@ -277,6 +277,57 @@ pub fn set_corners(path: &mut PathData, live: &mut Option<Box<LiveShape>>, corne
|
||||
}
|
||||
}
|
||||
|
||||
/// Edit the anchors of the uncut outline that `anchors` (of the path as drawn) come from, while the
|
||||
/// path keeps its Live Corners: `edit` gets the outline in document space and those of its anchors,
|
||||
/// and the path is cut again with the same radii and kinds. A live rectangle or polygon becomes a
|
||||
/// [`LiveShape::Path`] with that outline. [`LiveCorners::sources`] before and after the edit map
|
||||
/// the anchors as drawn to the corners they come from.
|
||||
/// Returns `None`, leaving the path unchanged, when the path has no live shape or
|
||||
/// no cut corner, or is a rectangle sheared or scaled unevenly.
|
||||
pub fn edit_corner_anchors(
|
||||
path: &mut PathData,
|
||||
live: &mut Option<Box<LiveShape>>,
|
||||
anchors: &BTreeSet<AnchorRef>,
|
||||
edit: impl FnOnce(&mut PathData, &BTreeSet<AnchorRef>),
|
||||
) -> Option<()> {
|
||||
live.as_ref()?;
|
||||
if let Some(LiveShape::Rectangle { xf, .. }) = live.as_deref() {
|
||||
let [a, b, c, d, _, _] = xf.as_coeffs();
|
||||
let scale = (a * a + b * b).max(c * c + d * d).max(1e-12);
|
||||
if ((a * a + b * b) - (c * c + d * d)).abs() > 1e-9 * scale || (a * c + b * d).abs() > 1e-9 * scale {
|
||||
return None;
|
||||
}
|
||||
}
|
||||
let (mut base, moved, radii, kinds, relative) = {
|
||||
let lc = LiveCorners::new(path, live.as_deref())?;
|
||||
if !lc.drawn.iter().any(|r| *r > 0.0) {
|
||||
return None;
|
||||
}
|
||||
let moved: BTreeSet<usize> = anchors.iter().filter_map(|(si, ai)| lc.sources.get(*si)?.get(*ai).copied()).collect();
|
||||
if moved.is_empty() {
|
||||
return None;
|
||||
}
|
||||
let mut radii = lc.radii.clone();
|
||||
radii.resize(lc.base.anchor_count(), 0.0);
|
||||
(lc.base.transformed(lc.xf), moved, radii, lc.kinds.clone(), lc.relative)
|
||||
};
|
||||
let mut on_base = BTreeSet::new();
|
||||
let mut k = 0;
|
||||
for (si, sp) in base.subpaths.iter().enumerate() {
|
||||
for ai in 0..sp.anchors.len() {
|
||||
if moved.contains(&k) {
|
||||
on_base.insert((si, ai));
|
||||
}
|
||||
k += 1;
|
||||
}
|
||||
}
|
||||
edit(&mut base, &on_base);
|
||||
let l = LiveShape::Path { base, radii, kinds, radii_relative: relative };
|
||||
*path = l.to_path();
|
||||
*live = Some(Box::new(l));
|
||||
Some(())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
@@ -103,7 +103,7 @@ pub use appearance::{
|
||||
};
|
||||
pub use assets::ExportAsset;
|
||||
pub use compound_shape::ShapeMode;
|
||||
pub use corners::LiveCorners;
|
||||
pub use corners::{LiveCorners, edit_corner_anchors};
|
||||
pub use depth::{MAX_DEPTH, MAX_SYMBOL_NODES};
|
||||
pub use graph::{
|
||||
ColumnDesign, ColumnType, DEFAULT_FILLED_LINE_WIDTH, FILLED_LINE_OUTLINE_WIDTH, Fractions, GraphDesign, GraphKind, GraphSpec, LabelRows,
|
||||
|
||||
@@ -40,6 +40,12 @@ use super::{CommandSpec, EngineError, Result, Session, bad, bool_or, cmd, has_do
|
||||
|
||||
pub fn specs() -> Vec<CommandSpec> {
|
||||
vec![
|
||||
cmd!(query "view.showMissingLinks", "Show Missing Links", ["View"], None,
|
||||
"{on?: bool (default: toggle)} show non-printing red outlines and badges on missing linked images and placed documents in the active document; transient view state, no undo step; reads no files (the desktop app scans in the background, links.marked inspects now) → {on}",
|
||||
has_doc, show_missing_links),
|
||||
cmd!(query "links.marked", "Marked Missing Links", [], None,
|
||||
"{} inspect missing links now; only visible image objects and placed documents are marked, and none when the toggle is off → {on, images: [{id, bounds: [x0, y0, x1, y1]}]}",
|
||||
has_doc, marked),
|
||||
cmd!(
|
||||
query "links.check",
|
||||
"Check Links",
|
||||
@@ -518,6 +524,8 @@ fn refused(link: &LinkInfo, doc_path: Option<&str>) -> Option<craft_docpath::Ref
|
||||
/// the content shown. Its bytes are read only when its size or modification time changed. An image
|
||||
/// placed from a DCS file is modified when one of its plate files of their own changed.
|
||||
fn probe(g: &Group, base: LinkBase) -> (Status, Option<Found>) {
|
||||
#[cfg(test)]
|
||||
probe_gate::hold(&g.link.path);
|
||||
let Some(mut f) = locate(&g.link, base) else { return (Status::Missing, None) };
|
||||
let l = &g.link;
|
||||
if !g.plate_files.is_empty() && super::place::dcs::plate_files_changed(&g.plate_files, &f.path) {
|
||||
@@ -536,6 +544,24 @@ fn probe(g: &Group, base: LinkBase) -> (Status, Option<Found>) {
|
||||
(if same { Status::Ok } else { Status::Modified }, Some(f))
|
||||
}
|
||||
|
||||
/// Whether [`probe`] would find group `g`'s file missing, without reading or hashing its content.
|
||||
/// A changed file is opened to check it can be read, and nothing more: the canvas markers ask only
|
||||
/// this, and with Update Links set to Manually a changed file keeps differing from its stored link,
|
||||
/// so a full probe would read the whole file again on every look while the markers are on.
|
||||
fn missing(g: &Group, base: LinkBase) -> bool {
|
||||
#[cfg(test)]
|
||||
probe_gate::hold(&g.link.path);
|
||||
let Some(f) = locate(&g.link, base) else { return true };
|
||||
let l = &g.link;
|
||||
if !g.plate_files.is_empty() && super::place::dcs::plate_files_changed(&g.plate_files, &f.path) {
|
||||
return false;
|
||||
}
|
||||
if l.size == Some(f.size) && l.modified.is_some() && l.modified == f.modified {
|
||||
return false;
|
||||
}
|
||||
fileio::read_file_head(&f.path, 0).is_err()
|
||||
}
|
||||
|
||||
/// Is image `key` of `d` showing its preview (its file not read)?
|
||||
fn previewing(d: &Document, key: &str) -> bool {
|
||||
d.images.get(key).is_none_or(ImageBlob::is_proxy)
|
||||
@@ -2159,6 +2185,7 @@ fn update_where(s: &mut Session, ids: Option<Vec<NodeId>>, path: Option<&str>) -
|
||||
editing_brush_art(d, |d| reads.into_iter().try_for_each(|(g, read)| install_read(d, &g.ids, read, None, Some(&g))))
|
||||
})?;
|
||||
}
|
||||
clear_markers(s, &updated)?;
|
||||
let mut out = json!({ "updated": updated, "missing": missing });
|
||||
if !warnings.is_empty() {
|
||||
out["warnings"] = json!(warnings);
|
||||
@@ -2451,6 +2478,7 @@ fn relink(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
}
|
||||
not_found.sort();
|
||||
not_found.dedup();
|
||||
clear_markers(s, &relinked)?;
|
||||
let mut out = json!({ "relinked": relinked, "notFound": not_found });
|
||||
if !warnings.is_empty() {
|
||||
out["warnings"] = json!(warnings);
|
||||
@@ -2630,6 +2658,56 @@ pub(crate) fn statuses(st: &crate::DocState) -> BTreeMap<NodeId, (Status, Option
|
||||
out
|
||||
}
|
||||
|
||||
/// Missing placed objects, using the same file resolution as the Links panel. Hidden ones are
|
||||
/// included: [`crate::DocState::marked_missing_links`] leaves out what is hidden when it is drawn, so
|
||||
/// artwork shown later is marked without another scan. Also used on the link watch worker, away
|
||||
/// from the UI thread.
|
||||
pub(crate) fn missing_markers(doc: &Document, base: LinkBase) -> Vec<NodeId> {
|
||||
groups(doc, None).iter().filter(|g| !g.ids.is_empty() && missing(g, base)).flat_map(|g| g.ids.iter().copied()).collect()
|
||||
}
|
||||
|
||||
fn show_missing_links(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let st = s.doc_mut()?;
|
||||
let on = super::switch_or(p, "on", !st.show_missing_links, "view.showMissingLinks")?;
|
||||
// Never probes files here: a changed linked file is read in full to tell whether it still
|
||||
// matches, which would hold up the caller (the desktop UI thread) on a large or slow file.
|
||||
// Turning the overlay on leaves its markers unscanned; the link watch worker scans them
|
||||
// at once ([`Session::missing_link_scan_due`]) and the canvas repaints from its result.
|
||||
// `links.marked` stays the explicit, synchronous inspection. The web build has no worker
|
||||
// and no files to read: its app marks them in place ([`Session::mark_missing_links_in_place`]).
|
||||
if !on || !st.show_missing_links {
|
||||
st.missing_link_markers = None;
|
||||
}
|
||||
st.show_missing_links = on;
|
||||
Ok(json!({"on": on}))
|
||||
}
|
||||
|
||||
fn marked(s: &mut Session, _: &Value) -> Result<Value> {
|
||||
let st = s.doc_mut()?;
|
||||
let ids = if st.show_missing_links { missing_markers(&st.doc, LinkBase::of(st)) } else { vec![] };
|
||||
let images: Vec<Value> = ids
|
||||
.iter()
|
||||
.filter(|id| st.doc.is_visible(**id))
|
||||
.filter_map(|id| {
|
||||
let b = st.doc.node(*id)?.geometric_bounds()?;
|
||||
Some(json!({"id": id.0, "bounds": [b.x0, b.y0, b.x1, b.y1]}))
|
||||
})
|
||||
.collect();
|
||||
st.missing_link_markers = Some((st.doc.clone(), ids));
|
||||
Ok(json!({"on": st.show_missing_links, "images": images}))
|
||||
}
|
||||
|
||||
/// Successful repair clears its decoration even when the file's metadata is unchanged.
|
||||
fn clear_markers(s: &mut Session, repaired: &[u64]) -> Result<()> {
|
||||
if !repaired.is_empty()
|
||||
&& let Some((_, ids)) = &mut s.doc_mut()?.missing_link_markers
|
||||
{
|
||||
let repaired: std::collections::HashSet<_> = repaired.iter().copied().collect();
|
||||
ids.retain(|id| !repaired.contains(&id.0));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// The format of the file image `im` of `d` shows: its link's extension, else its pixels' type.
|
||||
fn format_label(d: &Document, im: &ImageObject) -> &'static str {
|
||||
if im.link.is_some() && d.images.get(&im.key).is_some_and(ImageBlob::is_separated) {
|
||||
@@ -3319,6 +3397,64 @@ fn placement_options(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
Ok(json!({ "ids": ids_json(&ids), "placement": placement_json(shown) }))
|
||||
}
|
||||
|
||||
/// Test seam: hold the probe of one linked path until the test releases it, so a test can
|
||||
/// tell whether a command returned before the probe finished, and on which thread it ran.
|
||||
#[cfg(test)]
|
||||
pub(crate) mod probe_gate {
|
||||
use std::sync::{Arc, Condvar, Mutex, PoisonError};
|
||||
use std::time::Duration;
|
||||
|
||||
/// A gated path: (open, entered on thread named, finished), and the condition signalling
|
||||
/// each change.
|
||||
#[derive(Default)]
|
||||
pub struct Gate {
|
||||
state: Mutex<(bool, Option<String>, bool)>,
|
||||
changed: Condvar,
|
||||
}
|
||||
|
||||
static GATES: Mutex<Vec<(String, Arc<Gate>)>> = Mutex::new(Vec::new());
|
||||
|
||||
impl Gate {
|
||||
/// Gate probes of the link stored as `path` until [`Gate::open`].
|
||||
pub fn close(path: &str) -> Arc<Gate> {
|
||||
let g = Arc::new(Gate::default());
|
||||
GATES.lock().unwrap_or_else(PoisonError::into_inner).push((path.to_string(), g.clone()));
|
||||
g
|
||||
}
|
||||
pub fn open(&self) {
|
||||
self.state.lock().unwrap_or_else(PoisonError::into_inner).0 = true;
|
||||
self.changed.notify_all();
|
||||
}
|
||||
/// The name of the thread that entered the probe, waiting up to `limit` for one.
|
||||
pub fn entered(&self, limit: Duration) -> Option<String> {
|
||||
let s = self.state.lock().unwrap_or_else(PoisonError::into_inner);
|
||||
let (s, _) = self.changed.wait_timeout_while(s, limit, |s| s.1.is_none()).unwrap_or_else(PoisonError::into_inner);
|
||||
s.1.clone()
|
||||
}
|
||||
pub fn finished(&self) -> bool {
|
||||
self.state.lock().unwrap_or_else(PoisonError::into_inner).2
|
||||
}
|
||||
}
|
||||
|
||||
/// Called at the start of every probe: blocks while `path` is gated and closed (at most
|
||||
/// ten seconds, so a regression fails the test instead of hanging it).
|
||||
pub(super) fn hold(path: &str) {
|
||||
let gate = GATES.lock().unwrap_or_else(PoisonError::into_inner).iter().find(|(p, _)| p == path).map(|(_, g)| g.clone());
|
||||
let Some(g) = gate else { return };
|
||||
let mut s = g.state.lock().unwrap_or_else(PoisonError::into_inner);
|
||||
s.1 = Some(std::thread::current().name().unwrap_or("").to_string());
|
||||
g.changed.notify_all();
|
||||
let (mut s, _) = g.changed.wait_timeout_while(s, Duration::from_secs(10), |s| !s.0).unwrap_or_else(PoisonError::into_inner);
|
||||
s.2 = true;
|
||||
g.changed.notify_all();
|
||||
}
|
||||
|
||||
/// Stop gating `path`.
|
||||
pub fn remove(path: &str) {
|
||||
GATES.lock().unwrap_or_else(PoisonError::into_inner).retain(|(p, _)| p != path);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -16,7 +16,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Transform",
|
||||
[],
|
||||
None,
|
||||
"{matrix: [a,b,c,d,e,f], copy?: bool, ids?, strokes?: bool, corners?: bool, typeAreas?: bool, anchors?: bool, objects?: bool (Transform Objects, default true; false: the art stays and, with patterns, only its pattern tiles transform), patterns?: bool (Transform Patterns: pattern fills and strokes transform with the art; default: prefs transformPatternTiles), releaseOutside?: bool, interpolate?: bool (with anchors and a matrix that only moves them: the handles of each segment with one moved end are re-mapped, as path.moveAnchors's; default: prefs interpolateControlPoints), drawBehind?: bool (with copy: in Draw Behind, view.drawMode, each copy goes directly below its original instead of above it, as the Selection and Direct Selection tools' Alt-drags send; default false)} apply an affine to the selection (or ids); anchors (without ids or copy): paths with anchors selected with Direct Selection have only those anchors and their handles transformed, as the Transform tools and object.move/rotate/scale/reflect/shear do (default: the whole objects); strokes/corners: Scale Strokes & Effects / Scale Corners (default: the preferences); typeAreas: area type among them (not type inside a group) reshapes its frame by the matrix and its text reflows at its size, as a bounding-box handle drag does (default: the type transforms too); releaseOutside (without copy or anchors): a Shaper Group's original shape that ends wholly outside the bounds the group's original shapes had before takes shaper.releaseSource in the same undo step, named Remove from Shaper Group, as the Selection tool's moves in Construction mode do",
|
||||
"{matrix: [a,b,c,d,e,f], copy?: bool, ids?, strokes?: bool, corners?: bool, typeAreas?: bool, anchors?: bool, objects?: bool (Transform Objects, default true; false: the art stays and, with patterns, only its pattern tiles transform), patterns?: bool (Transform Patterns: pattern fills and strokes transform with the art; default: prefs transformPatternTiles), releaseOutside?: bool, interpolate?: bool (with anchors and a matrix that only moves them: the handles of each segment with one moved end are re-mapped, as path.moveAnchors's; default: prefs interpolateControlPoints), drawBehind?: bool (with copy: in Draw Behind, view.drawMode, each copy goes directly below its original instead of above it, as the Selection and Direct Selection tools' Alt-drags send; default false)} apply an affine to the selection (or ids); anchors (without ids or copy): paths with anchors selected with Direct Selection have only those anchors and their handles transformed, as the Transform tools and object.move/rotate/scale/reflect/shear do (default: the whole objects), and a matrix that only moves them moves the uncut corners of a path with rounded Live Corners, which is cut again at its radii; strokes/corners: Scale Strokes & Effects / Scale Corners (default: the preferences); typeAreas: area type among them (not type inside a group) reshapes its frame by the matrix and its text reflows at its size, as a bounding-box handle drag does (default: the type transforms too); releaseOutside (without copy or anchors): a Shaper Group's original shape that ends wholly outside the bounds the group's original shapes had before takes shaper.releaseSource in the same undo step, named Remove from Shaper Group, as the Selection tool's moves in Construction mode do",
|
||||
has_doc,
|
||||
transform
|
||||
),
|
||||
@@ -25,7 +25,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Move…",
|
||||
["Object", "Transform"],
|
||||
Some("Cmd+Shift+M"),
|
||||
"{ids?: [id…] (selected first; default: the selection), dx, dy, copy?, objects?: bool (Transform Objects, default true; false: the art stays and, with patterns, only its pattern tiles transform), patterns?: bool (Transform Patterns: pattern fills and strokes transform with the art; default: prefs transformPatternTiles), typeAreas?: bool (area type: the frame is reshaped and the text reflows at its size), interpolate?: bool (as path.moveAnchors's; default: prefs interpolateControlPoints)}. With anchors selected with Direct Selection (and no copy), only those anchors and their handles transform, about the centre of their own box.",
|
||||
"{ids?: [id…] (selected first; default: the selection), dx, dy, copy?, objects?: bool (Transform Objects, default true; false: the art stays and, with patterns, only its pattern tiles transform), patterns?: bool (Transform Patterns: pattern fills and strokes transform with the art; default: prefs transformPatternTiles), typeAreas?: bool (area type: the frame is reshaped and the text reflows at its size), interpolate?: bool (as path.moveAnchors's; default: prefs interpolateControlPoints)}. With anchors selected with Direct Selection (and no copy), only those anchors and their handles transform, about the centre of their own box. On a path with rounded Live Corners, the uncut corner of each selected anchor moves by (dx, dy) and is cut again at its radius.",
|
||||
has_selection_or_guides,
|
||||
move_cmd
|
||||
),
|
||||
|
||||
+163
-17
@@ -41,7 +41,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Move Anchors",
|
||||
[],
|
||||
None,
|
||||
"{dx, dy (a move by 0 changes nothing and records no undo step), patterns?: bool (Transform Patterns: pattern fills and strokes transform with the objects that move whole; default: prefs transformPatternTiles), interpolate?: bool (Interpolate Control Points: the handles of each segment with one moved end are re-mapped by the turn, scale and move that take its old ends to its new ends; default: prefs interpolateControlPoints)} move direct-selected anchors (whole paths if fully selected); refused while an object of a symbol instance's art is selected",
|
||||
"{dx, dy (a move by 0, or one that the pixel-grid snap of pixel-aligned paths takes back, changes nothing and records no undo step), patterns?: bool (Transform Patterns: pattern fills and strokes transform with the objects that move whole; default: prefs transformPatternTiles), interpolate?: bool (Interpolate Control Points: the handles of each segment with one moved end are re-mapped by the turn, scale and move that take its old ends to its new ends; default: prefs interpolateControlPoints)} move direct-selected anchors (whole paths if fully selected); with rounded Live Corners, each selected anchor's uncut corner moves by (dx, dy) and is recut at its radius, so a grabbed arc end can move off a snap target; refused while an object of a symbol instance's art is selected",
|
||||
has_selection,
|
||||
move_anchors
|
||||
),
|
||||
@@ -68,7 +68,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Move Anchor Point",
|
||||
[],
|
||||
None,
|
||||
"{id, subpath?, anchor, x, y} move one anchor to (x, y), its handles with it",
|
||||
"{id, subpath?, anchor, x, y} move one anchor to (x, y), its handles with it; with rounded Live Corners, the uncut corner moves by the delta from the drawn anchor to (x, y) and is recut at its radius, so the drawn anchor can finish away from (x, y)",
|
||||
has_doc,
|
||||
move_anchor
|
||||
),
|
||||
@@ -176,6 +176,118 @@ pub(super) fn path_mut(d: &mut vectorcraft_doc::Document, id: NodeId) -> Result<
|
||||
}
|
||||
}
|
||||
|
||||
/// Transform `anchors` of path `id` by `xf` when the path has cut Live Corners: the anchors of its
|
||||
/// uncut outline move (with `interpolate` and a move, as [`move_interpolating_handles`] moves
|
||||
/// them) and the corners are cut again with the same radii, so they stay live
|
||||
/// ([`vectorcraft_doc::edit_corner_anchors`]). Returns `None`, changing nothing, for a path
|
||||
/// without cut corners.
|
||||
fn transform_live_corner_anchors(
|
||||
d: &mut vectorcraft_doc::Document,
|
||||
id: NodeId,
|
||||
anchors: &BTreeSet<AnchorRef>,
|
||||
xf: vectorcraft_geom::Affine,
|
||||
interpolate: bool,
|
||||
) -> Option<()> {
|
||||
let NodeKind::Path { path, live, .. } = &mut d.node_mut(id)?.kind else { return None };
|
||||
let c = xf.as_coeffs();
|
||||
vectorcraft_doc::edit_corner_anchors(path, live, anchors, |base, set| {
|
||||
if interpolate && c[..4] == [1.0, 0.0, 0.0, 1.0] {
|
||||
move_interpolating_handles(base, set, Vec2::new(c[4], c[5]));
|
||||
} else {
|
||||
for &(si, ai) in set {
|
||||
if let Some(a) = base.anchor_mut(si, ai) {
|
||||
*a = a.transform(xf);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/// For each anchor of path `id` as drawn (per subpath), the anchor of its uncut outline it comes
|
||||
/// from ([`vectorcraft_doc::LiveCorners::sources`]), or `None` when `id` is not a path.
|
||||
fn corner_sources(d: &Document, id: NodeId) -> Option<Vec<Vec<usize>>> {
|
||||
let NodeKind::Path { path, live, .. } = &d.node(id)?.kind else { return None };
|
||||
Some(vectorcraft_doc::LiveCorners::new(path, live.as_deref())?.sources().to_vec())
|
||||
}
|
||||
|
||||
/// After the anchors of path `id` as drawn changed from `before` to `after` (each listing the
|
||||
/// corners they come from, as [`corner_sources`] gives them), point the selected anchors and the
|
||||
/// key anchor of `sel` on that path at the anchors of the same corners, and drop the path's
|
||||
/// selected segments. An unchanged layout leaves `sel` as it is.
|
||||
fn remap_corner_anchors(sel: &mut Selection, id: NodeId, before: &[Vec<usize>], after: &[Vec<usize>]) {
|
||||
if before == after {
|
||||
return;
|
||||
}
|
||||
let source = |(si, ai): AnchorRef| before.get(si).and_then(|v| v.get(ai)).copied();
|
||||
let drawn =
|
||||
|k: usize| after.iter().enumerate().flat_map(move |(si, v)| v.iter().enumerate().filter(move |(_, s)| **s == k).map(move |(ai, _)| (si, ai)));
|
||||
if let Some(set) = sel.anchors.get_mut(&id) {
|
||||
let corners: BTreeSet<usize> = set.iter().filter_map(|r| source(*r)).collect();
|
||||
*set = corners.into_iter().flat_map(drawn).collect();
|
||||
}
|
||||
if let Some((key, r)) = sel.key_anchor
|
||||
&& key == id
|
||||
{
|
||||
sel.key_anchor = source(r).and_then(|k| drawn(k).next()).map(|r| (id, r));
|
||||
}
|
||||
sel.segments.remove(&id);
|
||||
}
|
||||
|
||||
/// Snap pixel-aligned path `id`, or the pixel-aligned compound path that holds it, to the pixel
|
||||
/// grid again, with `sel` following its anchors when the snap cuts its Live Corners again with a
|
||||
/// different layout ([`remap_corner_anchors`]).
|
||||
fn snap_keeping_selection(d: &mut Document, id: NodeId, sel: &mut Selection, before: Option<&[Vec<usize>]>) {
|
||||
let top = compound_or_self(d, id);
|
||||
if let Some(n) = d.node_mut(top) {
|
||||
super::object::snap_if_aligned(n);
|
||||
}
|
||||
if let (Some(before), Some(after)) = (before, corner_sources(d, id)) {
|
||||
remap_corner_anchors(sel, id, before, &after);
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether `apply` on a copy of the active document, followed by the pixel-grid snap that
|
||||
/// [`Session::edit`] makes, leaves the document as it was (a nudge that the snap of a
|
||||
/// pixel-aligned path takes back). Without a pixel-aligned path among `ids` (or a compound path
|
||||
/// holding one) the answer is `false` without trying. An anchor edit turns a live rectangle or
|
||||
/// polygon into a live path with the same outline, radii and kinds; that conversion alone counts
|
||||
/// as no change, while any change to the uncut outline or the corner settings still counts.
|
||||
fn snap_undoes(s: &Session, ids: impl IntoIterator<Item = NodeId>, apply: impl FnOnce(&mut Document, &mut Selection) -> Result<()>) -> Result<bool> {
|
||||
let st = s.doc()?;
|
||||
let ids: Vec<NodeId> = ids.into_iter().collect();
|
||||
if !ids.iter().any(|&id| st.doc.node(compound_or_self(&st.doc, id)).is_some_and(|n| n.extras().pixel_aligned)) {
|
||||
return Ok(false);
|
||||
}
|
||||
let mut doc = (*st.doc).clone();
|
||||
let mut sel = st.selection.clone();
|
||||
apply(&mut doc, &mut sel)?;
|
||||
super::refresh_pixel_aligned(&st.doc, &mut doc);
|
||||
for &id in &ids {
|
||||
let (Some(NodeKind::Path { path, live, .. }), Some(anchors)) = (st.doc.node(id).map(|n| &n.kind), st.selection.anchors.get(&id)) else {
|
||||
continue;
|
||||
};
|
||||
// A live path keeps its variant through an anchor edit, so only a rectangle or polygon
|
||||
// needs the comparison below.
|
||||
if !matches!(live.as_deref(), Some(vectorcraft_doc::LiveShape::Rectangle { .. } | vectorcraft_doc::LiveShape::Polygon { .. })) {
|
||||
continue;
|
||||
}
|
||||
// The path and live shape the same anchors, left where they are, would turn this path
|
||||
// into. The drawn path is cut from the live shape, and a recut can differ from the stored
|
||||
// path by rounding, so the live shapes are compared and both fields are restored.
|
||||
let (mut converted_path, mut converted) = (path.clone(), live.clone());
|
||||
if vectorcraft_doc::edit_corner_anchors(&mut converted_path, &mut converted, anchors, |_, _| {}).is_none() {
|
||||
continue;
|
||||
}
|
||||
if let Some(NodeKind::Path { path: after_path, live: after, .. }) = doc.node_mut(id).map(|n| &mut n.kind)
|
||||
&& *after == converted
|
||||
{
|
||||
after.clone_from(live);
|
||||
after_path.clone_from(path);
|
||||
}
|
||||
}
|
||||
Ok(doc == *st.doc)
|
||||
}
|
||||
|
||||
fn append_anchor(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let id = object_param(p, "id", "path.appendAnchor")?.ok_or_else(|| bad("path.appendAnchor", "missing id"))?;
|
||||
let a = anchor_from_json(p, "path.appendAnchor")?;
|
||||
@@ -278,6 +390,13 @@ fn move_selected(s: &mut Session, p: &Value, bend: bool) -> Result<Value> {
|
||||
let st = s.doc()?;
|
||||
let mut sel = st.selection.clone();
|
||||
let (held, bends) = if bend { held_segments(&st.doc, &mut sel, d) } else { (false, vec![]) };
|
||||
// A path with a curved segment that bends or holds its anchors is edited anchor by anchor, so
|
||||
// the segment indices found above stay valid.
|
||||
let plain: BTreeSet<NodeId> = bends
|
||||
.iter()
|
||||
.map(|b| b.0)
|
||||
.chain(sel.anchors.iter().filter(|(id, set)| st.selection.anchors.get(id) != Some(*set)).map(|(id, _)| *id))
|
||||
.collect();
|
||||
// Segments that hold their anchors and don't bend, with nothing else to move, change nothing.
|
||||
if held && bends.is_empty() && sel.whole().is_empty() && sel.guides.is_empty() && sel.anchors.values().all(BTreeSet::is_empty) {
|
||||
return ok();
|
||||
@@ -286,15 +405,21 @@ fn move_selected(s: &mut Session, p: &Value, bend: bool) -> Result<Value> {
|
||||
// `patterns` (default: General › Transform Pattern Tiles) is on.
|
||||
let sc = Scaling { patterns: super::object::transform_patterns(s, p, &sel.whole())?, ..Scaling::default() };
|
||||
let interpolate = interpolates_handles(s, p, C)?;
|
||||
s.edit(if bends.is_empty() { "Move" } else { "Reshape" }, |doc, _| {
|
||||
transform_selected(doc, &sel, vectorcraft_geom::Affine::translate(d), sc, interpolate)?;
|
||||
let apply = |doc: &mut Document, live: &mut Selection| -> Result<()> {
|
||||
transform_selected(doc, &sel, live, &plain, vectorcraft_geom::Affine::translate(d), sc, interpolate)?;
|
||||
for &(id, si, seg) in &bends {
|
||||
if let Some(sp) = path_mut(doc, id)?.subpaths.get_mut(si) {
|
||||
sp.nudge_segment(seg, d);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
})?;
|
||||
};
|
||||
// Anchors and objects selected whole that the pixel-grid snap puts back where they were change
|
||||
// nothing, and record no undo step.
|
||||
if sel.guides.is_empty() && snap_undoes(s, sel.anchors.keys().copied().chain(sel.whole()), apply)? {
|
||||
return ok();
|
||||
}
|
||||
s.edit(if bends.is_empty() { "Move" } else { "Reshape" }, apply)?;
|
||||
// Transform Again repeats a move that moved something; a drag records it when it commits. A
|
||||
// move that held segments' anchors is not one move of the selection.
|
||||
let st = s.doc_mut()?;
|
||||
@@ -350,7 +475,7 @@ pub(crate) fn transform_anchors(s: &mut Session, label: &str, xf: vectorcraft_ge
|
||||
let c = xf.as_coeffs();
|
||||
let is_translation = (c[0] - 1.0).abs() < 1e-9 && c[1].abs() < 1e-9 && c[2].abs() < 1e-9 && (c[3] - 1.0).abs() < 1e-9;
|
||||
s.edit(label, |doc, live| {
|
||||
transform_selected(doc, &sel, xf, sc, interpolate)?;
|
||||
transform_selected(doc, &sel, live, &BTreeSet::new(), xf, sc, interpolate)?;
|
||||
Ok(if is_translation { vec![] } else { doc.transform_ruler_guides(live, xf) })
|
||||
})
|
||||
}
|
||||
@@ -359,14 +484,32 @@ pub(crate) fn transform_anchors(s: &mut Session, label: &str, xf: vectorcraft_ge
|
||||
/// objects selected whole (those with no entry in `sel`'s `anchors`). An object inside
|
||||
/// another selected object, such as a path in a selected group, moves once, with that object.
|
||||
/// When `xf` is a move and `interpolate` is on, the handles of each segment with one moved end
|
||||
/// are re-mapped ([`move_interpolating_handles`]).
|
||||
fn transform_selected(doc: &mut Document, sel: &Selection, xf: vectorcraft_geom::Affine, sc: Scaling, interpolate: bool) -> Result<()> {
|
||||
/// are re-mapped ([`move_interpolating_handles`]). A path with rounded Live Corners keeps them
|
||||
/// ([`transform_live_corner_anchors`]), and `live_sel` follows its anchors when the recut changes
|
||||
/// them, except for the paths in `plain`, which are edited anchor by anchor.
|
||||
fn transform_selected(
|
||||
doc: &mut Document,
|
||||
sel: &Selection,
|
||||
live_sel: &mut Selection,
|
||||
plain: &BTreeSet<NodeId>,
|
||||
xf: vectorcraft_geom::Affine,
|
||||
sc: Scaling,
|
||||
interpolate: bool,
|
||||
) -> Result<()> {
|
||||
let ids = super::edit::outermost(doc, sel.objects.clone());
|
||||
let c = xf.as_coeffs();
|
||||
let is_translation = (c[0] - 1.0).abs() < 1e-9 && c[1].abs() < 1e-9 && c[2].abs() < 1e-9 && (c[3] - 1.0).abs() < 1e-9;
|
||||
let delta = vectorcraft_geom::Vec2::new(c[4], c[5]);
|
||||
for id in &ids {
|
||||
match sel.anchors.get(id) {
|
||||
Some(set)
|
||||
if c[..4] == [1.0, 0.0, 0.0, 1.0]
|
||||
&& !plain.contains(id)
|
||||
&& let Some(before) = corner_sources(doc, *id)
|
||||
&& transform_live_corner_anchors(doc, *id, set, xf, interpolate).is_some() =>
|
||||
{
|
||||
snap_keeping_selection(doc, *id, live_sel, Some(&before));
|
||||
}
|
||||
Some(set) => {
|
||||
let path = path_mut(doc, *id)?;
|
||||
// Only an exact move takes the interpolating path: a near-identity scale or
|
||||
@@ -798,16 +941,19 @@ fn move_anchor(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
{
|
||||
return ok();
|
||||
}
|
||||
s.edit("Move", |d, _| {
|
||||
let path = path_mut(d, id)?;
|
||||
let a = path.anchor_mut(si, ai).ok_or_else(|| EngineError::Other("no such anchor".into()))?;
|
||||
*a = a.transform(vectorcraft_geom::Affine::translate(pos - a.p));
|
||||
// A pixel-aligned path, or the pixel-aligned compound path that holds it, snaps to the
|
||||
// pixel grid again.
|
||||
let top = compound_or_self(d, id);
|
||||
if let Some(n) = d.node_mut(top) {
|
||||
super::object::snap_if_aligned(n);
|
||||
s.edit("Move", |d, sel| {
|
||||
let old = d.node(id).and_then(|n| n.path_data()).and_then(|p| p.subpaths.get(si)).and_then(|sp| sp.anchors.get(ai)).map(|a| a.p);
|
||||
let before = corner_sources(d, id);
|
||||
let moved = BTreeSet::from([(si, ai)]);
|
||||
let kept = old.and_then(|p0| transform_live_corner_anchors(d, id, &moved, vectorcraft_geom::Affine::translate(pos - p0), false));
|
||||
if kept.is_none() {
|
||||
let path = path_mut(d, id)?;
|
||||
let a = path.anchor_mut(si, ai).ok_or_else(|| EngineError::Other("no such anchor".into()))?;
|
||||
*a = a.transform(vectorcraft_geom::Affine::translate(pos - a.p));
|
||||
}
|
||||
// A pixel-aligned path, or the pixel-aligned compound path that holds it, snaps to the
|
||||
// pixel grid again, and the selection follows a path whose corners were cut again.
|
||||
snap_keeping_selection(d, id, sel, kept.and(before.as_deref()));
|
||||
Ok(())
|
||||
})?;
|
||||
ok()
|
||||
|
||||
@@ -750,6 +750,7 @@ pub const SWITCHING_LABELS: &[&str] = &[
|
||||
"Lock Guides",
|
||||
"Hide Slices",
|
||||
"Show Print Tiling",
|
||||
"Show Missing Links",
|
||||
"Lock Grid",
|
||||
"Edit Envelope",
|
||||
"Edit Contents",
|
||||
|
||||
@@ -132,6 +132,10 @@ pub struct DocState {
|
||||
pub spelling_ignored: std::collections::BTreeSet<String>,
|
||||
/// View → Show Transparency Grid, per document (saved view state, not undoable).
|
||||
pub transparency_grid: bool,
|
||||
/// View → Show Missing Links: transient canvas decoration, never document artwork.
|
||||
pub show_missing_links: bool,
|
||||
/// Last worker scan, tied to the exact document snapshot it inspected.
|
||||
pub missing_link_markers: Option<(Arc<Document>, Vec<NodeId>)>,
|
||||
/// The format Save writes ([`cmd::fileio::SAVE_FORMATS`]): the one the document was opened
|
||||
/// from or last saved as.
|
||||
pub format: &'static str,
|
||||
@@ -491,6 +495,30 @@ impl SameContent {
|
||||
}
|
||||
|
||||
impl DocState {
|
||||
/// Cached missing links still present and visible in the current art. Geometry-only edits
|
||||
/// keep their markers moving with the objects; relinking or embedding drops them immediately.
|
||||
pub fn marked_missing_links(&self) -> Vec<NodeId> {
|
||||
if !self.show_missing_links {
|
||||
return vec![];
|
||||
}
|
||||
let Some((before, ids)) = &self.missing_link_markers else { return vec![] };
|
||||
fn link(n: &vectorcraft_doc::Node) -> Option<&vectorcraft_doc::LinkInfo> {
|
||||
match &n.kind {
|
||||
NodeKind::Image(im) => im.link.as_ref(),
|
||||
NodeKind::PlacedDocument(p) => Some(&p.link),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
ids.iter()
|
||||
.copied()
|
||||
.filter(|id| {
|
||||
let old = before.node(*id).and_then(link);
|
||||
let now = self.doc.node(*id).and_then(link);
|
||||
now.is_some() && now == old && self.doc.is_visible(*id)
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn new(mut doc: Document, path: Option<String>) -> Self {
|
||||
let active_layer = doc.default_layer();
|
||||
// Saved view state lives here while the document is open (saves write it back).
|
||||
@@ -532,6 +560,8 @@ impl DocState {
|
||||
mask_view: None,
|
||||
spelling_ignored: Default::default(),
|
||||
transparency_grid,
|
||||
show_missing_links: false,
|
||||
missing_link_markers: None,
|
||||
format: "vectorcraft",
|
||||
save_options: Default::default(),
|
||||
save_artboards: vec![],
|
||||
|
||||
@@ -27,9 +27,24 @@ use crate::{Result, Session};
|
||||
/// A file's size and modification time (nanoseconds since 1970).
|
||||
pub type Stamp = (u64, u128);
|
||||
|
||||
/// Stamps of a document's linked files taken on a worker thread: (document uid, [(file,
|
||||
/// object ids, stamp)]), the condition the worker signals when it ends, and whether it has.
|
||||
pub type LinkScan = Arc<(Mutex<Option<(u64, Vec<(String, Vec<u64>, Option<Stamp>)>)>>, Condvar, AtomicBool)>;
|
||||
/// A document's linked-file scan, the condition the worker signals when it ends, and whether
|
||||
/// it has. Includes missing-link marker ids when their view toggle is enabled.
|
||||
pub type LinkScan = Arc<(Mutex<Option<LinkScanResult>>, Condvar, AtomicBool)>;
|
||||
|
||||
/// A worker's stamps and optional missing-link overlay scan of the same document snapshot.
|
||||
pub struct LinkScanResult {
|
||||
uid: u64,
|
||||
stamps: Vec<(String, Vec<u64>, Option<Stamp>)>,
|
||||
markers: Option<(Arc<vectorcraft_doc::Document>, Vec<vectorcraft_doc::NodeId>)>,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
impl LinkScanResult {
|
||||
/// A look's stamps of document `uid`'s linked files, with no missing-link scan.
|
||||
pub(crate) fn stamps(uid: u64, stamps: Vec<(String, Vec<u64>, Option<Stamp>)>) -> Self {
|
||||
Self { uid, stamps, markers: None }
|
||||
}
|
||||
}
|
||||
|
||||
/// Held by a look's worker: marks the look as ended and wakes [`Session::wait_link_scan`] when
|
||||
/// dropped, whether the worker returned or unwound.
|
||||
@@ -83,6 +98,29 @@ pub(crate) fn update_changed(s: &mut Session, _: &Value) -> Result<Value> {
|
||||
}
|
||||
|
||||
impl Session {
|
||||
/// Whether the active document shows missing links but has no marker scan yet (the overlay
|
||||
/// was just turned on, or its first scan saw art that has since changed): the desktop app
|
||||
/// then starts a look at once instead of waiting for the next periodic one.
|
||||
pub fn missing_link_scan_due(&self) -> bool {
|
||||
self.link_scan.is_none() && self.active().is_some_and(|st| st.show_missing_links && st.missing_link_markers.is_none())
|
||||
}
|
||||
|
||||
/// Find the active document's missing links again, here and now, when it shows them and its art
|
||||
/// changed since they were last found (or they never were); returns whether it did. This reads
|
||||
/// linked files on the calling thread, so only the web app calls it: it has no files to read,
|
||||
/// so every linked file is missing there, and no link watch worker to scan in the background.
|
||||
/// Artwork restored or placed while the overlay is on is then marked too. The desktop app
|
||||
/// scans on the worker instead ([`Session::start_link_scan`]).
|
||||
pub fn mark_missing_links_in_place(&mut self) -> bool {
|
||||
let Some(st) = self.active_mut() else { return false };
|
||||
if !st.show_missing_links || st.missing_link_markers.as_ref().is_some_and(|(seen, _)| Arc::ptr_eq(seen, &st.doc)) {
|
||||
return false;
|
||||
}
|
||||
let ids = crate::cmd::links::missing_markers(&st.doc, crate::cmd::links::LinkBase::of(st));
|
||||
st.missing_link_markers = Some((st.doc.clone(), ids));
|
||||
true
|
||||
}
|
||||
|
||||
/// Start stamping the active document's linked files on a worker thread, unless a look is
|
||||
/// still running, a script is running (or the build has no files to look at: the web app).
|
||||
pub fn start_link_scan(&mut self) {
|
||||
@@ -94,7 +132,14 @@ impl Session {
|
||||
// A confined caller's roots, else what the caller that opened the document may read (the
|
||||
// desktop frame is unconfined).
|
||||
let opened_by = st.opened_by.clone();
|
||||
let marker_doc = st.show_missing_links.then(|| st.doc.clone());
|
||||
let links_from = st.links_from.clone();
|
||||
if files.is_empty() {
|
||||
// Nothing linked, so nothing missing: an empty scan, which also ends
|
||||
// [`Session::missing_link_scan_due`] without starting a worker.
|
||||
if let Some(st) = self.docs.iter_mut().find(|st| st.uid == uid) {
|
||||
st.missing_link_markers = st.show_missing_links.then(|| (st.doc.clone(), vec![]));
|
||||
}
|
||||
return;
|
||||
}
|
||||
let slot: LinkScan = Arc::default();
|
||||
@@ -103,12 +148,18 @@ impl Session {
|
||||
let spawned = std::thread::Builder::new().name("link-watch".into()).spawn(move || {
|
||||
// Marks the look as ended when the worker returns or unwinds.
|
||||
let _ended = Ended(out.clone());
|
||||
let stamps = scope.run(|| {
|
||||
let (stamps, markers) = scope.run(|| {
|
||||
crate::file_access::confine(crate::file_access::current().or(opened_by).as_ref(), || {
|
||||
files.into_iter().map(|(p, ids)| (p.clone(), ids, stamp(&p, doc_path.as_deref()))).collect()
|
||||
let stamps = files.into_iter().map(|(p, ids)| (p.clone(), ids, stamp(&p, doc_path.as_deref()))).collect();
|
||||
let markers = marker_doc.map(|doc| {
|
||||
let base = crate::cmd::links::LinkBase::of_files(doc_path.as_deref(), links_from.as_deref());
|
||||
let ids = crate::cmd::links::missing_markers(&doc, base);
|
||||
(doc, ids)
|
||||
});
|
||||
(stamps, markers)
|
||||
})
|
||||
});
|
||||
*out.0.lock().unwrap_or_else(PoisonError::into_inner) = Some((uid, stamps));
|
||||
*out.0.lock().unwrap_or_else(PoisonError::into_inner) = Some(LinkScanResult { uid, stamps, markers });
|
||||
});
|
||||
if spawned.is_ok() {
|
||||
self.link_scan = Some(slot);
|
||||
@@ -123,8 +174,15 @@ impl Session {
|
||||
return None;
|
||||
}
|
||||
self.link_scan.take_if(|scan| ended_without_stamps(scan, |ended| ended.load(Ordering::SeqCst)));
|
||||
let (uid, stamps) = self.link_scan.as_ref()?.0.lock().unwrap_or_else(PoisonError::into_inner).take()?;
|
||||
let LinkScanResult { uid, stamps, markers } = self.link_scan.as_ref()?.0.lock().unwrap_or_else(PoisonError::into_inner).take()?;
|
||||
self.link_scan = None;
|
||||
if let Some(st) = self.docs.iter_mut().find(|st| st.uid == uid)
|
||||
&& st.show_missing_links
|
||||
&& let Some((doc, ids)) = markers
|
||||
&& Arc::ptr_eq(&st.doc, &doc)
|
||||
{
|
||||
st.missing_link_markers = Some((doc, ids));
|
||||
}
|
||||
Some(self.apply_link_stamps(uid, stamps, false))
|
||||
}
|
||||
|
||||
|
||||
@@ -853,9 +853,24 @@ fn art_remove_all(h: &Host, a: &[Data], kind: Kind) -> Answer {
|
||||
let locks = d.locked_artboards();
|
||||
let on_locked: Vec<u64> = ids.iter().filter(|i| locks.holds_id(**i)).map(|i| i.0).take(20).collect();
|
||||
// A clipping path whose group or layer keeps other art would leave the next object clipping it.
|
||||
let going: std::collections::HashSet<NodeId> = ids.iter().copied().collect();
|
||||
// Deleting every path of a compound path would leave it empty, so a compound path that
|
||||
// clips counts as deleted too.
|
||||
let mut going: std::collections::HashSet<NodeId> = ids.iter().copied().collect();
|
||||
let mut seen = std::collections::HashSet::new();
|
||||
let mut emptied: Vec<NodeId> = Vec::new();
|
||||
for p in ids.iter().filter_map(|i| d.parent_of(*i)) {
|
||||
if going.contains(&p) || !seen.insert(p) {
|
||||
continue;
|
||||
}
|
||||
let all_go = |n: &crate::doc::Node| n.children().is_some_and(|k| k.iter().all(|k| going.contains(&k.id)));
|
||||
if d.node(p).is_some_and(|n| matches!(n.kind, NodeKind::Compound { .. }) && all_go(n)) {
|
||||
emptied.push(p);
|
||||
}
|
||||
}
|
||||
going.extend(emptied.iter().copied());
|
||||
let masks: Vec<u64> = ids
|
||||
.iter()
|
||||
.chain(&emptied)
|
||||
.filter(|i| {
|
||||
d.parent_of(**i).and_then(|p| d.node(p)).is_some_and(|p| {
|
||||
let kids = p.children().map_or(&[][..], Vec::as_slice);
|
||||
|
||||
@@ -394,6 +394,19 @@ fn paint_owner<'a>(d: &'a crate::Document, id: NodeId, n: &'a crate::doc::Node)
|
||||
d.parent_of(id).and_then(|p| d.node(p)).filter(|p| matches!(p.kind, NodeKind::Compound { .. }) || p.is_compound_shape()).unwrap_or(n)
|
||||
}
|
||||
|
||||
/// A script's new path goes on the active layer while it is shown and unlocked, or the topmost
|
||||
/// shown, unlocked layer otherwise. While an opacity mask, pattern or symbol is being edited,
|
||||
/// the path goes on the layer recorded by that edit mode. `create::on_layer` validates the layer.
|
||||
fn new_path_layer(st: &crate::DocState) -> Option<NodeId> {
|
||||
let d = &st.doc;
|
||||
if let Some(layer) =
|
||||
d.mask_edit.map(|e| e.layer).or_else(|| d.pattern_edit.as_ref().map(|e| e.layer)).or_else(|| d.symbol_edit.as_ref().map(|e| e.layer))
|
||||
{
|
||||
return Some(layer);
|
||||
}
|
||||
st.current_layer().filter(|l| d.is_editable(*l)).or_else(|| d.default_layer())
|
||||
}
|
||||
|
||||
/// Runs a path creation command with its layer placement recorded.
|
||||
fn drawing_normally(h: &super::Host, parent: Option<NodeId>, id: &str, params: &Value) -> std::result::Result<(Data, Value), HostError> {
|
||||
let mut params = params.clone();
|
||||
@@ -679,7 +692,7 @@ fn made_id(r: &(Data, Value)) -> std::result::Result<NodeId, HostError> {
|
||||
fn make(h: &super::Host, doc: Doc, id: &str, params: &Value, reversed: bool) -> Answer {
|
||||
let made = keeping_paint(h, || {
|
||||
on_doc(h, doc.uid, true, |h| {
|
||||
let parent = with_doc(h, doc, |_, st| st.current_layer().or_else(|| st.doc.default_layer()));
|
||||
let parent = with_doc(h, doc, |_, st| new_path_layer(st));
|
||||
let id = made_id(&drawing_normally(h, parent, id, params)?)?;
|
||||
if reversed {
|
||||
command(h, "path.reverse", &json!({"ids": [id.0]}))?;
|
||||
@@ -845,7 +858,7 @@ fn items_add(h: &super::Host, a: &[Data]) -> Answer {
|
||||
let ap = h.session.borrow().new_art();
|
||||
ap.fill_paint().is_none() && ap.stroke_paint().is_none()
|
||||
};
|
||||
let parent = with_doc(h, doc, |_, st| st.current_layer().or_else(|| st.doc.default_layer()));
|
||||
let parent = with_doc(h, doc, |_, st| new_path_layer(st));
|
||||
let id = made_id(&drawing_normally(h, parent, "path.create", &json!({"d": ""}))?)?;
|
||||
if unpainted {
|
||||
command(h, "paint.setStroke", &json!({"none": true, "ids": [id.0], "objectOnly": true}))?;
|
||||
|
||||
@@ -118,6 +118,7 @@ mod livecorners;
|
||||
mod maskview;
|
||||
pub(super) mod menucmds;
|
||||
mod mesh_picks;
|
||||
mod missing_links;
|
||||
mod moved;
|
||||
mod nativefile;
|
||||
mod newart;
|
||||
|
||||
@@ -152,7 +152,7 @@ fn a_look_that_stores_its_stamps_between_the_polls_reads_keeps_them() {
|
||||
// The worker takes its turn after the slot is read and before the flag is, if the slot is free.
|
||||
let ended = link_watch::ended_without_stamps(&scan, |flag| {
|
||||
if let Ok(mut slot) = scan.0.try_lock() {
|
||||
*slot = Some((uid, stamps.clone()));
|
||||
*slot = Some(link_watch::LinkScanResult::stamps(uid, stamps.clone()));
|
||||
flag.store(true, Ordering::SeqCst);
|
||||
}
|
||||
flag.load(Ordering::SeqCst)
|
||||
@@ -163,7 +163,7 @@ fn a_look_that_stores_its_stamps_between_the_polls_reads_keeps_them() {
|
||||
let scan = scan.clone();
|
||||
move || {
|
||||
let _ended = link_watch::Ended(scan.clone());
|
||||
*scan.0.lock().unwrap() = Some((uid, stamps));
|
||||
*scan.0.lock().unwrap() = Some(link_watch::LinkScanResult::stamps(uid, stamps));
|
||||
}
|
||||
});
|
||||
worker.join().unwrap();
|
||||
|
||||
@@ -1241,3 +1241,258 @@ fn a_double_click_on_a_corner_widget_with_the_selection_tool_asks_for_the_transf
|
||||
let asked = double_click(&mut s, "directSelection");
|
||||
assert!(matches!(asked.as_slice(), [UiRequest::Dialog(k, _)] if k == vectorcraft_tools::corners::DIALOG), "{asked:?}");
|
||||
}
|
||||
|
||||
/// Live radii of every corner of path `id`, or `None` when it has no Live Corners left.
|
||||
fn live_radii(s: &Session, id: NodeId) -> Option<Vec<f64>> {
|
||||
let n = s.doc().unwrap().doc.node(id).unwrap();
|
||||
let lc = LiveCorners::of(n)?;
|
||||
let all = lc.all();
|
||||
Some(all.iter().map(|k| lc.drawn_radius(*k)).collect())
|
||||
}
|
||||
|
||||
/// #10545: moving an anchor of a rounded rectangle moves its corner and keeps every corner live
|
||||
/// at its radius, in one undo step.
|
||||
#[test]
|
||||
fn moving_an_anchor_keeps_the_corners_live() {
|
||||
let (mut s, id) = session();
|
||||
run(&mut s, json!({"radius": 10}));
|
||||
let undo = s.doc().unwrap().history.undo.len();
|
||||
s.execute("path.moveAnchor", &json!({"id": id.0, "anchor": 0, "x": 0, "y": 25})).unwrap();
|
||||
assert_eq!(live_radii(&s, id), Some(vec![10.0; 4]));
|
||||
assert_eq!(s.doc().unwrap().history.undo.len(), undo + 1);
|
||||
let n = s.doc().unwrap().doc.node(id).unwrap();
|
||||
assert_eq!(n.path_data().unwrap().anchor_count(), 8);
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
assert_eq!(corners(&s, id), ([10.0; 4], [CornerKind::Round; 4], 8));
|
||||
}
|
||||
|
||||
/// #10545: dragging direct-selected anchors of a rounded rectangle keeps its corners live, and
|
||||
/// the corner they belong to moves by the drag.
|
||||
#[test]
|
||||
fn dragging_selected_anchors_keeps_the_corners_live() {
|
||||
let (mut s, id) = session();
|
||||
run(&mut s, json!({"radius": 10}));
|
||||
let before = s.doc().unwrap().doc.node(id).unwrap().geometric_bounds().unwrap();
|
||||
// The two ends of the top-left corner's arc.
|
||||
let arc: Vec<[usize; 2]> = {
|
||||
let lc = LiveCorners::of(s.doc().unwrap().doc.node(id).unwrap()).unwrap();
|
||||
lc.anchors_of(&BTreeSet::from([0])).into_iter().map(|(si, ai)| [si, ai]).collect()
|
||||
};
|
||||
assert_eq!(arc.len(), 2);
|
||||
s.execute("select.anchors", &json!({"id": id.0, "anchors": arc, "mode": "set"})).unwrap();
|
||||
s.execute("path.moveAnchors", &json!({"dx": -20, "dy": 0})).unwrap();
|
||||
assert_eq!(live_radii(&s, id), Some(vec![10.0; 4]));
|
||||
let after = s.doc().unwrap().doc.node(id).unwrap().geometric_bounds().unwrap();
|
||||
assert!(after.x0 < before.x0 - 10.0 && (after.x1 - before.x1).abs() < 1e-6, "{before:?} -> {after:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn moving_an_anchor_of_a_distorted_rectangle_edits_the_drawn_path() {
|
||||
for xf in [Affine::scale_non_uniform(2.0, 1.0), Affine::new([1.0, 0.0, 0.5, 1.0, 10.0, 10.0])] {
|
||||
for command in ["path.moveAnchor", "path.moveAnchors"] {
|
||||
let (mut s, id) = session();
|
||||
let live = LiveShape::Rectangle { w: 50.0, h: 60.0, radii: [10.0; 4], kinds: Default::default(), radii_relative: false, xf };
|
||||
let mut expected = live.to_path();
|
||||
{
|
||||
let d = std::sync::Arc::make_mut(&mut s.doc_mut().unwrap().doc);
|
||||
let NodeKind::Path { path, live: slot, .. } = &mut d.node_mut(id).unwrap().kind else { panic!("not a path") };
|
||||
*path = expected.clone();
|
||||
*slot = Some(Box::new(live));
|
||||
}
|
||||
let delta = vectorcraft_geom::Vec2::new(-20.0, 5.0);
|
||||
let a = expected.anchor_mut(0, 0).unwrap();
|
||||
*a = a.transform(Affine::translate(delta));
|
||||
let target = a.p;
|
||||
s.execute("select.anchors", &json!({"id": id.0, "anchors": [[0, 0]], "mode": "set"})).unwrap();
|
||||
let params = if command == "path.moveAnchor" {
|
||||
json!({"id": id.0, "anchor": 0, "x": target.x, "y": target.y})
|
||||
} else {
|
||||
json!({"dx": delta.x, "dy": delta.y, "interpolate": false})
|
||||
};
|
||||
s.execute(command, ¶ms).unwrap();
|
||||
let n = s.doc().unwrap().doc.node(id).unwrap();
|
||||
assert!(n.live_shape().is_none(), "{command}: {xf:?}");
|
||||
assert_eq!(n.path_data().unwrap(), &expected, "{command}: {xf:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_recut_remaps_the_whole_anchor_selection() {
|
||||
for command in ["path.moveAnchor", "path.moveAnchors"] {
|
||||
let (mut s, id) = session();
|
||||
run(&mut s, json!({"radius": 10}));
|
||||
let (selected, moved, target, sources) = {
|
||||
let n = s.doc().unwrap().doc.node(id).unwrap();
|
||||
let lc = LiveCorners::of(n).unwrap();
|
||||
let selected: BTreeSet<_> = [0, 2].into_iter().map(|k| *lc.anchors_of(&BTreeSet::from([k])).first().unwrap()).collect();
|
||||
let moved = *lc.anchors_of(&BTreeSet::from([0])).first().unwrap();
|
||||
let target = n.path_data().unwrap().subpaths[moved.0].anchors[moved.1].p + vectorcraft_geom::Vec2::new(50.0, 30.0);
|
||||
(selected, moved, target, lc.sources().to_vec())
|
||||
};
|
||||
s.doc_mut().unwrap().selection.anchors.insert(id, selected);
|
||||
s.doc_mut().unwrap().selection.segments.insert(id, BTreeSet::from([(0, 0)]));
|
||||
let before = s.doc().unwrap().selection.clone();
|
||||
let params = if command == "path.moveAnchor" {
|
||||
json!({"id": id.0, "subpath": moved.0, "anchor": moved.1, "x": target.x, "y": target.y})
|
||||
} else {
|
||||
json!({"dx": 50, "dy": 30, "interpolate": false})
|
||||
};
|
||||
s.execute(command, ¶ms).unwrap();
|
||||
let lc = LiveCorners::of(s.doc().unwrap().doc.node(id).unwrap()).unwrap();
|
||||
assert_ne!(lc.sources(), sources, "{command}: the corner becomes straight");
|
||||
assert_eq!(selected_anchors(&s, id), Some(lc.anchors_of(&BTreeSet::from([0, 2]))), "{command}");
|
||||
assert!(!s.doc().unwrap().selection.segments.contains_key(&id), "{command}");
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
assert_eq!(s.doc().unwrap().selection, before, "{command}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_recut_clears_segments_even_when_selected_anchor_indices_stay_the_same() {
|
||||
let (mut s, id) = session();
|
||||
run(&mut s, json!({"radius": 10}));
|
||||
let (selected, moved, target, sources) = {
|
||||
let n = s.doc().unwrap().doc.node(id).unwrap();
|
||||
let lc = LiveCorners::of(n).unwrap();
|
||||
let selected = lc.anchors_of(&BTreeSet::from([1]));
|
||||
let moved = *lc.anchors_of(&BTreeSet::from([2])).first().unwrap();
|
||||
let target = n.path_data().unwrap().subpaths[moved.0].anchors[moved.1].p + vectorcraft_geom::Vec2::new(-50.0, -30.0);
|
||||
(selected, moved, target, lc.sources().to_vec())
|
||||
};
|
||||
s.doc_mut().unwrap().selection.anchors.insert(id, selected.clone());
|
||||
s.doc_mut().unwrap().selection.segments.insert(id, BTreeSet::from([(0, 1)]));
|
||||
s.execute("path.moveAnchor", &json!({"id": id.0, "anchor": moved.1, "x": target.x, "y": target.y})).unwrap();
|
||||
let lc = LiveCorners::of(s.doc().unwrap().doc.node(id).unwrap()).unwrap();
|
||||
assert_ne!(lc.sources(), sources);
|
||||
assert_eq!(lc.anchors_of(&BTreeSet::from([1])), selected);
|
||||
assert_eq!(selected_anchors(&s, id), Some(selected));
|
||||
assert!(!s.doc().unwrap().selection.segments.contains_key(&id));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_unchanged_corner_layout_keeps_the_selection() {
|
||||
for command in ["path.moveAnchor", "path.moveAnchors"] {
|
||||
let (mut s, id) = session();
|
||||
run(&mut s, json!({"radius": 10}));
|
||||
s.doc_mut().unwrap().selection.anchors.insert(id, anchors(&[0, 1, 2]));
|
||||
s.doc_mut().unwrap().selection.segments.insert(id, BTreeSet::from([(0, 1)]));
|
||||
let before = s.doc().unwrap().selection.clone();
|
||||
let n = s.doc().unwrap().doc.node(id).unwrap();
|
||||
let sources = LiveCorners::of(n).unwrap().sources().to_vec();
|
||||
let target = n.path_data().unwrap().subpaths[0].anchors[4].p + vectorcraft_geom::Vec2::new(-20.0, 0.0);
|
||||
let params = if command == "path.moveAnchor" {
|
||||
json!({"id": id.0, "anchor": 4, "x": target.x, "y": target.y})
|
||||
} else {
|
||||
json!({"dx": -20, "dy": 0, "interpolate": false})
|
||||
};
|
||||
s.execute(command, ¶ms).unwrap();
|
||||
assert_eq!(LiveCorners::of(s.doc().unwrap().doc.node(id).unwrap()).unwrap().sources(), sources);
|
||||
assert_eq!(s.doc().unwrap().selection, before, "{command}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_recut_keeps_the_key_anchor_on_its_corner() {
|
||||
for command in ["path.moveAnchor", "path.moveAnchors"] {
|
||||
let (mut s, id) = session();
|
||||
run(&mut s, json!({"radius": 10}));
|
||||
let (selected, moved, key, target, sources) = {
|
||||
let n = s.doc().unwrap().doc.node(id).unwrap();
|
||||
let lc = LiveCorners::of(n).unwrap();
|
||||
// The top right corner moves to the middle of the rectangle.
|
||||
let moved = *lc.anchors_of(&BTreeSet::from([1])).first().unwrap();
|
||||
let key = *lc.anchors_of(&BTreeSet::from([3])).first().unwrap();
|
||||
let target = n.path_data().unwrap().subpaths[moved.0].anchors[moved.1].p + vectorcraft_geom::Vec2::new(-50.0, 30.0);
|
||||
(BTreeSet::from([moved, key]), moved, key, target, lc.sources().to_vec())
|
||||
};
|
||||
let sel = &mut s.doc_mut().unwrap().selection;
|
||||
sel.anchors.insert(id, selected);
|
||||
sel.key_anchor = Some((id, key));
|
||||
let params = if command == "path.moveAnchor" {
|
||||
json!({"id": id.0, "subpath": moved.0, "anchor": moved.1, "x": target.x, "y": target.y})
|
||||
} else {
|
||||
json!({"dx": -50, "dy": 30, "interpolate": false})
|
||||
};
|
||||
s.execute(command, ¶ms).unwrap();
|
||||
let lc = LiveCorners::of(s.doc().unwrap().doc.node(id).unwrap()).unwrap();
|
||||
assert_ne!(lc.sources(), sources, "{command}: the corner becomes straight");
|
||||
let now = s.doc().unwrap().selection.key_anchor;
|
||||
assert_eq!(now, lc.anchors_of(&BTreeSet::from([3])).first().map(|r| (id, *r)), "{command}");
|
||||
assert_ne!(now, Some((id, key)), "{command}: the key anchor's index changed with the recut");
|
||||
}
|
||||
}
|
||||
|
||||
/// A nudge of a pixel-aligned rounded rectangle's edge that the pixel-grid snap takes back
|
||||
/// changes nothing and records no undo step.
|
||||
#[test]
|
||||
fn a_nudge_the_pixel_grid_takes_back_records_no_undo_step() {
|
||||
let (mut s, id) = session();
|
||||
s.execute("object.setPixelAligned", &json!({"ids": [id.0]})).unwrap();
|
||||
run(&mut s, json!({"radius": 10}));
|
||||
let left: Vec<[usize; 2]> = {
|
||||
let lc = LiveCorners::of(s.doc().unwrap().doc.node(id).unwrap()).unwrap();
|
||||
lc.anchors_of(&BTreeSet::from([0, 3])).into_iter().map(|(si, ai)| [si, ai]).collect()
|
||||
};
|
||||
assert_eq!(left.len(), 4);
|
||||
s.execute("select.anchors", &json!({"id": id.0, "anchors": left, "mode": "set"})).unwrap();
|
||||
// A first move by a whole point makes the rectangle a live path; the snap keeps that move.
|
||||
let undo = s.doc().unwrap().history.undo.len();
|
||||
s.execute("path.moveAnchors", &json!({"dx": 1, "dy": 0})).unwrap();
|
||||
assert_eq!(s.doc().unwrap().history.undo.len(), undo + 1);
|
||||
let doc = s.doc().unwrap().doc.clone();
|
||||
let undo = s.doc().unwrap().history.undo.len();
|
||||
s.execute("path.moveAnchors", &json!({"dx": 0.2, "dy": 0})).unwrap();
|
||||
assert_eq!(s.doc().unwrap().doc, doc);
|
||||
assert_eq!(s.doc().unwrap().history.undo.len(), undo);
|
||||
}
|
||||
|
||||
/// The same nudge on a rounded rectangle that no anchor edit has touched yet records no undo
|
||||
/// step and leaves it a live rectangle.
|
||||
#[test]
|
||||
fn a_nudge_the_pixel_grid_takes_back_keeps_a_live_rectangle() {
|
||||
for x in [10, 50, 137] {
|
||||
let mut s = Session::new();
|
||||
s.execute("file.new", &json!({"width": 400, "height": 400})).unwrap();
|
||||
let id = NodeId(s.execute("shape.rectangle", &json!({"x": x, "y": 10, "width": 100, "height": 60})).unwrap()["id"].as_u64().unwrap());
|
||||
s.execute("object.setPixelAligned", &json!({"ids": [id.0]})).unwrap();
|
||||
run(&mut s, json!({"radius": 10}));
|
||||
let left: Vec<[usize; 2]> = {
|
||||
let lc = LiveCorners::of(s.doc().unwrap().doc.node(id).unwrap()).unwrap();
|
||||
lc.anchors_of(&BTreeSet::from([0, 3])).into_iter().map(|(si, ai)| [si, ai]).collect()
|
||||
};
|
||||
s.execute("select.anchors", &json!({"id": id.0, "anchors": left, "mode": "set"})).unwrap();
|
||||
let doc = s.doc().unwrap().doc.clone();
|
||||
let undo = s.doc().unwrap().history.undo.len();
|
||||
s.execute("path.moveAnchors", &json!({"dx": 0.2, "dy": 0})).unwrap();
|
||||
assert_eq!(s.doc().unwrap().history.undo.len(), undo, "x = {x}");
|
||||
assert!(matches!(s.doc().unwrap().doc.node(id).unwrap().live_shape(), Some(LiveShape::Rectangle { .. })), "x = {x}");
|
||||
assert_eq!(s.doc().unwrap().doc, doc, "x = {x}");
|
||||
}
|
||||
}
|
||||
|
||||
/// The same nudge with a second pixel-aligned rectangle selected whole, which the snap also takes
|
||||
/// back, records no undo step and leaves the rounded rectangle a live rectangle.
|
||||
#[test]
|
||||
fn a_nudge_the_pixel_grid_takes_back_with_an_object_selected_whole_records_no_undo_step() {
|
||||
let mut s = Session::new();
|
||||
s.execute("file.new", &json!({"width": 400, "height": 400})).unwrap();
|
||||
let id = NodeId(s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 100, "height": 60})).unwrap()["id"].as_u64().unwrap());
|
||||
s.execute("object.setPixelAligned", &json!({"ids": [id.0]})).unwrap();
|
||||
run(&mut s, json!({"radius": 10}));
|
||||
let whole = NodeId(s.execute("shape.rectangle", &json!({"x": 200, "y": 200, "width": 50, "height": 40})).unwrap()["id"].as_u64().unwrap());
|
||||
s.execute("object.setPixelAligned", &json!({"ids": [whole.0]})).unwrap();
|
||||
let left: Vec<[usize; 2]> = {
|
||||
let lc = LiveCorners::of(s.doc().unwrap().doc.node(id).unwrap()).unwrap();
|
||||
lc.anchors_of(&BTreeSet::from([0, 3])).into_iter().map(|(si, ai)| [si, ai]).collect()
|
||||
};
|
||||
s.execute("select.anchors", &json!({"id": id.0, "anchors": left, "mode": "set"})).unwrap();
|
||||
s.execute("select.add", &json!({"ids": [whole.0]})).unwrap();
|
||||
assert_eq!(s.doc().unwrap().selection.whole(), vec![whole]);
|
||||
let doc = s.doc().unwrap().doc.clone();
|
||||
let undo = s.doc().unwrap().history.undo.len();
|
||||
s.execute("path.moveAnchors", &json!({"dx": 0.2, "dy": 0})).unwrap();
|
||||
assert_eq!(s.doc().unwrap().history.undo.len(), undo);
|
||||
assert!(matches!(s.doc().unwrap().doc.node(id).unwrap().live_shape(), Some(LiveShape::Rectangle { .. })));
|
||||
assert_eq!(s.doc().unwrap().doc, doc);
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
//! Canvas marker state and command API, independent of artwork and link update preferences.
|
||||
|
||||
use serde_json::json;
|
||||
|
||||
use crate::tests_links::{Folder, RED, place, png, session, write};
|
||||
use crate::*;
|
||||
|
||||
fn marked(s: &mut Session) -> Vec<u64> {
|
||||
s.execute("links.marked", &json!({})).unwrap()["images"].as_array().unwrap().iter().map(|r| r["id"].as_u64().unwrap()).collect()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn missing_link_toggle_is_transient_per_document_and_validated() {
|
||||
let mut s = session();
|
||||
let before = s.doc().unwrap().doc.clone();
|
||||
let undo = s.doc().unwrap().history.undo.len();
|
||||
assert!(marked(&mut s).is_empty());
|
||||
assert_eq!(s.execute("view.showMissingLinks", &json!({"on": true})).unwrap(), json!({"on": true}));
|
||||
for p in [json!({"on": "false"}), json!({"on": 1}), json!({"on": []})] {
|
||||
assert!(s.execute("view.showMissingLinks", &p).is_err());
|
||||
assert!(s.doc().unwrap().show_missing_links);
|
||||
}
|
||||
assert!(std::sync::Arc::ptr_eq(&before, &s.doc().unwrap().doc));
|
||||
assert_eq!(s.doc().unwrap().history.undo.len(), undo);
|
||||
assert!(!s.doc().unwrap().is_dirty());
|
||||
s.execute("file.new", &json!({})).unwrap();
|
||||
assert!(!s.doc().unwrap().show_missing_links);
|
||||
s.execute("document.activate", &json!({"index": 0})).unwrap();
|
||||
assert!(s.doc().unwrap().show_missing_links);
|
||||
assert_eq!(s.execute("view.showMissingLinks", &json!({})).unwrap(), json!({"on": false}));
|
||||
assert!(s.doc().unwrap().missing_link_markers.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn missing_link_markers_follow_files_relink_update_and_embed() {
|
||||
let dir = Folder::new("marker-lifecycle");
|
||||
let path = dir.file("art.png");
|
||||
let replacement = dir.file("replacement.png");
|
||||
let bytes = png(40, 40, RED);
|
||||
write(&path, &bytes);
|
||||
write(&replacement, &bytes);
|
||||
let mut s = session();
|
||||
let id = place(&mut s, &path);
|
||||
s.execute("view.showMissingLinks", &json!({"on": true})).unwrap();
|
||||
assert!(marked(&mut s).is_empty());
|
||||
std::fs::remove_file(&path).unwrap();
|
||||
assert_eq!(marked(&mut s), vec![id.0]);
|
||||
let doc = s.doc().unwrap().doc.clone();
|
||||
let selection = s.doc().unwrap().selection.clone();
|
||||
let undo = s.doc().unwrap().history.undo.len();
|
||||
let saved = vectorcraft_format::save_file(&doc);
|
||||
let pixels = vectorcraft_render::Renderer::new().render_region(&doc, vectorcraft_geom::Rect::new(0.0, 0.0, 400.0, 300.0), 1.0, true).pixels;
|
||||
s.execute("view.showMissingLinks", &json!({"on": false})).unwrap();
|
||||
assert!(marked(&mut s).is_empty());
|
||||
s.execute("view.showMissingLinks", &json!({"on": true})).unwrap();
|
||||
assert_eq!(marked(&mut s), vec![id.0]);
|
||||
let st = s.doc().unwrap();
|
||||
assert_eq!(st.selection, selection);
|
||||
assert_eq!(st.history.undo.len(), undo);
|
||||
assert_eq!(vectorcraft_format::save_file(&st.doc), saved);
|
||||
assert_eq!(
|
||||
vectorcraft_render::Renderer::new().render_region(&st.doc, vectorcraft_geom::Rect::new(0.0, 0.0, 400.0, 300.0), 1.0, true).pixels,
|
||||
pixels
|
||||
);
|
||||
s.execute("links.relink", &json!({"ids": [id.0], "path": replacement})).unwrap();
|
||||
assert!(s.doc().unwrap().marked_missing_links().is_empty());
|
||||
assert!(marked(&mut s).is_empty());
|
||||
std::fs::remove_file(&replacement).unwrap();
|
||||
assert_eq!(marked(&mut s), vec![id.0]);
|
||||
write(&replacement, &bytes);
|
||||
s.execute("links.update", &json!({"ids": [id.0]})).unwrap();
|
||||
assert!(s.doc().unwrap().marked_missing_links().is_empty());
|
||||
assert!(marked(&mut s).is_empty());
|
||||
s.execute("links.embed", &json!({"ids": [id.0]})).unwrap();
|
||||
std::fs::remove_file(&replacement).unwrap();
|
||||
assert!(marked(&mut s).is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn missing_link_worker_refreshes_without_the_panel_and_ignores_old_art() {
|
||||
for mode in ["automatically", "askWhenModified", "manually"] {
|
||||
let dir = Folder::new(&format!("marker-watch-{mode}"));
|
||||
let path = dir.file("art.png");
|
||||
let bytes = png(20, 20, RED);
|
||||
write(&path, &bytes);
|
||||
let mut s = session();
|
||||
s.prefs.update_links = mode.into();
|
||||
let id = place(&mut s, &path);
|
||||
s.execute("view.showMissingLinks", &json!({"on": true})).unwrap();
|
||||
let undo = s.doc().unwrap().history.undo.len();
|
||||
std::fs::remove_file(&path).unwrap();
|
||||
s.start_link_scan();
|
||||
s.wait_link_scan();
|
||||
s.poll_link_scan().unwrap().unwrap();
|
||||
assert_eq!(s.doc().unwrap().missing_link_markers.as_ref().unwrap().1, vec![id]);
|
||||
write(&path, &bytes);
|
||||
s.start_link_scan();
|
||||
s.wait_link_scan();
|
||||
s.poll_link_scan().unwrap().unwrap();
|
||||
assert!(s.doc().unwrap().missing_link_markers.as_ref().unwrap().1.is_empty());
|
||||
assert_eq!(s.doc().unwrap().history.undo.len(), undo);
|
||||
std::fs::remove_file(&path).unwrap();
|
||||
s.start_link_scan();
|
||||
s.wait_link_scan();
|
||||
let seen = s.doc().unwrap().missing_link_markers.as_ref().unwrap().0.clone();
|
||||
s.execute("shape.rectangle", &json!({"x": 1, "y": 1, "width": 3, "height": 4})).unwrap();
|
||||
s.poll_link_scan().unwrap().unwrap();
|
||||
assert!(std::sync::Arc::ptr_eq(&seen, &s.doc().unwrap().missing_link_markers.as_ref().unwrap().0));
|
||||
assert!(s.doc().unwrap().marked_missing_links().is_empty());
|
||||
s.start_link_scan();
|
||||
s.wait_link_scan();
|
||||
// Switching the toggle off while a look is pending must not resurrect its markers.
|
||||
s.execute("view.showMissingLinks", &json!({"on": false})).unwrap();
|
||||
s.poll_link_scan().unwrap().unwrap();
|
||||
assert!(s.doc().unwrap().missing_link_markers.is_none());
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn turning_missing_links_on_returns_before_the_file_probe_and_scans_on_the_link_watcher() {
|
||||
use crate::cmd::links::probe_gate::{self, Gate};
|
||||
use std::time::Duration;
|
||||
let dir = Folder::new("marker-toggle-nonblocking");
|
||||
let path = dir.file("art.png");
|
||||
write(&path, &png(20, 20, RED));
|
||||
let mut s = session();
|
||||
let id = place(&mut s, &path);
|
||||
std::fs::remove_file(&path).unwrap();
|
||||
let stored = crate::tests_links::image(&s, id).link.unwrap().path;
|
||||
let gate = Gate::close(&stored);
|
||||
// The toggle returns while the probe of the (slow) linked file is held closed.
|
||||
assert_eq!(s.execute("view.showMissingLinks", &json!({"on": true})).unwrap(), json!({"on": true}));
|
||||
assert!(!gate.finished(), "the toggle waited for the file probe");
|
||||
assert_eq!(gate.entered(Duration::ZERO), None, "the toggle probed the file on the calling thread");
|
||||
assert!(s.doc().unwrap().missing_link_markers.is_none());
|
||||
assert!(s.doc().unwrap().marked_missing_links().is_empty());
|
||||
// The desktop app starts the watcher's look at once, and the probe runs there.
|
||||
assert!(s.missing_link_scan_due());
|
||||
s.start_link_scan();
|
||||
assert!(!s.missing_link_scan_due());
|
||||
assert_eq!(gate.entered(Duration::from_secs(10)).as_deref(), Some("link-watch"));
|
||||
assert!(s.poll_link_scan().is_none(), "the look ended before its probe was released");
|
||||
gate.open();
|
||||
s.wait_link_scan();
|
||||
s.poll_link_scan().unwrap().unwrap();
|
||||
probe_gate::remove(&stored);
|
||||
assert_eq!(s.doc().unwrap().marked_missing_links(), vec![id]);
|
||||
assert!(!s.missing_link_scan_due());
|
||||
// Turning it on again while on keeps the markers; off clears them.
|
||||
s.execute("view.showMissingLinks", &json!({"on": true})).unwrap();
|
||||
assert_eq!(s.doc().unwrap().marked_missing_links(), vec![id]);
|
||||
s.execute("view.showMissingLinks", &json!({"on": false})).unwrap();
|
||||
assert!(!s.missing_link_scan_due());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn missing_link_scan_for_a_document_without_links_ends_without_a_worker() {
|
||||
let mut s = session();
|
||||
s.execute("view.showMissingLinks", &json!({"on": true})).unwrap();
|
||||
assert!(s.missing_link_scan_due());
|
||||
s.start_link_scan();
|
||||
assert!(s.link_scan.is_none());
|
||||
assert!(!s.missing_link_scan_due());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn missing_link_hidden_when_the_overlay_turns_on_is_marked_once_shown() {
|
||||
let dir = Folder::new("marker-hidden-then-shown");
|
||||
let path = dir.file("art.png");
|
||||
write(&path, &png(20, 20, RED));
|
||||
// Found by the desktop's link watch worker, and in place as the web app does.
|
||||
for in_place in [false, true] {
|
||||
let mut s = session();
|
||||
let id = place(&mut s, &path);
|
||||
std::fs::remove_file(&path).unwrap();
|
||||
s.execute("object.hide", &json!({"ids": [id.0]})).unwrap();
|
||||
s.execute("view.showMissingLinks", &json!({"on": true})).unwrap();
|
||||
let mark = |s: &mut Session| {
|
||||
if in_place {
|
||||
s.mark_missing_links_in_place();
|
||||
} else {
|
||||
s.start_link_scan();
|
||||
s.wait_link_scan();
|
||||
s.poll_link_scan().unwrap().unwrap();
|
||||
}
|
||||
};
|
||||
mark(&mut s);
|
||||
assert!(s.doc().unwrap().marked_missing_links().is_empty(), "hidden art is not marked");
|
||||
s.execute("object.showAll", &json!({})).unwrap();
|
||||
assert_eq!(s.doc().unwrap().marked_missing_links(), vec![id], "shown art is marked without another scan");
|
||||
if in_place {
|
||||
// Artwork restored while the overlay is on is marked again.
|
||||
s.execute("select.set", &json!({"ids": [id.0]})).unwrap();
|
||||
s.execute("edit.clear", &json!({})).unwrap();
|
||||
assert!(s.doc().unwrap().doc.node(id).is_none());
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
assert!(s.mark_missing_links_in_place());
|
||||
assert_eq!(s.doc().unwrap().marked_missing_links(), vec![id]);
|
||||
assert!(!s.mark_missing_links_in_place(), "unchanged art is not looked at again");
|
||||
}
|
||||
write(&path, &png(20, 20, RED));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn missing_link_markers_include_placed_documents_and_exclude_hidden_art() {
|
||||
let dir = Folder::new("marker-placed");
|
||||
let path = dir.file("placed.vectorcraft");
|
||||
write(&path, &vectorcraft_format::save_file(&vectorcraft_doc::Document::new(40.0, 20.0)));
|
||||
let mut s = session();
|
||||
let id = place(&mut s, &path);
|
||||
assert!(matches!(s.doc().unwrap().doc.node(id).unwrap().kind, vectorcraft_doc::NodeKind::PlacedDocument(_)));
|
||||
std::fs::remove_file(&path).unwrap();
|
||||
s.execute("view.showMissingLinks", &json!({"on": true})).unwrap();
|
||||
assert_eq!(marked(&mut s), vec![id.0]);
|
||||
s.execute("object.move", &json!({"ids": [id.0], "dx": 15, "dy": 10})).unwrap();
|
||||
assert_eq!(s.doc().unwrap().marked_missing_links(), vec![id]);
|
||||
s.execute("object.hide", &json!({"ids": [id.0]})).unwrap();
|
||||
assert!(s.doc().unwrap().marked_missing_links().is_empty());
|
||||
assert!(marked(&mut s).is_empty());
|
||||
}
|
||||
@@ -2713,6 +2713,32 @@ fn removing_all_the_paths_of_a_compound_path_keeps_the_compound_path() {
|
||||
assert_eq!(undo_steps(&s), steps + 1);
|
||||
}
|
||||
|
||||
/// `removeAll()` on the `pathItems` of a compound path that clips a group keeping other art
|
||||
/// would leave an empty clipping path, so it throws and deletes nothing, as deleting the clipping
|
||||
/// path itself does. Removing some of its paths still works.
|
||||
#[test]
|
||||
fn removing_all_the_paths_of_a_clipping_compound_path_is_refused() {
|
||||
let (mut s, a, b) = doc();
|
||||
s.execute("select.set", &json!({"ids": [a.0, b.0]})).unwrap();
|
||||
s.execute("object.compoundPath.make", &json!({})).unwrap();
|
||||
let compound = s.active().unwrap().doc.parent_of(a).unwrap();
|
||||
let other = rect(&mut s, 200.0, 20.0, 30.0, 40.0);
|
||||
s.execute("select.set", &json!({"ids": [compound.0, other.0]})).unwrap();
|
||||
s.execute("object.group", &json!({})).unwrap();
|
||||
run(&mut s, "var g = app.activeDocument.groupItems[0]; g.compoundPathItems[0].zOrder(ZOrderMethod.BRINGTOFRONT); g.clipped = true;").unwrap();
|
||||
let d = &s.active().unwrap().doc;
|
||||
assert_eq!(d.parent_of(compound).and_then(|g| d.node(g)).and_then(|g| g.children()).map(|k| k[0].id), Some(compound));
|
||||
let before = s.active().unwrap().doc.clone();
|
||||
let steps = undo_steps(&s);
|
||||
let e = failure(&mut s, "app.activeDocument.compoundPathItems[0].pathItems.removeAll();");
|
||||
assert!(e.contains("cannot delete a clipping path"), "{e}");
|
||||
assert!(e.contains(&compound.0.to_string()), "{e}");
|
||||
assert_eq!(s.active().unwrap().doc, before);
|
||||
assert_eq!(undo_steps(&s), steps);
|
||||
run(&mut s, "app.activeDocument.compoundPathItems[0].pathItems[0].remove();").unwrap();
|
||||
assert_eq!(s.active().unwrap().doc.node(compound).and_then(|n| n.children()).map(Vec::len), Some(1));
|
||||
}
|
||||
|
||||
/// `move` leaves art on a locked artboard where it is, and a move that leaves an object where it
|
||||
/// is runs no command, also in a layer whose ruler guides are above its art.
|
||||
#[test]
|
||||
|
||||
@@ -680,6 +680,68 @@ fn document_path_creators_use_the_active_layer_during_isolation() {
|
||||
}
|
||||
}
|
||||
|
||||
/// A locked or hidden active layer does not take a script's new path: the path goes on the
|
||||
/// topmost shown, unlocked layer, where the app's own creation commands put new art.
|
||||
#[test]
|
||||
fn document_path_creators_skip_a_locked_or_hidden_active_layer() {
|
||||
for (prop, value) in [("locked", true), ("visible", false)] {
|
||||
for create in ["add()", "rectangle(100, 10, 20, 30)", "roundedRectangle(100, 10, 20, 30)", "ellipse()", "polygon()", "star()"] {
|
||||
let (mut s, _, _) = doc();
|
||||
let editable = s.active().unwrap().active_layer.unwrap();
|
||||
let top = NodeId(s.execute("layer.new", &json!({})).unwrap()["id"].as_u64().unwrap());
|
||||
assert_eq!(s.active().unwrap().active_layer, Some(top));
|
||||
s.execute("layer.setProps", &json!({"id": top.0, prop: value})).unwrap();
|
||||
let before = node(&s, editable).children().unwrap().len();
|
||||
log(&mut s, &format!("app.activeDocument.pathItems.{create};"));
|
||||
let st = s.active().unwrap();
|
||||
assert!(st.doc.node(top).unwrap().children().unwrap().is_empty(), "{prop} {create}");
|
||||
let children = st.doc.node(editable).unwrap().children().unwrap();
|
||||
assert_eq!(children.len(), before + 1, "{prop} {create}");
|
||||
let made = children.last().unwrap();
|
||||
assert!(matches!(made.kind, NodeKind::Path { .. }), "{prop} {create}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// While an opacity mask is being edited, a locked mask layer refuses a script's new path instead
|
||||
/// of the path going on an ordinary layer outside the mask.
|
||||
#[test]
|
||||
fn document_path_creators_refuse_a_locked_mask_editing_layer() {
|
||||
let (mut s, a, _) = doc();
|
||||
s.execute("select.set", &json!({"ids": [a.0]})).unwrap();
|
||||
s.execute("transparency.makeOpacityMask", &json!({})).unwrap();
|
||||
let layer = s.active().unwrap().doc.mask_edit.unwrap().layer;
|
||||
assert_eq!(s.active().unwrap().active_layer, Some(layer));
|
||||
s.execute("layer.setProps", &json!({"id": layer.0, "locked": true})).unwrap();
|
||||
let before = art(&s);
|
||||
let e = failure(&mut s, "app.activeDocument.pathItems.add();");
|
||||
assert!(e.contains("onLayer must name an editable layer"), "{e}");
|
||||
assert_eq!(art(&s), before);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn document_path_creators_use_the_mask_editing_layer_after_the_active_layer_changes() {
|
||||
let (mut s, a, _) = doc();
|
||||
let ordinary = s.active().unwrap().active_layer.unwrap();
|
||||
s.execute("select.set", &json!({"ids": [a.0]})).unwrap();
|
||||
s.execute("transparency.makeOpacityMask", &json!({})).unwrap();
|
||||
let layer = s.active().unwrap().doc.mask_edit.unwrap().layer;
|
||||
s.execute("layer.setCurrent", &json!({"id": ordinary.0})).unwrap();
|
||||
s.execute("layer.setProps", &json!({"id": ordinary.0, "locked": true})).unwrap();
|
||||
assert_eq!(s.active().unwrap().active_layer, Some(ordinary));
|
||||
let before = node(&s, layer).children().unwrap().len();
|
||||
let ordinary_before = node(&s, ordinary).children().unwrap().len();
|
||||
log(&mut s, "app.activeDocument.pathItems.add();");
|
||||
let st = s.active().unwrap();
|
||||
assert_eq!(st.doc.mask_edit.unwrap().layer, layer);
|
||||
let children = st.doc.node(layer).unwrap().children().unwrap();
|
||||
assert_eq!(children.len(), before + 1);
|
||||
assert!(matches!(children.last().unwrap().kind, NodeKind::Path { .. }));
|
||||
// The mask's art is stored on its object, which stays on the ordinary layer; that layer gains
|
||||
// no path of its own.
|
||||
assert_eq!(node(&s, ordinary).children().unwrap().len(), ordinary_before);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn paint_writes_refuse_generated_graph_design_paths() {
|
||||
for (kind, command) in [("column", "graph.column"), ("line", "graph.marker")] {
|
||||
|
||||
@@ -27,7 +27,16 @@ fn headless_links_report_missing_files_and_relink() {
|
||||
let r = run(&mut h, "document.open", json!({"path": file("doc.vectorcraft")}));
|
||||
assert_eq!(r["missingLinks"][0]["ids"], json!([id]), "{r}");
|
||||
assert_eq!(run(&mut h, "links.check", json!({}))["missing"], 1);
|
||||
assert_eq!(run(&mut h, "links.marked", json!({})), json!({"on": false, "images": []}));
|
||||
assert_eq!(run(&mut h, "view.showMissingLinks", json!({"on": true})), json!({"on": true}));
|
||||
let markers = run(&mut h, "links.marked", json!({}));
|
||||
assert_eq!(markers["images"][0]["id"], id);
|
||||
assert_eq!(markers["images"][0]["bounds"].as_array().unwrap().len(), 4);
|
||||
run(&mut h, "view.showMissingLinks", json!({"on": false}));
|
||||
assert_eq!(run(&mut h, "links.marked", json!({}))["images"], json!([]));
|
||||
run(&mut h, "view.showMissingLinks", json!({"on": true}));
|
||||
let r = run(&mut h, "links.relink", json!({"ids": [id], "path": file("b.png")}));
|
||||
assert_eq!(r["relinked"], json!([id]));
|
||||
assert_eq!(run(&mut h, "links.check", json!({}))["links"][0]["status"], "ok");
|
||||
assert_eq!(run(&mut h, "links.marked", json!({}))["images"], json!([]));
|
||||
}
|
||||
@@ -631,6 +631,12 @@ impl VectorcraftApp {
|
||||
}
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
self.tick_link_updates(ctx, now);
|
||||
// The web app has no link watch worker and no files to read: View › Show Missing Links
|
||||
// marks again here whenever the art changed, so artwork shown or restored is marked too.
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
if self.session.mark_missing_links_in_place() {
|
||||
ctx.request_repaint();
|
||||
}
|
||||
crate::addons::select::link_status::refresh(self, now);
|
||||
if !self.background.jobs.is_empty()
|
||||
|| !self.opening.pending.is_empty()
|
||||
|
||||
@@ -95,7 +95,9 @@ impl VectorcraftApp {
|
||||
let last: f64 = ctx.data(|d| d.get_temp(last_key)).unwrap_or(f64::NEG_INFINITY);
|
||||
// The active document as the last look saw it: its uid and revision.
|
||||
let (seen_key, doc) = (egui::Id::unique("linkWatch.seen"), self.session.active().map(|d| (d.uid, d.revision)));
|
||||
if now - last >= 2.0 || (focused && !was_focused) {
|
||||
// View › Show Missing Links just turned on: its first scan runs on the worker now, and
|
||||
// the canvas repaints from the result (the toggle itself never reads files).
|
||||
if now - last >= 2.0 || (focused && !was_focused) || self.session.missing_link_scan_due() {
|
||||
// Walking the document's links costs a pass over it: only when a look is due.
|
||||
// `start_link_scan` starts none for a document without links, which then doesn't
|
||||
// wake the app for looks of its own (any frame still looks once one is due).
|
||||
|
||||
@@ -66,6 +66,11 @@ const WAVE_MAX: usize = 4_000;
|
||||
/// long story of unknown words costs one check's worth.
|
||||
const MAX_UNDERLINED: usize = 1_000;
|
||||
|
||||
/// The radius of a missing link's badge and the size of its question mark, in screen points: the
|
||||
/// same at every zoom.
|
||||
const MISSING_BADGE_RADIUS: f32 = 7.0;
|
||||
const MISSING_BADGE_TEXT: f32 = 11.0;
|
||||
|
||||
/// The marks Show Hidden Characters drew on each text object in the last pass
|
||||
/// ([`crate::CanvasCache::hidden_chars`]). Each is kept with the node it was laid out from: an edited
|
||||
/// object is a new `Arc` and is laid out again, and all type is laid out again when the fonts or the
|
||||
@@ -158,6 +163,9 @@ pub(crate) struct Marks {
|
||||
fade: Vec<[Pos2; 4]>,
|
||||
bleed: Vec<BezPath>,
|
||||
artboard_marks: Vec<BezPath>,
|
||||
/// View › Show Missing Links: each visible missing linked image or placed document in view, as
|
||||
/// its box on the screen and where its badge sits (the box's top left corner in the document).
|
||||
pub(crate) missing: Vec<([Pos2; 4], Pos2)>,
|
||||
}
|
||||
|
||||
/// Drops the hidden-character and spelling memos and the text nodes they hold.
|
||||
@@ -194,6 +202,8 @@ pub(crate) fn marks_of(app: &mut VectorcraftApp, view: &CanvasView) -> Marks {
|
||||
return m;
|
||||
};
|
||||
let key = (st.uid, st.revision);
|
||||
// The link watcher's last scan: nothing here reads files.
|
||||
m.missing = missing_links(st, view);
|
||||
if fades && let Some(shown) = app.view() {
|
||||
m.fade = artboards::fade_quads(view, &artboards::frames(app, st, shown, shown.outline));
|
||||
}
|
||||
@@ -310,6 +320,18 @@ fn text_nodes(layers: &[Arc<Node>]) -> Vec<Arc<Node>> {
|
||||
out
|
||||
}
|
||||
|
||||
/// The missing links [`DocState::marked_missing_links`] marks in view: each one's box on the screen
|
||||
/// (following a turned view) and its badge's place.
|
||||
fn missing_links(st: &DocState, view: &CanvasView) -> Vec<([Pos2; 4], Pos2)> {
|
||||
st.marked_missing_links()
|
||||
.into_iter()
|
||||
.filter_map(|id| st.doc.node(id))
|
||||
.filter(|n| in_view(n, view))
|
||||
.filter_map(|n| n.geometric_bounds())
|
||||
.map(|b| (view.quad(b), view.to_screen(Point::new(b.x0, b.y0))))
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Whether `n`'s box meets the part of the document the view shows (the box round the view's
|
||||
/// corners, which a turned view makes larger than the canvas).
|
||||
fn in_view(n: &Node, view: &CanvasView) -> bool {
|
||||
@@ -549,6 +571,8 @@ pub(crate) struct ArtMarks<'a> {
|
||||
arm_color: [u8; 3],
|
||||
/// The print tiles.
|
||||
tiles: &'a [Tile],
|
||||
/// The missing links' boxes and badges.
|
||||
missing: &'a [([Pos2; 4], Pos2)],
|
||||
}
|
||||
|
||||
impl<'a> ArtMarks<'a> {
|
||||
@@ -565,6 +589,7 @@ impl<'a> ArtMarks<'a> {
|
||||
arms: &marks.arms,
|
||||
arm_color: marks.arm_color,
|
||||
tiles: &marks.tiles,
|
||||
missing: &marks.missing,
|
||||
}
|
||||
.label(label)
|
||||
}
|
||||
@@ -625,6 +650,9 @@ impl Component for ArtMarks<'_> {
|
||||
for tile in self.tiles {
|
||||
paint_tile(&draw, tile);
|
||||
}
|
||||
for (quad, at) in self.missing {
|
||||
paint_missing(&draw, quad, *at, style.bad);
|
||||
}
|
||||
}
|
||||
|
||||
fn finish(self, cx: Cx<'_, Self>) -> Response {
|
||||
@@ -655,6 +683,16 @@ fn paint_tile(draw: &Draw<'_>, tile: &Tile) {
|
||||
draw.doc(room, &DocText::new(&run));
|
||||
}
|
||||
|
||||
/// One missing link: a thick outline round its box and, at the box's corner, a filled badge with a
|
||||
/// question mark, so the mark doesn't rely on its colour alone.
|
||||
fn paint_missing(draw: &Draw<'_>, quad: &[Pos2; 4], at: Pos2, color: StyleColor) {
|
||||
draw.stroke(&PaintShape::Path(ring(quad.to_vec(), true)), StrokeWidth::Thick, color);
|
||||
draw.fill(&PaintShape::Circle(at, MISSING_BADGE_RADIUS), color);
|
||||
let run = [DocRun::new("?", FontRef::proportional(), MISSING_BADGE_TEXT, DataColor::new(Color32::WHITE))];
|
||||
let room = egui::Rect::from_min_size(at - Vec2::new(MISSING_BADGE_TEXT * 0.3, MISSING_BADGE_TEXT * 0.7), Vec2::splat(MISSING_BADGE_TEXT * 1.4));
|
||||
draw.doc(room, &DocText::new(&run));
|
||||
}
|
||||
|
||||
/// A wavy line from `a` to `b` on screen, waves 4 pixels long and 1.5 high, down the page from the
|
||||
/// line whichever way the type runs; empty for a segment under a pixel long or not finite.
|
||||
pub(crate) fn wave(a: Pos2, b: Pos2) -> Vec<Pos2> {
|
||||
|
||||
@@ -492,3 +492,47 @@ fn auto_spell_check_is_a_toggle_of_the_canvas_lines() {
|
||||
assert_eq!(segments(&mut app), 0, "off");
|
||||
assert!(app.canvas.spelling.lines.is_empty(), "no node is kept");
|
||||
}
|
||||
|
||||
/// A document with a placed document whose file is gone, View › Show Missing Links on and its markers
|
||||
/// inspected → (app, the placed object).
|
||||
fn missing_placed(name: &str) -> (VectorcraftApp, NodeId) {
|
||||
let dir = std::env::temp_dir().join(format!("vectorcraft-marks-{name}-{}", std::process::id()));
|
||||
std::fs::create_dir_all(&dir).unwrap();
|
||||
let path = dir.join("placed.vectorcraft");
|
||||
std::fs::write(&path, vectorcraft_format::save_file(&vectorcraft_doc::Document::new(80.0, 40.0))).unwrap();
|
||||
let mut app = app();
|
||||
let r = app.session.execute("file.place", &json!({"path": path.to_string_lossy(), "at": [200, 150]})).unwrap();
|
||||
let id = NodeId(r["ids"][0].as_u64().unwrap());
|
||||
std::fs::remove_dir_all(&dir).unwrap();
|
||||
app.run("view.showMissingLinks", json!({"on": true})).unwrap();
|
||||
// The synchronous inspection stands in for the link watcher's scan.
|
||||
app.run("links.marked", json!({})).unwrap();
|
||||
(app, id)
|
||||
}
|
||||
|
||||
/// A missing link is outlined round its box and badged at its corner in any view, turned or zoomed,
|
||||
/// and nothing is marked once the toggle is off.
|
||||
#[test]
|
||||
fn missing_links_are_marked_round_their_box_in_any_view_until_turned_off() {
|
||||
let (mut app, id) = missing_placed("follow");
|
||||
let bounds = app.session.active().unwrap().doc.node(id).unwrap().geometric_bounds().unwrap();
|
||||
for (zoom, rotation) in [(0.25, 0.0), (1.0, 37.0), (8.0, 90.0)] {
|
||||
let view = CanvasView::new(view().rect, bounds.center(), zoom).rotation(rotation);
|
||||
let m = marks_of(&mut app, &view);
|
||||
assert_eq!(m.missing, vec![(view.quad(bounds), view.to_screen(Point::new(bounds.x0, bounds.y0)))], "zoom {zoom}, {rotation}°");
|
||||
}
|
||||
app.run("view.showMissingLinks", json!({"on": false})).unwrap();
|
||||
assert!(marks_of(&mut app, &view()).missing.is_empty());
|
||||
}
|
||||
|
||||
/// The menu item runs the engine's toggle, and its label follows it.
|
||||
#[test]
|
||||
fn the_missing_links_menu_item_uses_the_engine_toggle() {
|
||||
let mut app = app();
|
||||
assert_eq!(crate::menus::dynamic_label(&app, "view.showMissingLinks", ""), "Show Missing Links");
|
||||
app.run("view.showMissingLinks", json!({"on": true})).unwrap();
|
||||
assert!(app.session.active().unwrap().show_missing_links);
|
||||
assert_eq!(crate::menus::dynamic_label(&app, "view.showMissingLinks", ""), "Hide Missing Links");
|
||||
app.run("view.showMissingLinks", json!({"on": false})).unwrap();
|
||||
assert!(!app.session.active().unwrap().show_missing_links);
|
||||
}
|
||||
@@ -30,6 +30,7 @@ pub const TOGGLES: &[&str] = &[
|
||||
"view.rulers",
|
||||
"view.boundingBox",
|
||||
"view.transparencyGrid",
|
||||
"view.showMissingLinks",
|
||||
"view.guides",
|
||||
"view.grid",
|
||||
"view.slices.hide",
|
||||
|
||||
@@ -52,6 +52,9 @@ fn window_toggle_label(app: &VectorcraftApp, id: &str) -> Option<String> {
|
||||
"view.transparencyGrid" => {
|
||||
if app.session.active().is_some_and(|d| d.transparency_grid) { "Hide Transparency Grid" } else { "Show Transparency Grid" }.into()
|
||||
}
|
||||
"view.showMissingLinks" => {
|
||||
if app.session.active().is_some_and(|d| d.show_missing_links) { "Hide Missing Links" } else { "Show Missing Links" }.into()
|
||||
}
|
||||
"view.guides" => if v.guides { "Hide Guides" } else { "Show Guides" }.into(),
|
||||
"view.grid" => if v.grid { "Hide Grid" } else { "Show Grid" }.into(),
|
||||
"view.guides.lock" => if app.session.guides_locked() { "Unlock Guides" } else { "Lock Guides" }.into(),
|
||||
@@ -371,6 +374,8 @@ pub const DYNAMIC_LABELS: &[&str] = &[
|
||||
"Show Bounding Box",
|
||||
"Hide Transparency Grid",
|
||||
"Show Transparency Grid",
|
||||
"Show Missing Links",
|
||||
"Hide Missing Links",
|
||||
"Hide Guides",
|
||||
"Show Guides",
|
||||
"Hide Grid",
|
||||
|
||||
@@ -674,6 +674,7 @@ fn built_in_tree(english_names: bool, listed: &Listed) -> Vec<(&'static str, Vec
|
||||
),
|
||||
c("Hide Bounding Box", "view.boundingBox"),
|
||||
c("Show Transparency Grid", "view.transparencyGrid"),
|
||||
c("Show Missing Links", "view.showMissingLinks"),
|
||||
c("Hide Text Threads", "view.textThreads"),
|
||||
c("Hide Gradient Annotator", "view.gradientAnnotator"),
|
||||
c("Hide Corner Widget", "view.cornerWidget"),
|
||||
|
||||
@@ -1073,6 +1073,12 @@ fn groups(app: &VectorcraftApp) -> [Vec<(CommandRef, CommandState)>; 6] {
|
||||
let f = Facts::of(&cache.list, &selected);
|
||||
let o = &app.ui.links.options;
|
||||
let e = |id: &str, params: Value, a: Act, label: &str| entry(app, &f, id, params, a, label);
|
||||
// View › Show Missing Links, also here: checked while the canvas marks them.
|
||||
let marking = app.session.active().map(|st| st.show_missing_links);
|
||||
let show_missing = (
|
||||
CommandRef::with_params("view.showMissingLinks", json!({ "on": marking != Some(true) })),
|
||||
CommandState::new().enabled(marking.is_some()).checked(marking == Some(true)).title(tl!("Show Missing Links")),
|
||||
);
|
||||
[
|
||||
vec![
|
||||
e("ui.relinkDialog", json!({ "ids": f.all() }), Act::Relink, "Relink…"),
|
||||
@@ -1097,6 +1103,7 @@ fn groups(app: &VectorcraftApp) -> [Vec<(CommandRef, CommandState)>; 6] {
|
||||
.chain([
|
||||
option_entry("ui.links.linkInfo", Value::Null, o.info, "Show Link Info"),
|
||||
option_entry("ui.links.dcs", Value::Null, o.dcs, "Show DCS Transparency Interactions"),
|
||||
show_missing,
|
||||
])
|
||||
.collect(),
|
||||
]
|
||||
|
||||
@@ -83,6 +83,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard
|
||||
|---|---|---|
|
||||
| 2026-12-02 | minor | G12: Retype panel font rows have an item context menu: a secondary click or Shift+F10 selects the row and offers Apply Font (what a click on the row does; off without live text selected), the panel menu's Small, Medium and Large sample sizes and Reset Retype Panel; the menu closes when the list or the document changes. Headless regressions: `panels::retype::tests`. Scores and estimates unchanged. |
|
||||
| 2026-12-02 | minor | G12: SVG Interactivity event rows have an item menu: a right-click (or Shift+F10 on the focused row) picks that event and offers Remove Event (`svgInteractivity.removeEvent` for that row, one undo step), Clear Events (`svgInteractivity.clearEvents`, enabled like the panel menu row) and Link JavaScript Files… (`ui.javascriptFilesDialog`). Headless regressions: `panels::svg_interactivity::tests`. Scores and estimates unchanged. |
|
||||
| 2026-11-26 | minor | Show Missing Links in View and the Links panel marks missing linked images and placed documents on the canvas; the link watcher scans them in the background, so turning it on never waits on a file; transient overlays stay out of artwork, export and undo history; command API controls and lists markers (#5547). Scores and estimates unchanged. |
|
||||
| 2026-11-25 | minor | Document Info › Objects: total enclosed area (`pathArea` in pt²) for closed and compound paths (holes subtracted per fill rule; guides and open paths left out) and formatted Path Area in document units, beyond reference panel (#6965). Worked out only when the request covers Objects (`pathArea` null otherwise or with `pathArea: false`); the panel asks for it only while Objects or All Categories is shown. Tests: `info_gives_the_paths_total_area`, `info_works_out_the_path_area_only_for_the_objects_category`, `the_path_area_is_worked_out_only_while_objects_is_shown`, `format_area_formats_and_trims_cleanly`. Scores and estimates unchanged. |
|
||||
| 2026-11-24 | minor | G12: History row context menus use shared Craft List and Menu controls after rebasing onto the panel migration. App-specific actions retain the chosen snapshot across pending edits and dismiss on document switches; keyboard context requests and focus restoration use the shared runtime. Regression cases retained (#8845); scores and estimates unchanged. |
|
||||
| 2026-11-21 | minor | G12: Document Info › Selection Only (`ui.docInfo.selectionOnly`) counts objects in the selection through `document.info`; with no artwork selected it shows (No artwork selected) and artboards the Artboard tool has selected still show. Headless regressions: `panels::doc_info::tests::test_doc_info_counts_entire_document`, `test_doc_info_selection_only_toggles_and_filters_counts`, `test_doc_info_selection_only_keeps_selected_artboard`, `test_doc_info_panel_menu_toggles_state`. Scores and estimates unchanged. |
|
||||
|
||||
+43
-3
@@ -62,6 +62,28 @@ Effect ids from `effect.list` / `apply_effect` / `vectorcraft://effect/{id}` (fo
|
||||
|
||||
A release `vectorcraft-cli` on `PATH` can lag the checkout. Prefer `cargo install --path apps/vectorcraft-cli --locked` and put `$CARGO_HOME/bin` first in the MCP client's environment, or set the client's `command` to that binary's absolute path (#6460).
|
||||
|
||||
## Missing-link canvas markers
|
||||
|
||||
Use `run_command` with these engine commands (the `command_run` alias takes the same calls with `id` in place of `command`):
|
||||
|
||||
```json
|
||||
{"command":"view.showMissingLinks","params":{"on":true}}
|
||||
{"command":"links.marked","params":{}}
|
||||
{"command":"view.showMissingLinks","params":{"on":false}}
|
||||
```
|
||||
|
||||
`links.marked` refreshes file status and returns `{on, images: [{id, bounds: [x0, y0,
|
||||
x1, y1]}]}` for visible missing linked images and placed documents in the active document.
|
||||
When the toggle is off, `images` is empty; `links.list {show: "missing"}` still lists missing
|
||||
links independently. Neither command changes selection or undo history. `view.showMissingLinks`
|
||||
never reads linked files, so it returns at once even for a large or slow file; `links.marked` is
|
||||
the explicit, synchronous inspection. The desktop canvas draws a red outline and badge, scans
|
||||
files in the background as soon as the toggle turns on and then about every two seconds even
|
||||
with the Links panel closed, and removes markers after repair. The toggle is per open
|
||||
document and starts off on reopen. Markers are never saved as artwork, rendered into exports
|
||||
or printing, or exposed as selectable objects. Headless mode exposes the same state and
|
||||
queries; it has no canvas on which to draw decorations.
|
||||
|
||||
## Install and register
|
||||
|
||||
From the repository root, with Rust 1.95+ and the platform's source-build prerequisites installed:
|
||||
@@ -3270,7 +3292,8 @@ through `$`:
|
||||
and `Artboard` objects (`Stale artboard`); the document's own collections list the reverted document.
|
||||
`removeAll()` on a layer's or group's `pageItems`, `groupItems` or `compoundPathItems`, or on the document's `pathItems`,
|
||||
`groupItems` or `compoundPathItems`, throws and deletes nothing when it would delete the clipping path of a group
|
||||
or layer that keeps other objects. The document's `pathItems.removeAll()` still deletes the paths of a group that
|
||||
or layer that keeps other objects that are not ruler guides. `removeAll()` on the `pathItems` of a compound path that is such a clipping
|
||||
path throws the same way, since it would leave the clipping path empty. The document's `pathItems.removeAll()` still deletes the paths of a group that
|
||||
is the clipping path when a visible text object that lays out glyphs stays inside that group, because the text then
|
||||
clips. Text beside the clipping path in the clipping group does not count. Hidden text, text
|
||||
in a hidden group, blank text without a list marker, area text too short for its first line, and text that a clipping group nested in
|
||||
@@ -3707,7 +3730,11 @@ through `$`:
|
||||
radius = 50, innerRadius = 20, points = 5, reversed?)`, which run `shape.rectangle`, `path.create`,
|
||||
`shape.ellipse`, `shape.polygon` and `shape.star` (and `path.reverse` for `reversed`) and paint the new path as new
|
||||
art is painted. `add()` and the shape creators put the new path on top of the active layer whatever the drawing
|
||||
mode, which stays as it was. These creation commands take `onLayer: layerId` to draw normally on that layer and
|
||||
mode, which stays as it was. For ordinary layer placement, when the active layer is locked or hidden, the new
|
||||
path goes on the topmost shown, unlocked layer. While an opacity mask, pattern or symbol is being edited, the
|
||||
new path goes on that editing layer, and the call throws and makes no path when that layer is locked or hidden.
|
||||
The call also throws and makes no path when the document has layers and every one is locked or hidden.
|
||||
These creation commands take `onLayer: layerId` to draw normally on that layer and
|
||||
record this placement for replay. A null `onLayer` draws normally on the active layer.
|
||||
A `PathItem` (https://ai-scripting.docsforadobe.dev/jsobjref/PathItem/) adds to the page item
|
||||
members `pathPoints`, `closed`, `evenodd`, `area` (negative for a path that runs counterclockwise), `length`,
|
||||
@@ -9203,6 +9230,17 @@ is not a whole number of 0 or more, such as 1.5, -1 or "1" ("`subpath` must be a
|
||||
an `anchor` or `segment` in the same way. The document does not change and no undo step is recorded.
|
||||
`path.moveAnchor` to the point the anchor is at, and `path.setHandle` to the point the handle is at on an anchor that
|
||||
keeps its kind, leave the document as it is and record no undo step.
|
||||
On a path with rounded Live Corners, `path.moveAnchor` and `path.moveAnchors` (and the arrow keys) move the uncut corner
|
||||
each moved anchor belongs to by the drag delta and cut the corners again at their radii. The corners stay live; a live
|
||||
rectangle or polygon becomes a path with live corners. The delta is measured from the drawn anchor, but the recut can
|
||||
move that anchor again: a grabbed arc end can finish away from a snap target, and `path.moveAnchor` can leave the drawn
|
||||
anchor away from `(x, y)`. When the recut changes the anchor layout, all selected anchors of that path are remapped
|
||||
through their uncut outline anchors and its selected segments are cleared. An unchanged layout keeps the selection.
|
||||
Anchor edits instead make the shape a plain path when it has no rounded corner, when a live rectangle is sheared or
|
||||
unevenly scaled, when an arrow-key nudge's selected curved segments bend or hold their anchors, or when a transform of
|
||||
direct-selected anchors is other than a move. A nudge that changes nothing, including one that the pixel-grid snap of a
|
||||
pixel-aligned path takes back (objects selected whole beside the anchors included), records no undo step and leaves Live Corners as they are: a live rectangle stays a live
|
||||
rectangle. These fallbacks edit the drawn anchors rather than recutting the uncut outline.
|
||||
`path.setHandle` with `symmetric: true` also places the anchor's other handle opposite the moved one at the same
|
||||
length, and the anchor keeps its kind. At an open end, where no segment leaves the anchor on the other side,
|
||||
`symmetric` has no effect and the handle moves as it would without it. Both `symmetric` and `independent` default to false, and a call with both true is
|
||||
@@ -10290,7 +10328,9 @@ the corners holding a Direct-Selected anchor, or every corner of a path selected
|
||||
hold no corner is left out. The pop-up has the corner kind, the radius (blank while the picked corners differ) and the
|
||||
rounding, Relative or Absolute (`relativeRadii`, which applies to each path as a whole; neither is chosen while the
|
||||
paths differ). A path without Live Corners is Absolute: Relative leaves it, an ellipse or a line as it is, with no
|
||||
undo step. Editing a path's anchors (for example `path.moveAnchors`) ends its Live Corners, so it is Absolute again.
|
||||
undo step. Moving a path's anchors with `path.moveAnchor`, `path.moveAnchors` or the arrow keys keeps Live Corners and
|
||||
the radius mode under the rules above. An anchor edit that makes the shape a plain path ends Live Corners and resets
|
||||
the radius mode to Absolute.
|
||||
With Relative rounding, a radius is
|
||||
compared as the fraction it stores (its share of the corner's maximum, at most all of it), so typing the radius
|
||||
shown again adds no undo step. The Corner Radius field beside the link sets the same corners. Each change runs one
|
||||
|
||||
+2
-1
@@ -84,6 +84,7 @@ M7 type: Touch Type moves a right-to-left character along its line and up from i
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-26 | minor | Show Missing Links in View and the Links panel marks missing linked images and placed documents on the canvas; the link watcher scans them in the background, so turning it on never waits on a file; transient overlays stay out of artwork, export and undo history; command API controls and lists markers (#5547). Scores and estimates unchanged. |
|
||||
| 2026-11-24 | minor | G12: History row context menus use shared Craft List and Menu controls after rebasing onto the panel migration. App-specific actions retain the chosen snapshot across pending edits and dismiss on document switches; keyboard context requests and focus restoration use the shared runtime. Regression cases retained (#8845); scores and estimates unchanged. |
|
||||
| 2026-11-21 | minor | G12/M14: History row context menus retain the chosen snapshot while the menu is open and pending edits settle; jumps settle typing before counting undo/redo, and discarded states report that they are unavailable. Shift+F10 opens the focused row menu, Escape restores row focus, and switching documents dismisses the popup. History checklist, area and milestone evidence updated (#8845); scores and estimates unchanged. |
|
||||
| 2026-11-20 | minor | G12: Asset Export tiles have item context menus for Export, Remove, Rename, Select Artwork on Canvas and collecting selected artwork; right-click selects an unselected tile and preserves an existing multi-selection. Headless regressions: panels::tests_asset_export. Scores and estimates unchanged. |
|
||||
@@ -198,7 +199,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule
|
||||
| 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); Layers own appearance has a hollow diamond and tooltip distinct from targeting/selection (#8710), retaining Hassan1305's #8757 ring-visibility fix; validation pending | 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); View › Snapping consolidates five existing toggles and Pixel Snapping Options…, retaining top-level entries and shortcuts (G13); 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); in a document with more than 20,000 anchors the topmost, newest objects keep their Smart Guides targets (#8531) | 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; Recolor with Preset asks whether to limit the colors to a swatch library first); 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); the stop editor offers the five Color panel modes (#7918); native port validation pending | 4–8 |
|
||||
| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | `.ai` import: type takes the installed copy of its font that sets its PDF part's widths (#8087; estimates unchanged); `.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 importLine truncated
|
||||
| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | `.ai` import: type takes the installed copy of its font that sets its PDF part's widths (#8087; estimates unchanged); `.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; View and Links controls and command access for transient missing-link canvas markers (#5547); 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 stLine truncated
|
||||
| M5 | Performance | 🟡 background render + caches + MT done; text thread overlays index repeated selection lookups, keeping the first lookup and singleton selections direct (#6543); `vectorcraft-cli bench` and `vectorcraft-cli perf` (budget suite); opaque solid-fill knockout paths draw once in hard-edge/supersampled raster export, with analytical-AA compositing unchanged; file format v2 opens 3× faster (50k paths: 722 → 244 ms); raster effects (glows, shadows, blur, feather) no longer force the whole frame single-threaded (filtered offscreen per effect, verified equal to the single-threaded reference); Craquelure/Mosaic Tiles/Stained Glass distance searches optimized with pixel-invariance checks and the `texture_drag_perf` probe (#1257); effect-heavy demos need a clean-machine benchmark; in the web build an edit while the view of a heavy document moves draws only the part it changed into the last frame (#8688); dirty-region rendering, GPU backend spike pending | 15–25 |
|
||||
| M6 | Path operations (Pathfinder, Shape Builder, offset…) | ✅ mostly done (live compound shapes: Make, Alt-click a Shape Mode, member modes, Release, Expand (#4522); single-result Pathfinder names and SVG IDs retained (#1293); Divide open-cutting-path geometry, appearance and history verified (#1307; existing segment cap remains); Simplify preview/counts and rewritten-path component selection verified (#1272; the slider opens at the Auto-Simplify level; a Direct Selection part of a path simplifies on its own); Compound appearance and member fill-rule edits verified (#1197); Boolean precision on almost-horizontal edges fixed and the property tests made deterministic; Shape Builder gap detection, large-offset bug open); Shape Builder Gap Detection shares Live Paint’s spatial gap finder and temporary merge bridges (#2526); Custom is capped at 72 pt in the existing options dialog | 3–6 |
|
||||
| M7 | Type (point/area/path, editing, styles, OpenType, threading, glyphs) | Spell check engine: `text.spelling.check` and `text.spelling.suggest` on craft-proof, the custom dictionary and Ignore All commands, Auto Spell Check with its right-click suggestions, Ignore All and Add to Dictionary, Spelling › Auto Spell Check in the context menu of type, the Edit Custom Dictionary dialog, and the modal Check Spelling dialog (Edit › Spelling › Check Spelling…, `Cmd+I`, `ui.checkSpelling`, #4936); 🟡 Retype phase 1: `type.retype` turns outlined text that exactly matches an available font back into point text (#4934), keeping even spacing as tracking and making stacked, aligned lines one area type object; Right-aligned area type sets the text after a line's last tab against the right edge, the text before it at its stops (#6147); A line a soft return ends is justified as a wrapped line is (#6137); Indian-language pattern hyphenation preserves syllables in both composers (#4947); 🟡 Hanging punctuation keeps its published amounts under Glyph Scaling, and Standard burasagari counts a hung line start as room; Fullwidth `!` / `?` keep an upright fallback in vertical type; Hyphenation… and Justification… per paragraph (#2310, #2755), Auto Leading also driving the Character panel's Leading, the Alt+↑/↓ leading nudge and Fill with Placeholder Text; Document-point character controls after object/group scaling (#1034; optional font-size preservation remains separate), Character/Paragraph Styles (explicit Auto-leading resets and local leading overrides), per-paragraph paragraph attributes, mixed paragraph alignment indication (headless regressions, full integration CI and visual review pass), Area Type Options (with Width/Height, Auto Size and Shrink Text to Fit; overflow reported to agents and vertical Align), type areas resized by their handles and reshaped with Direct Selection, threaded text, Fit Headline, Glyphs (feature-valued alternates and unencoded glyphs applied in one Undo step while keeping Arabic joining, #5514), OpenType panel (including font-defined Stylistic Sets), Find Font (Document, Recent and System replacement sources, #5217), installed system fonts in every font menu (fonts registered with Windows outside its font folders, the XDG and Flatpak host font folders on Linux, and fonts installed while the app runs, listed when it comes back to the front; searchable; the Character and Properties menus show each family's sample of the selected text, preview it live under the pointer or ↑/↓, show recently applied families first (#3515), filter by script and kind, list a family's styles, and star favourites; the Glyphs panel and Find Font's Replace With use the same menu without the live preview) and found by name on open/import (full-name aliases and Missing Fonts searches verified, #1258; Windows font-service QA pending), variable fonts' named instances as styles, CJK names in the UI, input methods (marked text in place, candidate window at the caret; Japanese IME), Text Wrap (offset, invert, both sides of an object; follows edits), Type on a Path effects and Options with draggable start/centre/end brackets (slide, flip), tab stops + Tabs panel (Above Text floats it over the selected text, its ruler at the canvas zoom so stops line up with the columns, #729), inline symbols in text (beyond parity), Hebrew/Arabic bidirectional text, Paragraph Direction, Every-line/Single-line Composer per object (ragged text too) done; paint-only Arabic harakat keep joining with GDEF-mark ownership and Insert Kashidas tatweels on the base letter's paint (`tests::harakat`); tab leaders done (#1880); vertical type in progress (Type › Type Orientation, #5027) | 45–60 |
|
||||
|
||||
@@ -132,6 +132,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-26 | minor | Show Missing Links in View and the Links panel marks missing linked images and placed documents on the canvas; the link watcher scans them in the background, so turning it on never waits on a file; transient overlays stay out of artwork, export and undo history; command API controls and lists markers (#5547). Scores and estimates unchanged. |
|
||||
| 2026-11-25 | minor | Document Info › Objects: total enclosed area (`pathArea` in pt²) for closed and compound paths (holes subtracted per fill rule; guides and open paths left out) and formatted Path Area in document units (#6965). Worked out only when the request covers Objects (`pathArea` null otherwise or with `pathArea: false`); the panel asks for it only while Objects or All Categories is shown. Tests: `info_gives_the_paths_total_area`, `info_works_out_the_path_area_only_for_the_objects_category`, `the_path_area_is_worked_out_only_while_objects_is_shown`, `format_area_formats_and_trims_cleanly`. Scores and estimates unchanged. |
|
||||
| 2026-11-24 | minor | G12: History row context menus use shared Craft List and Menu controls after rebasing onto the panel migration. App-specific actions retain the chosen snapshot across pending edits and dismiss on document switches; keyboard context requests and focus restoration use the shared runtime. Regression cases retained (#8845); scores and estimates unchanged. |
|
||||
| 2026-11-21 | minor | G12/M14: History row context menus retain the chosen snapshot while the menu is open and pending edits settle; jumps settle typing before counting undo/redo, and discarded states report that they are unavailable. Shift+F10 opens the focused row menu, Escape restores row focus, and switching documents dismisses the popup. History checklist, area and milestone evidence updated (#8845); scores and estimates unchanged. |
|
||||
@@ -373,7 +374,7 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de
|
||||
| Print, colour management, separations, flattener | 3 | 80% | Production Preflight available; print preview fidelity remains | 2–4 | estimated |
|
||||
| Automation (Actions, Variables, scripting, batch) | 3 | 80% | script DOM classes for layers, artboards and gradient stops, `#engine` (#1183), Batch option depth (scripting, #9019, Batch, #1938, and image and graph variables are done) | 8–14 | estimated; MCP `add_text` exposes existing vertical type; score and hours unchanged |
|
||||
| UI chrome (panels, Properties, workspaces, preferences) | 6 | 80% | Document Info Selection Only (`ui.docInfo.selectionOnly`) counts the selection through `document.info`, and with no artwork selected it shows (No artwork selected) and artboards the Artboard tool has selected still show (`panels::doc_info::tests::test_doc_info_counts_entire_document`, `test_doc_info_selection_only_toggles_and_filters_counts`, `test_doc_info_selection_only_keeps_selected_artboard`, `test_doc_info_panel_menu_toggles_state`); Properties Quick Actions offer Ungroup for any selected group, Isolate Group only for one group, and Unite only for selections of at least two objects, each a non-guide path or a compound path (`panels::properties::tests::two_groups_offer_ungroup_without_isolate_group`, `one_group_offers_ungroup_and_isolate_group`, `several_paths_offer_group_clipping_mask_and_unite`); Asset Export item context menus implemented (G12); Properties per context, 2 Preferences options stored but unused (#394, audited 2026-10-30: Scratch Disks, legacy vector clipboard), context menus in the remaining panels that have none (History rows implemented, #8845), accessibility | 13–20 | estimated; floating panels in OS windows of their own on the desktop (#4135), score and hours unchanged; macOS save Format menu implemented (#866), score and hours unchanged; Eyedropper cursor and precise setting checked (#1269), OS visual QA unverified; the line under the Preferences fields describes each General, Selection & Anchor Display, Guides & Grid, Smart Guides, Slices, Hyphenation, Plug-ins & Scratch Disks, User Interface, Performance, File Handling, Clipboard Handling, Appearance of Black and Devices setting on hover and keyboard focus (#8199, #8223, #8248, #8264, #8360, #8376, #8402, #8429, #8453, #8475, #8483, #8498), score and hours unchanged; numeric-field focus and normal text drags regression-tested (#1326); a focus click released more than 1 pt from its press keeps the caret and a tap within 1 pt selects all (#6659); artboard navigation synchronizes the tool selection before destructive actions; status messages and readouts use stable responsive allocations sized for localized labels and ordinary coordinates (sample widths cached by language/unit/DPI; regression and contributor original-file evidence below; scores/hours unchanged); effect dialogs' colour fields show a swatch that opens the Color Picker (#5365), score and hours unchanged; icon-strip flyouts retain user sizes (#5713); floating tab groups collapse into the side icon rail and opened rail panels fold back into it (#5925, in part), scores and hours unchanged ; interim macOS cursor delivery (#2292), headless coverage only; native validation pending, score and hours unchanged; Swatches item context menus have focused regressions and rendered-layout evidence below; Character Styles and Paragraph Styles item context menus have focused regressions (panels::text_styles::tests::right_click_context_menu_*); scores and estimates unchanged; History row context menus have snapshot, pending-edit, typing and clear-history headless regressions (panels::history::tests, #8845); swatches dropped on New Swatch or Delete Swatch carry the selected swatches the find field or kind filter hides (#8620); scores and estimates unchanged; the Artboards panel's list fills the panel, so it resizes with the window (#6085), score and hours unchanged; Layers appearance marker uses a hollow diamond and tooltip separate from targeting and selected art (#8710), based on Hassan1305's #8757; focused Layers coverage, runtime validation pending; scores and hours unchanged; Tools toolbar Search entry and retained customization covered in `crates/ui-egui/src/toolbar/tests.rs` (#8758), scores and hours unchanged |
|
||||
| Libraries, Links, Package | 2 | 82% | shared libraries, linked graphics, gradients and patterns as library items (no cloud by design) | 2–3 | estimated; #5804: private native-picked raster editor (scores unchanged) |
|
||||
| Libraries, Links, Package | 2 | 82% | shared libraries, linked graphics, gradients and patterns as library items (no cloud by design) | 2–3 | estimated; #5804: private native-picked raster editor (scores unchanged); #5547: missing-link canvas outlines and badges, View/Links toggles and command API (score and hours unchanged) |
|
||||
| Generative AI (Text to Vector, Generative Recolor, Shape Fill, Concept to Vector, Prompt to Edit, Rewrite Text) | 2 | 0% | a pluggable provider and the panels; needs an owner decision on models | 30–60 | measured (absent) |
|
||||
| **Feature depth** | **105** | **~79%** | | **~250–420** | |
|
||||
| Interaction-fidelity pass (every tool's modifiers, cursors, Properties per context) | | | [ui-parity.md](ui-parity.md) | 60–90 | estimated |
|
||||
@@ -863,6 +864,7 @@ since 2026-10-01.
|
||||
- **A Shift-click inside a selected group** (VectorCraft's own rule): with Direct Selection, a Shift-click on the fill of a path inside a selected group deselects that path, and the group's other objects stay selected (`select.remove`); a Shift-drag from there moves nothing. A Shift-click on one of the path's anchors deselects only that anchor, and the path's other anchors and the group's other objects stay selected. Tests: `direct::tests::a_shift_press_inside_a_selected_group_deselects_the_path`, `selection_commands::remove_and_anchor_toggle_open_a_selected_group`, `selection::tests::expand_to_selects_a_member_in_place_of_its_selected_group`.
|
||||
- **Shift-click on corner widgets (#5188):** with Direct Selection, when every corner of every selected path is selected (the paths selected whole), a Shift-click on a corner widget picks that corner alone, so the next drag rounds just it. When another selected path has only some corners picked, a Shift-click on a widget of a path selected whole deselects that corner and keeps the other picks. The other corners' widgets then show as not picked; a Shift-click on another corner's anchor or widget adds that corner, and a Shift-click on a picked widget deselects its corner. Corner widgets are chosen by clicking one and Shift-clicking the others ([a tutorial on rounded corners](https://logosbynick.com/?p=15787)). Test: `corners::tests::a_shift_click_on_a_widget_of_a_whole_path_picks_its_corner`.
|
||||
- **Picking corner widgets (#1232):** with Direct Selection, every corner's widget shows while some corners are picked: a picked corner's widget has a dot at its center and the others are hollow. A click on a widget that is not picked picks its corner alone, a Shift-click adds or removes a corner across selected paths, and a double-click on a picked widget opens Corners for the picked corners of its path ([Live Corners help page, archived](https://web.archive.org/web/2019/https://helpx.adobe.com/illustrator/using/reshape-with-live-corners.html)). As VectorCraft's own rules, a plain click on a picked widget keeps the picks (while every corner of every selected path is picked, it picks that corner alone, and a double-click then opens Corners for that corner), a drag or Alt-click on a widget that is not picked edits its corner together with the picked ones, and over a widget that is not picked, a selected anchor's handle end or a nearer anchor takes the press. Tests: `corners::tests::a_press_on_a_widget_not_picked_edits_it_with_the_picked_corners`, `corners::tests::widgets_are_picked_across_paths`, `corners::tests::a_handle_end_over_a_widget_not_picked_takes_the_press`, `corners::tests::a_nearer_anchor_over_a_widget_not_picked_takes_the_press`, `corners::tests::a_shift_click_toggles_a_rounded_corner_whole`, `corners::tests::a_path_with_hidden_widgets_keeps_its_picks`, `tests::corner_widgets_pick_corners_across_paths_through_the_session`.
|
||||
- **Anchor edits keep Live Corners (#10545):** moving an anchor of a path with rounded corners (Direct Selection drag, arrow keys, `path.moveAnchor`) moves its uncut corner by the drag delta and recuts it at its radius. A grabbed arc end can finish away from a snap target. A live rectangle or polygon becomes a path with live corners. When the anchor layout changes, the path's whole anchor selection is remapped and its segment selection is cleared. An anchor edit makes the shape a plain path when there is no rounded corner, a live rectangle is sheared or unevenly scaled, an arrow-key nudge bends selected curved segments or holds their anchors, or direct-selected anchors receive a transform other than a move. A nudge that changes nothing, including one that the pixel-grid snap of pixel-aligned paths takes back (with objects selected whole too), records no undo step and leaves Live Corners as they are: a live rectangle stays a live rectangle. These are VectorCraft's own rules. Tests: `tests::livecorners::moving_an_anchor_keeps_the_corners_live`, `tests::livecorners::dragging_selected_anchors_keeps_the_corners_live`, `tests::livecorners::moving_an_anchor_of_a_distorted_rectangle_edits_the_drawn_path`, `tests::livecorners::a_recut_remaps_the_whole_anchor_selection`, `tests::livecorners::a_recut_clears_segments_even_when_selected_anchor_indices_stay_the_same`, `tests::livecorners::an_unchanged_corner_layout_keeps_the_selection`.
|
||||
- **TIFF in screen and asset export:** both format menus expose the existing TIFF encoder and Format Settings. Headless UI regressions choose TIFF and check scaled dimensions, artboard selection, filenames, encoding options, saved settings and collected-asset output. Public reference: [Export for Screens](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/export-for-screens.html), updated 2026-09-28, lists TIFF for both artboards and assets. Adobe staff [confirmed support in 30.2.1](https://illustrator.uservoice.com/forums/333657-illustrator-desktop-feature-requests/suggestions/49081034-add-tiff-format-into-export-for-screens-assets-d) on 2026-02-19; the older 2025 Collect assets guide omits TIFF.
|
||||
- **Lossy WebP with a Quality setting:** WebP Options has a Compression menu (Lossless, Lossy) and a Quality slider from 0 to 100 that is enabled for Lossy. Lossy writes a `VP8 ` WebP file, with an `ALPH` chunk that keeps the alpha exactly when some pixels are not opaque. `document.export`, `document.serialize` and Export for Screens take `lossless: false` with `quality` (default 90, VectorCraft's own value), in a format row or in `settings.webp`; Format Settings for WebP keeps both. Lossless stays the default, and a quality above 100 or one that is not a whole number is refused. Public reference: [export file format options](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/export-file-format-options-in-illustrator.html) describes Lossless and Lossy WebP and a Quality setting for Lossy (`webp_is_lossless_by_default_and_lossy_when_asked`, `lossy_webp_keeps_translucent_pixels`, `webp_quality_out_of_its_range_is_refused` in `crates/engine/src/cmd/fileio/tests_text.rs`, `webp_options_choose_lossless_or_lossy_at_a_quality`).
|
||||
- **Export for Screens of the selected artboards:** while the Artboard tool is in use, File › Export › Export for Screens… (`file.exportForScreens`) opens with the artboards the tool has selected checked on its Artboards tab, and Export Artboard writes only those. Shift-clicks on the canvas, or Shift- or Ctrl/Cmd-clicks on the Artboards panel's rows, select several. The other fields show the settings the document last exported with. With another tool in use, the dialog takes its artboard choice from those settings too. Public reference: [Export selected artboards](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/organize-manage-artboards/export-artboards.html).
|
||||
@@ -1119,7 +1121,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- Scripts: a page item's `translate`, `rotate`, `resize` and `transform` move, turn, scale and transform the object by offsets, an angle, percentages or a `Matrix` record, about its center or a `Transformation` point, with positions, patterns, gradients and line widths following their arguments (https://ai-scripting.docsforadobe.dev/jsobjref/PageItem/). Each call that moves or reshapes the object runs `object.transform` inside the run's transaction, a call that changes only a path's stroke weight runs `stroke.set`, and a call that changes nothing runs no command. `resize` and `transform` on a member of a compound path with `changeLineWidths` at their own scale set the compound's stroke weight; locked art, art on a locked artboard and bad arguments throw an error with nothing changed (`docs/mcp.md`). `crates/engine/src/tests/script_dom_transform.rs`.
|
||||
- Scripts: `Document.placedItems` and `Document.rasterItems` list a document's linked and embedded images; `placedItems.add()` with a `File` assigned to `file` places an image linked, and `PlacedItem.relink(file)` and `embed()` relink and embed it, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/PlacedItems/, https://ai-scripting.docsforadobe.dev/jsobjref/PlacedItem/, https://ai-scripting.docsforadobe.dev/jsobjref/RasterItems/ and https://ai-scripting.docsforadobe.dev/jsobjref/RasterItem/ describe them. A raster item's bits per channel, channels, color space and transparency come from its encoded pixels' header. Only files the script may read, of at most 256 MiB and holding an image, are placed or relinked. `crates/engine/src/tests/script_dom_images.rs`.
|
||||
- Scripts: `app.preferences` reads, stores and removes values by key with the type they were set as, keeps them across runs and restarts, and turns the warning before a picked script on with the key `ShowExternalJSXWarning`, and off only after the person answers Yes to a confirm (https://ai-scripting.docsforadobe.dev/jsobjref/Preferences/; the confirm is VectorCraft's own rule); `app` makes, joins, inverts and compares `Matrix` records (https://ai-scripting.docsforadobe.dev/jsobjref/Matrix/), rounding each joined value once from its exact sum of products and deciding whether an inverted value overflows from its exact quotient, and runs Copy, Cut and Paste on the active document inside the run's transaction (https://ai-scripting.docsforadobe.dev/jsobjref/Application/). `crates/engine/src/tests/script_dom_prefs.rs`.
|
||||
- Scripts: `Document.pathItems` lists the paths and makes rectangles, rounded rectangles, ellipses, polygons, stars and empty paths with the defaults the help page https://ai-scripting.docsforadobe.dev/jsobjref/PathItems/ gives; each path's points, closed state, fill rule, area, length, guide state, selected points, fill and stroke colors, stroke options and transforms read and change as https://ai-scripting.docsforadobe.dev/jsobjref/PathItem/, https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints/ and https://ai-scripting.docsforadobe.dev/jsobjref/PathPoint/ describe them, and `RGBColor`, `CMYKColor`, `GrayColor`, `LabColor` and `NoColor` make colors (`docs/mcp.md`). `pathItems["name"]` reads a path by name as `pageItems` does, and `removeAll()` deletes nothing and throws when any path is hidden or locked, is on a locked artboard or is a guide while guides are locked, or when it would delete or empty the clipping path of a group or layer that keeps other objects. It still deletes the paths of a group that is the clipping path when a visible text object that lays out glyphs stays inside that group, because the text then clips; text beside the clipping path does not count, and a clipping group nested in the mask counts only when its own clipping path keeps such geometry. A path takes the page item transforms, and `resize` also sets its stroke weight to a `changeLineWidths` percent from 0 to 100000 (at most 1000 points; a member of a compound sets the compound's stroke); gradients move with positions, so a `changeFillGradients` different from `changePositions` throws an error, as do `changeFillPatterns` and `changeStrokePattern` given as different values (`docs/mcp.md` lists these limits). Gradient stops are not there yet. A `PathPoint` of a path in an Objects on Path group goes stale when an edit of another path in the group moves it. A `PathPoint` of another Global Edit member goes stale when Global Edit changes its path's points. `crates/engine/src/tests/script_dom_paths.rs`.
|
||||
- Scripts: `Document.pathItems` lists the paths and makes rectangles, rounded rectangles, ellipses, polygons, stars and empty paths with the defaults the help page https://ai-scripting.docsforadobe.dev/jsobjref/PathItems/ gives; each path's points, closed state, fill rule, area, length, guide state, selected points, fill and stroke colors, stroke options and transforms read and change as https://ai-scripting.docsforadobe.dev/jsobjref/PathItem/, https://ai-scripting.docsforadobe.dev/jsobjref/PathPoints/ and https://ai-scripting.docsforadobe.dev/jsobjref/PathPoint/ describe them, and `RGBColor`, `CMYKColor`, `GrayColor`, `LabColor` and `NoColor` make colors (`docs/mcp.md`). For ordinary layer placement, the creators use the topmost shown, unlocked layer when the active layer is locked or hidden. The call also throws and makes no path when the document has layers and every one is locked or hidden. `pathItems["name"]` reads a path by name as `pageItems` does, and `removeAll()` deletes nothing and throws when any path is hidden or locked, is on a locked artboard or is a guide while guides are locked, or when it would delete or empty the clipping path of a group or layer that keeps other objects. It still deletes the paths of a group that is the clipping path when a visible text object that lays out glyphs stays inside that group, because the text then clips; text beside the clipping path does not count, and a clipping group nested in the mask counts only when its own clipping path keeps such geometry. A path takes the page item transforms, and `resize` also sets its stroke weight to a `changeLineWidths` percent from 0 to 100000 (at most 1000 points; a member of a compound sets the compound's stroke); gradients move with positions, so a `changeFillGradients` different from `changePositions` throws an error, as do `changeFillPatterns` and `changeStrokePattern` given as different values (`docs/mcp.md` lists these limits). Gradient stops are not there yet. A `PathPoint` of a path in an Objects on Path group goes stale when an edit of another path in the group moves it. A `PathPoint` of another Global Edit member goes stale when Global Edit changes its path's points. `crates/engine/src/tests/script_dom_paths.rs`.
|
||||
- Scripts: `PlacedItem.trace()` and `RasterItem.trace()` make an Image Trace object and return it as a `PluginItem` whose `tracing` gives its path, anchor and color counts, the source image's resolution, `expandTracing()`, `releaseTracing()` and its `TracingOptions`; assigning an option or loading a preset traces it again, except that the view options (`viewRaster` and `viewVector`) only change the view, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/PluginItem/, https://ai-scripting.docsforadobe.dev/jsobjref/TracingObject/ and https://ai-scripting.docsforadobe.dev/jsobjref/TracingOptions/ describe them. Option values are checked for type and range before any trace, a script cannot save a preset, and the options without a VectorCraft setting throw. The source image of a traced item is left out of `pageItems`, `placedItems` and `rasterItems`; a script reaches it through `PluginItem.tracing.sourceArt`. Renaming an ordinary group that holds an image first to `Image Trace`, or moving or duplicating an image to the bottom of an ordinary group with that name, throws an error. `crates/engine/src/tests/script_dom_tracing.rs`.
|
||||
- Scripts: a document's `default*` members (https://ai-scripting.docsforadobe.dev/jsobjref/Document/) read and set the fill, stroke and stroke options of the next object drawn through `appearance.setNewArt`, leaving the selection and its art as they were, and `scaleFactor` reads 1 (`docs/mcp.md`). `crates/engine/src/tests/script_dom_defaults.rs`.
|
||||
- Scripts: `app.undo()` and `app.redo()` undo and redo the edits the run made, and each document open before and after the run that it changed gets one undo step. `crates/engine/src/tests/script_dom.rs`.
|
||||
@@ -1127,7 +1129,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- Scripts: `document.characterStyles` and `document.paragraphStyles` add, find, rename, redefine, apply and remove character and paragraph styles, with the Normal styles listed first and kept, and a text range lists the styles its text is in, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/CharacterStyles/, https://ai-scripting.docsforadobe.dev/jsobjref/CharacterStyle/, https://ai-scripting.docsforadobe.dev/jsobjref/ParagraphStyles/, https://ai-scripting.docsforadobe.dev/jsobjref/ParagraphStyle/ and https://ai-scripting.docsforadobe.dev/jsobjref/TextRange/ describe them (`docs/mcp.md`). Style names of 1 to 256 characters without control characters, and at most 4,096 styles named in one run, are VectorCraft's own rules. Load Character Styles, Load Paragraph Styles and Load All Styles refuse a file larger than 64 MB. A paragraph style's character attributes are not there yet. `crates/engine/src/tests/script_styles.rs`.
|
||||
- Scripts: a text frame's `nextFrame` and `previousFrame` read and set its links to the frames before and after it, `areaText` and `pathText` thread a new frame to a base frame, and `document.stories` lists the stories, each with its frames in thread order and its text across them as one text range with its characters, words and paragraphs, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/TextFrameItem/, https://ai-scripting.docsforadobe.dev/jsobjref/Story/ and https://ai-scripting.docsforadobe.dev/jsobjref/Stories/ describe them; `text.thread.setNeighbor` links or unlinks two frames by id (`docs/mcp.md`). Which links are refused, and how a story is listed and found, are VectorCraft's own rules. `crates/engine/src/tests/script_threads.rs`.
|
||||
- Scripts: `PageItem.tags` reads, adds, renames and deletes an object's tags, name and value pairs that the native file keeps, and `Document.tags` reads, renames and deletes the tags of every page item but adds none (its `add` throws; a script adds a tag through the page item's `tags`), as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/Tags/ and https://ai-scripting.docsforadobe.dev/jsobjref/Tag/ describe them, through `object.tags` and the `object.tag.*` commands, at most 64 tags an object (`docs/mcp.md`). `crates/engine/src/tests/script_tags.rs`.
|
||||
- Scripts: a document's layers and sublayers with their options, stacking and current layer, its groups and compound paths with clipping masks, new empty groups and compound paths and paths moved into compound paths, and its artboards with their rectangles, names, ruler origins and display options, added, inserted, removed and made active, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/Layer/, https://ai-scripting.docsforadobe.dev/jsobjref/Layers/, https://ai-scripting.docsforadobe.dev/jsobjref/GroupItems/, https://ai-scripting.docsforadobe.dev/jsobjref/CompoundPathItem/, https://ai-scripting.docsforadobe.dev/jsobjref/CompoundPathItems/, https://ai-scripting.docsforadobe.dev/jsobjref/Artboard/ and https://ai-scripting.docsforadobe.dev/jsobjref/Artboards/ describe them (`docs/mcp.md`); `artboards.add` returns the new artboard and `artboards.insert` returns nothing. Scoped collections support string conversion, which fails for `Layers`, `GroupItems`, `CompoundPathItems` and `Artboards` once their container is gone; compound paths expose `PathItems` objects and reject unsupported path creation. Empty clipping containers release their masks in the deletion's undo step, and `clipped` changes check the group's, layer's and artboard's locks; turning clipping on also refuses a hidden or locked topmost object, which would become the mask. Layer selection changes keep unrelated selected objects, layer colors are assignable `RGBColor` values, stacking scans count toward the script budget, and paths moved into pixel-aligned compound paths are snapped. The `textFrames` of a layer or group list the type directly in it and put new type on top of its contents (VectorCraft's own rule), as https://ai-scripting.docsforadobe.dev/jsobjref/Layer/ and https://ai-scripting.docsforadobe.dev/jsobjref/GroupItem/ list them. `crates/engine/src/tests/script_dom.rs`, `crates/engine/src/tests/script_text.rs`, `crates/ui-egui/src/tests/script_run.rs`.
|
||||
- Scripts: a document's layers and sublayers with their options, stacking and current layer, its groups and compound paths with clipping masks, new empty groups and compound paths and paths moved into compound paths, and its artboards with their rectangles, names, ruler origins and display options, added, inserted, removed and made active, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/Layer/, https://ai-scripting.docsforadobe.dev/jsobjref/Layers/, https://ai-scripting.docsforadobe.dev/jsobjref/GroupItems/, https://ai-scripting.docsforadobe.dev/jsobjref/CompoundPathItem/, https://ai-scripting.docsforadobe.dev/jsobjref/CompoundPathItems/, https://ai-scripting.docsforadobe.dev/jsobjref/Artboard/ and https://ai-scripting.docsforadobe.dev/jsobjref/Artboards/ describe them (`docs/mcp.md`); `artboards.add` returns the new artboard and `artboards.insert` returns nothing. Scoped collections support string conversion, which fails for `Layers`, `GroupItems`, `CompoundPathItems` and `Artboards` once their container is gone; compound paths expose `PathItems` objects and reject unsupported path creation; `removeAll()` on a compound path's `pathItems` throws when it would empty a compound path that clips a group or layer keeping other objects that are not ruler guides. Empty clipping containers release their masks in the deletion's undo step, and `clipped` changes check the group's, layer's and artboard's locks; turning clipping on also refuses a hidden or locked topmost object, which would become the mask. Layer selection changes keep unrelated selected objects, layer colors are assignable `RGBColor` values, stacking scans count toward the script budget, and paths moved into pixel-aligned compound paths are snapped. The `textFrames` of a layer or group list the type directly in it and put new type on top of its contents (VectorCraft's own rule), as https://ai-scripting.docsforadobe.dev/jsobjref/Layer/ and https://ai-scripting.docsforadobe.dev/jsobjref/GroupItem/ list them. `crates/engine/src/tests/script_dom.rs`, `crates/engine/src/tests/script_text.rs`, `crates/ui-egui/src/tests/script_run.rs`.
|
||||
- Scripts: `Document.print` prints the document to a file with `PrintOptions` and the job, color management, color separation, coordinate, flattener, font, page marks, paper and PostScript option classes the help pages https://ai-scripting.docsforadobe.dev/jsobjref/PrintOptions/ and https://ai-scripting.docsforadobe.dev/jsobjref/PrintJobOptions/ describe, over the document's print settings, and `app.printPresetsList` lists the print presets (`docs/mcp.md`); `CUSTOMPROFILE` without a profile `name` throws. `crates/engine/src/tests/script_print.rs`.
|
||||
- Scripts: `Document.exportFile` with `ExportType.AutoCAD` writes a DXF file with the `ExportOptionsAutoCAD` options and the AutoCAD enumerations that https://ai-scripting.docsforadobe.dev/jsobjref/ExportOptionsAutoCAD/ and https://ai-scripting.docsforadobe.dev/jsobjref/scripting-constants/ describe; DWG throws an error that says it is not available, and `unitScaleRatio` is a percentage, with 100 at full size (`docs/mcp.md`). `crates/engine/src/tests/script_save_open.rs`.
|
||||
- Scripts: `Document.print` without a file prints to the printer `PrintOptions.printerName` names, or the default printer, and `app.printerList` lists the installed printers as `Printer` objects, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/PrintOptions/, https://ai-scripting.docsforadobe.dev/jsobjref/Application/ and https://ai-scripting.docsforadobe.dev/jsobjref/Printer/ describe. VectorCraft's own rules: the jobs are sent after the run's changes are kept and the person at the keyboard clicks Print or presses Space on it, which takes no click or focus for the first second, nothing is sent from a failed run, and the web build, and MCP or the command line without the app, cannot print to a printer from a script (`docs/mcp.md`). `crates/engine/src/tests/script_print.rs`, `crates/ui-egui/src/tests/script_print.rs`.
|
||||
|
||||
+4
-2
@@ -114,6 +114,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard
|
||||
| 2026-11-06 | minor | Drop Shadow, Outer Glow and Inner Glow: spinner arrows beside Opacity, the offsets, Blur and Darkness (#5367, #5368); scores and estimates unchanged |
|
||||
| 2026-11-06 | minor | Rename (`ui.rename`, no default key) opens the Layers panel's name field on the selected layer, group or object's row, as double-clicking its name does; a key can be assigned in Keyboard Shortcuts (#5324, a VectorCraft addition); scores and estimates unchanged |
|
||||
| 2026-11-06 | minor | Properties panel in Edit Artboards (Shift+O): a Transform section with the shared reference point, X, Y, W and H, the preset and orientation, and Move and Scale Artwork with Artboard, above the Artboards section with the name, Artboard Options and Fill (#5219); scores and estimates unchanged |
|
||||
| 2026-11-26 | minor | Show Missing Links in View and the Links panel marks missing linked images and placed documents on the canvas; the link watcher scans them in the background, so turning it on never waits on a file; transient overlays stay out of artwork, export and undo history; command API controls and lists markers (#5547). Scores and estimates unchanged. |
|
||||
| 2026-11-06 | minor | Shape tools: a press on the selection's centre point (Show Center) moves the selection, also where no art is painted, and a press in the rotate zone just outside a bounding-box corner turns it about the centre, both as the Selection tool's do (#5477); the Selection tool takes its centre point too, so an unfilled shape moves instead of starting a marquee; scores and estimates unchanged |
|
||||
| 2026-11-06 | minor | Transform fields: one Tab moves from one numeric field to the next in the Transform panel, the Properties panel's Transform section and the Control bar — a field's scrub label was a second, invisible tab stop, and the W/H link between W and H is now made after the fields, so it stays a tab stop after them; scores and estimates unchanged |
|
||||
| 2026-11-06 | minor | Scrubby labels: the Control bar's Stroke: and Opacity: and the Properties panel's Stroke, links to their panels, scrub the field after them as other labels do; a click still opens the panel (#4088); scores and estimates unchanged |
|
||||
@@ -195,9 +196,9 @@ tools, never checked side by side) isn't captured row by row.
|
||||
|
||||
## Headless (RFC-0052)
|
||||
|
||||
**Headless ([RFC-0052](https://github.com/storytold/craft-contrib/blob/main/rfcs/0052-headless-reach.md)): 0 yes, 0 no (window 0, os 0, engine-gap 0), 0 partial, 366 unknown.**
|
||||
**Headless ([RFC-0052](https://github.com/storytold/craft-contrib/blob/main/rfcs/0052-headless-reach.md)): 0 yes, 0 no (window 0, os 0, engine-gap 0), 0 partial, 368 unknown.**
|
||||
|
||||
Every parity table on this page has a Headless column: the Summary table (12 area rows, including the overall row) and the behaviour tables (353 rows). Every row is `unknown` until it is checked. A checked row may be marked `no (<reach>)` or `partial (<reach>)` by hand, where the reach is `window` (needs the desktop window, a dialog or the pointer), `os` (needs an OS or online service the engine doesn't wrap) or `engine-gap` (could be a command, isn't one yet). A `partial` row's notes say which part a headless client can do. `yes` only when the row cites a command id from the engine registry that `vectorcraft-cli` and the MCP server load (LightCraft's `cmd:<id>` check is the model). Some rows already cite command ids such as `toolbar.show`, `tool.select` and `guide.add`; those are not enough for `yes` until they are registry ids, and desktop-only ids (including the generated list in `crates/mcp/src/ui_catalog.rs`) do not count. Update the counts in this line when you mark rows.
|
||||
Every parity table on this page has a Headless column: the Summary table (12 area rows, including the overall row) and the behaviour tables (356 rows). Every row is `unknown` until it is checked. A checked row may be marked `no (<reach>)` or `partial (<reach>)` by hand, where the reach is `window` (needs the desktop window, a dialog or the pointer), `os` (needs an OS or online service the engine doesn't wrap) or `engine-gap` (could be a command, isn't one yet). A `partial` row's notes say which part a headless client can do. `yes` only when the row cites a command id from the engine registry that `vectorcraft-cli` and the MCP server load (LightCraft's `cmd:<id>` check is the model). Some rows already cite command ids such as `toolbar.show`, `tool.select` and `guide.add`; those are not enough for `yes` until they are registry ids, and desktop-only ids (including the generated list in `crates/mcp/src/ui_catalog.rs`) do not count. Update the counts in this line when you mark rows.
|
||||
|
||||
## Pen, Curvature and anchor tools
|
||||
|
||||
@@ -620,6 +621,7 @@ next unit in the order a right-click on a ruler lists them, from Feet back to Po
|
||||
| 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 | unknown |
|
||||
| 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 | unknown |
|
||||
| Color Effects add-on (VectorCraft addition): Object › Plug-ins › Color Effects › Randomize Fill Colors… picks Colors (Any Color, Tints of a Swatch or Grays), a Swatch among the document's global and spot swatches, Minimum and Maximum (%) and a Seed, with Preview, and gives each selected filled path and compound path, inside groups too, its own fill color at random, one undo step | done | `addon.color.randomFill`, `crates/engine/src/cmd/addons/color/random_fill.rs`, `crates/ui-egui/src/addons/color/random_fill.rs` and their tests; a VectorCraft addition, so it is not scored | unknown |
|
||||
| Missing linked images and placed documents can show red canvas bounds and a badge; View and Links panel toggles share transient per-document state; command API can set and list markers | done | #5547; `cmd/links.rs`, `link_watch.rs`, `canvas/missing_links.rs`; focused engine/canvas/MCP regressions, headless visual check and full CI (including WebAssembly) pass | unknown |
|
||||
| Selection Tools add-on (VectorCraft addition): Object › Plug-ins › Selection Tools › Select by Artboards… lists every artboard (number, name, width × height in the document's units), filters them by name, chooses several (click, Shift-click for a range, Cmd/Ctrl-click to toggle; Select All / None act on the rows shown; a count of those chosen), fits a row's artboard in the window on double-click and makes it active, and on OK selects the objects overlapping, fully inside or fully outside the chosen artboards (Overlapping is All on Active Artboard's test) | done | #5525, #5548, #5549; `addon.select.byArtboards`, `crates/engine/src/cmd/addons/select.rs`, `crates/ui-egui/src/addons/select.rs` and their tests; not a feature of the reference app | unknown |
|
||||
| Selection Tools add-on (VectorCraft addition): Select Linked, Select Embedded, Select Missing and Select Modified in Object › Plug-ins › Selection Tools and the Links panel menu (off when no image has that status; Shift adds to the selection) select the images and placed documents with that link status, leaving out hidden, locked, template-layer and outside-isolation ones, which the status bar counts (e.g. "Selected 9 missing images; 3 more are hidden or locked"); Select by Link Status… lists them with name, status and format, searches by name, filters by status, picks with checkboxes and All / None, and selects with Zoom to Selection on by default | done | #5526; `addon.select.byLinkStatus`, `crates/engine/src/cmd/addons/select.rs`, `crates/ui-egui/src/addons/select/link_status.rs` and their tests; not a feature of the reference app | unknown |
|
||||
| Style panels: a double-click on a user character style's row opens its Character Style Options, and on a paragraph style's row opens the same Paragraph Style Options as the panel menu, with General, Basic Paragraph Formats, Tabs, Composition, Hyphenation, Justification and East Asian Composition Settings; the Character Style Options dialog keeps a fixed width, its sections scrolling when the window is shorter so OK and Cancel stay on screen | done | `ui.charStyleOptions`, `ui.paraStyleOptions` (`paraStyle.edit`); `panels::text_styles::tests::double_clicking_a_character_style_row_opens_its_options`, `dialogs::char_style_options::tests::the_sections_scroll_in_a_window_shorter_than_the_general_list`, `dialogs::para_style_options::tests::every_section_draws_its_fields`, `dialogs::para_style_options::tests::tabs_section_edits_the_style_stops` | unknown |
|
||||
|
||||
Reference in new issue
Block a user