forked from 1b-agent/opencadstudio-upstream
fix(grid): remove implicit drawing limits
This commit is contained in:
1 parent
cd1378e6b2
commit
ad736e20ea
4 files changed
+26
-4
No files matched your search
Generated
+2
-2
@@ -78,7 +78,7 @@ checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618"
|
||||
[[package]]
|
||||
name = "acadrust"
|
||||
version = "0.4.0"
|
||||
source = "git+https://github.com/OpenAEC-Foundation/acadifc.git?rev=a66b0d9#a66b0d994c052e446fd0d6168bef9ec2b2aceed8"
|
||||
source = "git+https://github.com/OpenAEC-Foundation/acadifc.git?rev=5a2069a#5a2069a7abe6b440fbd3bbacb4dfff8555f082c9"
|
||||
dependencies = [
|
||||
"ahash 0.8.12",
|
||||
"anyhow",
|
||||
@@ -3259,7 +3259,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b577e2d69827c4740cba2b52efaad1c4cc7c73042860b199710b3575c68438d"
|
||||
dependencies = [
|
||||
"bytecount",
|
||||
"memchr 2.8.3",
|
||||
"memchr 1.0.2",
|
||||
"nom 8.0.0",
|
||||
]
|
||||
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ windows-sys = { version = "0.61", features = ["Win32_UI_Shell", "Win32_UI_Window
|
||||
|
||||
[patch.crates-io]
|
||||
# Track standard DWG object relationships used by the scene integration.
|
||||
acadrust = { git = "https://github.com/OpenAEC-Foundation/acadifc.git", rev = "a66b0d9" }
|
||||
acadrust = { git = "https://github.com/OpenAEC-Foundation/acadifc.git", rev = "5a2069a" }
|
||||
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||
# Native enables the plugin host runtime (out-of-process plugins).
|
||||
|
||||
+1
-1
@@ -438,7 +438,7 @@ impl DocumentTab {
|
||||
pub(super) fn new_drawing(n: usize) -> Self {
|
||||
let mut scene = Scene::new();
|
||||
linetypes::populate_document(&mut scene.document);
|
||||
// Override acadrust's imperial default limits (12×9) with A4 landscape.
|
||||
// Paper layouts start as A4 landscape.
|
||||
for obj in scene.document.objects.values_mut() {
|
||||
if let acadrust::objects::ObjectType::Layout(l) = obj {
|
||||
if l.name != "Model" {
|
||||
|
||||
@@ -1589,6 +1589,28 @@ fn draw_grid(
|
||||
}
|
||||
}
|
||||
draw_segments(frame, &segments);
|
||||
|
||||
// LIMITS bounds the grid, not the UCS axes. Size the axes from the
|
||||
// visible grid plane so X/Y/Z still span the viewport even when the
|
||||
// finite grid rectangle is small or currently off-screen.
|
||||
let axis_extent = samples.iter().fold(0.0_f32, |extent, (_, world)| {
|
||||
let delta = (*world - grid_origin).as_vec3();
|
||||
extent
|
||||
.max(delta.dot(axis1).abs())
|
||||
.max(delta.dot(axis2).abs())
|
||||
});
|
||||
if axis_extent > 0.0 {
|
||||
let extent = (axis_extent + s) * 1.5;
|
||||
draw_axes(
|
||||
frame,
|
||||
view_rot,
|
||||
eye,
|
||||
bounds,
|
||||
extent.max(10.0),
|
||||
grid_origin,
|
||||
(gx, gy, gz),
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user