forked from 1b-agent/opencadstudio-upstream
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 <noreply@anthropic.com>
This commit is contained in:
1 parent
3298ebff91
commit
fad7b16d5f
1 file changed
+2
-2
+2
-2
@@ -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
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user