Render route-D preview pages at page size

This commit is contained in:
gloamxun committed 2026-10-20 21:16:45 +08:00
1 parent 875f8a7600
commit fab9a473fc
1 file changed
+4 -1
+4 -1
View File
@@ -51,7 +51,10 @@ pub fn preview_json(source: &str) -> Result<String, String> {
json.push_str("{\"status\":\"ok\",\"pageWidthMm\":215.90,\"pageHeightMm\":279.40,\"pages\":[");
let mut page_count = 0usize;
for page in engine.pages() {
let svg = page.display_list().to_svg();
let mut list = page.display_list();
list.width = list.width.max(612 * SCALE);
list.height = list.height.max(PAGE_HEIGHT_PT * SCALE);
let svg = list.to_svg();
if page_count > 0 {
json.push(',');
}