Frames: state-following ribbon list, DWF/DGN frames, image frame encoding and profile, frame-only picking

- The Frames list shows the drawing's frame state (hide / display and plot /
  display but not plot / frames vary), follows commands, undo and document
  switches, and lists the mixed state as a disabled item.
- DWFFRAME and DGNFRAME are frame variables of their own, kept in the header,
  and FRAME sets them with the others.
- Out-of-range frame values say "Requires an integer between 0 and 2." and
  ask again; a set value reports "Regenerating model.".
- IMAGEFRAME is stored in the image variables as bits (2 is written as 3) and
  a drawing without them uses the profile value, which setting IMAGEFRAME
  updates and the settings file keeps.
- Raster images, PDF underlays and wipeouts are picked on their frame only;
  underlay snap geometry is never picked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ramox81andClaude Opus 5.5 committed 2026-09-28 10:53:53 +03:00
1 parent 801882314f
commit 7f8f8457c7
72 files changed
+451 -65

No files matched your search

+2
View File
@@ -614,6 +614,7 @@ impl OpenCADStudio {
right_click_mode: self.right_click_mode,
right_click_hold_ms: self.right_click_hold_ms,
grip_object_limit: self.grip_object_limit,
image_frame: crate::scene::frame::profile_image_mode(),
ncopy_bind: self.ncopy_bind,
cursor_type: self.cursor_type,
crosshair_color: self.crosshair_color,
@@ -698,6 +699,7 @@ impl OpenCADStudio {
self.right_click_mode = s.right_click_mode;
self.right_click_hold_ms = super::super::settings::clamp_right_click_hold_ms(s.right_click_hold_ms);
self.grip_object_limit = s.grip_object_limit.clamp(0, 32767);
crate::scene::frame::set_profile_image_mode(s.image_frame);
self.ncopy_bind = s.ncopy_bind;
self.cursor_type = s.cursor_type;
self.crosshair_color = s.crosshair_color;
+17
View File
@@ -326,9 +326,26 @@ impl OpenCADStudio {
if self.tabs.get(self.active_tab).map(|tab| tab.id) != before {
self.sync_underlay_tab();
}
self.sync_frame_dropdown();
task
}
/// The Frames list on the ribbon shows the active drawing's frame state
/// (FRAME), however it was changed: the list, a command, undo or another
/// drawing.
fn sync_frame_dropdown(&mut self) {
let Some(tab) = self.tabs.get(self.active_tab).filter(|tab| !tab.is_start) else {
return;
};
let current = match crate::scene::frame::master_mode(&tab.scene.document) {
0 => "FRAMES0",
1 => "FRAMES1",
2 => "FRAMES2",
_ => "FRAMES3",
};
self.ribbon.set_dropdown_current("FRAMES_DROPDOWN", current);
}
fn update_message(&mut self, msg: Message) -> Task<Message> {
if let Some(tab) = self.tabs.get(self.active_tab) {
crate::entities::common::set_unit_context(
+1
View File
@@ -2726,6 +2726,7 @@ impl OpenCADStudio {
world_width: 0.0,
depth_override: None,
display_visible: true,
snap_only: false,
plot_visible: true,
fill_is_3d: false,
fill_is_2d_solid: false,