From 3f0353326bb6adb17e57504aa69708737ec37ab1 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 26 Nov 2026 22:24:03 -0800 Subject: [PATCH] Tests: build the flattener test's Save PDF job with its drawing `SavePdfJob` gained a private `document` field in #9549, and the Transparency Flattener dialog test added in #9692 builds the job as a struct literal without it, so `vectorcraft-ui-egui`'s tests no longer compile on main (flatten.rs:480, "cannot construct `SavePdfJob` with struct literal syntax due to private fields"). Each pull request passed its own CI before the other merged. The field is now `pub(crate)` like the job's other fields, and the test takes the drawing from the active document, as the Save PDF dialog does when it opens. --- crates/ui-egui/src/dialogs/flatten.rs | 2 ++ crates/ui-egui/src/dialogs/save_pdf.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/dialogs/flatten.rs b/crates/ui-egui/src/dialogs/flatten.rs index e39c8e8bdf..92ee610e3b 100644 --- a/crates/ui-egui/src/dialogs/flatten.rs +++ b/crates/ui-egui/src/dialogs/flatten.rs @@ -477,7 +477,9 @@ mod tests { }); fixture.room(egui::vec2(880.0, 720.0)); let ctx = fixture.ctx().clone(); + let document = app.borrow().session.active().unwrap().uid; let mut job = SavePdfJob { + document, path: None, save_mode: None, flattener: Some(FlattenOptions { line_art_ppi: 611.0, ..FlattenOptions::default() }), diff --git a/crates/ui-egui/src/dialogs/save_pdf.rs b/crates/ui-egui/src/dialogs/save_pdf.rs index b03cf32bcd..506ef94fce 100644 --- a/crates/ui-egui/src/dialogs/save_pdf.rs +++ b/crates/ui-egui/src/dialogs/save_pdf.rs @@ -38,7 +38,7 @@ const WRONG_DOCUMENT: &str = "Return to the original drawing to save the PDF or /// What the Save PDF dialog was opened for; the preset editor has none. pub(crate) struct SavePdfJob { /// The drawing this job reads and writes. - document: u64, + pub(crate) document: u64, /// The file the PDF goes to; none: the write asks. pub(crate) path: Option, /// The save command (`file.saveAs`, `file.saveCopy`) this PDF finishes; none: a plain PDF copy.