Document Settings: design units (document.units: mm, cm, m, in, ft; values keep their meaning) from the browser's Units row, display precision row; new designs take the preferred units; the Properties window shows lengths, areas and volumes in the design's units with the chosen precision
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
1 parent
c99e7e41ec
commit
13070abc55
6 files changed
+127
-17
No files matched your search
@@ -402,3 +402,17 @@ fn named_views_save_restore_rename_and_delete() {
|
||||
context_menu::run_item(&mut app, &find(&top, "Restore"), pos2(0.0, 0.0));
|
||||
assert!(app.cam_anim.is_some());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn units_menu_changes_the_design_units_and_new_designs_take_the_preference() {
|
||||
let mut app = sample_app();
|
||||
let items = context_menu::items(&app, &Target::Units);
|
||||
assert_eq!(items.len(), 5);
|
||||
act(&mut app, &Target::Units, "in");
|
||||
assert_eq!(app.session.doc.units, "in");
|
||||
assert!(crate::prefs::show_mm(&app, 25.4, 1).starts_with("1.00 in"));
|
||||
app.preferences.default_units = "cm".into();
|
||||
crate::documents::new_design(&mut app);
|
||||
assert_eq!(app.session.doc.units, "cm");
|
||||
assert!(!app.session.is_dirty(), "a fresh design stays unmodified");
|
||||
}
|
||||
Reference in new issue
Block a user