fix: set A4 landscape limits on initial Layout1 at document creation
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 <noreply@anthropic.com>
This commit is contained in:
parent
f63858876d
commit
578dd51af4
1 changed files with 11 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue