A new empty design takes Units of new designs (#1283)

The empty design shown at launch, New on a design that is still empty, file.new and the blank design left when the last tab closes all take the Units of new designs preference. Opened files and the sample part keep their own units. Fixes #1205.

Co-authored-by: raythurman2386 <raythurman2386@users.noreply.github.com>
This commit is contained in:
Raymond Thurmanandraythurman2386 authored and GitHub committed 2026-10-15 01:20:02 -04:00
1 parent 7391e8ed75
commit af2f09fac2
5 files changed
+74 -6

No files matched your search

+2
View File
@@ -516,6 +516,8 @@ pub fn apply(app: &mut SolveApp, ctx: &egui::Context) {
}
/// A new, empty design takes the preferred units (not an undo step, not a change to save).
/// Callers: a launch with no file, New on a design that is already empty, `file.new`, and the
/// blank design left when the last tab closes. A design that already has features is unchanged.
pub fn apply_new_design(app: &mut SolveApp) {
if app.session.doc.features.is_empty() && app.session.doc.units != app.preferences.default_units {
let saved = !app.session.is_dirty();