forked from 1b-agent/opencadstudio-upstream
Cargo: codec aad7053, kernel 1a52eaf, graph 263de59; honour viewport clipping
Brings codec PRs #84 (cross-version visual styles, table styles, subentity managers), #88 (viewport clipping flag, DXF boundary handle), #89 (DXF viewport snap/twist in degrees) and #92 (field format codes, event updates). With #88 a viewport keeps a stored boundary whether or not clipping is on, so a linked boundary alone no longer means "clipped": rendering, paper picking, VPCLIP and the Clipped property check the clipping flag too, and VPCLIP / MVIEW Object and Polygon set it. Before, OCS never set the flag, so its clipped viewports opened rectangular elsewhere. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2dfa9f3f2a
commit
81bb8d48cf
12 files changed
+32
-19
No files matched your search
@@ -90,6 +90,7 @@ impl OpenCADStudio {
|
||||
let mut vp = vp;
|
||||
if clip.is_null() {
|
||||
vp.clip_boundary_handle = Handle::NULL;
|
||||
vp.status.non_rectangular_clipping = false;
|
||||
} else {
|
||||
let (lo, hi) = clip_boundary_extents(scene, clip)
|
||||
.map(|(lo, hi)| (glam::DVec2::from(lo), glam::DVec2::from(hi)))
|
||||
@@ -117,6 +118,7 @@ impl OpenCADStudio {
|
||||
vp.height = hi.y - lo.y;
|
||||
vp.view_height = vp.height * scale;
|
||||
vp.clip_boundary_handle = clip;
|
||||
vp.status.non_rectangular_clipping = true;
|
||||
if let Some(entity) = scene.document.get_entity_mut(clip) {
|
||||
let common = entity.common_mut();
|
||||
if !common.reactors.contains(&viewport) {
|
||||
@@ -228,6 +230,7 @@ impl OpenCADStudio {
|
||||
viewport.height = max_y - min_y;
|
||||
viewport.id = 2;
|
||||
viewport.clip_boundary_handle = clip_handle;
|
||||
viewport.status.non_rectangular_clipping = !clip_handle.is_null();
|
||||
let viewport_handle = self.commit_entity_handle(codec::EntityType::Viewport(viewport));
|
||||
if let Some(viewport_handle) = viewport_handle {
|
||||
if !created_boundary {
|
||||
|
||||
Reference in new issue
Block a user