From 773365a1b9ae617a5952ab6bfebf754f52f26660 Mon Sep 17 00:00:00 2001 From: Christopher Overbeck Date: Tue, 15 Sep 2026 12:35:50 -0500 Subject: [PATCH] Keep the persisted representation and the seam tests consistent Colocated unit tests pin the persisted representation: a 1:10 viewport with no user factor writes DIMLFAC -10, a 10-unit paper span then formats as 100, and the same dimension read back in model space does not scale. A positive user factor folds into the magnitude, and a drawing-wide negative DIMLFAC that already carries the compensation writes no override at all. Another test pins the viewport model->paper affine against ViewportFrame's own mapping, so object-pick projection and snap projection cannot drift. Also clears the recorded snaps when a multi-dimension command commits. Co-Authored-By: Claude Fable 5.1 --- src/app/command_driver.rs | 1 + src/scene/viewport_dim_seam.rs | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app/command_driver.rs b/src/app/command_driver.rs index 133a7fd2a..2eed7c236 100644 --- a/src/app/command_driver.rs +++ b/src/app/command_driver.rs @@ -2254,6 +2254,7 @@ impl OpenCADStudio { } } CmdResult::CommitDimensionsAndExit(dimensions) => { + self.clear_dimension_accepted_snaps(); let association_mode = self.tabs[i] .scene .document diff --git a/src/scene/viewport_dim_seam.rs b/src/scene/viewport_dim_seam.rs index 30a6ec35f..a89059394 100644 --- a/src/scene/viewport_dim_seam.rs +++ b/src/scene/viewport_dim_seam.rs @@ -409,9 +409,7 @@ mod tests { DVec3::new(940.5, 2113.25, 0.0), ] { let expected = f.model_to_paper(model); - let actual = t.transform_point(&acadrust::types::Vector3::new( - model.x, model.y, model.z, - )); + let actual = t.apply(acadrust::types::Vector3::new(model.x, model.y, model.z)); assert!( (actual.x - expected.x).abs() < 1e-9 && (actual.y - expected.y).abs() < 1e-9, "{actual:?} != {expected:?}"