Fill the page background with pagecolor

This commit is contained in:
gloamxun committed 2026-10-26 02:31:50 +08:00
1 parent 4cb456743a
commit 1ab2a29bfa
6 files changed
+56 -5

No files matched your search

+11
View File
@@ -512,6 +512,16 @@ fn page_content(
origin: PageOrigin,
) -> String {
let mut content = String::from("q\n0 0 0 rg\n");
if let Some(DisplayItem::Background(color)) = list.items.first() {
content.push_str(&format!(
"{:.3} {:.3} {:.3} rg\n0 0 {} {} re f\n0 0 0 rg\n",
color[0] as f64 / 255.0,
color[1] as f64 / 255.0,
color[2] as f64 / 255.0,
pt(list.width),
pt(height)
));
}
if origin != PageOrigin::default() {
content.push_str(&format!(
"1 0 0 1 {} {} cm\n",
@@ -562,6 +572,7 @@ fn page_content(
operand
));
}
DisplayItem::Background(_) => {}
DisplayItem::Rule {
x,
y,