From fad7b16d5fa20299714687eebb21f3e80bd48480 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Fri, 1 May 2026 10:52:25 +0300 Subject: [PATCH] fix: correct PageSetup paper size when layout origin is non-zero paper_limits() can return a non-zero origin (e.g. when min_limits has negative margin values). PageSetup was using x1/y1 directly instead of (x1-x0)/(y1-y0), giving wrong dimensions in those cases. Co-Authored-By: Claude Sonnet 4.6 --- src/app/update.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/update.rs b/src/app/update.rs index 1bb846c9f..d3f296ad4 100644 --- a/src/app/update.rs +++ b/src/app/update.rs @@ -2668,8 +2668,8 @@ impl H7CAD { Message::PageSetupOpen => { let i = self.active_tab; // Populate edit buffers from current paper limits. - let (w, h) = if let Some(((_, _), (x1, y1))) = self.tabs[i].scene.paper_limits() { - (x1, y1) + let (w, h) = if let Some(((x0, y0), (x1, y1))) = self.tabs[i].scene.paper_limits() { + (x1 - x0, y1 - y0) } else { (297.0, 210.0) // A4 default };