From 578dd51af404d56e45646c673534cfc6f0bae7fd Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Thu, 23 Apr 2026 14:23:38 +0300 Subject: [PATCH] fix: set A4 landscape limits on initial Layout1 at document creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit acadrust initialises every Layout with 12×9 imperial defaults; override all non-Model layouts to 297×210mm in new_drawing() so the first paper tab opens at A4 size, consistent with layouts added later. Co-Authored-By: Claude Sonnet 4.6 --- src/app/document.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/app/document.rs b/src/app/document.rs index f980d8bc1..743ead477 100644 --- a/src/app/document.rs +++ b/src/app/document.rs @@ -48,6 +48,17 @@ impl DocumentTab { pub(super) fn new_drawing(n: usize) -> Self { let mut scene = Scene::new(); linetypes::populate_document(&mut scene.document); + // Override acadrust's imperial default limits (12×9) with A4 landscape. + for obj in scene.document.objects.values_mut() { + if let acadrust::objects::ObjectType::Layout(l) = obj { + if l.name != "Model" { + l.min_limits = (0.0, 0.0); + l.max_limits = (297.0, 210.0); + l.min_extents = (0.0, 0.0, 0.0); + l.max_extents = (297.0, 210.0, 0.0); + } + } + } Self { scene, current_path: None,