Layouts: first opening follows the page setup; viewports picked by their frame

- A layout opens for the first time when its page setup was never
  initialized (no paper size, no media name) or it was created in this
  session; its page setup is initialized then, and with
  LAYOUTCREATEVIEWPORT it gets its first viewport. A layout never opened
  is saved with an uninitialized page setup and no viewports, so it gets
  its viewport when the file is opened again, here or in the reference.
- Select Viewport for view: a viewport is selected when the pick box
  (PICKBOX pixels at the sheet's zoom) touches its frame; a pick well
  inside or outside selects nothing and the prompt repeats.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
ramox81andClaude Opus 5.5 committed 2026-10-13 12:02:26 +03:00
1 parent 006be8909e
commit c55dbb886e
7 files changed
+88 -6

No files matched your search

+6
View File
@@ -80,6 +80,12 @@ impl OpenCADStudio {
visual_styles: visual_styles.into_iter().map(|(name, _)| name).collect(),
live_sections: live_sections.into_iter().map(|(name, _)| name).collect(),
sheet_viewports,
// PICKBOX pixels in sheet units, at the sheet camera's zoom.
sheet_pick_tolerance: {
let height = scene.camera.borrow().ortho_size() as f64 * 2.0;
let (_, pixels) = scene.selection.borrow().view.vp_size;
f64::from(self.pick_box) * height / f64::from(pixels).max(1.0)
},
}
}
+1
View File
@@ -6538,6 +6538,7 @@ properties={:.1}ms picked={}",
.as_ref()
.map(|style| style.name.clone())
.unwrap_or_default();
self.tabs[i].scene.new_layout_plot_style = plot_style.clone();
for obj in self.tabs[i].scene.document.objects.values_mut() {
if let codec::objects::ObjectType::Layout(l) = obj {
if l.name == new_name {