PDF/EPS export: EPS export and PostScript printing expand pattern tile images once

EPS export expanded the pattern fills whose tile images need flattening and
then flattened the result with flatten_document, which expanded them again
with a new object limit. PostScript printing did the same, on the layers
shown rather than the layers that print. EPS export now flattens the
expanded document without expanding it again (flatten_expanded), and
PostScript printing leaves the expansion to the flattener, which runs on
the layers that print, and only checks for such pattern fills to warn.
This commit is contained in:
dotCooCoo
2026-11-01 00:35:23 +07:00
committed by bflatastic
parent e2fddc6b12
commit a32a7cbb0d
5 changed files with 36 additions and 19 deletions
+9
View File
@@ -820,6 +820,15 @@ fn flattening_that_keeps_colorize_leaves_colorized_pattern_tile_images_alone() {
assert!(crate::cmd::flatten::flatten_document(d, &o).unwrap().is_none(), "the pattern isn't expanded for a colorize paint alone");
}
/// EPS export expands pattern tile images once: flattening the expanded
/// document leaves the patterns the expansion kept, past its object limit, as they are.
#[test]
fn flattening_an_expanded_document_does_not_expand_patterns_again() {
let s = colorized_pattern_over_blue();
let d = &s.doc().unwrap().doc;
assert!(crate::cmd::flatten::flatten_expanded(d, &crate::cmd::FlattenOptions::default()).unwrap().is_none());
}
#[test]
fn eps_flattens_colorized_image_in_a_see_through_pattern_tile_group_and_warns() {
let mut s = colorized_pattern_over_blue();