forked from 1b-agent/opencadstudio-upstream
Complete jogged radius dimension workflow
This commit is contained in:
1 parent
bbd58eb9f2
commit
5a9894fd3e
11 files changed
+664
-85
No files matched your search
+23
-16
@@ -1030,22 +1030,19 @@ impl OpenCADStudio {
|
||||
if !dim_style_names.is_empty() {
|
||||
// Current style is already shown as text in the geom section;
|
||||
// replace/upgrade it to a Choice if we have a list.
|
||||
if let Some(geom) = sections.last_mut() {
|
||||
// Replace the style name with a choice.
|
||||
if let Some(prop) =
|
||||
geom.props.iter_mut().find(|p| p.field == "style_name")
|
||||
{
|
||||
let current = match &prop.value {
|
||||
crate::scene::model::object::PropValue::PlainText(s) => {
|
||||
s.clone()
|
||||
}
|
||||
_ => String::new(),
|
||||
};
|
||||
prop.value = crate::scene::model::object::PropValue::Choice {
|
||||
selected: current,
|
||||
options: dim_style_names,
|
||||
};
|
||||
}
|
||||
if let Some(prop) = sections
|
||||
.iter_mut()
|
||||
.flat_map(|section| section.props.iter_mut())
|
||||
.find(|property| property.field == "style_name")
|
||||
{
|
||||
let current = match &prop.value {
|
||||
crate::scene::model::object::PropValue::PlainText(s) => s.clone(),
|
||||
_ => String::new(),
|
||||
};
|
||||
prop.value = crate::scene::model::object::PropValue::Choice {
|
||||
selected: current,
|
||||
options: dim_style_names,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1065,6 +1062,16 @@ impl OpenCADStudio {
|
||||
&self.tabs[i].scene.document,
|
||||
));
|
||||
|
||||
if matches!(d, acadrust::entities::Dimension::LargeRadial(_)) {
|
||||
if let Some(index) = sections
|
||||
.iter()
|
||||
.position(|section| section.title == t!("Misc").as_ref())
|
||||
{
|
||||
let misc = sections.remove(index);
|
||||
sections.push(misc);
|
||||
}
|
||||
}
|
||||
|
||||
// Prefer entity-level dimension-variable overrides;
|
||||
// fall back to the assigned style values.
|
||||
use crate::entities::dim_override as dov;
|
||||
|
||||
Reference in new issue
Block a user