diff --git a/crates/engine/src/cmd.rs b/crates/engine/src/cmd.rs index 20a93f0fca..af395afea4 100644 --- a/crates/engine/src/cmd.rs +++ b/crates/engine/src/cmd.rs @@ -877,6 +877,9 @@ pub use xform::{AppearanceAttrs, EyedropperAttrs, EyedropperOptions, FillAttrs, /// The shape modes of the selected compound-shape members (the Pathfinder panel lights theirs). pub use compoundshape::selected_member_modes; +/// Make Compound Shape's warning when a member is an open path that encloses no area. +pub use compoundshape::OPEN_PATHS_ADD_NO_AREA; + /// Pathfinder Options (`Prefs::pathfinder`). pub use pathops::{PATHFINDER_PRECISION_RANGE, PathfinderOptions}; diff --git a/crates/engine/src/cmd/compoundshape.rs b/crates/engine/src/cmd/compoundshape.rs index bc93b399a5..b1c610d8bd 100644 --- a/crates/engine/src/cmd/compoundshape.rs +++ b/crates/engine/src/cmd/compoundshape.rs @@ -8,6 +8,8 @@ use std::sync::Arc; use serde_json::{Value, json}; use vectorcraft_doc::{Document, Node, NodeId, NodeKind, ShapeMode}; +use vectorcraft_geom::{FillRule, PathData, SubPath}; +use vectorcraft_pathops as po; use vectorcraft_render::effects; use super::edit::{roots_of, selected_roots}; @@ -16,6 +18,10 @@ use super::{CommandSpec, EngineError, Result, Session, bad, cmd, has_multi}; const MODE_NAMES: [&str; 4] = ["add", "subtract", "intersect", "exclude"]; +/// Make Compound Shape's warning, which the status bar shows, when a member holds a line or another +/// open path that encloses no area once closed, and so contributes no area to the shape. +pub const OPEN_PATHS_ADD_NO_AREA: &str = "a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first"; + pub fn specs() -> Vec { vec![ cmd!( @@ -23,7 +29,7 @@ pub fn specs() -> Vec { "Make Compound Shape", ["Window", "Pathfinder"], None, - "{ids?: [id…] (selected first; default: the selection), mode?: \"add\"|\"subtract\"|\"intersect\"|\"exclude\" (default add; Alt-clicking a Shape Mode button gives its mode)} the two or more selected objects (paths, compound paths, groups, compound shapes, type, blends, envelopes) become the members of one compound shape, each with the shape mode, in their stacking order where the frontmost was: it draws as the area they make from the backmost up (open paths closed; a blend as its steps, an envelope as its distorted art, an object with a warp or other geometry effect as it draws), painted with the appearance and transparency of the topmost member in Add, Intersect or Exclude mode (with every member in Subtract, the backmost), and the members stay editable (Direct Selection, Layers panel, isolation mode) → {id}", + "{ids?: [id…] (selected first; default: the selection), mode?: \"add\"|\"subtract\"|\"intersect\"|\"exclude\" (default add; Alt-clicking a Shape Mode button gives its mode)} the two or more selected objects (paths, compound paths, groups, compound shapes, type, blends, envelopes) become the members of one compound shape, each with the shape mode, in their stacking order where the frontmost was: it draws as the area they make from the backmost up (open paths closed; a blend as its steps, an envelope as its distorted art, an object with a warp or other geometry effect as it draws), painted with the appearance and transparency of the topmost member in Add, Intersect or Exclude mode (with every member in Subtract, the backmost), and the members stay editable (Direct Selection, Layers panel, isolation mode) → {id, warning?: when a member is or holds a line or another open path that encloses no area once closed, and so contributes no area}", has_multi, make ), @@ -157,6 +163,7 @@ fn make(s: &mut Session, p: &Value) -> Result { // all have `mode`, the topmost, or the backmost when they all subtract. let order: Vec<&Node> = if mode == ShapeMode::Subtract { members } else { members.into_iter().rev().collect() }; let hook = |c: &Node| effects::outline_object(Some(d), c); + let no_area = order.iter().any(|n| adds_no_area(d, n, &hook)); let style = order.into_iter().find_map(|n| top_style(d, n, &hook)); let id = s.edit("Make Compound Shape", |d, sel| { let gid = d.alloc_id(); @@ -179,7 +186,44 @@ fn make(s: &mut Session, p: &Value) -> Result { sel.set([id]); Ok(id) })?; - Ok(json!({ "id": id.0 })) + let mut out = json!({ "id": id.0 }); + if no_area { + out["warning"] = json!(OPEN_PATHS_ADD_NO_AREA); + } + Ok(out) +} + +/// Member `n` holds an open path that adds no area to a compound shape: one of the paths it takes +/// part as ([`effects::member_leaves`]), inside a group or a compound path too, has an open subpath +/// that encloses no area once closed (a straight line, or an evenodd contour traced twice), or it +/// has an open subpath and its subpaths, all closed, enclose no area together (open evenodd +/// subpaths that cancel one another or a closed subpath). The area is the one the path's fill rule +/// gives, which also keeps a self-crossing path whose signed area is zero (a bow tie) from the +/// warning, as Divide measures it. An area that can't be measured gives no warning. +fn adds_no_area(d: &Document, n: &Node, hook: effects::OutlineHook) -> bool { + effects::member_leaves(Some(d), n, Some(hook)).iter().any(|leaf| { + let (paths, rule): (Vec<&PathData>, FillRule) = match &leaf.kind { + NodeKind::Compound { children, rule } => (children.iter().filter_map(|c| c.path_data()).collect(), *rule), + NodeKind::Path { path, rule, .. } => (vec![path], *rule), + _ => return false, + }; + let subpaths: Vec<&SubPath> = paths.iter().flat_map(|p| &p.subpaths).collect(); + if subpaths.iter().all(|sp| sp.closed) { + return false; + } + let closed = |sp: &SubPath| { + let mut sp = sp.clone(); + sp.closed = true; + sp + }; + // An area that can't be measured counts as an area, so a failed measurement gives no warning. + let no_area = |p: PathData| po::try_area(&p, rule).is_ok_and(|a| a <= 0.0); + subpaths.iter().filter(|sp| !sp.closed).any(|sp| { + // The signed-area test alone only holds for nonzero: evenodd can fill nothing where + // the signed area is not zero (a contour traced twice). + !(rule == FillRule::NonZero && po::encloses_area(sp)) && no_area(PathData::single(closed(sp))) + }) || (subpaths.len() > 1 && no_area(PathData::new(subpaths.iter().map(|sp| closed(sp)).collect()))) + }) } /// The paint and transparency of the frontmost shape `n` adds to a compound shape's area, from the diff --git a/crates/engine/src/tests/compound_shape.rs b/crates/engine/src/tests/compound_shape.rs index 3f027254b0..0057af9253 100644 --- a/crates/engine/src/tests/compound_shape.rs +++ b/crates/engine/src/tests/compound_shape.rs @@ -696,3 +696,108 @@ fn a_locked_or_hidden_layer_keeps_the_isolated_compound_shape_from_clicks() { assert!(selected(&s).is_empty(), "{prop}: nor by a marquee"); } } + +/// A straight line, closed as a compound shape closes open paths, encloses no area, so it +/// contributes no area to the shape: Make Compound Shape still makes it, in any mode and at any +/// place in the stack, and its reply carries a warning that names Outline Stroke. The shape draws +/// the area the other members make in that mode: the square alone in Add, or on top in Subtract, +/// and nothing in Intersect or when the line is the backmost member in Subtract. A line in a group, +/// beside a closed path too, an open evenodd square traced twice, and open evenodd subpaths that cancel one another or a closed +/// subpath of the same path are the same. An open path that encloses an area once closed (a bow tie +/// whose lobes cancel in signed area included) and closed shapes alone give no warning (#7849). +#[test] +fn lines_that_add_no_area_are_reported() { + use crate::cmd::OPEN_PATHS_ADD_NO_AREA; + fn line_of(s: &mut Session) -> NodeId { + NodeId(run(s, "shape.line", json!({"x1": 20, "y1": 50, "x2": 180, "y2": 50}))["id"].as_u64().unwrap()) + } + fn vee_of(s: &mut Session) -> NodeId { + let anchors = json!([{"x": 20, "y": 50}, {"x": 100, "y": 150}, {"x": 180, "y": 50}]); + NodeId(run(s, "path.create", json!({ "anchors": anchors }))["id"].as_u64().unwrap()) + } + fn bow_tie_of(s: &mut Session) -> NodeId { + let anchors = json!([{"x": 20, "y": 0}, {"x": 180, "y": 100}, {"x": 180, "y": 0}, {"x": 20, "y": 100}]); + NodeId(run(s, "path.create", json!({ "anchors": anchors }))["id"].as_u64().unwrap()) + } + fn twice_around_of(s: &mut Session) -> NodeId { + let d = "M20 20 L80 20 L80 80 L20 80 L20 20 L80 20 L80 80 L20 80"; + let id = NodeId(run(s, "path.create", json!({ "d": d }))["id"].as_u64().unwrap()); + run(s, "path.setFillRule", json!({"rule": "evenOdd"})); + id + } + fn evenodd_of(s: &mut Session, d: &str) -> NodeId { + let id = NodeId(run(s, "path.create", json!({ "d": d }))["id"].as_u64().unwrap()); + run(s, "path.setFillRule", json!({"rule": "evenOdd"})); + id + } + fn two_open_squares_of(s: &mut Session) -> NodeId { + evenodd_of(s, "M20 20 L80 20 L80 80 L20 80 M20 20 L80 20 L80 80 L20 80") + } + fn open_over_closed_of(s: &mut Session) -> NodeId { + evenodd_of(s, "M20 20 L80 20 L80 80 L20 80 Z M20 20 L80 20 L80 80 L20 80") + } + fn group_of(s: &mut Session, ids: &[NodeId]) -> NodeId { + run(s, "select.set", json!({"ids": ids.iter().map(|i| i.0).collect::>()})); + NodeId(run(s, "object.group", json!({}))["id"].as_u64().unwrap()) + } + type Build = fn(&mut Session) -> NodeId; + // (case, mode, the other member, whether it goes behind the 100 pt square, warned, area drawn) + type Case = (&'static str, &'static str, Build, bool, bool, Option); + let cases: [Case; 13] = [ + ("an open evenodd square traced twice", "add", twice_around_of, false, true, Some(10_000.0)), + ("two open evenodd squares on one another", "add", two_open_squares_of, false, true, Some(10_000.0)), + ("an open evenodd square on the same closed square", "add", open_over_closed_of, false, true, Some(10_000.0)), + ("a line", "add", line_of, false, true, Some(10_000.0)), + ("a line, subtracting", "subtract", line_of, false, true, Some(10_000.0)), + ("a line, intersecting", "intersect", line_of, false, true, Some(0.0)), + ("a line behind, subtracting", "subtract", line_of, true, true, Some(0.0)), + ( + "a group of lines", + "add", + |s| { + let ids = [line_of(s), line_of(s)]; + group_of(s, &ids) + }, + false, + true, + Some(10_000.0), + ), + ( + "a group of a line and a square", + "add", + |s| { + let ids = [line_of(s), square(s, 200.0, "#00ff00")]; + group_of(s, &ids) + }, + false, + true, + Some(20_000.0), + ), + ("an open path that encloses an area", "add", vee_of, false, false, None), + ("an open bow tie, whose signed area is zero", "add", bow_tie_of, false, false, None), + ("a square", "add", |s| square(s, 50.0, "#0000ff"), false, false, Some(15_000.0)), + ("a square, subtracting", "subtract", |s| square(s, 50.0, "#0000ff"), false, false, Some(5_000.0)), + ]; + for (what, mode, build, behind, warned, want) in cases { + let mut s = Session::new(); + run(&mut s, "file.new", json!({"width": 400, "height": 300})); + let (back, front) = if behind { + let other = build(&mut s); + (other, square(&mut s, 0.0, "#ff0000")) + } else { + let sq = square(&mut s, 0.0, "#ff0000"); + (sq, build(&mut s)) + }; + run(&mut s, "select.set", json!({"ids": [back.0, front.0]})); + let r = run(&mut s, "object.compoundShape.make", json!({ "mode": mode })); + let id = NodeId(r["id"].as_u64().unwrap_or_else(|| panic!("{what}: {r}"))); + assert_eq!(node(&s, id).children().unwrap().len(), 2, "{what}: both are members"); + assert_eq!(r.get("warning").and_then(Value::as_str), warned.then_some(OPEN_PATHS_ADD_NO_AREA), "{what}: {r}"); + if let Some(want) = want { + let d = &s.doc().unwrap().doc; + let hook = |c: &Node| effects::outline_object(Some(d), c); + let got = effects::compound_shape_area(None, &node(&s, id), Some(&hook)).map_or(0.0, |p| area(&p)); + assert!((got - want).abs() < 0.5, "{what}: draws {got}, not {want}"); + } + } +} diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index e10d6182e0..60e5b024e7 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -8608,6 +8608,7 @@ breakText Glyphs Glifs @msg A joint does not close by {gap} pt. Una unió no es tanca per {gap} pt. @msg Two panels pass through each other. Dos panells es travessen l’un a l’altre. @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer ha de ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine" +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first una línia o un altre traçat obert que no tanca cap àrea no aporta cap àrea a la forma composta; per incloure’l, apliqueu-hi primer Objecte › Traçat › Contorneja el traç Pressure Sensitive Sensible a la pressió Flex Ribbon Cinta flexible Pulse Stroke Traç pulsant diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 5ce51c6301..4c81f329b3 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -9966,6 +9966,7 @@ breakText Glyphs Glyfy @msg the character's size can't be measured velikost znaku nelze změřit @msg the code runs past its last instruction kód běží za svou poslední instrukci @msg the compound shape is too complex to expand složený tvar je příliš složitý na rozložení +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first čára nebo jiná otevřená cesta, která neohraničuje žádnou plochu, nepřidá složenému tvaru žádnou plochu; chcete-li ji zahrnout, použijte na ni nejprve Objekt › Cesta › Převést tah na obrys @msg the container of the listed objects is gone kontejner uvedených objektů už neexistuje @msg the copy `{user_id}` can't be read as a library kopii `{user_id}` nelze přečíst jako knihovnu @msg the copy would leave the canvas kopie by opustila plátno diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 452a6d5dca..c13893b490 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -10496,6 +10496,7 @@ breakText Glyphs Glyffer @msg A joint does not close by {gap} pt. En samling lukker ikke med {gap} pt. @msg Two panels pass through each other. To paneler går gennem hinanden. @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer skal være "singleLine", "everyLine", "standardSingleLine" eller "standardEveryLine" +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first en linje eller anden åben kurve, der ikke omslutter noget område, tilføjer intet område til den sammensatte figur; anvend først Objekt › Kurve › Streg til kontur på den for at tage den med Pressure Sensitive Trykfølsom Flex Ribbon Fleksibelt bånd Pulse Stroke Pulserende strøg diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 57c579275a..b1a515a3f6 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -9517,6 +9517,7 @@ breakText Glyphs Glyphen @msg the artboards don't fit on the canvas: fewer artboards, less spacing or a smaller size die Zeichenflächen passen nicht auf die Arbeitsfläche: weniger Zeichenflächen, weniger Abstand oder eine kleinere Größe @msg the character's size can't be measured die Größe des Zeichens kann nicht gemessen werden @msg the compound shape is too complex to expand die zusammengesetzte Form ist zu komplex zum Umwandeln +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first eine Linie oder ein anderer offener Pfad, der keine Fläche umschließt, trägt keine Fläche zur zusammengesetzten Form bei; um ihn einzubeziehen, wenden Sie zuerst Objekt › Pfad › Konturlinie darauf an @msg the container of the listed objects is gone der Container der aufgelisteten Objekte ist nicht mehr vorhanden @msg the copy `{user_id}` can't be read as a library die Kopie `{user_id}` kann nicht als Bibliothek gelesen werden @msg the copy would leave the canvas die Kopie würde die Arbeitsfläche verlassen diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index b535d56688..d2d3da94c7 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -8582,6 +8582,7 @@ breakText Glyphs Γλύφοι @msg A joint does not close by {gap} pt. Μια ένωση δεν κλείνει κατά {gap} pt. @msg Two panels pass through each other. Δύο πάνελ διαπερνούν το ένα το άλλο. @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" το composer πρέπει να είναι "singleLine", "everyLine", "standardSingleLine" ή "standardEveryLine" +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first μια γραμμή ή άλλη ανοιχτή διαδρομή που δεν περικλείει εμβαδόν δεν προσθέτει εμβαδόν στο σύνθετο σχήμα· για να τη συμπεριλάβετε, εφαρμόστε της πρώτα Αντικείμενο › Διαδρομή › Μετατροπή περιγράμματος σε διαδρομή Pressure Sensitive Ευαίσθητα στην πίεση Flex Ribbon Εύκαμπτη κορδέλα Pulse Stroke Παλμική πινελιά diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index de0ee0f920..013436077b 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -8569,6 +8569,7 @@ breakText Glyphs Glifos @msg A joint does not close by {gap} pt. Una unión no cierra por {gap} pt. @msg Two panels pass through each other. Dos paneles se atraviesan entre sí. @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer debe ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine" +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first una línea u otro trazado abierto que no encierra ningún área no aporta ningún área a la forma compuesta; para incluirlo, aplícale primero Objeto › Trazado › Contornear trazo Pressure Sensitive Sensible a la presión Flex Ribbon Cinta flexible Pulse Stroke Trazo pulsante diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 445ab49838..c2fbabb239 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -8665,6 +8665,7 @@ breakText Glyphs Merkit @msg A joint does not close by {gap} pt. Liitos ei sulkeudu, rako {gap} pt. @msg Two panels pass through each other. Kaksi paneelia kulkee toistensa läpi. @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer on oltava "singleLine", "everyLine", "standardSingleLine" tai "standardEveryLine" +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first viiva tai muu avoin polku, joka ei rajaa aluetta, ei lisää yhdistelmämuotoon aluetta; jos haluat sisällyttää sen, käytä siihen ensin komentoa Objekti › Polku › Ääriviivaa viiva Pressure Sensitive Paineherkkä Flex Ribbon Joustava nauha Pulse Stroke Sykkivä veto diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 08fe931dcc..96cc536bfd 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -9826,6 +9826,7 @@ breakText Glyphs Glyphes @msg the character's size can't be measured la taille du caractère ne peut pas être mesurée @msg the code runs past its last instruction le code s’exécute au-delà de sa dernière instruction @msg the compound shape is too complex to expand la forme composée est trop complexe pour être décomposée +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first une ligne ou un autre tracé ouvert qui n’entoure aucune surface n’ajoute aucune surface à la forme composée ; pour l’inclure, appliquez-lui d’abord Objet › Tracé › Vectoriser le contour @msg the container of the listed objects is gone le conteneur des objets listés a disparu @msg the copy `{user_id}` can't be read as a library la copie `{user_id}` ne peut pas être lue comme une bibliothèque @msg the copy would leave the canvas la copie sortirait de la zone de travail diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 1f480d9fcb..3b83883a00 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -8972,6 +8972,7 @@ liquify-list-end {0}, {1} {0} और {1} @msg the CMYK image couldn't be written CMYK इमेज को नहीं लिखा जा सकता @msg the Color Picker is not open रंग पिकर खुला नहीं है @msg the compound shape is too complex to expand मिश्रित आकार का विस्तार करने के लिए बहुत जटिल है +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first कोई रेखा या अन्य खुला पाथ जो कोई क्षेत्र नहीं घेरता, मिश्रित आकार में कोई क्षेत्र नहीं जोड़ता; इसे शामिल करने के लिए पहले उस पर ऑब्जेक्ट › पाथ › स्ट्रोक को आउटलाइन में बदलें लागू करें @msg the compressed file unpacks to more than {_1} MB संकुचित फ़ाइल {_1} MB से अधिक के लिए अनपैक @msg the compressed file unpacks to more than VectorCraft reads ({_1} MB of document, {_2} MB per image) संपीड़ित फ़ाइल खुलकर उससे बड़ी हो जाती है जितना VectorCraft पढ़ता है (डॉक्यूमेंट के {_1} MB, हर इमेज के {_2} MB) @msg the container of the listed objects is gone सूचीबद्ध ऑब्जेक्ट्स का कंटेनर चला गया है diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index becef69f72..def65e8751 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -9836,6 +9836,7 @@ breakText Glyphs Glifák @msg the character's size can't be measured a karakter mérete nem mérhető meg @msg the code runs past its last instruction a kód túlfut az utolsó utasításán @msg the compound shape is too complex to expand az összetett alakzat túl bonyolult a kibontáshoz +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first egy vonal vagy más nyitott útvonal, amely nem zár közre területet, nem ad területet az összetett alakzathoz; a felvételéhez előbb alkalmazza rá az Objektum › Útvonal › Körvonal útvonallá alakítása parancsot @msg the container of the listed objects is gone a felsorolt objektumok tárolója már nincs meg @msg the copy `{user_id}` can't be read as a library a másolat nem olvasható be könyvtárként: `{user_id}` @msg the copy would leave the canvas a másolat kikerülne a vászonról diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 585f5a0a9b..b627342817 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -9569,6 +9569,7 @@ breakText Glyphs Glifi @msg the artboards don't fit on the canvas: fewer artboards, less spacing or a smaller size le tavole da disegno non entrano nell'area di lavoro: usa meno tavole da disegno, una spaziatura minore o una dimensione più piccola @msg the character's size can't be measured impossibile misurare la dimensione del carattere @msg the compound shape is too complex to expand la forma composta è troppo complessa da espandere +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first una linea o un altro tracciato aperto che non racchiude alcuna area non aggiunge alcuna area alla forma composta; per includerlo, applica prima Oggetto › Tracciato › Contorna traccia @msg the container of the listed objects is gone il contenitore degli oggetti elencati non esiste più @msg the copy `{user_id}` can't be read as a library la copia `{user_id}` non può essere letta come libreria @msg the copy would leave the canvas la copia uscirebbe dall'area di lavoro diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 6f673bbb9d..cf47674517 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -8454,6 +8454,7 @@ axis Y Axis Y 軸 @msg the artboards don't fit on the canvas: fewer artboards, less spacing or a smaller size アートボードがキャンバスに収まりません: アートボードの数を減らすか、間隔またはサイズを小さくしてください @msg the character's size can't be measured 文字のサイズを計測できません @msg the compound shape is too complex to expand 複合シェイプが複雑すぎて拡張できません +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first 領域を囲まない直線などのオープンパスは、複合シェイプに領域を加えません。含めるには、先にそのパスに「オブジェクト › パス › パスのアウトライン」を適用してください @msg the container of the listed objects is gone 指定したオブジェクトを含むコンテナがなくなりました @msg the copy `{user_id}` can't be read as a library コピー `{user_id}` をライブラリとして読み込めません @msg the copy would leave the canvas コピーがキャンバスからはみ出します diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index c41b44b255..916410c903 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -1557,6 +1557,7 @@ @msg the color book is cut short ფერთა წიგნი შეკვეცილია @msg the color book's names take more than {_1} MB ფერთა წიგნის სახელები {_1} MB-ზე მეტს იკავებს @msg the compound shape is too complex to expand შედგენილი ფიგურა ზედმეტად რთულია გასაშლელად +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first ხაზი ან სხვა ღია ტრაექტორია, რომელიც ფართობს არ შემოსაზღვრავს, შედგენილ ფიგურას ფართობს არ უმატებს; მის ჩასართავად ჯერ გამოიყენეთ ობიექტი › ტრაექტორია › კონტურის ფიგურად გარდაქმნა @msg the container of the listed objects is gone ჩამოთვლილი ობიექტების კონტეინერი აღარ არსებობს @msg the copy `{user_id}` can't be read as a library ასლის `{user_id}` ბიბლიოთეკად წაკითხვა შეუძლებელია @msg the copy would leave the canvas ასლი ტილოს გარეთ გავიდოდა diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 1dd9240432..adfe4ff61b 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -9577,6 +9577,7 @@ breakText Glyphs 글리프 @msg the character's size can't be measured 글자의 크기를 잴 수 없습니다 @msg the code runs past its last instruction 코드가 마지막 명령을 지나 실행됩니다 @msg the compound shape is too complex to expand 컴파운드 모양이 너무 복잡해서 확장할 수 없습니다 +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first 영역을 둘러싸지 않는 선이나 기타 열린 패스는 컴파운드 모양에 영역을 더하지 않습니다. 포함하려면 먼저 개체 › 패스 › 선 윤곽선화를 적용하세요 @msg the container of the listed objects is gone 나열한 개체의 컨테이너가 없어졌습니다 @msg the copy `{user_id}` can't be read as a library 복사본 `{user_id}`을(를) 라이브러리로 읽을 수 없습니다 @msg the copy would leave the canvas 복사본이 캔버스를 벗어납니다 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 1e12e99aaf..847f627819 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -7529,6 +7529,7 @@ imageTrace Outline Contour @msg the character's size can't be measured de grootte van het teken kan niet worden gemeten @msg the code runs past its last instruction de code loopt voorbij de laatste instructie @msg the compound shape is too complex to expand de samengestelde vorm is te complex om uit te breiden +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first een lijn of ander open pad dat geen oppervlak omsluit, voegt geen oppervlak toe aan de samengestelde vorm; pas er eerst Object › Pad › Contour omzetten op toe om het op te nemen @msg the container of the listed objects is gone de container van de vermelde objecten is verdwenen @msg the copy `{user_id}` can't be read as a library de kopie `{user_id}` kan niet als bibliotheek worden gelezen @msg the copy would leave the canvas de kopie zou buiten het canvas vallen diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index e9e6c9f7c1..bde04419d8 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -9805,6 +9805,7 @@ breakText Glyphs Glify @msg the artboards don't fit on the canvas: fewer artboards, less spacing or a smaller size obszary kompozycji nie mieszczą się na płótnie: użyj mniejszej liczby obszarów, mniejszych odstępów lub mniejszego rozmiaru @msg the character's size can't be measured nie można zmierzyć rozmiaru znaku @msg the compound shape is too complex to expand kształt złożony jest zbyt skomplikowany, aby go rozszerzyć +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first linia lub inna otwarta ścieżka, która nie obejmuje żadnego obszaru, nie dodaje obszaru do kształtu złożonego; aby ją uwzględnić, najpierw zastosuj do niej Obiekt › Ścieżka › Obrys konturu @msg the container of the listed objects is gone kontener wymienionych obiektów już nie istnieje @msg the copy `{user_id}` can't be read as a library kopii `{user_id}` nie można odczytać jako biblioteki @msg the copy would leave the canvas kopia wykroczyłaby poza płótno diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 6a6eb1deb4..b6bdbe36b4 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -10027,6 +10027,7 @@ swatch Yellow Green Verde-amarelado @msg the character's size can't be measured não é possível medir o tamanho do caractere @msg the code runs past its last instruction o código passa da última instrução @msg the compound shape is too complex to expand a forma composta é complexa demais para expandir +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first uma linha ou outro caminho aberto que não envolve nenhuma área não acrescenta nenhuma área à forma composta; para incluí-lo, aplique primeiro Objeto › Caminho › Contornar Traçado a ele @msg the container of the listed objects is gone o contêiner dos objetos listados não existe mais @msg the copy `{user_id}` can't be read as a library a cópia `{user_id}` não pode ser lida como uma biblioteca @msg the copy would leave the canvas a cópia sairia da tela diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 8c3d1d2270..3550155c11 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -9938,6 +9938,7 @@ shape Open Открытый @msg the character's size can't be measured размер символа невозможно измерить @msg the code runs past its last instruction код выполняется дальше своей последней инструкции @msg the compound shape is too complex to expand составная фигура слишком сложна, чтобы её разобрать +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first линия или другой открытый контур, не охватывающий площади, не добавляет площади к составной фигуре; чтобы включить его, сначала примените к нему Объект › Контур › Обвести обводку @msg the container of the listed objects is gone контейнер перечисленных объектов больше не существует @msg the copy `{user_id}` can't be read as a library копию `{user_id}` невозможно прочитать как библиотеку @msg the copy would leave the canvas копия вышла бы за пределы холста diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 10ba692e38..140e64a20c 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -9501,6 +9501,7 @@ digits Hindi Hindi @msg the character's size can't be measured tecknets storlek kan inte mätas @msg the CMYK image couldn't be written CMYK-bilden kunde inte skrivas @msg the compound shape is too complex to expand den sammansatta formen är för komplex för att expanderas +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first en linje eller annan öppen bana som inte omsluter någon yta lägger inte till någon yta i den sammansatta formen; för att ta med den, använd först Objekt › Bana › Konvertera kontur till form på den @msg the container of the listed objects is gone behållaren för de listade objekten finns inte längre @msg the copy `{user_id}` can't be read as a library kopian `{user_id}` kan inte läsas som ett bibliotek @msg the copy would leave the canvas kopian skulle hamna utanför arbetsytan diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index 79c7b4b7c3..d0b976ee44 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -554,6 +554,17 @@ fn objects_on_path_detach_strings_are_in_complete_catalogs() { } } +/// Make Compound Shape's warning for a member that adds no area, which the status bar shows and +/// the message scan doesn't read, is translated in each language of [`COMPLETE_MESSAGES`]. +#[test] +fn compound_shape_no_area_warning_is_translated() { + let warning = vectorcraft_engine::cmd::OPEN_PATHS_ADD_NO_AREA; + for code in COMPLETE_MESSAGES { + let lang = Lang::from_code(code).expect("registered"); + assert_ne!(message(lang, warning), warning, "{code}"); + } +} + /// The status messages the Shape Builder tool gives when a gesture builds nothing come from the /// tools crate, which [`message_literals`] does not scan, so every complete catalog is checked for /// them here. diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index aed206cebd..c411c2767c 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -8831,6 +8831,7 @@ axis Y Axis Y ekseni @msg the artboards don't fit on the canvas: fewer artboards, less spacing or a smaller size çalışma yüzeyleri tuvale sığmıyor: daha az çalışma yüzeyi, daha az aralık veya daha küçük bir boyut kullanın @msg the character's size can't be measured karakterin boyutu ölçülemiyor @msg the compound shape is too complex to expand bileşik şekil genişletilemeyecek kadar karmaşık +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first alan çevrelemeyen bir çizgi veya başka bir açık yol bileşik şekle hiçbir alan eklemez; dahil etmek için önce ona Nesne › Yol › Anahat Konturu uygulayın @msg the container of the listed objects is gone listelenen nesnelerin kapsayıcısı artık yok @msg the copy `{user_id}` can't be read as a library `{user_id}` kopyası bir kütüphane olarak okunamıyor @msg the copy would leave the canvas kopya tuvalin dışına çıkardı diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 05ad46ae9c..9ea1557ca3 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -9574,6 +9574,7 @@ breakText Glyphs Гліфи @msg the character's size can't be measured розмір символу не можна виміряти @msg the code runs past its last instruction код виконується далі своєї останньої інструкції @msg the compound shape is too complex to expand складена фігура занадто складна для розбирання +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first лінія чи інший відкритий контур, що не охоплює площі, не додає площі до складеної фігури; щоб включити його, спершу застосуйте до нього Об’єкт › Контур › Обвести обведення @msg the container of the listed objects is gone контейнера перелічених об’єктів більше немає @msg the copy `{user_id}` can't be read as a library копію `{user_id}` не вдалося прочитати як бібліотеку @msg the copy would leave the canvas копія вийшла б за межі полотна diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index ea64ff360e..c21aa71919 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -8252,6 +8252,7 @@ breakText Glyphs Glyph @msg {width} × {height} pixels is too large for Targa (at most 65535 pixels a side): lower the resolution {width} × {height} điểm ảnh quá lớn cho Targa (tối đa 65535 điểm ảnh mỗi cạnh): hãy giảm độ phân giải @msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} điểm ảnh quá lớn cho PSD (tối đa {MAX_SIDE} điểm ảnh mỗi cạnh): hãy giảm độ phân giải @msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer phải là "singleLine", "everyLine", "standardSingleLine" hoặc "standardEveryLine" +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first một đường thẳng hoặc đường dẫn mở khác không bao quanh vùng nào sẽ không thêm vùng nào vào hình phức hợp; để đưa nó vào, trước tiên hãy áp dụng Đối tượng › Đường dẫn › Đường bao nét cho nó Pressure Sensitive Nhạy áp lực Flex Ribbon Dải mềm Pulse Stroke Nét rung diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 94fe3aede7..096a7d3e3b 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -9789,6 +9789,7 @@ breakText Glyphs 字形 @msg the artboards don't fit on the canvas: fewer artboards, less spacing or a smaller size 画板在画布上放不下:请减少画板、缩小间距或减小尺寸 @msg the character's size can't be measured 无法测量该字符的大小 @msg the compound shape is too complex to expand 复合形状过于复杂,无法扩展 +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first 直线或其他不围成区域的开放路径不会为复合形状增加任何区域;要包含它,请先对其应用“对象 › 路径 › 轮廓化描边” @msg the container of the listed objects is gone 所列对象的容器已不存在 @msg the copy `{user_id}` can't be read as a library 副本 `{user_id}` 无法作为库读取 @msg the copy would leave the canvas 副本会超出画布 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index dd04e0bcc3..64c362efdf 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -9724,6 +9724,7 @@ breakText Glyphs 字符 @msg the artboards don't fit on the canvas: fewer artboards, less spacing or a smaller size 工作區域無法容納於畫布:請減少工作區域、縮小間距或縮小尺寸 @msg the character's size can't be measured 無法測量字元的大小 @msg the compound shape is too complex to expand 複合形狀過於複雜,無法展開 +@msg a line or other open path that encloses no area contributes no area to the compound shape; to include it, apply Object › Path › Outline Stroke to it first 直線或其他不圍成區域的開放路徑不會為複合形狀增加任何區域;若要納入,請先對其套用「物件 › 路徑 › 外框筆畫」 @msg the container of the listed objects is gone 所列物件的容器已不存在 @msg the copy `{user_id}` can't be read as a library 複本 `{user_id}` 無法讀取為資料庫 @msg the copy would leave the canvas 複本會超出畫布 diff --git a/docs/mcp.md b/docs/mcp.md index 81b3a8cb28..acd5613399 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -5752,7 +5752,9 @@ envelopes) the members of one live compound shape, each in shape mode `mode` (`" as its steps, an envelope as its distorted art, an object with a warp or another geometry effect as it draws, each updated when the member is edited), painted with its own appearance, which it takes from the topmost member not in Subtract (with every member subtracting, the backmost); a -fill or stroke given to it or to a member paints the compound shape. The members stay editable (Direct Selection, +fill or stroke given to it or to a member paints the compound shape. Open paths are closed, so a straight line encloses +no area and contributes no area to the shape. When a member is or holds such a path, the reply's `warning` says so +and names Object › Path › Outline Stroke. The members stay editable (Direct Selection, the Layers panel, isolation mode). `object.compoundShape.setMode {mode, ids?}` sets the mode of the members the selection is or is in, `object.compoundShape.release` gives the members back as they were, and `object.compoundShape.expand` turns each compound shape into the path, or compound path, of its area. A saved file