diff --git a/crates/engine/src/tests/plugins.rs b/crates/engine/src/tests/plugins.rs index 6519bc347b..1c0539a2f9 100644 --- a/crates/engine/src/tests/plugins.rs +++ b/crates/engine/src/tests/plugins.rs @@ -182,6 +182,136 @@ fn filters_make_guides_and_locked_objects_left_unselected() { assert_eq!(st.history.undo.len(), undo + 1); } +/// A compound path handed back with its path as it was keeps its members, hidden and locked ones +/// included. A changed path replaces its members, and is refused while a member is hidden, locked, +/// a guide or not a path, as is turning it into a plain path. +#[test] +fn a_filter_keeps_or_replaces_a_compound_path_s_members_whole() { + use std::sync::Arc; + use vectorcraft_doc::{Appearance, Node, NodeKind}; + use vectorcraft_geom::FillRule; + let mut s = session(); + let compound_of = |s: &mut Session, members: Vec| { + let mut id = NodeId(0); + s.edit("Set up", |d, _| { + let n = Node::new(d.alloc_id(), NodeKind::Compound { children: members.into_iter().map(Arc::new).collect(), rule: FillRule::NonZero }); + let layer = d.layers[0].id; + id = d.insert(Some(layer), usize::MAX, n).unwrap(); + Ok(()) + }) + .unwrap(); + id + }; + let members = |s: &Session, id: NodeId| match &node(s, id).kind { + NodeKind::Compound { children, .. } => children.iter().map(|c| (c.id, c.visible, c.locked, c.path_data().cloned())).collect::>(), + _ => Vec::new(), + }; + let new_ids = |s: &mut Session| s.edit("Set up", |d, _| Ok([d.alloc_id(), d.alloc_id(), d.alloc_id(), d.alloc_id()])).unwrap(); + let [a, b, c, d] = new_ids(&mut s); + let [g, h, i, j] = new_ids(&mut s); + let hidden = |id: NodeId, x: f64| { + let mut n = Node::path(id, square_at(x), Appearance::default()); + n.visible = false; + n + }; + let locked = |id: NodeId, x: f64| { + let mut n = Node::path(id, square_at(x), Appearance::default()); + n.locked = true; + n + }; + // A member with an empty subpath, which plug-in output can't hold, still counts as handed back. + let empty = Node::path(g, PathData::single(SubPath::polyline(&[], false)), Appearance::default()); + let kept = compound_of(&mut s, vec![hidden(a, 40.0), locked(b, 80.0), empty]); + let plain = + compound_of(&mut s, vec![Node::path(c, square_at(120.0), Appearance::default()), Node::path(d, square_at(160.0), Appearance::default())]); + let was = members(&s, kept); + install_wat(&mut s, &tpl::module(&tpl::manifest("test.engine.compound.echo", "filter", "{}"), tpl::ECHO, "", 1)); + run(&mut s, "plugin.run", json!({"id": "test.engine.compound.echo", "ids": [kept.0]})); + assert_eq!(members(&s, kept), was, "handed back as it was, the members stay as they were"); + // New geometry for a compound with a hidden or a locked member, or the same geometry as a plain + // path, is refused, and the document is left alone. + let mut moved = square_at(200.0); + moved.subpaths.extend(square_at(240.0).subpaths); + let reshape = |id: &str, target: NodeId, extra: Value| { + let mut o = json!({"id": target.0, "path": moved.clone()}); + o.as_object_mut().unwrap().extend(extra.as_object().unwrap().clone()); + tpl::returning(&tpl::manifest(id, "filter", "{}"), &json!({ "objects": [o] }).to_string()) + }; + let hidden_only = compound_of(&mut s, vec![hidden(h, 360.0)]); + let locked_only = compound_of(&mut s, vec![Node::path(i, square_at(360.0), Appearance::default()), locked(j, 380.0)]); + // A member that is itself a compound path, shown and unlocked but holding a hidden member: its + // geometry isn't in the input, so a new path or a plain path would drop it. + let [k, l, m, _] = new_ids(&mut s); + let inner = Node::new(k, NodeKind::Compound { children: vec![Arc::new(hidden(l, 400.0))], rule: FillRule::NonZero }); + let nested = compound_of(&mut s, vec![Node::path(m, square_at(440.0), Appearance::default()), inner]); + let was_nested = node(&s, nested).clone(); + run(&mut s, "plugin.run", json!({"id": "test.engine.compound.echo", "ids": [nested.0]})); + assert_eq!(node(&s, nested).kind, was_nested.kind, "handed back as it was, a nested compound member stays"); + let flagged = "a hidden, locked or guide member"; + for (target, why) in [(hidden_only, flagged), (locked_only, flagged), (nested, "a member that isn't a path")] { + install_wat(&mut s, &reshape("test.engine.compound.reshape", target, json!({}))); + let flatten = tpl::returning( + &tpl::manifest("test.engine.compound.flatten", "filter", "{}"), + &json!({"objects": [{"id": target.0, "type": "path"}]}).to_string(), + ); + install_wat(&mut s, &flatten); + let before = (s.doc().unwrap().doc.clone(), s.doc().unwrap().history.undo.len()); + for id in ["test.engine.compound.reshape", "test.engine.compound.flatten"] { + let e = s.execute("plugin.run", &json!({"id": id, "ids": [target.0]})).unwrap_err().to_string(); + assert!(e.contains(&format!("compound path {} has {why}", target.0)), "{id}: {e}"); + assert_eq!((s.doc().unwrap().doc.clone(), s.doc().unwrap().history.undo.len()), before, "{id}"); + } + } + // Without such members, new geometry replaces the members: one per subpath, in the old members' places. + install_wat(&mut s, &reshape("test.engine.compound.reshape", plain, json!({}))); + run(&mut s, "plugin.run", json!({"id": "test.engine.compound.reshape", "ids": [plain.0]})); + let now = members(&s, plain); + assert_eq!(now.iter().map(|m| m.3.clone()).collect::>(), [Some(square_at(200.0)), Some(square_at(240.0))]); + assert!(now.iter().all(|m| m.1 && !m.2), "shown and unlocked members: {now:?}"); + assert_eq!(now.iter().map(|m| m.0).collect::>(), [c, d], "the members keep their places' ids"); + // A guide member is refused the same way, unless the output sets `guide` for the whole object. + let guide_of = |s: &mut Session| { + let [e, f, ..] = new_ids(s); + let mut guide_member = Node::path(e, square_at(280.0), Appearance::default()); + if let NodeKind::Path { guide, .. } = &mut guide_member.kind { + *guide = true; + } + compound_of(s, vec![guide_member, Node::path(f, square_at(320.0), Appearance::default())]) + }; + let guides = |s: &Session, id: NodeId| match &node(s, id).kind { + NodeKind::Compound { children, .. } => children.iter().map(|c| matches!(c.kind, NodeKind::Path { guide: true, .. })).collect::>(), + _ => Vec::new(), + }; + let guide = guide_of(&mut s); + install_wat(&mut s, &reshape("test.engine.compound.reshape", guide, json!({}))); + let err = s.execute("plugin.run", &json!({"id": "test.engine.compound.reshape", "ids": [guide.0]})).unwrap_err().to_string(); + assert!(err.contains("guide member"), "{err}"); + let flatten = tpl::returning( + &tpl::manifest("test.engine.compound.flatten.unflagged", "filter", "{}"), + &json!({"objects": [{"id": guide.0, "type": "path"}]}).to_string(), + ); + install_wat(&mut s, &flatten); + let err = s.execute("plugin.run", &json!({"id": "test.engine.compound.flatten.unflagged", "ids": [guide.0]})).unwrap_err().to_string(); + assert!(err.contains(&format!("compound path {} has {flagged}", guide.0)), "{err}"); + assert_eq!(guides(&s, guide), [true, false], "a refused flatten leaves the guide member as it was"); + for (id, on) in [("test.engine.compound.unguide", false), ("test.engine.compound.reguide", true)] { + let target = guide_of(&mut s); + install_wat(&mut s, &reshape(id, target, json!({ "guide": on }))); + run(&mut s, "plugin.run", json!({"id": id, "ids": [target.0]})); + assert_eq!(members(&s, target).iter().map(|m| m.3.clone()).collect::>(), [Some(square_at(200.0)), Some(square_at(240.0))], "{id}"); + assert_eq!(guides(&s, target), [on, on], "{id}: every new member takes the output's `guide`"); + } + // Turning it into a plain path is allowed the same way when the output sets `guide`. + let target = guide_of(&mut s); + let flatten = tpl::returning( + &tpl::manifest("test.engine.compound.flatten.guide", "filter", "{}"), + &json!({"objects": [{"id": target.0, "type": "path", "guide": true}]}).to_string(), + ); + install_wat(&mut s, &flatten); + run(&mut s, "plugin.run", json!({"id": "test.engine.compound.flatten.guide", "ids": [target.0]})); + assert!(matches!(node(&s, target).kind, NodeKind::Path { guide: true, .. }), "{:?}", node(&s, target).kind); +} + #[test] fn failing_plugins_leave_the_document_and_history_alone() { let mut s = session(); diff --git a/crates/plugins/src/objects.rs b/crates/plugins/src/objects.rs index 19a90500ce..ad69c25720 100644 --- a/crates/plugins/src/objects.rs +++ b/crates/plugins/src/objects.rs @@ -1031,12 +1031,40 @@ fn members(doc: &mut Document, old: &[Arc], path: PathData) -> Vec bool { + returned.subpaths.iter().eq(current.subpaths.iter().filter(|sp| !sp.anchors.is_empty())) +} + +/// Refuses an output that replaces the members of compound path `n` while one of them isn't a path +/// (plug-ins aren't given its geometry), or is hidden, locked or (unless the output sets `guide`) a +/// guide. +fn check_members_replaceable(n: &Node, children: &[Arc], sets_guide: bool, at: &str) -> Result<()> { + let id = n.id.0; + if children.iter().any(|c| c.path_data().is_none()) { + return Err(out_err(at, format!("compound path {id} has a member that isn't a path, so its members can't be replaced"))); + } + if children.iter().any(|c| !c.visible || c.locked || (!sets_guide && is_guide(c))) { + return Err(out_err(at, format!("compound path {id} has a hidden, locked or guide member, so its members can't be replaced"))); + } + Ok(()) +} + /// Writes `o` into `n` (an input object, or a fresh node for a new one); its effect records once /// `admit` lets them in. fn write(doc: &mut Document, n: &mut Node, o: OutObject, at: &str, admit: AdmitEffects) -> Result<()> { let (cur_path, cur_rule, cur_compound) = geometry(n).unwrap_or((PathData::default(), FillRule::NonZero, false)); let compound = o.compound.unwrap_or(cur_compound); let rule = o.rule.unwrap_or(cur_rule); + // A compound path handed back with its path as it was keeps its members as they are. + let same_members = cur_compound && o.path.as_ref().is_none_or(|p| same_geometry(p, &cur_path)); + if let NodeKind::Compound { children, .. } = &n.kind + && (!same_members || !compound) + { + let at = if compound { format!("{at}.path") } else { format!("{at}.type") }; + check_members_replaceable(n, children, o.guide.is_some(), &at)?; + } match (&mut n.kind, compound) { (NodeKind::Path { path, rule: r, live, .. }, false) => { // A path handed back as it was stays the live shape it was. @@ -1047,7 +1075,7 @@ fn write(doc: &mut Document, n: &mut Node, o: OutObject, at: &str, admit: AdmitE *r = rule; } (NodeKind::Compound { children, rule: r }, true) => { - if let Some(p) = o.path { + if let Some(p) = o.path.filter(|_| !same_members) { *children = members(doc, children, p); } *r = rule; diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 6886013758..0ebd34bda7 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -7794,6 +7794,8 @@ variable-list-end {0}, {1} {0} i {1} @msg `plates` requires a stop linked to a spot swatch `plates` requereix una parada vinculada a una mostra de color directe @msg the output la sortida @msg the path has no anchor points el traçat no té punts d’ancoratge +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced el traçat compost {id} té un membre ocult, bloquejat o guia, per tant no se’n poden substituir els membres +@msg compound path {id} has a member that isn't a path, so its members can't be replaced el traçat compost {id} té un membre que no és un traçat, per tant no se’n poden substituir els membres @msg too many anchor points (limit {MAX_ANCHORS}) massa punts d’ancoratge (límit {MAX_ANCHORS}) @msg true or false true o false @msg a number >= {_1} un nombre >= {_1} diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index feace9a058..217fc9161f 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -7404,6 +7404,8 @@ axis Y Axis osa Y @msg `plates` requires a stop linked to a spot swatch `plates` vyžaduje zarážku propojenou se vzorkem přímé barvy @msg the output výstup @msg the path has no anchor points cesta nemá žádné kotevní body +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced složená cesta {id} má skrytý, zamčený nebo vodítkový člen, takže její členy nelze nahradit +@msg compound path {id} has a member that isn't a path, so its members can't be replaced složená cesta {id} má člen, který není cestou, takže její členy nelze nahradit @msg too many anchor points (limit {MAX_ANCHORS}) příliš mnoho kotevních bodů (limit {MAX_ANCHORS}) @msg true or false true nebo false @msg a number >= {_1} číslo >= {_1} diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index b9a10a0566..9eba4ff3ad 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -635,6 +635,8 @@ liquify-list-end {0}, {1} {0} og {1} @msg `plates` requires a stop linked to a spot swatch `plates` kræver et gradientstop, der er knyttet til en spotfarveprøve @msg the output outputtet @msg the path has no anchor points kurven har ingen ankerpunkter +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced den sammensatte kurve {id} har et skjult, låst eller hjælpelinjemedlem, så dens medlemmer kan ikke erstattes +@msg compound path {id} has a member that isn't a path, so its members can't be replaced den sammensatte kurve {id} har et medlem, der ikke er en kurve, så dens medlemmer kan ikke erstattes @msg too many anchor points (limit {MAX_ANCHORS}) for mange ankerpunkter (grænse {MAX_ANCHORS}) @msg true or false true eller false @msg a number >= {_1} et tal >= {_1} diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index bcba9b32a7..abb89c6dc7 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -6987,6 +6987,8 @@ axis Y Axis Y-Achse @msg `plates` requires a stop linked to a spot swatch `plates` erfordert einen Farbstopp, der mit einem Volltonfarbfeld verknüpft ist @msg the output die Ausgabe @msg the path has no anchor points der Pfad hat keine Ankerpunkte +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced der zusammengesetzte Pfad {id} hat ein ausgeblendetes, gesperrtes oder als Hilfslinie dienendes Element, daher lassen sich seine Elemente nicht ersetzen +@msg compound path {id} has a member that isn't a path, so its members can't be replaced der zusammengesetzte Pfad {id} hat ein Element, das kein Pfad ist, daher lassen sich seine Elemente nicht ersetzen @msg too many anchor points (limit {MAX_ANCHORS}) zu viele Ankerpunkte (Grenze {MAX_ANCHORS}) @msg true or false true oder false @msg a number >= {_1} eine Zahl >= {_1} diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 765e92b250..ea7eb53703 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -7394,6 +7394,8 @@ axis Y Axis Άξονας Y @msg `plates` requires a stop linked to a spot swatch το `plates` απαιτεί σημείο χρώματος συνδεδεμένο με δείγμα πλακάτου χρώματος @msg the output η έξοδος @msg the path has no anchor points η διαδρομή δεν έχει σημεία αγκύρωσης +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced η σύνθετη διαδρομή {id} έχει κρυφό, κλειδωμένο ή οδηγό μέλος, οπότε τα μέλη της δεν μπορούν να αντικατασταθούν +@msg compound path {id} has a member that isn't a path, so its members can't be replaced η σύνθετη διαδρομή {id} έχει μέλος που δεν είναι διαδρομή, οπότε τα μέλη της δεν μπορούν να αντικατασταθούν @msg too many anchor points (limit {MAX_ANCHORS}) πάρα πολλά σημεία αγκύρωσης (όριο {MAX_ANCHORS}) @msg true or false true ή false @msg a number >= {_1} αριθμός >= {_1} diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index a96bf8b497..586c53d87e 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -7380,6 +7380,8 @@ axis Y Axis Eje Y @msg `plates` requires a stop linked to a spot swatch `plates` requiere una parada vinculada a una muestra de tinta plana @msg the output la salida @msg the path has no anchor points el trazado no tiene puntos de ancla +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced el trazado compuesto {id} tiene un miembro oculto, bloqueado o guía, por lo que sus miembros no se pueden reemplazar +@msg compound path {id} has a member that isn't a path, so its members can't be replaced el trazado compuesto {id} tiene un miembro que no es un trazado, por lo que sus miembros no se pueden reemplazar @msg too many anchor points (limit {MAX_ANCHORS}) demasiados puntos de ancla (límite {MAX_ANCHORS}) @msg true or false true o false @msg a number >= {_1} un número >= {_1} diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index c0259ddb23..9dda197d2e 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -7471,6 +7471,8 @@ axis Y Axis Y-akseli @msg `plates` requires a stop linked to a spot swatch `plates` vaatii väripisteen, joka on linkitetty spottivärin värimalliin @msg the output tuloste @msg the path has no anchor points polulla ei ole ankkuripisteitä +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced yhdistelmäpolulla {id} on piilotettu, lukittu tai apuviivana oleva jäsen, joten sen jäseniä ei voi korvata +@msg compound path {id} has a member that isn't a path, so its members can't be replaced yhdistelmäpolulla {id} on jäsen, joka ei ole polku, joten sen jäseniä ei voi korvata @msg too many anchor points (limit {MAX_ANCHORS}) liian monta ankkuripistettä (raja {MAX_ANCHORS}) @msg true or false true tai false @msg a number >= {_1} luku >= {_1} diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index f02b92a064..34583f51fd 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -7400,6 +7400,8 @@ axis Y Axis Axe Y @msg `plates` requires a stop linked to a spot swatch `plates` exige une étape liée à une nuance de ton direct @msg the output la sortie @msg the path has no anchor points le tracé n’a aucun point d’ancrage +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced le tracé transparent {id} a un membre masqué, verrouillé ou repère, donc ses membres ne peuvent pas être remplacés +@msg compound path {id} has a member that isn't a path, so its members can't be replaced le tracé transparent {id} a un membre qui n’est pas un tracé, donc ses membres ne peuvent pas être remplacés @msg too many anchor points (limit {MAX_ANCHORS}) trop de points d’ancrage (limite {MAX_ANCHORS}) @msg true or false true ou false @msg a number >= {_1} un nombre >= {_1} diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index c443b216ed..0cf6ac8ac8 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -6581,6 +6581,8 @@ arrowhead Feather पंख @msg `plates` requires a stop linked to a spot swatch `plates` के लिए स्पॉट रंग स्वॉच से जुड़ा स्टॉप आवश्यक है @msg the output आउटपुट @msg the path has no anchor points पाथ में कोई एंकर पॉइंट नहीं है +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced कंपाउंड पाथ {id} का कोई सदस्य छिपा हुआ, बंद या गाइड है, इसलिए इसके सदस्य बदले नहीं जा सकते +@msg compound path {id} has a member that isn't a path, so its members can't be replaced कंपाउंड पाथ {id} का कोई सदस्य पाथ नहीं है, इसलिए इसके सदस्य बदले नहीं जा सकते @msg too many anchor points (limit {MAX_ANCHORS}) बहुत अधिक एंकर पॉइंट (सीमा {MAX_ANCHORS}) @msg true or false true या false @msg a number >= {_1} एक संख्या >= {_1} diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 969139fd66..2cd00f0257 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -7389,6 +7389,8 @@ axis Y Axis Y tengely @msg `plates` requires a stop linked to a spot swatch a `plates` direktszín-színmintához kapcsolt színátmenet-pontot igényel @msg the output a kimenet @msg the path has no anchor points az útvonalnak nincsenek horgonypontjai +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced a(z) {id} összetett útvonalnak van rejtett, zárolt vagy segédvonal tagja, ezért a tagjai nem cserélhetők le +@msg compound path {id} has a member that isn't a path, so its members can't be replaced a(z) {id} összetett útvonalnak van olyan tagja, amely nem útvonal, ezért a tagjai nem cserélhetők le @msg too many anchor points (limit {MAX_ANCHORS}) túl sok horgonypont (korlát: {MAX_ANCHORS}) @msg true or false true vagy false @msg a number >= {_1} szám >= {_1} diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 5717f41e41..7f832ee024 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -517,6 +517,8 @@ @msg `plates` requires a stop linked to a spot swatch `plates` memerlukan perhentian yang ditautkan ke swatch warna spot @msg the output keluaran @msg the path has no anchor points jalur tidak memiliki titik jangkar +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced jalur majemuk {id} memiliki anggota yang tersembunyi, terkunci, atau garis panduan, sehingga anggotanya tidak dapat diganti +@msg compound path {id} has a member that isn't a path, so its members can't be replaced jalur majemuk {id} memiliki anggota yang bukan jalur, sehingga anggotanya tidak dapat diganti @msg too many anchor points (limit {MAX_ANCHORS}) terlalu banyak titik jangkar (batas {MAX_ANCHORS}) @msg true or false true atau false @msg a number >= {_1} angka >= {_1} diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 2b00e4f14a..b79d6dfa31 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -7026,6 +7026,8 @@ axis Y Axis Asse Y @msg `plates` requires a stop linked to a spot swatch `plates` richiede un cursore colore collegato a un campione di colore spot @msg the output l’output @msg the path has no anchor points il tracciato non ha punti di ancoraggio +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced il tracciato composto {id} ha un membro nascosto, bloccato o guida, quindi i suoi membri non possono essere sostituiti +@msg compound path {id} has a member that isn't a path, so its members can't be replaced il tracciato composto {id} ha un membro che non è un tracciato, quindi i suoi membri non possono essere sostituiti @msg too many anchor points (limit {MAX_ANCHORS}) troppi punti di ancoraggio (limite {MAX_ANCHORS}) @msg true or false true o false @msg a number >= {_1} un numero >= {_1} diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index dad3b11cf3..a86b292640 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -7101,6 +7101,8 @@ axis Y Axis Y 軸 @msg `plates` requires a stop linked to a spot swatch `plates` には特色スウォッチにリンクされた分岐点が必要です @msg the output 出力 @msg the path has no anchor points パスにアンカーポイントがありません +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced 複合パス {id} に非表示、ロック、またはガイドのメンバーがあるため、メンバーを置き換えられません +@msg compound path {id} has a member that isn't a path, so its members can't be replaced 複合パス {id} にパスではないメンバーがあるため、メンバーを置き換えられません @msg too many anchor points (limit {MAX_ANCHORS}) アンカーポイントが多すぎます (上限 {MAX_ANCHORS}) @msg true or false true または false @msg a number >= {_1} {_1} 以上の数値 diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 4e92268924..8a5b40ecc3 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -9509,6 +9509,8 @@ axis Y Axis Y ღერძი @msg `plates` requires a stop linked to a spot swatch `plates` მოითხოვს გადასვლის წერტილს, რომელიც სპოტ-ფერის ნიმუშთანაა დაკავშირებული @msg the output გამოტანა @msg the path has no anchor points ტრაექტორიას საყრდენი წერტილები არ აქვს +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced შედგენილ ტრაექტორიას {id} აქვს დამალული, ჩაკეტილი ან დამხმარე ხაზის წევრი, ამიტომ მისი წევრების ჩანაცვლება შეუძლებელია +@msg compound path {id} has a member that isn't a path, so its members can't be replaced შედგენილ ტრაექტორიას {id} აქვს წევრი, რომელიც ტრაექტორია არ არის, ამიტომ მისი წევრების ჩანაცვლება შეუძლებელია @msg too many anchor points (limit {MAX_ANCHORS}) ძალიან ბევრი საყრდენი წერტილი (ლიმიტი {MAX_ANCHORS}) @msg true or false true ან false @msg a number >= {_1} რიცხვი >= {_1} diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index ef5048bd6b..a39c8bbc27 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -6998,6 +6998,8 @@ axis Y Axis Y축 @msg `plates` requires a stop linked to a spot swatch `plates`에는 별색 견본에 연결된 정지점이 필요합니다 @msg the output 출력 @msg the path has no anchor points 패스에 앵커 포인트가 없습니다 +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced 컴파운드 패스 {id}에 숨겨졌거나 잠겼거나 안내선인 멤버가 있어 멤버를 바꿀 수 없습니다 +@msg compound path {id} has a member that isn't a path, so its members can't be replaced 컴파운드 패스 {id}에 패스가 아닌 멤버가 있어 멤버를 바꿀 수 없습니다 @msg too many anchor points (limit {MAX_ANCHORS}) 앵커 포인트가 너무 많습니다(한도 {MAX_ANCHORS}) @msg true or false true 또는 false @msg a number >= {_1} {_1} 이상인 숫자 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index ab6ec2be3b..02d65423c0 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -480,6 +480,8 @@ liquify-list-end {0}, {1} {0} en {1} @msg `plates` requires a stop linked to a spot swatch `plates` vereist een verloopstop die aan een steunkleurstaal is gekoppeld @msg the output de uitvoer @msg the path has no anchor points het pad heeft geen ankerpunten +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced het samengestelde pad {id} heeft een verborgen, vergrendeld of hulplijnlid, dus de leden kunnen niet worden vervangen +@msg compound path {id} has a member that isn't a path, so its members can't be replaced het samengestelde pad {id} heeft een lid dat geen pad is, dus de leden kunnen niet worden vervangen @msg too many anchor points (limit {MAX_ANCHORS}) te veel ankerpunten (limiet {MAX_ANCHORS}) @msg true or false true of false @msg a number >= {_1} een getal >= {_1} diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 9f335d0ad1..1a802a143c 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -7259,6 +7259,8 @@ axis Y Axis Oś Y @msg `plates` requires a stop linked to a spot swatch `plates` wymaga punktu koloru połączonego z próbką koloru dodatkowego @msg the output wyjście @msg the path has no anchor points ścieżka nie ma punktów kontrolnych +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced ścieżka złożona {id} ma ukryty, zablokowany lub będący linią pomocniczą element, więc jej elementów nie można zastąpić +@msg compound path {id} has a member that isn't a path, so its members can't be replaced ścieżka złożona {id} ma element, który nie jest ścieżką, więc jej elementów nie można zastąpić @msg too many anchor points (limit {MAX_ANCHORS}) za dużo punktów kontrolnych (limit {MAX_ANCHORS}) @msg true or false true lub false @msg a number >= {_1} liczbą >= {_1} diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 8467cd4ca9..108484d046 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -7303,6 +7303,8 @@ axis Y Axis Eixo Y @msg `plates` requires a stop linked to a spot swatch `plates` requer uma parada vinculada a uma amostra de cor spot @msg the output a saída @msg the path has no anchor points o caminho não tem pontos de ancoragem +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced o caminho composto {id} tem um membro oculto, bloqueado ou guia, por isso seus membros não podem ser substituídos +@msg compound path {id} has a member that isn't a path, so its members can't be replaced o caminho composto {id} tem um membro que não é um caminho, por isso seus membros não podem ser substituídos @msg too many anchor points (limit {MAX_ANCHORS}) pontos de ancoragem demais (limite {MAX_ANCHORS}) @msg true or false true ou false @msg a number >= {_1} um número >= {_1} diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index c7c7310f91..1a6def9fd3 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -7026,6 +7026,8 @@ axis Y Axis Ось Y @msg `plates` requires a stop linked to a spot swatch для `plates` нужна точка перехода, связанная с образцом плашечного цвета @msg the output вывод @msg the path has no anchor points у контура нет опорных точек +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced у составного контура {id} есть скрытый, заблокированный или направляющий элемент, поэтому его элементы нельзя заменить +@msg compound path {id} has a member that isn't a path, so its members can't be replaced у составного контура {id} есть элемент, который не является контуром, поэтому его элементы нельзя заменить @msg too many anchor points (limit {MAX_ANCHORS}) слишком много опорных точек (предел {MAX_ANCHORS}) @msg true or false true или false @msg a number >= {_1} число >= {_1} diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 24492752c3..ca7693019c 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -7410,6 +7410,8 @@ axis Y Axis Y-axel @msg `plates` requires a stop linked to a spot swatch `plates` kräver ett gradientstopp som är länkat till en dekorfärgruta @msg the output utdata @msg the path has no anchor points banan har inga ankarpunkter +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced den sammansatta banan {id} har en dold, låst eller stödlinjemedlem, så dess medlemmar kan inte ersättas +@msg compound path {id} has a member that isn't a path, so its members can't be replaced den sammansatta banan {id} har en medlem som inte är en bana, så dess medlemmar kan inte ersättas @msg too many anchor points (limit {MAX_ANCHORS}) för många ankarpunkter (gräns {MAX_ANCHORS}) @msg true or false true eller false @msg a number >= {_1} ett tal >= {_1} diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 9a2f635eff..87a2998316 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -7476,6 +7476,8 @@ axis Y Axis Y ekseni @msg `plates` requires a stop linked to a spot swatch `plates`, nokta rengi örneğine bağlı bir degrade durağı gerektirir @msg the output çıktı @msg the path has no anchor points yolun bağlantı noktası yok +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced {id} bileşik yolunun gizli, kilitli veya kılavuz olan bir üyesi var, bu yüzden üyeleri değiştirilemez +@msg compound path {id} has a member that isn't a path, so its members can't be replaced {id} bileşik yolunun yol olmayan bir üyesi var, bu yüzden üyeleri değiştirilemez @msg too many anchor points (limit {MAX_ANCHORS}) çok fazla bağlantı noktası (sınır {MAX_ANCHORS}) @msg true or false true veya false @msg a number >= {_1} bir sayı >= {_1} diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index fea2b808f0..e21d744908 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -7008,6 +7008,8 @@ axis Y Axis Вісь Y @msg `plates` requires a stop linked to a spot swatch для `plates` потрібна точка переходу, пов’язана зі зразком плашкового кольору @msg the output виведення @msg the path has no anchor points контур не має опорних точок +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced складений контур {id} має прихований, заблокований або напрямний елемент, тому його елементи не можна замінити +@msg compound path {id} has a member that isn't a path, so its members can't be replaced складений контур {id} має елемент, який не є контуром, тому його елементи не можна замінити @msg too many anchor points (limit {MAX_ANCHORS}) забагато опорних точок (межа {MAX_ANCHORS}) @msg true or false true або false @msg a number >= {_1} число >= {_1} diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 5c21630078..69cec087fc 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -7055,6 +7055,8 @@ axis Y Axis Trục Y @msg `plates` requires a stop linked to a spot swatch `plates` cần một điểm dừng chuyển sắc liên kết với mẫu màu đặc biệt @msg the output đầu ra @msg the path has no anchor points đường dẫn không có điểm neo +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced đường dẫn phức {id} có thành phần bị ẩn, bị khóa hoặc là đường căn, nên không thể thay thế các thành phần của nó +@msg compound path {id} has a member that isn't a path, so its members can't be replaced đường dẫn phức {id} có thành phần không phải là đường dẫn, nên không thể thay thế các thành phần của nó @msg too many anchor points (limit {MAX_ANCHORS}) quá nhiều điểm neo (giới hạn {MAX_ANCHORS}) @msg true or false true hoặc false @msg a number >= {_1} một số >= {_1} diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index c930edb133..41a08fbef9 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -7236,6 +7236,8 @@ axis Y Axis Y 轴 @msg `plates` requires a stop linked to a spot swatch `plates` 需要链接到专色色板的渐变色标 @msg the output 输出 @msg the path has no anchor points 路径没有锚点 +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced 复合路径 {id} 有隐藏、锁定或参考线成员,因此无法替换其成员 +@msg compound path {id} has a member that isn't a path, so its members can't be replaced 复合路径 {id} 有不是路径的成员,因此无法替换其成员 @msg too many anchor points (limit {MAX_ANCHORS}) 锚点过多(上限 {MAX_ANCHORS}) @msg true or false true 或 false @msg a number >= {_1} 大于或等于 {_1} 的数字 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 29fa588a9a..e2beda57c7 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -7057,6 +7057,8 @@ axis Y Axis Y 軸 @msg `plates` requires a stop linked to a spot swatch `plates` 需要連結到特別色色票的漸層色標 @msg the output 輸出 @msg the path has no anchor points 路徑沒有錨點 +@msg compound path {id} has a hidden, locked or guide member, so its members can't be replaced 複合路徑 {id} 有隱藏、鎖定或參考線成員,因此無法取代其成員 +@msg compound path {id} has a member that isn't a path, so its members can't be replaced 複合路徑 {id} 有不是路徑的成員,因此無法取代其成員 @msg too many anchor points (limit {MAX_ANCHORS}) 錨點過多(上限 {MAX_ANCHORS}) @msg true or false true 或 false @msg a number >= {_1} 大於或等於 {_1} 的數字 diff --git a/docs/plugins.md b/docs/plugins.md index d8681295d9..242afb543c 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -797,6 +797,17 @@ For an **object filter**, the output is the new state of the input objects: the run locked or made guides are left out of the selection that follows. Hosts from before these keys ignore them. - A `path` returned as it was keeps a live shape live (a rectangle keeps its corner widgets); a changed one makes it a plain path. +- A compound path whose `path` is returned as it was, or left out, keeps its members as they are, hidden and locked + ones included; a changed `path` replaces its members with one plain member per subpath. Each new member keeps only + the id of the old member in its place: its name, live shape, opacity, blending mode, appearance, opacity mask and + other settings of its own are reset to a new path's defaults. The host refuses a `path` with no anchor points, so return a + compound path that has none without `path`. While a member is hidden, locked or a guide, or is not a path (its + geometry is not in the input's `path`), the host refuses a changed `path` and `type: "path"` for it (a guide member + is allowed when the output also sets `guide`). `guide` applies to every member, so `guide: false` on a compound path + makes each of its guide members an ordinary path. +- The host compares a returned `path` with the input coordinate by coordinate, exactly. A JSON parser that does not + read numbers back exactly as they were written (in Rust, `serde_json` without its `float_roundtrip` feature) can + change the last digit of a coordinate, so leave `path` out when the geometry does not change. The host validates everything before the document changes: coordinates must be finite and within ±4,000,000 pt, at most 100,000 objects and 4,000,000 anchors, 256 fills, strokes or gradient stops; colours, opacities and offsets are