diff --git a/src/app/mtext_editor.rs b/src/app/mtext_editor.rs index d7ee0d8c6..16ae076f9 100644 --- a/src/app/mtext_editor.rs +++ b/src/app/mtext_editor.rs @@ -364,6 +364,18 @@ impl super::OpenCADStudio { } _ => {} } + } else { + // New MText inherits the document's current text style (STYLE), + // not the "Standard" default. See #92. + let cur_style = self.tabs[self.active_tab] + .scene + .document + .header + .current_text_style_name + .clone(); + if !cur_style.trim().is_empty() { + state.style = cur_style; + } } self.mtext_editor = Some(state); self.rebuild_mtext_preview(); diff --git a/src/app/properties.rs b/src/app/properties.rs index 8eef3bde2..064a496f0 100644 --- a/src/app/properties.rs +++ b/src/app/properties.rs @@ -541,6 +541,23 @@ impl OpenCADStudio { entity.common_mut().linetype_scale = celtscale; } + // A new dimension inherits the document's current dimension style + // (DIMSTYLE) instead of staying at the entity "Standard" default. Only + // fill in when still at the default so an explicitly-styled dimension + // is preserved. See #92. + if let acadrust::EntityType::Dimension(ref mut d) = entity { + let cur = self.tabs[i] + .scene + .document + .header + .current_dimstyle_name + .clone(); + let s = d.base().style_name.clone(); + if (s.is_empty() || s.eq_ignore_ascii_case("Standard")) && !cur.is_empty() { + d.base_mut().style_name = cur; + } + } + // Commands pick points in local space (camera coordinates with world_offset // already subtracted). Re-add world_offset so the entity lands at the correct // DXF coordinate. Skip for paper-space entities (they use sheet mm coords). diff --git a/src/app/text_inline.rs b/src/app/text_inline.rs index 5420f738e..949a0df2c 100644 --- a/src/app/text_inline.rs +++ b/src/app/text_inline.rs @@ -190,11 +190,22 @@ impl super::OpenCADStudio { self.tabs[i].scene.bump_geometry(); self.tabs[i].dirty = true; } else { - let t = Text::with_value( + let mut t = Text::with_value( &ed.value, Vector3::new(ed.pos.x as f64, ed.pos.y as f64, ed.pos.z as f64), ) .with_height(ed.height); + // New text inherits the document's current text style (STYLE), not + // the entity default. See #92. + let cur_style = self.tabs[i] + .scene + .document + .header + .current_text_style_name + .clone(); + if !cur_style.is_empty() { + t.style = cur_style; + } self.push_undo_snapshot(i, "TEXT"); self.commit_entity(EntityType::Text(t)); self.tabs[i].dirty = true;