Pathfinder: Shape Mode buttons warn when a line encloses no area

Unite, Minus Front, Intersect, Exclude and Minus Back close open paths,
so a straight line encloses no area and does not change the result.
Until now the line was dropped with no message. Reported in #7849.

- The reply of object.pathfinder.unite, minusFront, intersect, exclude
  and minusBack now carries a warning, which the status bar shows, when
  a selected object is or holds an open path that encloses no area once
  closed (a line in a group or compound path included). The message
  names Object › Path › Outline Stroke. The area is measured with the
  path's fill rule, as Make Compound Shape's check in #7894 does.
- When such a path is what leaves the result empty (Intersect, or a
  line at the back in Minus Front), the error says so. Objects that
  leave nothing without the line keep the plain error.
- Both messages have rows in each complete-message catalog. The params
  text and docs/mcp.md describe the reply field.
This commit is contained in:
dotCooCoo
2026-11-16 07:37:40 -08:00
parent b352745d44
commit 9b1823c54c
29 changed files with 233 additions and 9 deletions
+3
View File
@@ -886,6 +886,9 @@ pub(crate) use buildcmds::TracePresetChanges;
/// The shapes a group selected alone gives the Pathfinder panel.
pub use pathops::shape_count;
/// The Shape Mode commands' warning when a selected open path encloses no area.
pub use pathops::SHAPE_MODE_OPEN_PATH_NO_AREA;
/// The gaps View › Show Live Paint Gaps shows on a Live Paint group.
pub use buildcmds::live_paint_gaps;
+57 -8
View File
@@ -27,7 +27,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Unite",
["Window", "Pathfinder"],
None,
"{ids?: [id…] (selected first; default: the selection), precision?: pt 0.001..10, removeRedundantPoints?: bool, removeUnpainted?: bool (default: the Pathfinder Options, see object.pathfinder.options; the values used join the journal entry)} operate on the selected objects (back → front) → {ids}",
"{ids?: [id…] (selected first; default: the selection), precision?: pt 0.001..10, removeRedundantPoints?: bool, removeUnpainted?: bool (default: the Pathfinder Options, see object.pathfinder.options; the values used join the journal entry)} operate on the selected objects (back → front) → {ids, warning?: when a selected object is or holds a line or another open path that encloses no area once closed, and so does not change the result (when such a path leaves the result empty, as in Intersect, the error says so)}",
has_selection,
|s, p| run_pf(s, p, PathfinderOp::Unite)
),
@@ -36,7 +36,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Minus Front",
["Window", "Pathfinder"],
None,
"{ids?: [id…] (selected first; default: the selection), precision?: pt 0.001..10, removeRedundantPoints?: bool, removeUnpainted?: bool (default: the Pathfinder Options, see object.pathfinder.options; the values used join the journal entry)} operate on the selected objects (back → front) → {ids}",
"{ids?: [id…] (selected first; default: the selection), precision?: pt 0.001..10, removeRedundantPoints?: bool, removeUnpainted?: bool (default: the Pathfinder Options, see object.pathfinder.options; the values used join the journal entry)} operate on the selected objects (back → front) → {ids, warning?: when a selected object is or holds a line or another open path that encloses no area once closed, and so does not change the result (when such a path leaves the result empty, as in Intersect, the error says so)}",
has_selection,
|s, p| run_pf(s, p, PathfinderOp::MinusFront)
),
@@ -45,7 +45,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Intersect",
["Window", "Pathfinder"],
None,
"{ids?: [id…] (selected first; default: the selection), precision?: pt 0.001..10, removeRedundantPoints?: bool, removeUnpainted?: bool (default: the Pathfinder Options, see object.pathfinder.options; the values used join the journal entry)} operate on the selected objects (back → front) → {ids}",
"{ids?: [id…] (selected first; default: the selection), precision?: pt 0.001..10, removeRedundantPoints?: bool, removeUnpainted?: bool (default: the Pathfinder Options, see object.pathfinder.options; the values used join the journal entry)} operate on the selected objects (back → front) → {ids, warning?: when a selected object is or holds a line or another open path that encloses no area once closed, and so does not change the result (when such a path leaves the result empty, as in Intersect, the error says so)}",
has_selection,
|s, p| run_pf(s, p, PathfinderOp::Intersect)
),
@@ -54,7 +54,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Exclude",
["Window", "Pathfinder"],
None,
"{ids?: [id…] (selected first; default: the selection), precision?: pt 0.001..10, removeRedundantPoints?: bool, removeUnpainted?: bool (default: the Pathfinder Options, see object.pathfinder.options; the values used join the journal entry)} operate on the selected objects (back → front) → {ids}",
"{ids?: [id…] (selected first; default: the selection), precision?: pt 0.001..10, removeRedundantPoints?: bool, removeUnpainted?: bool (default: the Pathfinder Options, see object.pathfinder.options; the values used join the journal entry)} operate on the selected objects (back → front) → {ids, warning?: when a selected object is or holds a line or another open path that encloses no area once closed, and so does not change the result (when such a path leaves the result empty, as in Intersect, the error says so)}",
has_selection,
|s, p| run_pf(s, p, PathfinderOp::Exclude)
),
@@ -108,7 +108,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Minus Back",
["Window", "Pathfinder"],
None,
"{ids?: [id…] (selected first; default: the selection), precision?: pt 0.001..10, removeRedundantPoints?: bool, removeUnpainted?: bool (default: the Pathfinder Options, see object.pathfinder.options; the values used join the journal entry)} operate on the selected objects (back → front) → {ids}",
"{ids?: [id…] (selected first; default: the selection), precision?: pt 0.001..10, removeRedundantPoints?: bool, removeUnpainted?: bool (default: the Pathfinder Options, see object.pathfinder.options; the values used join the journal entry)} operate on the selected objects (back → front) → {ids, warning?: when a selected object is or holds a line or another open path that encloses no area once closed, and so does not change the result (when such a path leaves the result empty, as in Intersect, the error says so)}",
has_selection,
|s, p| run_pf(s, p, PathfinderOp::MinusBack)
),
@@ -286,6 +286,37 @@ impl Style {
}
/// All subpaths of a path or compound path node, in document coordinates, with its fill rule.
/// The Shape Mode commands' warning, which the status bar shows, when a selected object is or holds
/// a line or another open path that encloses no area once closed, and so does not change the result.
pub const SHAPE_MODE_OPEN_PATH_NO_AREA: &str =
"a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first";
/// `path` has an open subpath that encloses no area once closed (a straight line, or an evenodd
/// contour traced twice), by the area its fill rule gives, so a self-crossing path whose signed
/// area is zero (a bow tie) still counts as enclosing area, as Divide measures it.
fn has_open_subpath_without_area(path: &PathData, rule: FillRule) -> bool {
path.subpaths.iter().filter(|sp| !sp.closed).any(|sp| {
// A point or a straight two-anchor line needs no area measurement.
if sp.anchors.len() < 2 || (sp.anchors.len() == 2 && sp.anchors.iter().all(|a| a.h_in == a.p && a.h_out == a.p)) {
return true;
}
let mut closed = sp.clone();
closed.closed = true;
// 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)) && po::area(&PathData::single(closed), rule) <= 0.0
})
}
/// The area `path` fills with its open subpaths closed, as the Shape Modes fill it.
fn closed_area(path: &PathData, rule: FillRule) -> f64 {
let mut closed = path.clone();
for sp in &mut closed.subpaths {
sp.closed = true;
}
po::area(&closed, rule)
}
pub(crate) fn node_path(n: &Node) -> Option<(PathData, FillRule)> {
match &n.kind {
NodeKind::Path { path, rule, .. } => Some((path.clone(), *rule)),
@@ -593,8 +624,9 @@ fn run_pf(s: &mut Session, p: &Value, op: PathfinderOp) -> Result<Value> {
matches!(op, PathfinderOp::Unite | PathfinderOp::MinusFront | PathfinderOp::Intersect | PathfinderOp::Exclude | PathfinderOp::MinusBack);
let label = pf_label(op);
let options = pf_options(s, p, &format!("object.pathfinder.{}", pf_id(op)))?;
let ids = s.edit(label, |d, sel| {
let (ids, no_area) = s.edit(label, |d, sel| {
// Build the stack (back → front); names are separate from paint/style identity.
let mut no_area = false;
let mut styles: Vec<Style> = vec![];
let mut shapes: Vec<po::Shape> = vec![];
let mut names: Vec<Option<String>> = vec![];
@@ -639,6 +671,7 @@ fn run_pf(s: &mut Session, p: &Value, op: PathfinderOp) -> Result<Value> {
// Among other objects, a group acts as one shape (the union of its leaves) with
// its top leaf's style. Selected alone, its members are the shapes (#1450).
let parts: Vec<(PathData, FillRule)> = lv.iter().filter_map(node_path).collect();
no_area = no_area || (shape_mode && parts.iter().any(|(p, r)| has_open_subpath_without_area(p, *r)));
let refs: Vec<(&PathData, FillRule)> = parts.iter().map(|(p, r)| (p, *r)).collect();
let name = n.name.clone().or_else(|| lv.iter().find_map(|l| l.name.clone()));
push(
@@ -650,6 +683,7 @@ fn run_pf(s: &mut Session, p: &Value, op: PathfinderOp) -> Result<Value> {
} else {
for l in &lv {
if let Some((p, r)) = node_path(l) {
no_area = no_area || (shape_mode && has_open_subpath_without_area(&p, r));
push(p, r, style_of(l), n.name.clone().or_else(|| l.name.clone()));
}
}
@@ -674,6 +708,17 @@ fn run_pf(s: &mut Session, p: &Value, op: PathfinderOp) -> Result<Value> {
}
}
if results.iter().all(|r| r.path.is_empty()) {
// The lines left the result empty when the shapes that enclose an area give a result
// without them, or when no such shape is selected.
let lines_emptied = no_area && {
let kept: Vec<po::Shape> = shapes.iter().filter(|s| closed_area(&s.path, s.rule) > 0.0).cloned().collect();
kept.is_empty() || po::pathfinder_with(op, &kept, options.precision).iter().any(|r| !r.path.is_empty())
};
if lines_emptied {
return Err(EngineError::Other(format!(
"{label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first"
)));
}
return Err(EngineError::Other(format!("{label} produced an empty result")));
}
let new_node = if shape_mode {
@@ -709,9 +754,13 @@ fn run_pf(s: &mut Session, p: &Value, op: PathfinderOp) -> Result<Value> {
};
let nid = d.wrap(&roots, |_| new_node)?;
sel.set([nid]);
Ok(vec![nid])
Ok((vec![nid], no_area))
})?;
Ok(ids_json(&ids))
let mut out = ids_json(&ids);
if no_area {
out["warning"] = json!(SHAPE_MODE_OPEN_PATH_NO_AREA);
}
Ok(out)
}
// ---------- Trap ----------
+100
View File
@@ -533,6 +533,106 @@ fn offset_path_stops_after_the_first_failure() {
}
}
/// A straight line, closed as the Shape Modes close open paths, encloses no area, so it does not
/// change the result: Unite, Minus Front, Exclude and Minus Back still give the 100 pt square's area
/// (with a line in a group selected beside it, the group's square too), and the reply carries a
/// warning that names Outline Stroke; where the line leaves nothing (Intersect, or the backmost
/// object in Minus Front), the error names it, and where the other objects leave nothing anyway, it
/// doesn't. An open evenodd square traced twice is the same. An open path
/// that encloses an area once closed (a bow tie whose lobes cancel in signed area included), closed
/// shapes alone, and Divide, where a line cuts, give no warning (#7849).
#[test]
fn shape_modes_report_lines_that_enclose_no_area() {
use crate::cmd::SHAPE_MODE_OPEN_PATH_NO_AREA;
fn id_of(v: Value) -> NodeId {
NodeId(v["id"].as_u64().unwrap())
}
fn line_of(s: &mut Session) -> NodeId {
id_of(s.execute("shape.line", &json!({"x1": 20, "y1": 50, "x2": 80, "y2": 50})).unwrap())
}
fn vee_of(s: &mut Session) -> NodeId {
let anchors = json!([{"x": 20, "y": 50}, {"x": 50, "y": 150}, {"x": 80, "y": 50}]);
id_of(s.execute("path.create", &json!({ "anchors": anchors })).unwrap())
}
fn bow_tie_of(s: &mut Session) -> NodeId {
let anchors = json!([{"x": 20, "y": 120}, {"x": 80, "y": 180}, {"x": 80, "y": 120}, {"x": 20, "y": 180}]);
id_of(s.execute("path.create", &json!({ "anchors": anchors })).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 = id_of(s.execute("path.create", &json!({ "d": d })).unwrap());
s.execute("path.setFillRule", &json!({"rule": "evenOdd"})).unwrap();
id
}
fn grouped_line_of(s: &mut Session) -> NodeId {
let ids = [line_of(s), rect(s, 200.0, 0.0, 100.0, 100.0)];
s.execute("select.set", &json!({"ids": ids.iter().map(|i| i.0).collect::<Vec<_>>()})).unwrap();
id_of(s.execute("object.group", &json!({})).unwrap())
}
fn square_of(s: &mut Session) -> NodeId {
rect(s, 50.0, 0.0, 100.0, 100.0)
}
type Build = fn(&mut Session) -> NodeId;
// (case, command, the other object, whether it goes behind the 100 pt square, warned, area drawn)
type Case = (&'static str, &'static str, Build, bool, bool, Option<f64>);
let cases: [Case; 11] = [
("a line", "unite", line_of, false, true, Some(10_000.0)),
("a line in front", "minusFront", line_of, false, true, Some(10_000.0)),
("a line", "exclude", line_of, false, true, Some(10_000.0)),
("a line behind", "minusBack", line_of, true, true, Some(10_000.0)),
("an open evenodd square traced twice", "unite", twice_around_of, false, true, Some(10_000.0)),
("a group of a line and a square", "unite", grouped_line_of, false, true, Some(20_000.0)),
("an open path that encloses an area", "unite", vee_of, false, false, None),
("an open bow tie, whose signed area is zero", "unite", bow_tie_of, false, false, None),
("a square", "unite", square_of, false, false, Some(15_000.0)),
("a square", "minusFront", square_of, false, false, Some(5_000.0)),
("a line, dividing", "divide", line_of, false, false, None),
];
for (what, op, build, behind, warned, want) in cases {
let mut s = session();
let (back, front) = if behind {
let other = build(&mut s);
(other, rect(&mut s, 0.0, 0.0, 100.0, 100.0))
} else {
let sq = rect(&mut s, 0.0, 0.0, 100.0, 100.0);
(sq, build(&mut s))
};
s.execute("select.set", &json!({"ids": [back.0, front.0]})).unwrap();
let r = s.execute(&format!("object.pathfinder.{op}"), &json!({})).unwrap_or_else(|e| panic!("{what}, {op}: {e}"));
let warning = r.get("warning").and_then(Value::as_str);
assert_eq!(warning, warned.then_some(SHAPE_MODE_OPEN_PATH_NO_AREA), "{what}, {op}: {r}");
if let Some(want) = want {
let got = area_of(&s, ids(&r)[0]);
assert!((got - want).abs() < 1.0, "{what}, {op}: area {got}, want {want}");
}
}
// A line that leaves nothing (Intersect, or the backmost object in Minus Front) gives an error
// that names it; two squares that don't meet give the plain one.
// (command, the other object, whether it goes behind the square, whether the error names the line)
let cases: [(&str, Build, bool, bool); 3] =
[("intersect", line_of, false, true), ("minusFront", line_of, true, true), ("intersect", |s| rect(s, 300.0, 0.0, 50.0, 50.0), false, false)];
for (op, build, behind, named) in cases {
let mut s = session();
let (back, front) = if behind {
let other = build(&mut s);
(other, rect(&mut s, 0.0, 0.0, 100.0, 100.0))
} else {
let sq = rect(&mut s, 0.0, 0.0, 100.0, 100.0);
(sq, build(&mut s))
};
s.execute("select.set", &json!({"ids": [back.0, front.0]})).unwrap();
let e = s.execute(&format!("object.pathfinder.{op}"), &json!({})).unwrap_err().to_string();
assert!(e.contains("produced an empty result"), "{op}: {e}");
assert_eq!(e.contains("Outline Stroke"), named, "{op}: {e}");
}
// Two squares that don't meet leave Intersect empty whatever a line beside them does.
let mut s = session();
let objects = [rect(&mut s, 0.0, 0.0, 100.0, 100.0), rect(&mut s, 300.0, 0.0, 50.0, 50.0), line_of(&mut s)];
s.execute("select.set", &json!({"ids": objects.iter().map(|i| i.0).collect::<Vec<_>>()})).unwrap();
let e = s.execute("object.pathfinder.intersect", &json!({})).unwrap_err().to_string();
assert!(e.contains("produced an empty result") && !e.contains("Outline Stroke"), "{e}");
}
#[test]
fn outline_stroke_of_line() {
let mut s = session();
+2
View File
@@ -6743,6 +6743,8 @@ liquify-list-end {0}, {1} {0} i {1}
@msg {label}: lost track of a shape's style {label}: s’ha perdut el rastre de l’estil d’una forma
@msg {label}: select paths {label}: selecciona traçats
@msg {label}: select paths, compound paths, groups or text {label}: selecciona traçats, traçats compostos, grups o text
@msg a line or other open path that encloses no area does not change the result; 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 canvia el resultat; per incloure’l, apliqueu-hi primer Objecte › Traçat › Contorneja el traç
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} ha produït un resultat buit: una línia o un altre traçat obert no tanca cap àrea; per incloure’l, apliqueu-hi primer Objecte › Traçat › Contorneja el traç
@msg {label}… {label}…
@msg {name}: CRC mismatch {name}: CRC no coincideix
@msg {name}: no local header {name}: no hi ha capçalera local
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -5584,6 +5584,8 @@ liquify-list-end {0}, {1} {0} a {1}
@msg {label}: lost track of a shape's style {label}: ztratil se styl tvaru
@msg {label}: select paths {label}: vyberte cesty
@msg {label}: select paths, compound paths, groups or text {label}: vyberte cesty, složené cesty, skupiny nebo text
@msg a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first čára nebo jiná otevřená cesta, která neohraničuje žádnou plochu, nemění výsledek; chcete-li ji zahrnout, použijte na ni nejprve Objekt › Cesta › Převést tah na obrys
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} vytvořil prázdný výsledek: čára nebo jiná otevřená cesta neohraničuje žádnou plochu; chcete-li ji zahrnout, použijte na ni nejprve Objekt › Cesta › Převést tah na obrys
@msg {label}… {label}…
@msg {name}: CRC mismatch {name}: nesouhlasí CRC
@msg {name}: no local header {name}: chybí lokální hlavička
Can't render this file because it is too large.
+2
View File
@@ -7690,6 +7690,8 @@ imageTrace Outline Kontur
@msg {label}: lost track of a shape's style {label}: mistede styr på en forms stil
@msg {label}: select paths {label}: markér stier
@msg {label}: select paths, compound paths, groups or text {label}: markér stier, sammensatte stier, grupper eller tekst
@msg a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first en linje eller anden åben kurve, der ikke omslutter noget område, ændrer ikke resultatet; anvend først Objekt › Kurve › Streg til kontur på den for at tage den med
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} gav et tomt resultat: en linje eller anden åben kurve omslutter intet område; anvend først Objekt › Kurve › Streg til kontur på den for at tage den med
@msg {label}… {label}…
@msg {name}: CRC mismatch {name}: CRC matcher ikke
@msg {name}: no local header {name}: ingen lokal header
Can't render this file because it is too large.
+2
View File
@@ -5185,6 +5185,8 @@ liquify-list-end {0}, {1} {0} und {1}
@msg {label}: lost track of a shape's style {label}: Der Stil einer Form ging verloren
@msg {label}: select paths {label}: Wählen Sie Pfade aus
@msg {label}: select paths, compound paths, groups or text {label}: Wählen Sie Pfade, zusammengesetzte Pfade, Gruppen oder Text aus
@msg a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first eine Linie oder ein anderer offener Pfad, der keine Fläche umschließt, ändert das Ergebnis nicht; um ihn einzubeziehen, wenden Sie zuerst Objekt › Pfad › Konturlinie darauf an
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} hat ein leeres Ergebnis geliefert: eine Linie oder ein anderer offener Pfad umschließt keine Fläche; um ihn einzubeziehen, wenden Sie zuerst Objekt › Pfad › Konturlinie darauf an
@msg {label}… {label}…
@msg {name}: CRC mismatch {name}: CRC stimmt nicht überein
@msg {name}: no local header {name}: kein lokaler Header
Can't render this file because it is too large.
+2
View File
@@ -5239,6 +5239,8 @@ digits Malayalam Μαλαγιάλαμ
@msg {label}: lost track of a shape's style {label}: χάθηκε η παρακολούθηση του στυλ σχήματος
@msg {label}: select paths {label}: επιλέξτε διαδρομές
@msg {label}: select paths, compound paths, groups or text {label}: επιλέξτε διαδρομές, σύνθετες διαδρομές, ομάδες ή κείμενο
@msg a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first μια γραμμή ή άλλη ανοιχτή διαδρομή που δεν περικλείει εμβαδόν δεν αλλάζει το αποτέλεσμα· για να τη συμπεριλάβετε, εφαρμόστε της πρώτα Αντικείμενο › Διαδρομή › Μετατροπή περιγράμματος σε διαδρομή
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first το {label} παρήγαγε κενό αποτέλεσμα: μια γραμμή ή άλλη ανοιχτή διαδρομή δεν περικλείει εμβαδόν· για να τη συμπεριλάβετε, εφαρμόστε της πρώτα Αντικείμενο › Διαδρομή › Μετατροπή περιγράμματος σε διαδρομή
@msg {label}… {label}…
@msg {name}: CRC mismatch {name}: ασυμφωνία CRC
@msg {name}: no local header {name}: δεν υπάρχει τοπική κεφαλίδα
Can't render this file because it is too large.
+2
View File
@@ -5292,6 +5292,8 @@ liquify-list-end {0}, {1} {0}, {1}
@msg {label}: lost track of a shape's style {label}: se perdió el estilo de una forma
@msg {label}: select paths {label}: selecciona trazados
@msg {label}: select paths, compound paths, groups or text {label}: selecciona trazados, trazados compuestos, grupos o texto
@msg a line or other open path that encloses no area does not change the result; 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 cambia el resultado; para incluirlo, aplícale primero Objeto › Trazado › Contornear trazo
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} produjo un resultado vacío: una línea u otro trazado abierto no encierra ningún área; para incluirlo, aplícale primero Objeto › Trazado › Contornear trazo
@msg {label}… {label}…
@msg {name}: CRC mismatch {name}: el CRC no coincide
@msg {name}: no local header {name}: no hay encabezado local
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -5508,6 +5508,8 @@ liquify-list-end {0}, {1} {0} ja {1}
@msg {label}: lost track of a shape's style {label}: muodon tyyli kadotettiin
@msg {label}: select paths {label}: valitse polkuja
@msg {label}: select paths, compound paths, groups or text {label}: valitse polkuja, yhdistelmäpolkuja, ryhmiä tai tekstiä
@msg a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first viiva tai muu avoin polku, joka ei rajaa aluetta, ei muuta tulosta; jos haluat sisällyttää sen, käytä siihen ensin komentoa Objekti › Polku › Ääriviivaa viiva
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} tuotti tyhjän tuloksen: viiva tai muu avoin polku ei rajaa aluetta; jos haluat sisällyttää sen, käytä siihen ensin komentoa Objekti › Polku › Ääriviivaa viiva
@msg {label}… {label}…
@msg {name}: CRC mismatch {name}: CRC ei täsmää
@msg {name}: no local header {name}: ei paikallista otsaketta
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -5252,6 +5252,8 @@ liquify-list-end {0}, {1} {0} et {1}
@msg {label}: lost track of a shape's style {label} : le style d’une forme a été perdu
@msg {label}: select paths {label} : sélectionnez des tracés
@msg {label}: select paths, compound paths, groups or text {label} : sélectionnez des tracés, des tracés transparents, des groupes ou du texte
@msg a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first une ligne ou un autre tracé ouvert qui n’entoure aucune surface ne modifie pas le résultat ; pour l’inclure, appliquez-lui d’abord Objet › Tracé › Vectoriser le contour
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} a produit un résultat vide : une ligne ou un autre tracé ouvert n’entoure aucune surface ; pour l’inclure, appliquez-lui d’abord Objet › Tracé › Vectoriser le contour
@msg {label}… {label}…
@msg {name}: CRC mismatch {name} : CRC non concordant
@msg {name}: no local header {name} : aucun en-tête local
Can't render this file because it is too large.
+2
View File
@@ -6048,6 +6048,8 @@ antiAlias Sharp शार्प
@msg {label}: lost track of a shape's style {label}: एक आकार की स्टाइल का ट्रैक खो गया
@msg {label}: select paths {label}: चुनें पाथ
@msg {label}: select paths, compound paths, groups or text {label}: चुनें पाथ, यौगिक पाथ, समूह या टेक्स्ट
@msg a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first कोई रेखा या अन्य खुला पाथ जो कोई क्षेत्र नहीं घेरता, परिणाम को नहीं बदलता; इसे शामिल करने के लिए पहले उस पर ऑब्जेक्ट › पाथ › स्ट्रोक को आउटलाइन में बदलें लागू करें
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} ने खाली परिणाम का उत्पादन किया: कोई रेखा या अन्य खुला पाथ कोई क्षेत्र नहीं घेरता; इसे शामिल करने के लिए पहले उस पर ऑब्जेक्ट › पाथ › स्ट्रोक को आउटलाइन में बदलें लागू करें
@msg {label}… {label}...
@msg {name} `{s}`: {ids} {name} `{s}`: {ids}
@msg {name} is built in and can't be deleted {name} बनाया गया है और इसे हटाया नहीं जा सकता है।
Can't render this file because it is too large.
+2
View File
@@ -6120,6 +6120,8 @@ liquify-list-end {0}, {1} {0} és {1}
@msg {label}: lost track of a shape's style {label}: egy alakzat stílusa elveszett
@msg {label}: select paths {label}: jelölj ki útvonalakat
@msg {label}: select paths, compound paths, groups or text {label}: jelölj ki útvonalakat, összetett útvonalakat, csoportokat vagy szöveget
@msg a line or other open path that encloses no area does not change the result; 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 változtatja meg az eredményt; a felvételéhez előbb alkalmazza rá az Objektum › Útvonal › Körvonal útvonallá alakítása parancsot
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first üres eredmény: {label}: egy vonal vagy más nyitott útvonal nem zár közre területet; a felvételéhez előbb alkalmazza rá az Objektum › Útvonal › Körvonal útvonallá alakítása parancsot
@msg {label}… {label}…
@msg {name}: CRC mismatch {name}: CRC-eltérés
@msg {name}: no local header {name}: nincs helyi fejléc
Can't render this file because it is too large.
+2
View File
@@ -5318,6 +5318,8 @@ liquify-list-end {0}, {1} {0} e {1}
@msg {label}: lost track of a shape's style {label}: lo stile di una forma è andato perso
@msg {label}: select paths {label}: seleziona tracciati
@msg {label}: select paths, compound paths, groups or text {label}: seleziona tracciati, tracciati composti, gruppi o testo
@msg a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first una linea o un altro tracciato aperto che non racchiude alcuna area non modifica il risultato; per includerlo, applica prima Oggetto › Tracciato › Contorna traccia
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} ha prodotto un risultato vuoto: una linea o un altro tracciato aperto non racchiude alcuna area; per includerlo, applica prima Oggetto › Tracciato › Contorna traccia
@msg {label}… {label}…
@msg {name}: CRC mismatch {name}: CRC non corrispondente
@msg {name}: no local header {name}: nessuna intestazione locale
Can't render this file because it is too large.
+2
View File
@@ -4773,6 +4773,8 @@ swatch Bright Violet ビビッドバイオレット
@msg {label}: lost track of a shape's style {label}: シェイプのスタイル情報が失われました
@msg {label}: select paths {label}: パスを選択してください
@msg {label}: select paths, compound paths, groups or text {label}: パス、複合パス、グループ、テキストのいずれかを選択してください
@msg a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first 領域を囲まない直線などのオープンパスは、結果を変えません。含めるには、先にそのパスに「オブジェクト › パス › パスのアウトライン」を適用してください
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} の結果が空になりました。領域を囲まない直線などのオープンパスがあります。含めるには、先にそのパスに「オブジェクト › パス › パスのアウトライン」を適用してください
@msg already editing a pattern すでにパターンを編集中です
@msg no pattern `{name}` パターン `{name}` が見つかりません
@msg not in pattern editing mode パターン編集モードではありません
Can't render this file because it is too large.
+2
View File
@@ -6953,6 +6953,8 @@ font-technology Variable ცვლადი
@msg {label}: lost track of a shape's style {label}: ფიგურის სტილი დაიკარგა
@msg {label}: select paths {label}: მონიშნეთ ტრაექტორიები
@msg {label}: select paths, compound paths, groups or text {label}: მონიშნეთ ტრაექტორიები, შედგენილი ტრაექტორიები, ჯგუფები ან ტექსტი
@msg a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first ხაზი ან სხვა ღია ტრაექტორია, რომელიც ფართობს არ შემოსაზღვრავს, შედეგს არ ცვლის; მის ჩასართავად ჯერ გამოიყენეთ ობიექტი › ტრაექტორია › კონტურის ფიგურად გარდაქმნა
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label}-მა ცარიელი შედეგი მოგვცა: ხაზი ან სხვა ღია ტრაექტორია ფართობს არ შემოსაზღვრავს; მის ჩასართავად ჯერ გამოიყენეთ ობიექტი › ტრაექტორია › კონტურის ფიგურად გარდაქმნა
@msg {label}… {label}…
@msg {name}: CRC mismatch {name}: CRC არ ემთხვევა
@msg {name}: no local header {name}: ლოკალური სათაური არ არის
Can't render this file because it is too large.
+2
View File
@@ -4700,6 +4700,8 @@ theme Appearance 외관
@msg {label}: lost track of a shape's style {label}: 모양의 스타일을 잃었습니다
@msg {label}: select paths {label}: 패스를 선택하세요
@msg {label}: select paths, compound paths, groups or text {label}: 패스, 컴파운드 패스, 그룹 또는 텍스트를 선택하세요
@msg a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first 영역을 둘러싸지 않는 선이나 기타 열린 패스는 결과를 바꾸지 않습니다. 포함하려면 먼저 개체 › 패스 › 선 윤곽선화를 적용하세요
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label}의 결과가 비어 있습니다. 선이나 기타 열린 패스가 영역을 둘러싸지 않습니다. 포함하려면 먼저 개체 › 패스 › 선 윤곽선화를 적용하세요
@msg already editing a pattern 이미 패턴을 편집 중입니다
@msg no pattern `{name}` `{name}` 패턴이 없습니다
@msg not in pattern editing mode 패턴 편집 모드가 아닙니다
Can't render this file because it is too large.
+2
View File
@@ -5584,6 +5584,8 @@ imageTrace Outline Contour
@msg {label}: lost track of a shape's style {label}: de stijl van een vorm is kwijtgeraakt
@msg {label}: select paths {label}: selecteer paden
@msg {label}: select paths, compound paths, groups or text {label}: selecteer paden, samengestelde paden, groepen of tekst
@msg a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first een lijn of ander open pad dat geen oppervlak omsluit, verandert het resultaat niet; pas er eerst Object › Pad › Contour omzetten op toe om het op te nemen
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} leverde een leeg resultaat op: een lijn of ander open pad omsluit geen oppervlak; pas er eerst Object › Pad › Contour omzetten op toe om het op te nemen
@msg {label}… {label}…
@msg {name}: CRC mismatch {name}: CRC komt niet overeen
@msg {name}: no local header {name}: geen lokale header
Can't render this file because it is too large.
+2
View File
@@ -5410,6 +5410,8 @@ liquify-list-end {0}, {1} {0} i {1}
@msg {label}: lost track of a shape's style {label}: utracono informację o stylu kształtu
@msg {label}: select paths {label}: zaznacz ścieżki
@msg {label}: select paths, compound paths, groups or text {label}: zaznacz ścieżki, ścieżki złożone, grupy lub tekst
@msg a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first linia lub inna otwarta ścieżka, która nie obejmuje żadnego obszaru, nie zmienia wyniku; aby ją uwzględnić, najpierw zastosuj do niej Obiekt › Ścieżka › Obrys konturu
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} dało pusty wynik: linia lub inna otwarta ścieżka nie obejmuje żadnego obszaru; aby ją uwzględnić, najpierw zastosuj do niej Obiekt › Ścieżka › Obrys konturu
@msg {label}… {label}…
@msg {name}: CRC mismatch {name}: niezgodność CRC
@msg {name}: no local header {name}: brak nagłówka lokalnego
Can't render this file because it is too large.
+2
View File
@@ -4592,6 +4592,8 @@ axis Both Ambos
@msg {label}: lost track of a shape's style {label}: perdeu o estilo de uma forma
@msg {label}: select paths {label}: selecione traçados
@msg {label}: select paths, compound paths, groups or text {label}: selecione traçados, traçados compostos, grupos ou texto
@msg a line or other open path that encloses no area does not change the result; 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 altera o resultado; para incluí-lo, aplique primeiro Objeto › Caminho › Contornar Traçado a ele
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} produziu um resultado vazio: uma linha ou outro caminho aberto não envolve nenhuma área; para incluí-lo, aplique primeiro Objeto › Caminho › Contornar Traçado a ele
@msg {label}… {label}…
@msg {name}: CRC mismatch {name}: CRC não confere
@msg {name}: no local header {name}: sem cabeçalho local
Can't render this file because it is too large.
+2
View File
@@ -5316,6 +5316,8 @@ liquify-list-end {0}, {1} {0} и {1}
@msg {label}: lost track of a shape's style {label}: потерян стиль фигуры
@msg {label}: select paths {label}: выделите контуры
@msg {label}: select paths, compound paths, groups or text {label}: выделите контуры, составные контуры, группы или текст
@msg a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first линия или другой открытый контур, не охватывающий площади, не меняет результат; чтобы включить его, сначала примените к нему Объект › Контур › Обвести обводку
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} дал пустой результат: линия или другой открытый контур не охватывает площади; чтобы включить его, сначала примените к нему Объект › Контур › Обвести обводку
@msg {label}… {label}…
@msg {name}: CRC mismatch {name}: несовпадение CRC
@msg {name}: no local header {name}: нет локального заголовка
Can't render this file because it is too large.
+2
View File
@@ -5180,6 +5180,8 @@ liquify-list-end {0}, {1} {0} och {1}
@msg {label}: lost track of a shape's style {label}: tappade bort en forms stil
@msg {label}: select paths {label}: markera banor
@msg {label}: select paths, compound paths, groups or text {label}: markera banor, sammansatta banor, grupper eller text
@msg a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first en linje eller annan öppen bana som inte omsluter någon yta ändrar inte resultatet; för att ta med den, använd först Objekt › Bana › Konvertera kontur till form på den
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} gav ett tomt resultat: en linje eller annan öppen bana omsluter ingen yta; för att ta med den, använd först Objekt › Bana › Konvertera kontur till form på den
@msg {label}… {label}…
@msg {name}: CRC mismatch {name}: CRC stämmer inte
@msg {name}: no local header {name}: lokalt huvud saknas
Can't render this file because it is too large.
+21
View File
@@ -4616,6 +4616,27 @@ fn pdfx_bleed_warning_is_translated() {
}
}
/// The Shape Mode commands' warning for a selected line that encloses no area, which the status bar
/// shows and the message scan doesn't read, and Intersect's error when such a line leaves nothing,
/// are translated in each language of [`COMPLETE_MESSAGES`].
#[test]
fn shape_mode_open_path_warning_is_translated() {
let warning = vectorcraft_engine::cmd::SHAPE_MODE_OPEN_PATH_NO_AREA;
let mut s = vectorcraft_engine::Session::new();
let run = |s: &mut vectorcraft_engine::Session, id: &str, p: serde_json::Value| s.execute(id, &p);
run(&mut s, "file.new", serde_json::json!({"width": 200, "height": 200})).unwrap();
let square = run(&mut s, "shape.rectangle", serde_json::json!({"x": 0, "y": 0, "width": 100, "height": 100})).unwrap()["id"].clone();
let line = run(&mut s, "shape.line", serde_json::json!({"x1": 20, "y1": 50, "x2": 80, "y2": 50})).unwrap()["id"].clone();
run(&mut s, "select.set", serde_json::json!({"ids": [square, line]})).unwrap();
let error = run(&mut s, "object.pathfinder.intersect", serde_json::json!({})).unwrap_err().to_string();
assert!(error.contains("Outline Stroke"), "{error}");
for code in COMPLETE_MESSAGES {
let lang = Lang::from_code(code).expect("registered");
assert_ne!(message(lang, warning), warning, "{code}");
assert!(!message(lang, &error).contains("encloses no area"), "{code}: {error}");
}
}
/// The errors of saving, renaming and deleting a tracing preset are translated in every language
/// that translates every message.
#[test]
+2
View File
@@ -5009,6 +5009,8 @@ liquify-list-end {0}, {1} {0} ve {1}
@msg {label}: lost track of a shape's style {label}: şeklin stilinin izini kaybettirdi
@msg {label}: select paths {label}: yolları seç
@msg {label}: select paths, compound paths, groups or text {label}: yolları, bileşik yolları, grupları veya metni seçin
@msg a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first alan çevrelemeyen bir çizgi veya başka bir açık yol sonucu değiştirmez; dahil etmek için önce ona Nesne › Yol › Anahat Konturu uygulayın
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} boş bir sonuç üretti: bir çizgi veya başka bir açık yol alan çevrelemiyor; dahil etmek için önce ona Nesne › Yol › Anahat Konturu uygulayın
@msg {label}… {label}…
@msg {name}: CRC mismatch {name}: CRC uyumsuzluğu
@msg {name}: no local header {name}: yerel başlık yok
Can't render this file because it is too large.
+2
View File
@@ -5302,6 +5302,8 @@ liquify-list-end {0}, {1} {0} і {1}
@msg {label}: lost track of a shape's style {label}: втрачено стиль фігури
@msg {label}: select paths {label}: виділіть контури
@msg {label}: select paths, compound paths, groups or text {label}: виділіть контури, складені контури, групи або текст
@msg a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first лінія чи інший відкритий контур, що не охоплює площі, не змінює результату; щоб включити його, спершу застосуйте до нього Об’єкт › Контур › Обвести обведення
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} дав порожній результат: лінія чи інший відкритий контур не охоплює площі; щоб включити його, спершу застосуйте до нього Об’єкт › Контур › Обвести обведення
@msg {label}… {label}…
@msg {name}: CRC mismatch {name}: розбіжність CRC
@msg {name}: no local header {name}: немає локального заголовка
Can't render this file because it is too large.
+2
View File
@@ -5887,6 +5887,8 @@ liquify-list-end {0}, {1} {0} và {1}
@msg {label}: lost track of a shape's style {label}: mất dấu kiểu của hình dạng
@msg {label}: select paths {label}: hãy chọn đường dẫn
@msg {label}: select paths, compound paths, groups or text {label}: hãy chọn đường dẫn, đường dẫn phức, nhóm hoặc văn bản
@msg a line or other open path that encloses no area does not change the result; 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 làm thay đổi kết quả; để đư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ó
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} tạo ra kết quả trống: một đường thẳng hoặc đường dẫn mở khác không bao quanh vùng nào; để đư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ó
@msg {label}… {label}…
@msg {name}: CRC mismatch {name}: CRC không khớp
@msg {name}: no local header {name}: không có tiêu đề cục bộ
Can't render this file because it contains an unexpected character in line 205 and column 5.
+2
View File
@@ -4471,6 +4471,8 @@ imageTrace Outline 轮廓
@msg {label}: lost track of a shape's style {label}:丢失了某个形状的样式
@msg {label}: select paths {label}:请选择路径
@msg {label}: select paths, compound paths, groups or text {label}:请选择路径、复合路径、编组或文字
@msg a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first 直线或其他不围成区域的开放路径不会改变结果;要包含它,请先对其应用“对象 › 路径 › 轮廓化描边”
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} 生成了空结果:直线或其他开放路径不围成区域;要包含它,请先对其应用“对象 › 路径 › 轮廓化描边”
@msg already editing a pattern 已在编辑图案
@msg no pattern `{name}` 没有图案 `{name}`
@msg not in pattern editing mode 不在图案编辑模式中
Can't render this file because it is too large.
+2
View File
@@ -2100,6 +2100,8 @@ file-filter Templates 範本
@msg {label}: lost track of a shape's style {label}:遺失了某個形狀的樣式
@msg {label}: select paths {label}:請選取路徑
@msg {label}: select paths, compound paths, groups or text {label}:請選取路徑、複合路徑、群組或文字
@msg a line or other open path that encloses no area does not change the result; to include it, apply Object › Path › Outline Stroke to it first 直線或其他不圍成區域的開放路徑不會改變結果;若要納入,請先對其套用「物件 › 路徑 › 外框筆畫」
@msg {label} produced an empty result: a line or other open path encloses no area; to include it, apply Object › Path › Outline Stroke to it first {label} 產生了空的結果:直線或其他開放路徑不圍成區域;若要納入,請先對其套用「物件 › 路徑 › 外框筆畫」
@msg already editing a pattern 已在編輯圖樣
@msg no pattern `{name}` 沒有圖樣 `{name}`
@msg not in pattern editing mode 不在圖樣編輯模式中
Can't render this file because it is too large.
+4 -1
View File
@@ -5250,7 +5250,10 @@ anchors that don't change a result's shape off it, and `removeUnpainted` makes D
of objects with no fill (or only hidden fills). Both default to false; `{}` reads the options. Each Shape Mode and
Pathfinder command (`object.pathfinder.unite` … `minusBack`) also takes `precision`, `removeRedundantPoints` and
`removeUnpainted` for one run; the values it used join its journal entry, so a replay or an action gives the same art
whatever the options are then.
whatever the options are then. Unite, Minus Front, Intersect, Exclude and Minus Back close open paths, so a straight
line encloses no area and does not change the result. When a selected object is or holds such a path, the reply's
`warning` says so and names Object › Path › Outline Stroke. When such a path leaves the result empty (Intersect, or a
line at the back in Minus Front), the error says so too.
```json
{"name":"run_command","arguments":{"command":"object.pathfinder.options","params":{"precision":0.1,"removeUnpainted":true}}}