forked from 1b-agent/opencadstudio-upstream
Feat: Phase 5 — MLine, Tolerance render; DimStyle Choice picker on dimensions
- mline.rs: MLine renders center spine + two parallel offset lines at ±scale/2 using the vertex miter directions; vertex grips; scale, closed and style-name properties - tolerance.rs: Tolerance renders the GDT text string via font tessellation at insertion_point with rotation from direction vector; insertion grip and position properties - properties.rs: Dimension entity's style_name EditText is upgraded to a Choice dropdown when document.dim_styles is non-empty, enabling point-and-click DimStyle assignment without a separate panel Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
1 parent
27c0e74468
commit
dafa079b6a
5 files changed
+335
No files matched your search
@@ -103,6 +103,32 @@ impl H7CAD {
|
||||
}
|
||||
}
|
||||
|
||||
// Inject DimStyle picker for Dimension entities.
|
||||
if let acadrust::EntityType::Dimension(_) = entity {
|
||||
let dim_style_names: Vec<String> = self.tabs[i].scene.document.dim_styles
|
||||
.iter()
|
||||
.map(|s| s.name.clone())
|
||||
.filter(|n| !n.is_empty())
|
||||
.collect();
|
||||
if !dim_style_names.is_empty() {
|
||||
// Current style is already shown as EditText in the geom section;
|
||||
// replace/upgrade it to a Choice if we have a list.
|
||||
if let Some(geom) = sections.last_mut() {
|
||||
// Find and replace the style_name EditText with a Choice.
|
||||
if let Some(prop) = geom.props.iter_mut().find(|p| p.field == "style_name") {
|
||||
let current = match &prop.value {
|
||||
crate::scene::object::PropValue::EditText(s) => s.clone(),
|
||||
_ => String::new(),
|
||||
};
|
||||
prop.value = crate::scene::object::PropValue::Choice {
|
||||
selected: current,
|
||||
options: dim_style_names,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !group_names.is_empty() {
|
||||
let label = group_names.join(", ");
|
||||
if let Some(general) = sections.first_mut() {
|
||||
|
||||
Reference in new issue
Block a user