mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-29 01:34:29 +01:00
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.
This commit is contained in:
1 parent
97da102592
commit
3f0353326b
2 files changed
+3
-1
No files matched your search
@@ -477,7 +477,9 @@ mod tests {
|
|||||||
});
|
});
|
||||||
fixture.room(egui::vec2(880.0, 720.0));
|
fixture.room(egui::vec2(880.0, 720.0));
|
||||||
let ctx = fixture.ctx().clone();
|
let ctx = fixture.ctx().clone();
|
||||||
|
let document = app.borrow().session.active().unwrap().uid;
|
||||||
let mut job = SavePdfJob {
|
let mut job = SavePdfJob {
|
||||||
|
document,
|
||||||
path: None,
|
path: None,
|
||||||
save_mode: None,
|
save_mode: None,
|
||||||
flattener: Some(FlattenOptions { line_art_ppi: 611.0, ..FlattenOptions::default() }),
|
flattener: Some(FlattenOptions { line_art_ppi: 611.0, ..FlattenOptions::default() }),
|
||||||
|
|||||||
@@ -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.
|
/// What the Save PDF dialog was opened for; the preset editor has none.
|
||||||
pub(crate) struct SavePdfJob {
|
pub(crate) struct SavePdfJob {
|
||||||
/// The drawing this job reads and writes.
|
/// The drawing this job reads and writes.
|
||||||
document: u64,
|
pub(crate) document: u64,
|
||||||
/// The file the PDF goes to; none: the write asks.
|
/// The file the PDF goes to; none: the write asks.
|
||||||
pub(crate) path: Option<String>,
|
pub(crate) path: Option<String>,
|
||||||
/// The save command (`file.saveAs`, `file.saveCopy`) this PDF finishes; none: a plain PDF copy.
|
/// The save command (`file.saveAs`, `file.saveCopy`) this PDF finishes; none: a plain PDF copy.
|
||||||
|
|||||||
Reference in new issue
Block a user