forked from 1b-agent/opencadstudio-upstream
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 <noreply@anthropic.com>
This commit is contained in:
1 parent
fcf1b96fdf
commit
773365a1b9
2 files changed
+2
-3
No files matched your search
@@ -2254,6 +2254,7 @@ impl OpenCADStudio {
|
||||
}
|
||||
}
|
||||
CmdResult::CommitDimensionsAndExit(dimensions) => {
|
||||
self.clear_dimension_accepted_snaps();
|
||||
let association_mode = self.tabs[i]
|
||||
.scene
|
||||
.document
|
||||
|
||||
@@ -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:?}"
|
||||
|
||||
Reference in new issue
Block a user