Layouts: a viewport on first opening (LAYOUTCREATEVIEWPORT)

A layout opened for the first time - one whose sheet viewport had to be
made, or one created in this session - gets a viewport centred on the
printable area, 0.8 of its width and height, zoomed to the model's
extents, while LAYOUTCREATEVIEWPORT is on. The profile variable takes
ON/OFF or 1/0 and is kept with the settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ramox81andClaude Opus 5.5 committed 2026-10-13 11:09:03 +03:00
1 parent 5d0390bcdf
commit e3a0ff1bad
9 files changed
+117 -14

No files matched your search

+4
View File
@@ -24,6 +24,7 @@ impl Scene {
/// cached layout-name list is invalidated on insert.
pub fn add_layout(&mut self, name: &str) -> codec::Result<Handle> {
let handle = self.document.add_layout(name)?;
self.unopened_layouts.insert(name.to_string());
self.bump_layout_epoch();
Ok(handle)
}
@@ -34,6 +35,9 @@ impl Scene {
if let ObjectType::Layout(l) = obj {
if l.name == old_name {
l.name = new_name.to_string();
if self.unopened_layouts.remove(old_name) {
self.unopened_layouts.insert(new_name.to_string());
}
self.bump_layout_epoch();
return;
}