From ad736e20eab13649288f984ca63580eebc97a9ad Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Wed, 29 Jul 2026 17:21:57 +0300 Subject: [PATCH] fix(grid): remove implicit drawing limits --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- src/app/document.rs | 2 +- src/ui/overlay.rs | 22 ++++++++++++++++++++++ 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d7a56a630..609c6bfd9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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", ] diff --git a/Cargo.toml b/Cargo.toml index 86f4d77a5..9dc1aaeb5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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). diff --git a/src/app/document.rs b/src/app/document.rs index 157a5b8ac..27cd29802 100644 --- a/src/app/document.rs +++ b/src/app/document.rs @@ -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" { diff --git a/src/ui/overlay.rs b/src/ui/overlay.rs index 31e31b279..a300ef590 100644 --- a/src/ui/overlay.rs +++ b/src/ui/overlay.rs @@ -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; }