diff --git a/crates/engine/src/cmd/buildcmds.rs b/crates/engine/src/cmd/buildcmds.rs index 739759afe6..b739ca5f7e 100644 --- a/crates/engine/src/cmd/buildcmds.rs +++ b/crates/engine/src/cmd/buildcmds.rs @@ -38,7 +38,7 @@ mod shape_builder; mod trace; pub use live_paint::live_paint_gaps; -pub(crate) use live_paint::{isolated_live_paint, merge_drawn_in_isolation}; +pub(crate) use live_paint::{LivePaintMove, check_part_name, clear_part_name, isolated_live_paints, merge_drawn_in_isolation}; use live_paint::{lp_expand, lp_fill, lp_gap_options, lp_info, lp_make, lp_merge, lp_release, lp_stroke_edge}; use shape_builder::{sb_merge, sb_regions}; pub(crate) use trace::TracePresetChanges; diff --git a/crates/engine/src/cmd/buildcmds/live_paint.rs b/crates/engine/src/cmd/buildcmds/live_paint.rs index 2eea5c2c00..02ba081477 100644 --- a/crates/engine/src/cmd/buildcmds/live_paint.rs +++ b/crates/engine/src/cmd/buildcmds/live_paint.rs @@ -1,8 +1,8 @@ use super::{ Appearance, AppearanceItem, Arc, Beside, Document, EDGE_NAME, EngineError, FACE_NAME, GapOptions, GapSize, LIVE_PAINT_NAME, Node, NodeId, - PathData, Point, Rect, Result, Selection, Session, SubPath, Value, b, bad, build_children, edge_near, face_at, finite, fit_to_old_edge, ids_json, - is_live_paint, json, number_or, object_param, paint_from, po, point_param, repaint_from, replace_roots, root_ids, source_nodes, source_shapes, - switch_or, + PathData, Point, Rect, Result, SOURCES_NAME, Selection, Session, SubPath, Value, b, bad, build_children, edge_near, face_at, finite, + fit_to_old_edge, ids_json, is_live_paint, json, number_or, object_param, paint_from, po, point_param, repaint_from, replace_roots, root_ids, + source_nodes, source_shapes, switch_or, }; /// `options` as stored on a Live Paint group: none for the defaults. @@ -74,6 +74,44 @@ fn set_parts(g: &mut Node, mut parts: Vec>, gone: &[NodeId]) { } } +/// Whether a path named `name` directly in a Live Paint group is one of its faces or edges: the +/// name is [`FACE_NAME`] or [`EDGE_NAME`]. +fn part_name(name: Option<&str>) -> bool { + matches!(name, Some(FACE_NAME | EDGE_NAME)) +} + +/// Whether `n` is a path whose parent `parent` is a Live Paint group. +fn path_in_live_paint(d: &Document, parent: Option, n: &Node) -> bool { + n.path_data().is_some() && parent.and_then(|p| d.node(p)).is_some_and(is_live_paint) +} + +/// Clear the name of `n`, put directly in `parent`, when it is a path named like a face or an edge +/// ([`part_name`]) and `parent` is a Live Paint group, so that the group's other children +/// ([`others_in`]) keep it when its faces and edges are made again. Paste uses it. +pub(crate) fn clear_part_name(d: &Document, parent: Option, n: &mut Node) { + if part_name(n.name.as_deref()) && path_in_live_paint(d, parent, n) { + n.name = None; + } +} + +/// Refuse naming rows `ids` `name` when it is the name of a face or an edge ([`part_name`]) and one +/// of them is a path directly in a Live Paint group that is not named `name` already. Checked +/// before anything changes. +pub(crate) fn check_part_name(d: &Document, ids: &[NodeId], name: &str) -> Result<()> { + if !part_name(Some(name)) { + return Ok(()); + } + for id in ids { + if let Some(n) = d.node(*id) + && n.name.as_deref() != Some(name) + && path_in_live_paint(d, d.parent_of(*id), n) + { + return Err(EngineError::Other("`Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name".into())); + } + } + Ok(()) +} + /// Select `ids` alone, without an undo step, when they are not selected that way already. fn select_only(s: &mut Session, ids: &[NodeId]) -> Result<()> { let st = s.doc()?; @@ -149,11 +187,16 @@ fn merge_live(d: &mut Document, sel: &mut Selection, roots: &[NodeId]) -> Result .ok_or_else(|| EngineError::Other("Live Paint Merge: select a Live Paint group and the paths to add".into()))?; check_live_paint_takes(d, roots)?; let old = d.node(target).cloned().ok_or(EngineError::NoNode(target))?; + // The rows that join are children of the group already when Merge runs after a drag, and a joining + // path named like a face or an edge is not one of the group's parts. + let mut old_parts = old.clone(); + if let Some(ch) = old_parts.children_mut() { + ch.retain(|c| !roots.contains(&c.id)); + } // Paint to carry over: (point inside face, paint) for faces that draw; edges are matched to the // old edges below. let keep_faces: Vec<(Point, Carried)> = - b::faces(&old).iter().filter(|f| draws(f)).filter_map(|f| Some((po::interior_point(f.path_data()?)?, Carried::of(f)))).collect(); - let old_parts = old.clone(); + b::faces(&old_parts).iter().filter(|f| draws(f)).filter_map(|f| Some((po::interior_point(f.path_data()?)?, Carried::of(f)))).collect(); let mut sources = source_nodes(&old); // The objects drawn in the other Live Paint groups besides their parts stay in the merged group. let mut others = vec![]; @@ -227,19 +270,22 @@ pub(super) fn lp_merge(s: &mut Session, p: &Value) -> Result { Ok(json!({ "id": id.0, "faces": faces, "edges": edges })) } -/// The Live Paint group whose drawn art is added when isolation mode leaves `isolated`: the innermost -/// Live Paint group that is `isolated` or holds it, such as a group drawn in an isolated Live Paint -/// group and then isolated itself. None when `isolated` is not in a Live Paint group. -pub(crate) fn isolated_live_paint(d: &Document, isolated: NodeId) -> Option { - d.ancestry(isolated)?.into_iter().rev().find(|id| d.node(*id).is_some_and(is_live_paint)) +/// The Live Paint groups whose drawn art can be added when isolation mode leaves `isolated`, innermost +/// first: every Live Paint group that is `isolated` or holds it, such as a group drawn in an isolated +/// Live Paint group and then isolated itself, and the group it was drawn in. Empty when `isolated` is +/// not in a Live Paint group. +pub(crate) fn isolated_live_paints(d: &Document, isolated: NodeId) -> Vec { + d.ancestry(isolated).unwrap_or_default().into_iter().rev().filter(|id| d.node(*id).is_some_and(is_live_paint)).collect() } /// The children of Live Paint group `g` besides its parts ([`others_in`]) that Live Paint takes /// ([`b::live_paint_takes`]) and that are shown and unlocked with everything in them, back to -/// front: the paths drawn in it in isolation mode. +/// front: the paths drawn in it in isolation mode. A Live Paint group's sources group, which is +/// always hidden, does not count. fn drawn_in(g: &Node) -> Vec { fn open(n: &Node) -> bool { - n.visible && !n.locked && n.children().is_none_or(|ch| ch.iter().all(|c| open(c))) + let src = b::sources(n).filter(|_| is_live_paint(n)).map(|s| s.id); + n.visible && !n.locked && n.children().is_none_or(|ch| ch.iter().filter(|c| Some(c.id) != src).all(|c| open(c))) } others_in(g).filter(|c| open(c) && b::live_paint_takes(c)).map(|c| c.id).collect() } @@ -259,6 +305,189 @@ pub(crate) fn merge_drawn_in_isolation(s: &mut Session, g: NodeId) -> Result) -> Spot { + let Some(p) = parent else { return Spot::Outside }; + for x in d.ancestry(p).unwrap_or_default().into_iter().rev() { + let n = d.node(x); + if n.is_some_and(is_live_paint) { + return if x == p { Spot::In(x) } else { Spot::Outside }; + } + if let Some(g) = d.parent_of(x) + && d.node(g).filter(|n| is_live_paint(n)).and_then(b::sources).is_some_and(|s| s.id == x) + { + return Spot::Source(g); + } + } + Spot::Outside +} + +/// The Live Paint groups that hold Live Paint group `g` among their paths (in their sources group, +/// at any depth), innermost first. +fn enclosing_live_paints(d: &Document, g: NodeId) -> Vec { + let mut out = vec![]; + let mut at = g; + while let Spot::Source(o) = spot_in(d, d.parent_of(at)) { + if out.contains(&o) { + break; + } + out.push(o); + at = o; + } + out +} + +/// What moving rows in the Layers panel (`layer.move`, `node.move`) does to Live Paint groups. +/// Rows that go into a Live Paint group from elsewhere are added to it as `livePaint.merge` adds +/// paths. Rows that go into or leave a group's paths (its sources group) change those paths, and +/// the group's faces and edges are made again from them, keeping the paint of the faces and edges +/// that stay, and so are those of every Live Paint group that holds a changed group among its +/// paths. Rows moved within one group's paths, or among a group's own children, change no faces. +pub(crate) struct LivePaintMove { + /// The Live Paint group the rows go into, and for each row whether it joins the group's paths. + join: Option<(NodeId, Vec)>, + /// The Live Paint group the rows go among the children of, with its sources group as it is + /// before the move. + keep_sources: Option<(NodeId, NodeId)>, + /// The Live Paint groups whose paths change. + rebuild: Vec, +} + +impl LivePaintMove { + /// Plan moving `rows` (with `copy`, copies of them) into `parent`, before anything changes. + /// Refuses rows Live Paint can't take ([`b::live_paint_takes`]) that would go among a group's + /// paths, with the message Make and Merge give. + pub(crate) fn plan(d: &Document, rows: &[NodeId], parent: Option, copy: bool) -> Result { + let to = spot_in(d, parent); + let from: Vec = rows.iter().map(|r| if copy { Spot::Outside } else { spot_in(d, d.parent_of(*r)) }).collect(); + let mut rebuild = vec![]; + for f in &from { + if let Spot::Source(g) = *f + && *f != to + && !rebuild.contains(&g) + { + rebuild.push(g); + } + } + if let Spot::Source(g) = to + && from.iter().any(|f| *f != to) + && !rebuild.contains(&g) + { + rebuild.push(g); + } + let entering: Vec = rows.iter().zip(&from).filter(|(_, f)| **f != to).map(|(r, _)| *r).collect(); + let join = match to { + Spot::In(g) if !entering.is_empty() => Some((g, from.iter().map(|f| *f != to).collect())), + _ => None, + }; + if to != Spot::Outside { + check_live_paint_takes(d, &entering)?; + } + let keep_sources = match to { + Spot::In(g) => d.node(g).and_then(b::sources).map(|s| (g, s.id)), + _ => None, + }; + Ok(Self { join, keep_sources, rebuild }) + } + + /// Whether rows join a Live Paint group, which makes the move a "Merge Live Paint" step. + pub(crate) fn joins(&self) -> bool { + self.join.is_some() + } + + /// After the rows were moved, now `moved` (in the order [`LivePaintMove::plan`] took them), + /// make the faces and edges of the groups whose paths changed again, and add the rows that + /// joined a group to it. → `moved` with the joined rows replaced by their group, once, and + /// without the faces and edges that were made again. + pub(crate) fn finish(self, d: &mut Document, sel: &mut Selection, moved: &[NodeId]) -> Result> { + // A moved object named like the sources group may now sit before it, where a lookup by name + // finds the object first. The group's own sources group goes back in front. + if let Some((g, src)) = self.keep_sources { + let ch = d.children_mut(Some(g))?; + if let Some(at) = ch.iter().position(|c| c.id == src) + && ch[..at].iter().any(|c| c.name.as_deref() == Some(SOURCES_NAME)) + { + let s = ch.remove(at); + ch.insert(0, s); + } + } + if self.join.is_none() && self.rebuild.is_empty() { + return Ok(moved.to_vec()); + } + // The group the rows join is made again by the merge below, from its paths as they are now + // and with the paint of its faces and edges as they were before the move. + let join_group = self.join.as_ref().map(|(g, _)| *g); + // A Live Paint group among another group's paths gives that group its faces and edges, so + // the groups holding a changed group among their paths are made again too, innermost first. + let mut groups: Vec = vec![]; + for g in self.rebuild.iter().copied().chain(join_group) { + for x in std::iter::once(g).chain(enclosing_live_paints(d, g)) { + if !groups.contains(&x) { + groups.push(x); + } + } + } + groups.sort_by_cached_key(|g| std::cmp::Reverse(d.ancestry(*g).map_or(0, |a| a.len()))); + let joined: Vec = match &self.join { + Some((_, mask)) => moved.iter().zip(mask).filter(|(_, j)| **j).map(|(r, _)| *r).collect(), + None => vec![], + }; + for g in groups { + if Some(g) == join_group { + let roots: Vec = std::iter::once(g).chain(joined.iter().copied()).collect(); + merge_live(d, sel, &roots)?; + } else if d.node(g).is_some() { + rebuild_paths(d, g)?; + } + } + let Some((g, mask)) = self.join else { return Ok(moved.iter().copied().filter(|r| d.node(*r).is_some()).collect()) }; + // `moved` holds each row once, so only the group can come twice. Faces and edges of the + // group moved along with the joining rows were made again, so they are left out. + let mut out = vec![]; + let mut listed = false; + for (r, j) in moved.iter().zip(&mask) { + if *j { + if !listed { + out.push(g); + listed = true; + } + } else if d.node(*r).is_some() { + out.push(*r); + } + } + Ok(out) + } +} + +/// Make Live Paint group `g`'s faces and edges again from the paths its sources group holds now, +/// with its Gap Options, carrying over the paint of the faces and edges that stay. With no path +/// left, the group keeps its sources group and its other children, and has no faces or edges. +fn rebuild_paths(d: &mut Document, g: NodeId) -> Result<()> { + let old = d.node(g).cloned().ok_or(EngineError::NoNode(g))?; + let sources = source_nodes(&old); + let mut n = old.clone(); + if source_shapes(&sources).0.is_empty() { + let src = b::sources(&old).cloned().ok_or(EngineError::NoNode(g))?; + set_parts(&mut n, vec![src], &[]); + } else { + let (children, _, _) = build_children(d, sources, old.gap_options().max_gap())?; + set_parts(&mut n, children, &[]); + repaint_from(&mut n, &old); + } + let mut changed = Beside::replacing(d, &[g]); + changed.put(d, g, vec![n])?; + changed.finish(d) +} + fn live_targets(s: &Session, p: &Value) -> Result> { let d = &s.doc()?.doc; let ids = root_ids(s, p)?; diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index 3b47fedb41..f126ac78ec 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -1611,6 +1611,7 @@ fn paste_clip(s: &mut Session, p: &Value, mode: PasteMode, clip: &Clipboard, cho } } else { super::object::keep_pixel_aligned(&mut c, sc); + super::buildcmds::clear_part_name(d, par, &mut c); new_ids.push(d.insert(par, idx, c)?); } } diff --git a/crates/engine/src/cmd/layer.rs b/crates/engine/src/cmd/layer.rs index 7a7f2b8e08..cd4077303b 100644 --- a/crates/engine/src/cmd/layer.rs +++ b/crates/engine/src/cmd/layer.rs @@ -13,6 +13,7 @@ use serde_json::{Value, json}; use vectorcraft_doc::{Artboard, ArtboardSide, Document, LAYER_COLORS, LayerColor, Node, NodeId, NodeKind, Scaling}; use vectorcraft_geom::{Affine, Rect}; +use super::buildcmds::LivePaintMove; use super::{ CommandSpec, Result, Session, bad, bool_or, check_numbers, check_switches, checked_id, checked_ids_param, checked_node, checked_nodes_param, cmd, color_value, f64_or, has_doc, has_selection, ids_param, index, object_param, ok, str_param, switch_or, @@ -83,7 +84,7 @@ pub fn specs() -> Vec { "Layer Options…", ["Window", "Layers"], None, - "{ids?|id? (default: the highlighted rows, else the current layer), name? (with prefs.identifyObjectsBy xmlId: a valid XML ID, stored as the object name), visible?, locked?, template?, printable?, preview?, dimImages?: 0..100|false, color?: index 0..26|\"#rrggbb\"|preset name (a hex color with an alpha part, #rrggbbaa or #rgba, is an error)} Layer Options; rows that are not layers take name, visible and locked, and `ids` may name ruler guides (their `guide.list` id), which hide or lock on their own. Template on also locks the layer and dims its images to 50% (unless given); off unlocks it and stops dimming. One undo step", + "{ids?|id? (default: the highlighted rows, else the current layer), name? (with prefs.identifyObjectsBy xmlId: a valid XML ID, stored as the object name), visible?, locked?, template?, printable?, preview?, dimImages?: 0..100|false, color?: index 0..26|\"#rrggbb\"|preset name (a hex color with an alpha part, #rrggbbaa or #rgba, is an error)} Layer Options; rows that are not layers take name, visible and locked, and `ids` may name ruler guides (their `guide.list` id), which hide or lock on their own. Template on also locks the layer and dims its images to 50% (unless given); off unlocks it and stops dimming. A path directly in a Live Paint group can't take the name Face or Edge, which name the group's faces and edges, unless it has it already. One undo step", has_doc, set_props ), @@ -110,7 +111,7 @@ pub fn specs() -> Vec { "Move Rows", [], None, - "{ids|id, target, place?: \"above\"|\"below\"|\"inside\" (default inside), copy?: bool} drag rows in the Layers panel: above or below the target row (beside it, in its layer or group), or inside a layer, group or Intertwine group (on top of its contents). Layers go only in layers or at the top level, objects in layers, groups and Intertwine groups; an object placed beside a top-level layer goes inside it. An object placed in an Intertwine group becomes a member drawn in its row's order, with no arranged areas, and one placed in a group that is a member becomes part of that member; one that is or holds an Intertwine group, a Repeat, a graph or a Live Paint group is refused. A member moved out of its Intertwine group drops its arranged areas, and a group left with one member is replaced by that member, or becomes a plain group of it when the group has an opacity, blending, appearance, mask, lock or hidden state of its own (with no member, it is removed). A row never goes into itself; a locked layer or group takes nothing. `copy` (Alt-drag) moves copies, which may also go above or below a row they copy (the target among `ids`). Every selected object left hidden or locked, such as one moved into a hidden layer or group, is deselected (the key object too). One undo step → {ids}", + "{ids|id, target, place?: \"above\"|\"below\"|\"inside\" (default inside), copy?: bool} drag rows in the Layers panel: above or below the target row (beside it, in its layer or group), or inside a layer, group or Intertwine group (on top of its contents). Layers go only in layers or at the top level, objects in layers, groups and Intertwine groups; an object placed beside a top-level layer goes inside it. An object placed in an Intertwine group becomes a member drawn in its row's order, with no arranged areas, and one placed in a group that is a member becomes part of that member; one that is or holds an Intertwine group, a Repeat, a graph or a Live Paint group is refused. A member moved out of its Intertwine group drops its arranged areas, and a group left with one member is replaced by that member, or becomes a plain group of it when the group has an opacity, blending, appearance, mask, lock or hidden state of its own (with no member, it is removed). A row never goes into itself; a locked layer or group takes nothing. `copy` (Alt-drag) moves copies, which may also go above or below a row they copy (the target among `ids`). A row that goes into a Live Paint group from elsewhere joins its paths as livePaint.merge adds them, and the group is selected (paths, compound paths, groups of them and Live Paint groups; anything else is refused and nothing moves); a row that goes into or leaves a Live Paint group's paths makes the group's faces and edges again, keeping the paint of those that stay. Every selected object left hidden or locked, such as one moved into a hidden layer or group, is deselected (the key object too). One undo step → {ids} (a row that joined a Live Paint group is listed as the group)", has_doc, move_rows ), @@ -119,7 +120,7 @@ pub fn specs() -> Vec { "Reorder", [], None, - "{id, parent?: id (null = top level), index} put a row at `index` (0 = bottom) of `parent` (layers only at the top level or in layers; an Intertwine group takes and gives up members as layer.move does), deselecting every selected object left hidden or locked (the key object too)", + "{id, parent?: id (null = top level), index} put a row at `index` (0 = bottom) of `parent` (layers only at the top level or in layers; an Intertwine group takes and gives up members as layer.move does), deselecting every selected object left hidden or locked (the key object too); a Live Paint group or its paths take a row as layer.move does", has_doc, move_node ), @@ -651,6 +652,10 @@ fn set_props(s: &mut Session, p: &Value) -> Result { if ids.is_empty() { return Err(bad(C, "no rows")); } + if let Some(v) = str_param(p, "name").filter(|v| !v.trim().is_empty()) { + let name = if xml_id { vectorcraft_doc::xml_id::to_object_name(v) } else { v.to_string() }; + super::buildcmds::check_part_name(&s.doc()?.doc, &ids, &name)?; + } s.edit("Layer Options", |d, sel| { for id in &ids { apply_options(d.node_mut(*id).ok_or(EngineError::NoNode(*id))?, p, xml_id); @@ -807,7 +812,15 @@ fn move_rows(s: &mut Session, p: &Value) -> Result { if parent.is_some_and(|p| locked_within(d, p)) { return Err(EngineError::Other("the layer or group is locked".into())); } - let label = if copy { "Duplicate Rows" } else { "Move Rows" }; + // Rows that go into a Live Paint group join its paths, as Live Paint › Merge adds them. + let live_paint = LivePaintMove::plan(d, &ids, parent, copy)?; + let label = if live_paint.joins() { + "Merge Live Paint" + } else if copy { + "Duplicate Rows" + } else { + "Move Rows" + }; // Where each moved row comes from (a copy has a new id, so it comes from nowhere), and the // Intertwine groups it leaves. let from: std::collections::HashMap> = ids.iter().map(|i| (*i, d.parent_of(*i))).collect(); @@ -848,6 +861,7 @@ fn move_rows(s: &mut Session, p: &Value) -> Result { } let placed: Vec<(NodeId, Option)> = out.iter().map(|o| (*o, from.get(o).copied().flatten())).collect(); super::intertwine::settle_members(d, &placed, &left)?; + let out = live_paint.finish(d, sel, &out)?; sel.prune(d); sel.deselect_uneditable(d); Ok(out) @@ -870,11 +884,14 @@ fn move_node(s: &mut Session, p: &Value) -> Result { if let Some(what) = super::intertwine::refused_in(d, parent, n) { return Err(bad(C, format!("{what} can't be intertwined"))); } + let live_paint = LivePaintMove::plan(d, &[id], parent, false)?; + let label = if live_paint.joins() { "Merge Live Paint" } else { "Reorder" }; let from = d.parent_of(id); let left = super::intertwine::groups_of(d, &[id]); - s.edit("Reorder", |d, sel| { + s.edit(label, |d, sel| { d.move_node(id, parent, index)?; super::intertwine::settle_members(d, &[(id, from)], &left)?; + live_paint.finish(d, sel, &[id])?; sel.prune(d); sel.deselect_uneditable(d); Ok(()) diff --git a/crates/engine/src/cmd/object/arrange.rs b/crates/engine/src/cmd/object/arrange.rs index ff0b22b31b..4250f3c377 100644 --- a/crates/engine/src/cmd/object/arrange.rs +++ b/crates/engine/src/cmd/object/arrange.rs @@ -371,16 +371,21 @@ pub(super) fn isolate(s: &mut Session, p: &Value) -> Result { } /// Leaving isolation mode in `isolated` for `next` (None: out of isolation mode) adds the paths drawn -/// in the Live Paint group isolation put new art in to that group, as `livePaint.merge` does, in one -/// undo step ([`crate::cmd::buildcmds::merge_drawn_in_isolation`]), unless `next` is that group or is -/// inside it; → the group when paths were added. +/// in each Live Paint group that is `isolated` or holds it to that group, as `livePaint.merge` does, +/// innermost group first, one undo step per group ([`crate::cmd::buildcmds::merge_drawn_in_isolation`]). +/// A group that `next` is or is inside is skipped, since isolation stays in it. → the outermost group +/// that paths were added to. fn add_drawn_live_paint(s: &mut Session, isolated: NodeId, next: Option) -> Result> { let d = &s.doc()?.doc; - let Some(g) = crate::cmd::buildcmds::isolated_live_paint(d, isolated) else { return Ok(None) }; - if next.is_some_and(|n| d.ancestry(n).is_some_and(|a| a.contains(&g))) { - return Ok(None); + let stays = next.and_then(|n| d.ancestry(n)).unwrap_or_default(); + let left: Vec = crate::cmd::buildcmds::isolated_live_paints(d, isolated).into_iter().filter(|g| !stays.contains(g)).collect(); + let mut added = None; + for g in left { + if crate::cmd::buildcmds::merge_drawn_in_isolation(s, g)? { + added = Some(g); + } } - Ok(crate::cmd::buildcmds::merge_drawn_in_isolation(s, g)?.then_some(g)) + Ok(added) } pub(super) fn exit_isolation(s: &mut Session, p: &Value) -> Result { diff --git a/crates/engine/src/cmd/object/commands.rs b/crates/engine/src/cmd/object/commands.rs index 4be83d7da6..92f4744fea 100644 --- a/crates/engine/src/cmd/object/commands.rs +++ b/crates/engine/src/cmd/object/commands.rs @@ -250,7 +250,7 @@ pub fn specs() -> Vec { "Exit Isolation Mode", [], None, - "{all?: bool (default false)} leave isolation mode; from an isolated sublayer, go up one level to its parent layer instead (the next call goes up again), unless all is true or the parent layer is hidden or locked; no undo step for the move up; while a symbol is edited, a group isolated in its art goes back to the symbol's layer first, with or without all; leaving an isolated Live Paint group adds the paths, compound paths and groups of them drawn in it (shown and unlocked with everything in them) to the group as livePaint.merge does, in one undo step, and leaves type, images and other objects in it as they are; object.isolate on a level outside the group does the same", + "{all?: bool (default false)} leave isolation mode; from an isolated sublayer, go up one level to its parent layer instead (the next call goes up again), unless all is true or the parent layer is hidden or locked; no undo step for the move up; while a symbol is edited, a group isolated in its art goes back to the symbol's layer first, with or without all; leaving an isolated Live Paint group adds the paths, compound paths and groups of them drawn in it (shown and unlocked with everything in them) to the group as livePaint.merge does, in one undo step, and leaves type, images and other objects in it as they are; object.isolate on a level outside the group does the same. Leaving a Live Paint group drawn in another isolated Live Paint group, and that group too, does this for each, innermost first, one undo step each", has_doc, exit_isolation ), @@ -259,7 +259,7 @@ pub fn specs() -> Vec { "Object Properties", [], None, - "{ids?|id?, name?, visible?, locked? (visible: false or locked: true deselects every selected object hidden or locked after the call, the key object included), opacity?: 0..100, blend?: \"Multiply\"…, isolate?, knockout?: \"on\"|\"off\"|\"neutral\"|bool (true = on, false = neutral), knockoutShape?: bool, data?: {key: \"value\" | null (removes it)} (the object's own data, SVG data-* attributes: {pivot: \"100,180\"} is data-pivot; document.node → attrs.data)}. On a path directly in a graph series, the graph also stores the object's opacity and blend mode, and on a series group the group's opacity, blend mode, isolate, knockout and knockoutShape (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's opacity and blend mode for every label or line of its kind", + "{ids?|id?, name?, visible?, locked? (visible: false or locked: true deselects every selected object hidden or locked after the call, the key object included), opacity?: 0..100, blend?: \"Multiply\"…, isolate?, knockout?: \"on\"|\"off\"|\"neutral\"|bool (true = on, false = neutral), knockoutShape?: bool, data?: {key: \"value\" | null (removes it)} (the object's own data, SVG data-* attributes: {pivot: \"100,180\"} is data-pivot; document.node → attrs.data)}. On a path directly in a graph series, the graph also stores the object's opacity and blend mode, and on a series group the group's opacity, blend mode, isolate, knockout and knockoutShape (exceptions: docs/mcp.md); on a graph label, or a graph's axis line, tick mark or radar ring, the graph stores that object's opacity and blend mode for every label or line of its kind. A path directly in a Live Paint group can't take the name Face or Edge, which name the group's faces and edges, unless it has it already", has_doc, set_props ), diff --git a/crates/engine/src/cmd/object/props.rs b/crates/engine/src/cmd/object/props.rs index 54ad23eb2f..f576435fe0 100644 --- a/crates/engine/src/cmd/object/props.rs +++ b/crates/engine/src/cmd/object/props.rs @@ -65,6 +65,9 @@ pub(super) fn set_props(s: &mut Session, p: &Value) -> Result { }) }; let d = &s.doc()?.doc; + if let Some(v) = str_param(p, "name") { + crate::cmd::buildcmds::check_part_name(d, &ids, v)?; + } // A graph keeps the object opacity and blend mode set on a mark of a series for the whole series, and set on a label // for its kind of label, so a value a mark or label already has still replaces the one another left on the graph. let transparency = opacity.is_some() || blend.is_some(); diff --git a/crates/engine/src/tests/build.rs b/crates/engine/src/tests/build.rs index dfab5336de..33483c5e21 100644 --- a/crates/engine/src/tests/build.rs +++ b/crates/engine/src/tests/build.rs @@ -5027,6 +5027,73 @@ fn live_paint_does_not_count_art_named_like_its_parts() { } } +/// A path drawn in an isolated Live Paint group can't be named Face or Edge, the names of the +/// group's faces and edges: `object.setProps` and `layer.setProps` return an error and rename +/// nothing, so Gap Options and a path dragged into the group keep the path. A face keeps its name. +#[test] +fn live_paint_refuses_part_names_for_paths_drawn_in_it() { + use vectorcraft_tools::builder::{EDGE_NAME, FACE_NAME, faces}; + let mut s = session(); + let g = live(&mut s); + let face = faces(&node(&s, g))[0].id; + s.execute("object.isolate", &json!({"id": g.0})).unwrap(); + let a = line_across(&mut s, 50.0); + // Hidden, the path stays in the group as drawn when isolation mode ends. + s.execute("object.setProps", &json!({"id": a.0, "visible": false})).unwrap(); + let before = (s.doc().unwrap().doc.clone(), s.doc().unwrap().history.undo.len()); + for name in [FACE_NAME, EDGE_NAME] { + let calls = [ + ("object.setProps", json!({"id": a.0, "name": name})), + ("layer.setProps", json!({"id": a.0, "name": name})), + ("layer.setProps", json!({"ids": [face.0, a.0], "name": name})), + ]; + for (c, p) in calls { + let err = s.execute(c, &p).unwrap_err().to_string(); + assert!(err.contains("give the path another name"), "{c} {p}: {err}"); + } + } + assert!(s.doc().unwrap().doc == before.0, "nothing was renamed"); + assert_eq!(s.doc().unwrap().history.undo.len(), before.1); + s.execute("layer.setProps", &json!({"id": face.0, "name": FACE_NAME})).unwrap(); + s.execute("object.exitIsolation", &json!({})).unwrap(); + assert_eq!(s.doc().unwrap().doc.parent_of(a), Some(g), "the hidden path stays in the group"); + s.execute("livePaint.gapOptions", &json!({"ids": [g.0], "detect": true})).unwrap(); + assert_eq!(s.doc().unwrap().doc.parent_of(a), Some(g), "Gap Options keeps the path"); + let b = line_to_right_face(&mut s, 30.0); + s.execute("layer.move", &json!({"ids": [b.0], "target": g.0, "place": "inside"})).unwrap(); + assert_eq!(s.doc().unwrap().doc.parent_of(a), Some(g), "a path dragged in keeps it"); + assert_eq!(faces(&node(&s, g)).len(), 5); +} + +/// A path pasted into an isolated Live Paint group under the name of a face or an edge loses the +/// name, so Gap Options keeps it and it joins the group's paths when isolation mode ends. +#[test] +fn live_paint_paste_clears_part_names() { + use vectorcraft_tools::builder::{EDGE_NAME, FACE_NAME, faces, sources}; + for name in [FACE_NAME, EDGE_NAME] { + let mut s = session(); + let g = live(&mut s); + let r = rect(&mut s, 20.0, 40.0, 60.0, 20.0); + s.execute("object.setProps", &json!({"id": r.0, "name": name})).unwrap(); + s.execute("select.set", &json!({"ids": [r.0]})).unwrap(); + s.execute("edit.copy", &json!({})).unwrap(); + s.execute("object.isolate", &json!({"id": g.0})).unwrap(); + s.execute("edit.pasteInPlace", &json!({})).unwrap(); + let pasted = s.doc().unwrap().selection.objects.clone(); + assert_eq!(pasted.len(), 1); + let d = &s.doc().unwrap().doc; + assert_eq!(d.parent_of(pasted[0]), Some(g), "{name}: the paste goes into the group"); + assert_eq!(d.node(pasted[0]).unwrap().name, None, "{name}: the paste loses the name"); + assert_eq!(d.node(r).unwrap().name.as_deref(), Some(name), "the path outside keeps its name"); + s.execute("livePaint.gapOptions", &json!({"ids": [g.0], "detect": true})).unwrap(); + assert_eq!(s.doc().unwrap().doc.parent_of(pasted[0]), Some(g), "{name}: Gap Options keeps the paste"); + s.execute("object.exitIsolation", &json!({})).unwrap(); + let n = node(&s, g); + assert_eq!(s.doc().unwrap().doc.parent_of(pasted[0]), Some(sources(&n).unwrap().id), "{name}: the paste joined"); + assert!(faces(&n).len() > 3); + } +} + /// With Real-time Drawing and Editing off, a rectangle still being drawn in a Live Paint group /// isolated in a pattern tile is drawn first when Exit Isolation Mode leaves pattern editing, and /// joins the group with the tile saved. @@ -5098,6 +5165,315 @@ fn live_paint_isolation_adds_a_drawn_group_isolated_inside_it() { } } +/// With Live Paint group `inner` made in isolated Live Paint group `outer` and then isolated itself, +/// leaving both levels (`object.exitIsolation`, or `object.isolate` on the layer) adds the path drawn +/// in `inner` to it and then `inner` and the path drawn directly in `outer` to `outer`, one undo step +/// each. Isolating `outer` from `inner` adds only `inner`'s drawn path, and `outer` keeps its own. +#[test] +fn live_paint_isolation_merges_nested_live_paint_groups_it_leaves() { + use vectorcraft_tools::builder::{faces, sources}; + for to in ["exit", "layer", "outer"] { + let mut s = session(); + let outer = live(&mut s); + let layer = s.doc().unwrap().doc.parent_of(outer).unwrap(); + s.execute("object.isolate", &json!({"id": outer.0})).unwrap(); + let a = line_across(&mut s, 50.0); + assert_eq!(s.doc().unwrap().doc.parent_of(a), Some(outer)); + let inner = live(&mut s); + assert_eq!(s.doc().unwrap().doc.parent_of(inner), Some(outer), "the inner group is drawn in the outer one"); + s.execute("object.isolate", &json!({"id": inner.0})).unwrap(); + let b = line_across(&mut s, 30.0); + assert_eq!(s.doc().unwrap().doc.parent_of(b), Some(inner)); + let steps = s.doc().unwrap().history.undo.len(); + match to { + "exit" => s.execute("object.exitIsolation", &json!({})).unwrap(), + "layer" => s.execute("object.isolate", &json!({"id": layer.0})).unwrap(), + _ => s.execute("object.isolate", &json!({"id": outer.0})).unwrap(), + }; + let d = &s.doc().unwrap().doc; + if to == "outer" { + assert_eq!(s.doc().unwrap().isolation, Some(outer)); + assert_eq!(s.doc().unwrap().history.undo.len(), steps + 1, "only the inner group's path joins"); + let n = node(&s, inner); + assert_eq!(d.parent_of(b), Some(sources(&n).unwrap().id), "the path drawn in the inner group joined it"); + assert_eq!(d.parent_of(inner), Some(outer), "the inner group stays drawn in the outer one"); + assert_eq!(d.parent_of(a), Some(outer), "the path drawn in the outer group stays as drawn"); + continue; + } + assert_eq!(s.doc().unwrap().history.undo.len(), steps + 2, "{to}: one undo step for each group"); + assert!(d.node(inner).is_none(), "{to}: the inner group joined the outer one"); + let n = node(&s, outer); + let src = sources(&n).unwrap().id; + assert_eq!(d.parent_of(a), Some(src), "{to}: the path drawn in the outer group joined it"); + assert!(d.ancestry(b).unwrap().contains(&src), "{to}: the path drawn in the inner group is among the outer group's paths"); + assert!(n.children().unwrap().iter().all(|c| c.id == src || c.path_data().is_some()), "{to}: only parts are left in the outer group"); + assert!(faces(&n).len() > 3, "{to}: the added paths cut the outer group's faces"); + if to == "exit" { + assert_eq!(s.doc().unwrap().selection.objects, vec![outer]); + } + } +} + +/// A line from left of the [`live`] group to its right face, so it cuts the two faces left of it. +fn line_to_right_face(s: &mut Session, y: f64) -> NodeId { + let r = s.execute("path.create", &json!({"anchors": [{"x": -10, "y": y}, {"x": 105, "y": y}]})).unwrap(); + NodeId(r["id"].as_u64().unwrap()) +} + +fn undo_label(s: &Session) -> Option { + s.doc().unwrap().history.undo.last().map(|e| e.label.clone()) +} + +/// Paths dragged into a Live Paint group in the Layers panel join its paths as Live Paint › Merge +/// adds them: they go among its sources and cut the faces they cross, a painted face they do not +/// cross keeps its fill, and the drop is one "Merge Live Paint" undo step that selects the group. +#[test] +fn layers_drag_adds_paths_to_a_live_paint_group() { + use vectorcraft_tools::builder::{face_at, faces, sources}; + let green = Paint::solid(Color::from_hex("#00ff00").unwrap()); + let mut s = session(); + let g = live(&mut s); + s.execute("livePaint.fill", &json!({"group": g.0, "point": [125, 50], "color": "#00ff00"})).unwrap(); + let layer = s.doc().unwrap().doc.parent_of(g); + let (a, b) = (line_to_right_face(&mut s, 30.0), line_to_right_face(&mut s, 70.0)); + assert_eq!(s.doc().unwrap().doc.parent_of(a), layer); + let steps = s.doc().unwrap().history.undo.len(); + let r = s.execute("layer.move", &json!({"ids": [a.0, b.0], "target": g.0, "place": "inside"})).unwrap(); + assert_eq!(r["ids"], json!([g.0]), "the rows that joined are listed as the group"); + let d = s.doc().unwrap(); + assert_eq!(d.history.undo.len(), steps + 1, "both paths join in one undo step"); + assert_eq!(undo_label(&s).as_deref(), Some("Merge Live Paint")); + assert_eq!(s.doc().unwrap().selection.objects, vec![g]); + let n = node(&s, g); + let src = sources(&n).unwrap(); + assert_eq!(src.children().unwrap().len(), 4); + for id in [a, b] { + assert_eq!(s.doc().unwrap().doc.parent_of(id), Some(src.id), "{id} joined the sources"); + } + assert_eq!(faces(&n).len(), 7, "two lines cut each of the two faces they cross in three"); + assert_eq!(face_at(&n, Point::new(125.0, 50.0)).unwrap().appearance.fill_paint(), green, "the face the lines do not cross keeps its fill"); + s.execute("edit.undo", &json!({})).unwrap(); + assert_eq!(faces(&node(&s, g)).len(), 3); + for id in [a, b] { + assert_eq!(s.doc().unwrap().doc.parent_of(id), layer, "Undo puts {id} back where it was"); + } + s.execute("edit.redo", &json!({})).unwrap(); + assert_eq!(faces(&node(&s, g)).len(), 7); +} + +/// A path named like a Live Paint group's sources group joins the group when it is dragged in, in +/// front of the sources group or behind it: the group keeps its own sources group and the path +/// goes among its paths. +#[test] +fn layers_drag_of_a_path_named_like_the_sources_group_joins_a_live_paint_group() { + use vectorcraft_tools::builder::{SOURCES_NAME, faces, sources}; + for index in [0, 99] { + let mut s = session(); + let g = live(&mut s); + let a = line_to_right_face(&mut s, 30.0); + s.execute("object.setProps", &json!({"id": a.0, "name": SOURCES_NAME})).unwrap(); + s.execute("node.move", &json!({"id": a.0, "parent": g.0, "index": index})).unwrap(); + assert_eq!(undo_label(&s).as_deref(), Some("Merge Live Paint"), "index {index}"); + let n = node(&s, g); + let src = sources(&n).unwrap(); + assert!(src.children().is_some(), "index {index}: the sources group is a group"); + assert_eq!(s.doc().unwrap().doc.parent_of(a), Some(src.id), "index {index}: the path joined the sources"); + assert_eq!(faces(&n).len(), 5, "index {index}"); + } +} + +/// An object drawn in a Live Paint group and named like its sources group can be moved ahead of the +/// sources group: the group keeps its own sources group and stays a Live Paint group. +#[test] +fn layers_reorder_of_an_object_named_like_the_sources_group_keeps_the_live_paint_group() { + use vectorcraft_tools::builder::{SOURCES_NAME, is_live_paint, sources}; + let mut s = session(); + let g = live(&mut s); + let real = sources(&node(&s, g)).unwrap().id; + s.execute("object.isolate", &json!({"id": g.0})).unwrap(); + let a = line_across(&mut s, 50.0); + assert_eq!(s.doc().unwrap().doc.parent_of(a), Some(g)); + s.execute("object.setProps", &json!({"id": a.0, "name": SOURCES_NAME})).unwrap(); + s.execute("node.move", &json!({"id": a.0, "parent": g.0, "index": 0})).unwrap(); + let n = node(&s, g); + assert!(is_live_paint(&n)); + assert_eq!(sources(&n).unwrap().id, real); + assert_eq!(s.doc().unwrap().doc.parent_of(a), Some(g), "the object stays where it was drawn"); +} + +/// A path named `Face` that is dragged into a Live Paint group is not one of its faces: the face it +/// covers keeps its own fill. +#[test] +fn layers_drag_of_a_path_named_face_does_not_repaint_the_group() { + use vectorcraft_tools::builder::{face_at, faces}; + let green = Paint::solid(Color::from_hex("#00ff00").unwrap()); + let mut s = session(); + let g = live(&mut s); + s.execute("livePaint.fill", &json!({"group": g.0, "point": [25, 50], "color": "#00ff00"})).unwrap(); + let a = rect(&mut s, 0.0, 0.0, 50.0, 100.0); + set_fill(&mut s, a, Color::rgb(0.0, 0.0, 1.0)); + s.execute("object.setProps", &json!({"id": a.0, "name": "Face"})).unwrap(); + s.execute("node.move", &json!({"id": a.0, "parent": g.0, "index": 99})).unwrap(); + let n = node(&s, g); + assert_eq!(faces(&n).len(), 3); + assert_eq!(face_at(&n, Point::new(25.0, 50.0)).unwrap().appearance.fill_paint(), green); +} + +/// An Alt-drag into a Live Paint group adds a copy and leaves the path where it was; a drop above +/// one of the group's faces, and `node.move` into the group, add the path the same way. +#[test] +fn layers_drag_copy_and_drop_beside_a_part_add_to_a_live_paint_group() { + use vectorcraft_tools::builder::{faces, sources}; + let mut s = session(); + let g = live(&mut s); + let layer = s.doc().unwrap().doc.parent_of(g); + let a = line_to_right_face(&mut s, 30.0); + s.execute("layer.move", &json!({"ids": [a.0], "target": g.0, "copy": true})).unwrap(); + assert_eq!(s.doc().unwrap().doc.parent_of(a), layer, "the path itself stays"); + let n = node(&s, g); + assert_eq!(faces(&n).len(), 5); + let src = sources(&n).unwrap().children().unwrap().clone(); + assert_eq!(src.len(), 3); + assert!(src.iter().all(|c| c.id != a), "a copy joined"); + let (face, other_face) = (faces(&n)[0].id, faces(&n)[1].id); + let b = line_to_right_face(&mut s, 70.0); + // A face dragged along is made again with the others, so only the group is listed. + let r = s.execute("layer.move", &json!({"ids": [b.0, other_face.0], "target": face.0, "place": "above"})).unwrap(); + assert_eq!(r["ids"], json!([g.0])); + assert_eq!(s.doc().unwrap().layer_rows, vec![g]); + let n = node(&s, g); + assert_eq!(s.doc().unwrap().doc.parent_of(b), Some(sources(&n).unwrap().id), "a drop beside a face joins"); + assert_eq!(faces(&n).len(), 7); + let c = line_to_right_face(&mut s, 50.0); + s.execute("node.move", &json!({"id": c.0, "parent": g.0, "index": 0})).unwrap(); + assert_eq!(undo_label(&s).as_deref(), Some("Merge Live Paint")); + let n = node(&s, g); + assert_eq!(s.doc().unwrap().doc.parent_of(c), Some(sources(&n).unwrap().id), "node.move into the group joins"); + assert_eq!(faces(&n).len(), 9); +} + +/// Dragging type, or type with a path, into a Live Paint group is refused with Make's message and +/// moves nothing, as Merge refuses it; a drop beside the group is an ordinary move. +#[test] +fn layers_drag_refuses_type_into_a_live_paint_group() { + use vectorcraft_tools::builder::faces; + let mut s = session(); + let g = live(&mut s); + let layer = s.doc().unwrap().doc.parent_of(g); + let a = line_to_right_face(&mut s, 30.0); + let text = NodeId(s.execute("text.create", &json!({"x": 20, "y": 20, "text": "Hi"})).unwrap()["id"].as_u64().unwrap()); + let before = (s.doc().unwrap().doc.clone(), s.doc().unwrap().history.undo.len()); + for p in [json!({"ids": [a.0, text.0], "target": g.0}), json!({"ids": [text.0], "target": g.0, "copy": true})] { + let err = s.execute("layer.move", &p).unwrap_err().to_string(); + assert!(err.contains("Live Paint takes paths and compound paths"), "{err}"); + } + assert!(s.execute("node.move", &json!({"id": text.0, "parent": g.0, "index": 0})).is_err()); + assert!(s.doc().unwrap().doc == before.0, "nothing moved"); + assert_eq!(s.doc().unwrap().history.undo.len(), before.1); + s.execute("layer.move", &json!({"ids": [a.0, text.0], "target": g.0, "place": "above"})).unwrap(); + assert_eq!(undo_label(&s).as_deref(), Some("Move Rows")); + assert_eq!(s.doc().unwrap().doc.parent_of(text), layer); + assert_eq!(faces(&node(&s, g)).len(), 3); +} + +/// A path dragged out of a Live Paint group's sources leaves its faces and edges: the group makes +/// them again from the paths left, and with none left it has no faces until a path joins it again. +/// Reordering the sources, or the group's own faces, makes nothing again. +#[test] +fn layers_drag_out_of_a_live_paint_group_makes_its_faces_again() { + use vectorcraft_tools::builder::{faces, sources}; + let mut s = session(); + let g = live(&mut s); + let layer = s.doc().unwrap().doc.parent_of(g).unwrap(); + let n = node(&s, g); + let src: Vec = sources(&n).unwrap().children().unwrap().iter().map(|c| c.id).collect(); + let face_ids: Vec = faces(&n).iter().map(|f| f.id).collect(); + s.execute("layer.move", &json!({"ids": [src[0].0], "target": src[1].0, "place": "above"})).unwrap(); + s.execute("layer.move", &json!({"ids": [face_ids[0].0], "target": face_ids[2].0, "place": "above"})).unwrap(); + let n = node(&s, g); + assert_eq!(sources(&n).unwrap().children().unwrap().len(), 2, "a reorder keeps the sources"); + let mut now: Vec = faces(&n).iter().map(|f| f.id).collect(); + now.sort(); + let mut was = face_ids.clone(); + was.sort(); + assert_eq!(now, was, "and the faces"); + s.execute("layer.move", &json!({"ids": [src[0].0], "target": layer.0})).unwrap(); + assert_eq!(undo_label(&s).as_deref(), Some("Move Rows")); + let n = node(&s, g); + assert_eq!(s.doc().unwrap().doc.parent_of(src[0]), Some(layer)); + assert_eq!(sources(&n).unwrap().children().unwrap().len(), 1); + assert_eq!(faces(&n).len(), 1, "one rectangle left"); + s.execute("node.move", &json!({"id": src[1].0, "parent": layer.0, "index": 0})).unwrap(); + let n = node(&s, g); + assert!(vectorcraft_tools::builder::is_live_paint(&n), "the group stays a Live Paint group"); + assert!(sources(&n).unwrap().children().unwrap().is_empty()); + assert!(faces(&n).is_empty() && vectorcraft_tools::builder::edges(&n).is_empty()); + s.execute("layer.move", &json!({"ids": [src[0].0], "target": g.0})).unwrap(); + assert_eq!(faces(&node(&s, g)).len(), 1, "a path joins the empty group"); + s.execute("edit.undo", &json!({})).unwrap(); + s.execute("edit.undo", &json!({})).unwrap(); + assert_eq!(faces(&node(&s, g)).len(), 1); +} + +/// A path dragged from a Live Paint group's sources into the group itself stays among its paths, +/// and the faces it bounds keep their paint, also when it is the group's only path. +#[test] +fn layers_drag_a_source_path_into_its_own_live_paint_group_keeps_the_paint() { + use vectorcraft_tools::builder::{face_at, faces, sources}; + let green = Paint::solid(Color::from_hex("#00ff00").unwrap()); + let blue = Paint::solid(Color::from_hex("#0000ff").unwrap()); + let mut s = session(); + let g = live(&mut s); + let layer = s.doc().unwrap().doc.parent_of(g).unwrap(); + s.execute("livePaint.fill", &json!({"group": g.0, "point": [25, 50], "color": "#00ff00"})).unwrap(); + let src: Vec = sources(&node(&s, g)).unwrap().children().unwrap().iter().map(|c| c.id).collect(); + s.execute("layer.move", &json!({"ids": [src[0].0], "target": g.0, "place": "inside"})).unwrap(); + let n = node(&s, g); + assert_eq!(s.doc().unwrap().doc.parent_of(src[0]), Some(sources(&n).unwrap().id), "the path stays among the group's paths"); + assert_eq!(faces(&n).len(), 3); + assert_eq!(face_at(&n, Point::new(25.0, 50.0)).unwrap().appearance.fill_paint(), green, "the face it bounds keeps its fill"); + s.execute("layer.move", &json!({"ids": [src[1].0], "target": layer.0})).unwrap(); + s.execute("livePaint.fill", &json!({"group": g.0, "point": [50, 50], "color": "#0000ff"})).unwrap(); + s.execute("layer.move", &json!({"ids": [src[0].0], "target": g.0, "place": "inside"})).unwrap(); + let n = node(&s, g); + assert_eq!(faces(&n).len(), 1); + assert_eq!(face_at(&n, Point::new(50.0, 50.0)).unwrap().appearance.fill_paint(), blue, "the only path's face keeps its fill"); +} + +/// A Live Paint group among another Live Paint group's paths gives it faces and edges: a path +/// dragged into or out of the inner group's paths, or from the outer group's paths into the inner +/// group's, makes the inner group's faces and edges again and then the outer group's. +#[test] +fn layers_drag_into_a_nested_live_paint_group_makes_the_outer_group_again() { + use vectorcraft_tools::builder::{faces, sources}; + let mut s = session(); + let outer = live(&mut s); + let inner = live(&mut s); + let layer = s.doc().unwrap().doc.parent_of(outer).unwrap(); + let first_source = |s: &Session, g: NodeId| sources(&node(s, g)).unwrap().children().unwrap()[0].id; + let into = |s: &mut Session, row: NodeId, g: NodeId| { + let target = first_source(s, g); + s.execute("layer.move", &json!({"ids": [row.0], "target": target.0, "place": "above"})).unwrap(); + }; + into(&mut s, inner, outer); + assert_eq!(s.doc().unwrap().doc.parent_of(inner), Some(sources(&node(&s, outer)).unwrap().id)); + let plain = faces(&node(&s, outer)).len(); + let a = line_to_right_face(&mut s, 30.0); + into(&mut s, a, inner); + assert_eq!(faces(&node(&s, inner)).len(), 5); + let cut = faces(&node(&s, outer)).len(); + assert!(cut > plain, "a path joining the inner group cuts the outer group's faces: {cut} faces, {plain} before"); + s.execute("layer.move", &json!({"ids": [a.0], "target": layer.0})).unwrap(); + assert_eq!(faces(&node(&s, inner)).len(), 3); + assert_eq!(faces(&node(&s, outer)).len(), plain, "a path leaving the inner group leaves the outer group's faces"); + into(&mut s, a, outer); + assert_eq!(faces(&node(&s, outer)).len(), cut); + into(&mut s, a, inner); + assert_eq!(s.doc().unwrap().doc.parent_of(a), Some(sources(&node(&s, inner)).unwrap().id)); + assert_eq!(faces(&node(&s, inner)).len(), 5); + assert_eq!(faces(&node(&s, outer)).len(), cut, "the outer group is made after the inner one"); +} + /// Give Live Paint group `g` a lock, hidden state, appearance, knockout, opacity mask and /// graphic style link, and return it as it then is. fn dress_live_group(s: &mut Session, g: NodeId) -> Node { diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 60e5b024e7..46fd6f9053 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -6540,6 +6540,7 @@ liquify-list-end {0}, {1} {0} i {1} @msg type used as a mask in linked areas, wraparound text or a compound path doesn't clip el text usat com a màscara en àrees enllaçades, en text ajustat o en un traçat compost no retalla @msg linked pictures with no preview in the file show a placeholder until their files are found: relink them in the Links panel les imatges enllaçades sense previsualització al fitxer mostren un marcador de posició fins que es trobin els seus fitxers: torneu-les a enllaçar al panell Enllaços @msg Live Paint Merge: select a Live Paint group and the paths to add Fusió de pintura interactiva: seleccioneu un grup de pintura interactiva i els traçats que voleu afegir +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` i `Edge` són els noms de les cares i les arestes d’un grup de pintura interactiva: doneu un altre nom al traçat @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first La pintura interactiva accepta traçats i traçats compostos: convertiu abans el text, les imatges i altres objectes a traçats @msg Live Paint: select paths or compound paths Pintura interactiva: seleccioneu traçats o traçats compostos @msg Live Paint: these paths are too degenerate to paint Pintura interactiva: aquests traçats són massa degenerats per pintar-los diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 0d8a7107b3..74c73b2344 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -5219,6 +5219,7 @@ liquify-list-end {0}, {1} {0} a {1} @msg Installed plug-in {_1} Nainstalován zásuvný modul {_1} @msg Internal error: {msg} (please report this bug) Vnitřní chyba: {msg} (nahlaste prosím tuto chybu) @msg Live Paint Merge: select a Live Paint group and the paths to add Sloučit živou malbu: vyberte skupinu živé malby a cesty, které chcete přidat +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` a `Edge` jsou názvy ploch a hran skupiny živé malby: dejte cestě jiný název @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Živá malba přijímá cesty a složené cesty: text, obrazy a jiné objekty nejprve převeďte na cesty @msg Live Paint: select paths or compound paths Živá malba: vyberte cesty nebo složené cesty @msg Live Paint: these paths are too degenerate to paint Živá malba: tyto cesty jsou příliš degenerované, aby je bylo možné malovat diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index c13893b490..ae2a2b5c75 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7446,6 +7446,7 @@ imageTrace Outline Kontur @msg Installed plug-in {_1} Installerede plug-in'en {_1} @msg Internal error: {msg} (please report this bug) Intern fejl: {msg} (meld venligst denne fejl) @msg Live Paint Merge: select a Live Paint group and the paths to add Live Paint-fletning: markér en Live Paint-gruppe og de kurver, der skal tilføjes +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` og `Edge` er navnene på fladerne og kanterne i en Live Paint-gruppe: giv kurven et andet navn @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Live Paint tager kurver og sammensatte kurver: konvertér først tekst, billeder og andre objekter til kurver @msg Live Paint: select paths or compound paths Live Paint: markér kurver eller sammensatte kurver @msg Live Paint: these paths are too degenerate to paint Live Paint: disse kurver er for degenererede til at blive malet diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index b1a515a3f6..61f7533950 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -4813,6 +4813,7 @@ liquify-list-end {0}, {1} {0} und {1} @msg Installed plug-in {_1} Plug-in {_1} installiert @msg Internal error: {msg} (please report this bug) Interner Fehler: {msg} (bitte melden Sie diesen Fehler) @msg Live Paint Merge: select a Live Paint group and the paths to add Interaktiv malen – Zusammenfügen: Wählen Sie eine Interaktiv-malen-Gruppe und die hinzuzufügenden Pfade aus +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` und `Edge` benennen die Teilflächen und Kanten einer Interaktiv-malen-Gruppe: Geben Sie dem Pfad einen anderen Namen @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Interaktiv malen nimmt Pfade und zusammengesetzte Pfade an: Wandeln Sie Text, Bilder und andere Objekte zuerst in Pfade um @msg Live Paint: select paths or compound paths Interaktiv malen: Wählen Sie Pfade oder zusammengesetzte Pfade aus @msg Live Paint: these paths are too degenerate to paint Interaktiv malen: Diese Pfade sind zu entartet, um sie zu bemalen diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index d2d3da94c7..68a240a52f 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -2754,6 +2754,7 @@ liquify-list-end {0}, {1} {0} και {1} @msg Installed plug-in {_1} Εγκαταστάθηκε η επέκταση {_1} @msg Internal error: {msg} (please report this bug) Εσωτερικό σφάλμα: {msg} (παρακαλούμε αναφέρετε αυτό το σφάλμα) @msg Live Paint Merge: select a Live Paint group and the paths to add Συγχώνευση δυναμικής βαφής: επιλέξτε ομάδα δυναμικής βαφής και τις διαδρομές προς προσθήκη +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name Τα `Face` και `Edge` ονομάζουν τις επιφάνειες και τις ακμές μιας ομάδας δυναμικής βαφής: δώστε άλλο όνομα στη διαδρομή @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Η δυναμική βαφή δέχεται διαδρομές και σύνθετες διαδρομές: μετατρέψτε πρώτα κείμενο, εικόνες και άλλα αντικείμενα σε διαδρομές @msg Live Paint: select paths or compound paths Δυναμική βαφή: επιλέξτε διαδρομές ή σύνθετες διαδρομές @msg Live Paint: these paths are too degenerate to paint Δυναμική βαφή: αυτές οι διαδρομές είναι πολύ εκφυλισμένες για να χρωματιστούν diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 013436077b..52abfcf415 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -4925,6 +4925,7 @@ liquify-list-end {0}, {1} {0}, {1} @msg Installed plug-in {_1} Se instaló el plugin {_1} @msg Internal error: {msg} (please report this bug) Error interno: {msg} (por favor, informa de este error) @msg Live Paint Merge: select a Live Paint group and the paths to add Combinar pintura interactiva: selecciona un grupo de pintura interactiva y los trazados que quieres agregar +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` y `Edge` son los nombres de las caras y los bordes de un grupo de pintura interactiva: ponle otro nombre al trazado @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first La pintura interactiva admite trazados y trazados compuestos: convierte primero el texto, las imágenes y otros objetos en trazados @msg Live Paint: select paths or compound paths Pintura interactiva: selecciona trazados o trazados compuestos @msg Live Paint: these paths are too degenerate to paint Pintura interactiva: estos trazados están demasiado degenerados para pintarlos diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index c2fbabb239..1c81fe93f0 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -5147,6 +5147,7 @@ liquify-list-end {0}, {1} {0} ja {1} @msg Installed plug-in {_1} Asennettiin laajennus {_1} @msg Internal error: {msg} (please report this bug) Sisäinen virhe: {msg} (ilmoita tästä virheestä) @msg Live Paint Merge: select a Live Paint group and the paths to add Elävän maalauksen yhdistäminen: valitse elävän maalauksen ryhmä ja lisättävät polut +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` ja `Edge` ovat elävän maalauksen ryhmän pintojen ja reunojen nimiä: anna polulle toinen nimi @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Elävä maalaus ottaa polkuja ja yhdistelmäpolkuja: muunna teksti, kuvat ja muut objektit ensin poluiksi @msg Live Paint: select paths or compound paths Elävä maalaus: valitse polkuja tai yhdistelmäpolkuja @msg Live Paint: these paths are too degenerate to paint Elävä maalaus: nämä polut ovat liian surkastuneita maalattaviksi diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index c75ce4cfbc..b790600dc6 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -4884,6 +4884,7 @@ liquify-list-end {0}, {1} {0} et {1} @msg Installed plug-in {_1} Module externe {_1} installé @msg Internal error: {msg} (please report this bug) Erreur interne : {msg} (merci de signaler ce bogue) @msg Live Paint Merge: select a Live Paint group and the paths to add Fusion de peinture dynamique : sélectionnez un groupe de peinture dynamique et les tracés à ajouter +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name Les noms `Face` et `Edge` sont réservés aux faces et aux bords d’un groupe de peinture dynamique, choisissez un autre nom pour le tracé @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first La peinture dynamique accepte les tracés et les tracés transparents : convertissez d’abord le texte, les images et les autres objets en tracés @msg Live Paint: select paths or compound paths Peinture dynamique : sélectionnez des tracés ou des tracés transparents @msg Live Paint: these paths are too degenerate to paint Peinture dynamique : ces tracés sont trop dégénérés pour être peints diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 3b83883a00..92779a1e47 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -7934,6 +7934,7 @@ liquify-list-end {0}, {1} {0} और {1} @msg linked pictures with no preview in the file show a placeholder until their files are found: relink them in the Links panel फ़ाइल में कोई प्रीव्यू के साथ जुड़े चित्र एक प्लेसहोल्डर दिखाते हैं जब तक कि उनकी फ़ाइलें नहीं मिलती: उन्हें लिंक पैनल में फिर से लिंक करें @msg linked type areas past VectorCraft's limits were left out VectorCraft की सीमाओं से आगे के लिंक्ड टाइप एरिया छोड़ दिए गए @msg Live Paint Merge: select a Live Paint group and the paths to add लाइव पेंट मर्ज: जोड़ने के लिए एक लाइव पेंट समूह और पाथ सिलेक्ट करें +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` और `Edge` लाइव पेंट समूह के फेस और एज के नाम हैं: पाथ को कोई दूसरा नाम दें @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first लाइव पेंट पाथ और कंपाउंड पाथ लेता है: पहले टाइप, इमेज और अन्य ऑब्जेक्ट्स को पाथ में बदलें @msg Live Paint: select paths or compound paths लाइव पेंट: पाथ या यौगिक पाथ सिलेक्ट करें @msg Live Paint: these paths are too degenerate to paint लाइव पेंट: इन पाथ को पेंट करने के लिए बहुत अलग किया जाता है diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 50d1de8ca2..907861de0e 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -5838,6 +5838,7 @@ liquify-list-end {0}, {1} {0} és {1} @msg line {line}: value for `{var}` must be true or false {line}. sor: a(z) `{var}` értéke csak true vagy false lehet @msg line {line}: value for `{var}` is longer than {MAX_GRAPH_CSV} bytes {line}. sor: a(z) `{var}` értéke hosszabb {MAX_GRAPH_CSV} bájtnál @msg Live Paint Merge: select a Live Paint group and the paths to add Élő festés egyesítése: jelölj ki egy élőfestés-csoportot és a hozzáadandó útvonalakat +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name A `Face` és az `Edge` az élőfestés-csoport felületeinek és éleinek neve: adj más nevet az útvonalnak @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Az élő festés útvonalakat és összetett útvonalakat fogad: előbb alakítsd útvonallá a szöveget, a képeket és a többi objektumot @msg Live Paint: select paths or compound paths Élő festés: jelölj ki útvonalakat vagy összetett útvonalakat @msg Live Paint: these paths are too degenerate to paint Élő festés: ezek az útvonalak túlságosan elfajultak a festéshez diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index b627342817..fdbfcbc073 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -4951,6 +4951,7 @@ liquify-list-end {0}, {1} {0} e {1} @msg Installed plug-in {_1} Plug-in installato: {_1} @msg Internal error: {msg} (please report this bug) Errore interno: {msg} (segnala questo bug) @msg Live Paint Merge: select a Live Paint group and the paths to add Fondi pittura dinamica: seleziona un gruppo di pittura dinamica e i tracciati da aggiungere +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` ed `Edge` sono i nomi delle facce e dei bordi di un gruppo di pittura dinamica: assegna un altro nome al tracciato @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first La pittura dinamica accetta tracciati e tracciati composti: converti prima in tracciati testo, immagini e altri oggetti @msg Live Paint: select paths or compound paths Pittura dinamica: seleziona tracciati o tracciati composti @msg Live Paint: these paths are too degenerate to paint Pittura dinamica: questi tracciati sono troppo degeneri per essere dipinti diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 153df0806e..860bc82584 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -4813,6 +4813,7 @@ swatch Bright Violet ビビッドバイオレット @msg the art has no bounds アートに境界がありません @msg Image Trace: the traced image is missing 画像トレース: トレース元の画像が見つかりません @msg Live Paint Merge: select a Live Paint group and the paths to add ライブペイントの結合: ライブペイントグループと、追加するパスを選択してください +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` と `Edge` はライブペイントグループの面とエッジの名前です: パスには別の名前を付けてください @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first ライブペイントで扱えるのはパスと複合パスです: テキスト、画像、その他のオブジェクトは先にパスに変換してください @msg Live Paint: select paths or compound paths ライブペイント: パスまたは複合パスを選択してください @msg Live Paint: these paths are too degenerate to paint ライブペイント: これらのパスは形状がつぶれすぎていてペイントできません diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index af440aad68..2b7ca1e1ec 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6710,6 +6710,7 @@ font-technology Variable ცვლადი @msg Installed plug-in {_1} დაინსტალირდა პლაგინი {_1} @msg Internal error: {msg} (please report this bug) შიდა შეცდომა: {msg} (გთხოვთ, შეგვატყობინოთ ამ ხარვეზის შესახებ) @msg Live Paint Merge: select a Live Paint group and the paths to add ცოცხალი შეღებვის შერწყმა: მონიშნეთ ცოცხალი შეღებვის ჯგუფი და დასამატებელი ტრაექტორიები +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` და `Edge` ცოცხალი შეღებვის ჯგუფის წახნაგებისა და კიდეების სახელებია: ტრაექტორიას სხვა სახელი დაარქვით @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first ცოცხალი შეღებვა იღებს ტრაექტორიებს და შედგენილ ტრაექტორიებს: ჯერ გადააქციეთ ტექსტი, გამოსახულებები და სხვა ობიექტები ტრაექტორიებად @msg Live Paint: select paths or compound paths ცოცხალი შეღებვა: მონიშნეთ ტრაექტორიები ან შედგენილი ტრაექტორიები @msg Live Paint: these paths are too degenerate to paint ცოცხალი შეღებვა: ეს ტრაექტორიები ზედმეტად გადაგვარებულია შესაღებად diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 9cebead15b..eabca7a88f 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -4742,6 +4742,7 @@ theme Appearance 외관 @msg the art has no bounds 아트웍에 경계가 없습니다 @msg Image Trace: the traced image is missing 이미지 추적: 추적한 이미지가 없습니다 @msg Live Paint Merge: select a Live Paint group and the paths to add 라이브 페인트 병합: 라이브 페인트 그룹과 추가할 패스를 선택하세요 +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face`와 `Edge`는 라이브 페인트 그룹의 면과 가장자리 이름입니다: 패스에 다른 이름을 지정하세요 @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first 라이브 페인트는 패스와 컴파운드 패스만 사용할 수 있습니다: 텍스트, 이미지 및 기타 개체를 먼저 패스로 변환하세요 @msg Live Paint: select paths or compound paths 라이브 페인트: 패스 또는 컴파운드 패스를 선택하세요 @msg Live Paint: these paths are too degenerate to paint 라이브 페인트: 이 패스는 퇴화되어 칠할 수 없습니다 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 3f6add7045..14833d7f40 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -5320,6 +5320,7 @@ imageTrace Outline Contour @msg Installed plug-in {_1} Plug-in {_1} geïnstalleerd @msg Internal error: {msg} (please report this bug) Interne fout: {msg} (meld deze bug alsjeblieft) @msg Live Paint Merge: select a Live Paint group and the paths to add Live Paint samenvoegen: selecteer een Live Paint-groep en de paden om toe te voegen +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` en `Edge` zijn de namen van de vlakken en randen van een Live Paint-groep: geef het pad een andere naam @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Live Paint neemt paden en samengestelde paden: zet tekst, afbeeldingen en andere objecten eerst om in paden @msg Live Paint: select paths or compound paths Live Paint: selecteer paden of samengestelde paden @msg Live Paint: these paths are too degenerate to paint Live Paint: deze paden zijn te gedegenereerd om te verven diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index bde04419d8..2a544efdec 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -5036,6 +5036,7 @@ liquify-list-end {0}, {1} {0} i {1} @msg Installed plug-in {_1} Zainstalowano wtyczkę {_1} @msg Internal error: {msg} (please report this bug) Błąd wewnętrzny: {msg} (zgłoś ten błąd) @msg Live Paint Merge: select a Live Paint group and the paths to add Scal aktywne malowanie: zaznacz grupę aktywnego malowania i ścieżki do dodania +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` i `Edge` to nazwy ścian i krawędzi grupy aktywnego malowania: nadaj ścieżce inną nazwę @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Aktywne malowanie przyjmuje ścieżki i ścieżki złożone: najpierw przekształć tekst, obrazy i inne obiekty w ścieżki @msg Live Paint: select paths or compound paths Aktywne malowanie: zaznacz ścieżki lub ścieżki złożone @msg Live Paint: these paths are too degenerate to paint Aktywne malowanie: te ścieżki są zbyt zdegenerowane, aby je malować diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index b6bdbe36b4..eb2a3eb8e6 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -4194,6 +4194,7 @@ axis Both Ambos @msg Installed plug-in {_1} Plug-in {_1} instalado @msg Internal error: {msg} (please report this bug) Erro interno: {msg} (relate este bug) @msg Live Paint Merge: select a Live Paint group and the paths to add Mesclar Pintura dinâmica: selecione um grupo de Pintura dinâmica e os traçados a adicionar +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` e `Edge` são os nomes das faces e arestas de um grupo de Pintura dinâmica: dê outro nome ao traçado @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first A pintura dinâmica aceita traçados e traçados compostos: converta primeiro texto, imagens e outros objetos em traçados @msg Live Paint: select paths or compound paths Pintura dinâmica: selecione traçados ou traçados compostos @msg Live Paint: these paths are too degenerate to paint Pintura dinâmica: estes traçados são degenerados demais para pintar diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 970736934e..ae30a875a3 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -4946,6 +4946,7 @@ liquify-list-end {0}, {1} {0} и {1} @msg Installed plug-in {_1} Установлен модуль {_1} @msg Internal error: {msg} (please report this bug) Внутренняя ошибка: {msg} (пожалуйста, сообщите об этой ошибке) @msg Live Paint Merge: select a Live Paint group and the paths to add Объединение быстрой заливки: выделите группу быстрой заливки и контуры для добавления +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name Имена `Face` и `Edge` носят грани и границы группы быстрой заливки: дайте контуру другое имя @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Быстрая заливка принимает контуры и составные контуры: сначала преобразуйте текст, изображения и другие объекты в контуры @msg Live Paint: select paths or compound paths Быстрая заливка: выделите контуры или составные контуры @msg Live Paint: these paths are too degenerate to paint Быстрая заливка: эти контуры слишком вырождены для заливки diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 140e64a20c..af153d3a9e 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -4821,6 +4821,7 @@ liquify-list-end {0}, {1} {0} och {1} @msg Installed plug-in {_1} Installerade pluginet {_1} @msg Internal error: {msg} (please report this bug) Internt fel: {msg} (rapportera gärna felet) @msg Live Paint Merge: select a Live Paint group and the paths to add Sammanfoga Live Paint: markera en Live Paint-grupp och de banor som ska läggas till +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` och `Edge` är namnen på ytorna och kanterna i en Live Paint-grupp: ge banan ett annat namn @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Live Paint tar banor och sammansatta banor: konvertera först text, bilder och andra objekt till banor @msg Live Paint: select paths or compound paths Live Paint: markera banor eller sammansatta banor @msg Live Paint: these paths are too degenerate to paint Live Paint: de här banorna är för degenererade för att målas diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index d3923e7618..d70b489f85 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -4661,6 +4661,7 @@ liquify-list-end {0}, {1} {0} ve {1} @msg Installed plug-in {_1} Yüklü eklenti {_1} @msg Internal error: {msg} (please report this bug) Dahili hata: {msg} (lütfen bu hatayı bildirin) @msg Live Paint Merge: select a Live Paint group and the paths to add Canlı Boyama Birleştirme: Canlı Boyama grubunu ve eklenecek yolları seçin +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` ve `Edge`, Canlı Boyama grubunun yüzlerinin ve kenarlarının adlarıdır: yola başka bir ad verin @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Canlı Boyama yolları ve bileşik yolları kabul eder: önce metni, görüntüleri ve diğer nesneleri yollara dönüştürün @msg Live Paint: select paths or compound paths Canlı Boyama: yolları veya bileşik yolları seçin @msg Live Paint: these paths are too degenerate to paint Canlı Boyama: Bu yollar boyanamayacak kadar yozlaşmış diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 9ea1557ca3..df72eeb083 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -4935,6 +4935,7 @@ liquify-list-end {0}, {1} {0} і {1} @msg Installed plug-in {_1} Встановлено модуль {_1} @msg Internal error: {msg} (please report this bug) Внутрішня помилка: {msg} (будь ласка, повідомте про цю помилку) @msg Live Paint Merge: select a Live Paint group and the paths to add Об’єднання швидкої заливки: виділіть групу швидкої заливки та контури для додавання +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name Імена `Face` і `Edge` мають грані та межі групи швидкої заливки: дайте контуру інше ім'я @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Швидка заливка приймає контури та складені контури: спершу перетворіть текст, зображення й інші об'єкти на контури @msg Live Paint: select paths or compound paths Швидка заливка: виділіть контури або складені контури @msg Live Paint: these paths are too degenerate to paint Швидка заливка: ці контури занадто вироджені для заливки diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index c21aa71919..100ba5abb7 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -5531,6 +5531,7 @@ liquify-list-end {0}, {1} {0} và {1} @msg type used as a mask in linked areas, wraparound text or a compound path doesn't clip chữ dùng làm mặt nạ trong các vùng liên kết, chữ bao quanh hoặc đường dẫn phức không cắt xén @msg linked pictures with no preview in the file show a placeholder until their files are found: relink them in the Links panel ảnh liên kết không có bản xem trước trong tệp hiển thị ô giữ chỗ cho đến khi tìm thấy tệp gốc: liên kết lại trong bảng Liên kết @msg Live Paint Merge: select a Live Paint group and the paths to add Hợp nhất tô trực tiếp: chọn nhóm tô trực tiếp và các đường dẫn để thêm +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` và `Edge` là tên của các mặt và cạnh trong nhóm tô trực tiếp: hãy đặt tên khác cho đường dẫn @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first Tô trực tiếp nhận đường dẫn và đường dẫn phức: hãy chuyển văn bản, hình ảnh và các đối tượng khác thành đường dẫn trước @msg Live Paint: select paths or compound paths Tô trực tiếp: chọn đường dẫn hoặc đường dẫn phức @msg Live Paint: these paths are too degenerate to paint Tô trực tiếp: các đường dẫn này quá suy biến để tô diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 096a7d3e3b..a2db551573 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -4531,6 +4531,7 @@ imageTrace Outline 轮廓 @msg the art has no bounds 图稿没有边界 @msg Image Trace: the traced image is missing 图像描摹:缺少所描摹的图像 @msg Live Paint Merge: select a Live Paint group and the paths to add 实时上色合并:请选择一个实时上色组以及要添加的路径 +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` 和 `Edge` 是实时上色组中表面和边缘的名称:请为路径另取一个名称 @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first 实时上色只接受路径和复合路径:请先将文字、图像和其他对象转换为路径 @msg Live Paint: select paths or compound paths 实时上色:请选择路径或复合路径 @msg Live Paint: these paths are too degenerate to paint 实时上色:这些路径过于退化,无法上色 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 1c014bbb2c..7b124ebb66 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -1994,6 +1994,7 @@ file-filter Templates 範本 @msg the art has no bounds 圖稿沒有邊界 @msg Image Trace: the traced image is missing 影像描圖:找不到描圖的影像 @msg Live Paint Merge: select a Live Paint group and the paths to add 即時上色合併:請選取即時上色群組和要加入的路徑 +@msg `Face` and `Edge` name the faces and edges of a Live Paint group: give the path another name `Face` 和 `Edge` 是即時上色群組中表面和邊緣的名稱:請為路徑另取名稱 @msg Live Paint takes paths and compound paths: convert type, images and other objects to paths first 即時上色只接受路徑和複合路徑:請先將文字、影像和其他物件轉換為路徑 @msg Live Paint: select paths or compound paths 即時上色:請選取路徑或複合路徑 @msg Live Paint: these paths are too degenerate to paint 即時上色:這些路徑過度退化,無法上色 diff --git a/docs/mcp.md b/docs/mcp.md index 670ecc6ac5..2fb7ea0a48 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5844,7 +5844,13 @@ and `layerRows`, the rows highlighted in the panel. bottom layer's into the empty space under the list) places them, unless objects are copied with a top-level layer that is the target, which would put them inside it (#8237). Dragging the selected-art square is `layer.move` with the selected objects. `node.move {id, parent?, index}` is the low-level - form with the same nesting rules; unlike `layer.move`, it also moves a row into a locked layer or group. + form with the same nesting rules; unlike `layer.move`, it also moves a row into a locked layer or group. A row that + either command puts into a Live Paint group from elsewhere (inside it, or above or below one of its rows) joins the + group's paths as `livePaint.merge` adds them, in one "Merge Live Paint" undo step, and the group is selected and + listed in `layer.move`'s `ids` in its place; paths, compound paths, groups of them and Live Paint groups can join, + and with anything else among the rows nothing moves. A row that goes into or leaves a Live Paint group's paths (its + hidden sources group) makes the group's faces and edges again, keeping the paint of those that stay; when no path is + left, the group has no faces or edges until a path joins it again. - **Buttons**: `layer.new {name?, top?, below?, …options}` (above the current layer at its level, or directly below it in Draw Behind; `top` with Ctrl/Cmd; `below`, directly below the current layer at its level, with Ctrl/Cmd+Alt; `top` and `below` apply in every drawing mode), @@ -5886,7 +5892,10 @@ and `layerRows`, the rows highlighted in the panel. Paint group (`object.exitIsolation`, or `object.isolate` on a level outside it) adds the paths, compound paths and groups of them drawn in it, shown and unlocked with everything in them, to the group as `livePaint.merge` does, in one undo step; type, images and other objects stay in it as they are, and with nothing drawn no undo step is - recorded. + recorded. When the isolated Live Paint group was drawn in another isolated Live Paint group, leaving both does this + for each group, innermost first, one undo step each, so the inner group joins the outer one. Face and Edge are the names of a Live Paint group's faces and edges: `layer.setProps` and + `object.setProps` return an error when they would give either name to another path directly in the group, and a + path pasted directly into the group under either name loses its name. - **Dialogs and panel state** (control channel and the app's MCP): `ui.layerOptions {ids?}` and `ui.newLayer {sublayer?}` open Layer Options (dialog `layerOptions`: name, color, template, locked, visible, printable, preview, dimImages, dimPercent; OK is one undo step; `ui.dialog.set` of `template` also sets `locked` and `dimImages`, as the diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index c8a1b340cd..57a4cbfaf3 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1807,7 +1807,8 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Create Strokes decides stroke or fill per feature, as the [help page](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/image-trace-panel-options.html) describes the Strokes width: the widest feature of the image that can become a stroke. A shape wider than Stroke somewhere keeps as its area every disc wider than Stroke that fits in it, and each piece outside those discs that reaches out of them at least one and a half times its own width (and 3 px) is traced as a stroked center line, its end at the area carried to the cut so the line's cap closes the join. Corners and edge slivers stay in the area. Which pieces count as features is VectorCraft's own rule. Each line still has one width; without Fills, the area is a 1 px outline as before. Tests: `thin_features_of_a_wide_shape_are_strokes_and_its_body_a_fill`, `wide_shapes_without_thin_features_stay_one_fill` and `distances_to_seeds_equal_brute_force` in `vectorcraft-trace`. The Image Trace score and estimates are unchanged. - The ignored centre-lines class measures that split on a mixed-width body scene: one disc with arms of 2, 3 and 5 px, at Stroke 6 px, traces as three stroked paths and one filled path in both the anti-aliased and hard input, with 100.0% of the arms' center samples found and 99.3% (anti-aliased) and 98.3% (hard) of the disc's pixels filled ([quality notes](image-trace-quality.md#centre-lines)). Test: `mixed_width_body_is_one_shape_traced_as_a_fill_and_strokes` in `vectorcraft-trace`. The Image Trace score and estimates are unchanged. Object › Live Paint › Merge adds the other selected paths and Live Paint groups to the bottom selected Live Paint group ([Live Paint groups](https://web.archive.org/web/20241230205225/https://helpx.adobe.com/illustrator/using/live-paint-groups.html)), which keeps its id, the paint of its faces and edges, and its name, lock, visibility, transparency, appearance, opacity mask and graphic style link. Object › Live Paint › Make with a Live Paint group selected, and a Live Paint Bucket click on a selected path beside a selected Live Paint group, add the paths to that group the same way. Make, Merge and the Live Paint Bucket take paths, compound paths and groups of them; with type, an image or another object among the selection they report that it has to be converted to paths first and change nothing, as type and raster images can't go into a Live Paint group directly ([Create Live Paint groups](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/create-live-paint-groups.html)); before, such an object went among the group's hidden sources and vanished from the canvas. Evidence: `tests_build::live_paint_refuses_type_and_images_and_changes_nothing`. - Paths drawn in an isolated Live Paint group join it when isolation mode ends, as the [help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/modify-live-paint-groups.html) describes: drawing paths in the isolated group and pressing Esc adds them. `object.exitIsolation` (Esc, the Control bar and isolation bar exits, a double-click outside, the Layers panel and the canvas context menu) adds the shown, unlocked paths, compound paths and groups of them drawn in the group as Merge does, in one undo step, and `object.isolate` on a level outside the group does the same. As VectorCraft's own rules, type, images, hidden and locked objects drawn there, and groups holding one, stay in the group as they are, and Gap Options, Merge and Release keep them; an exit with nothing drawn records no undo step. Evidence: `tests::build::{live_paint_isolation_adds_drawn_paths_on_exit, live_paint_isolation_adds_only_paths_it_takes, live_paint_isolation_leaves_a_group_holding_a_locked_path, live_paint_isolation_adds_drawn_paths_when_isolating_a_level_outside, live_paint_isolation_adds_a_drawn_group_isolated_inside_it, live_paint_isolation_keeps_art_named_like_its_parts, live_paint_keeps_type_drawn_in_it_through_gap_options_merge_and_release}`. + Paths drawn in an isolated Live Paint group join it when isolation mode ends, as the [help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/modify-live-paint-groups.html) describes: drawing paths in the isolated group and pressing Esc adds them. `object.exitIsolation` (Esc, the Control bar and isolation bar exits, a double-click outside, the Layers panel and the canvas context menu) adds the shown, unlocked paths, compound paths and groups of them drawn in the group as Merge does, in one undo step, and `object.isolate` on a level outside the group does the same. As VectorCraft's own rules, type, images, hidden and locked objects drawn there, and groups holding one, stay in the group as they are, and Gap Options, Merge and Release keep them; an exit with nothing drawn records no undo step; leaving a Live Paint group drawn in another isolated Live Paint group, and that group too, adds the drawn paths to each, innermost first, one undo step each. Evidence: `tests::build::{live_paint_isolation_adds_drawn_paths_on_exit, live_paint_isolation_adds_only_paths_it_takes, live_paint_isolation_leaves_a_group_holding_a_locked_path, live_paint_isolation_adds_drawn_paths_when_isolating_a_level_outside, live_paint_isolation_adds_a_drawn_group_isolated_inside_it, live_paint_isolation_merges_nested_live_paint_groups_it_leaves, live_paint_isolation_keeps_art_named_like_its_parts, live_paint_keeps_type_drawn_in_it_through_gap_options_merge_and_release}`. + Paths dragged into a Live Paint group in the Layers panel join it, as the [help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/modify-live-paint-groups.html) describes for adding paths to a group; older guides ([CS6, page 192](https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=192)) say several paths can be dragged at once. A drop inside the group, or above or below one of its rows (`layer.move`, and `node.move` into the group), adds the paths, compound paths, groups of them and Live Paint groups to it as Merge does, in one "Merge Live Paint" undo step that selects the group; an Alt-drag adds copies. As VectorCraft's own rules, type, an image or another object among the dragged rows refuses the whole drop with Merge's message, and a row dragged into or out of the group's hidden sources makes its faces and edges again, keeping the paint of those that stay; with no path left the group has no faces until a path joins it. Evidence: `tests::build::{layers_drag_adds_paths_to_a_live_paint_group, layers_drag_copy_and_drop_beside_a_part_add_to_a_live_paint_group, layers_drag_refuses_type_into_a_live_paint_group, layers_drag_out_of_a_live_paint_group_makes_its_faces_again}`. With the Live Paint Bucket selected, Alt-click on vector art samples its fill, stroke and stroke weight into the paint defaults ([Paint with the Live Paint Bucket tool](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/paint-with-the-live-paint-bucket-tool.html)). On a placed image it samples the image pixel as a solid fill with no stroke. Alt+Shift-click samples only the color under the pointer, including an intermediate gradient color or image pixels, into the active fill or stroke ([Default keyboard shortcuts](https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html)). Neither click paints or changes the selection or selected art, and the next Bucket click paints with the sampled paint. Evidence: `tests_build::live_paint_bucket_alt_sample_paints_next_face_without_changing_selection`. Double-clicking the Live Paint Bucket opens Live Paint Bucket Options ([Paint with the Live Paint Bucket tool](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/paint-with-the-live-paint-bucket-tool.html)): Paint Fills (on) and Paint Strokes (off) set whether a click paints faces, edges or both, Highlight turns the outline of the face or edge under the pointer on or off, and Color and Width set it (red and 4 px by default). Faces are outlined at the Width and edges at half of it, as the page says faces are highlighted with a thick line and edges with a thin line. With both on, a click paints the edge within 4 px of the pointer, else the face, and Shift switches to Paint Fills only; with one on, Shift switches to the other. The options last across tool switches and are saved with the preferences (`tool.setOption {tool: "livePaintBucket"}`). Evidence: `builder::tests::{bucket_options_choose_what_a_click_paints, bucket_options_set_the_highlight, bucket_highlights_an_edge_thinner_than_a_face}`, `dialogs::live_paint_bucket::tests::double_clicking_the_tool_opens_its_options_and_ok_sets_them`. Live Paint Bucket double-click and triple-click, as [the help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/learn-painting-basics/paint-with-the-live-paint-bucket-tool.html) describes them: a double-click on a face fills it and the faces reached across edges that draw no stroke, and on an edge it paints the edges joined to it with the same stroke; a triple-click fills every face of the group that has the face's fill, or paints every edge that draws with the edge's stroke paint, each with the bucket's paint (`livePaint.fill` and `livePaint.strokeEdge` `{scope: "connected" | "samePaint", match?}`; `pointer_gesture` and `ui.pointer` take `tripleclick`). Each click paints as it arrives, as its own undo step when it changes a paint, and the paint compared is the one the face or edge had before the first of its clicks that painted it, including a click whose drag or release crossed it; a first click that made the Live Paint group counts when the face it filled is the clicked face. With Space held for the view tools, a click, double-click or triple-click paints nothing and no face or edge is outlined, and with Cmd/Ctrl held a double-click or triple-click paints nothing. Which faces and edges join and which paints match are VectorCraft's own rules. Evidence: `tests_build::{live_paint_bucket_double_click_floods_across_unstroked_edges, live_paint_bucket_double_click_floods_curved_and_narrow_faces, live_paint_bucket_double_click_floods_across_hidden_edges_and_past_gaps, live_paint_bucket_triple_click_fills_every_face_of_the_same_fill, live_paint_bucket_triple_click_after_a_release_across_an_edge_matches_the_fill_before, live_paint_bucket_triple_click_released_from_another_face_matches_the_fill_before, live_paint_bucket_triple_click_after_making_the_group_across_an_edge_matches_the_made_fill, live_paint_bucket_triple_click_after_making_the_group_under_an_unfilled_path_matches_the_made_fill, live_paint_bucket_triple_click_after_merging_across_an_edge_matches_the_face_fill, live_paint_bucket_triple_click_after_merging_two_groups_matches_the_merged_fill, live_paint_bucket_triple_click_after_a_merge_splits_a_face_matches_the_part_fill, live_paint_bucket_triple_click_after_merging_matches_the_fixed_gradient, live_paint_bucket_triple_click_after_making_the_group_matches_the_made_fill, live_paint_bucket_double_and_triple_click_paint_joined_and_same_stroke_edges, live_paint_bucket_double_click_across_a_junction_paints_the_joined_edges, live_paint_bucket_double_click_released_back_on_the_first_edge_paints_the_joined_edges, live_paint_bucket_edge_double_click_after_filling_a_face_paints_the_joined_edges, live_paint_bucket_triple_click_with_a_cmd_press_between_matches_the_fill_before, live_paint_scope_and_match_are_checked}`, `builder::tests::{bucket_double_and_triple_click_widen_what_a_click_paints, bucket_triple_click_after_making_the_group_on_another_face_matches_its_own_face, bucket_triple_click_with_a_click_on_another_face_between_matches_the_first_fill, bucket_triple_click_with_a_view_tool_press_between_matches_the_first_fill, bucket_highlights_nothing_with_space_held}`, `canvas::tests::bucket_triple_click_with_a_view_tool_press_between_matches_the_fill_before`, `tests::build::{live_paint_scoped_fill_and_stroke_skip_parts_with_the_paint, live_paint_bucket_cmd_double_and_triple_click_paint_nothing}`, `tests::livepaint::{a_triple_click_fills_every_face_of_the_same_fill, clicks_with_space_held_paint_nothing}` (MCP).