forked from 1b-agent/opencadstudio-upstream
fix: make viewports from external DXF/DWG files visible and enterable
Two root causes prevented paper-space viewports from loading correctly: 1. acadrust's ViewportStatusFlags::from_bits() maps bit 0 → is_on, but the real DXF/DWG spec uses bit 15 (0x8000) for "viewport on". Post-load fixup in io/mod.rs now corrects this for both DXF and DWG files: when bit 0 is clear but bit 15 is set, is_on is forced true and locked is derived from bit 14 (0x4000). 2. Some DXF exporters write id=-1 for all viewport entities instead of the standard id=1 (sheet) / id≥2 (user) convention. The is_user_viewport_id() helper now treats any id ≠ 0 and ≠ 1 as a user viewport, covering both the standard id≥2 and the non-standard id=-1 cases. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
1 parent
00e61a1301
commit
66a73b00e1
3 files changed
+50
-11
No files matched your search
+1
-1
@@ -1696,7 +1696,7 @@ impl H7CAD {
|
||||
if let Some(AcadEntityType::Viewport(vp)) =
|
||||
self.tabs[i].scene.document.get_entity(h)
|
||||
{
|
||||
if vp.id > 1 { Some(h) } else { None }
|
||||
if Scene::is_user_viewport_id(vp.id) { Some(h) } else { None }
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user