mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-15 07:10:13 +00:00
.ai import: pen-samples test checks a brushed path after the samples
The check that pen samples mark only the object before them used an unbrushed filled rectangle as the following object. A style with no brush ignores the samples, so the check passed even when the samples marked every later object. The following object is now an unsampled path with the same pen-varying Calligraphic brush, and the test asserts that it comes in as a path stroked with that brush.
This commit is contained in:
@@ -10329,11 +10329,14 @@ fn a_brushed_path_with_samples_of_the_pen_keeps_its_drawn_look() {
|
||||
assert_eq!(a.len(), 1, "{a:#?}");
|
||||
assert!(matches!(a[0].kind, NodeKind::Group { .. }), "the drawn look: {a:#?}");
|
||||
assert!(r.warnings.iter().any(|w| w.contains("drawn look")), "{:?}", r.warnings);
|
||||
// The samples belong to the path before them: a path after them is read as it was.
|
||||
let after = format!("{path}{RED}{}f\n", rect_path(0.0, 0.0, 10.0, 10.0));
|
||||
// The samples belong to the path before them: a path after them with the same brush and no
|
||||
// samples of its own comes in brushed.
|
||||
let after = format!("{path}{}", brushed_path());
|
||||
let a = art(&read_ok(&format!("{def}{style}{}", layer(&after))).doc);
|
||||
assert_eq!(a.len(), 2, "{a:#?}");
|
||||
assert!(matches!(a[1].kind, NodeKind::Path { .. }) && a[1].appearance.fill().is_some(), "{a:#?}");
|
||||
assert!(matches!(a[0].kind, NodeKind::Group { .. }), "the sampled path's drawn look: {a:#?}");
|
||||
assert!(matches!(a[1].kind, NodeKind::Path { .. }), "the path after the samples, brushed: {a:#?}");
|
||||
assert_eq!(a[1].appearance.stroke().and_then(|s| s.brush.as_deref()), Some("Six D"), "{a:#?}");
|
||||
// Samples with no object before them in the layer mark nothing: the path after them is read.
|
||||
let first = format!("{PEN_SAMPLES}{}", brushed_path());
|
||||
let a = art(&read_ok(&format!("{def}{style}{}", layer(&first))).doc);
|
||||
|
||||
Reference in New Issue
Block a user