From 2720aca3625a2dbbf84a7ba0e7d298f5d0492401 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 13 Nov 2026 19:39:30 -0800 Subject: [PATCH] Tests: the hover-notes test takes its second note from a brushed knockout group The PDF exporter no longer warns about a plain knockout group, so the test's second note now comes from a knockout group whose soft masks would draw a brushed stroke, and the test checks for that note. --- crates/ui-egui/src/io.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/io.rs b/crates/ui-egui/src/io.rs index 83f463d668..1896ad134e 100644 --- a/crates/ui-egui/src/io.rs +++ b/crates/ui-egui/src/io.rs @@ -171,14 +171,20 @@ mod tests { app.run("file.save", json!({"path": "/out/b.vectorcraft"})).unwrap(); assert_eq!((app.ui.status.as_str(), &app.ui.status_notes), ("Saved /out/b.vectorcraft", &None)); - // A PDF export of a knockout group and of type in a font that isn't installed. + // A PDF export of a knockout group whose soft masks would draw a brushed stroke, and of type + // in a font that isn't installed. app.run("text.create", json!({"x": 5, "y": 20, "text": "Ab", "font": "Nonexistent Sans Probe"})).unwrap(); - app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 30, "height": 20})).unwrap(); + let lower = app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 30, "height": 20})).unwrap()["id"].clone(); + let upper = app.run("shape.rectangle", json!({"x": 25, "y": 15, "width": 30, "height": 20})).unwrap()["id"].clone(); + app.run("brush.apply", json!({"ids": [upper], "name": "3 pt. Round"})).unwrap(); + app.run("object.setProps", json!({"ids": [lower, upper], "opacity": 50, "knockoutShape": true})).unwrap(); + app.run("select.set", json!({"ids": [lower, upper]})).unwrap(); app.run("object.group", json!({})).unwrap(); app.run("transparency.set", json!({"knockout": "on"})).unwrap(); let r = export(&mut app, Some("pdf"), Some("/out/c.pdf".into()), &json!({})).unwrap(); let notes = notes_of(&r); assert_eq!(notes.len(), 2, "{r}"); + assert!(notes.iter().any(|n| n.contains("brushed strokes")), "{r}"); assert_eq!(app.ui.status, exported_with_notes("/out/c.pdf", notes.len(), ¬es[0])); assert_eq!(app.ui.status_notes, Some((app.ui.status.clone(), notes))); }