forked from 1b-agent/opencadstudio-upstream
feat(properties): audit editable vs read-only across all entities
Reclassify every property row to match standard palette behaviour: a row is editable only when its value maps directly to a stored field AND its apply_geom_prop handler is wired; computed/derived/count/handle/ cross-object values stay read-only. Newly editable (all apply-wired): attribute tag/prompt; ellipse major radius; hatch Double; lwpolyline closed/linetype-gen; mline style; multileader annotative/landing/background-fill; polyline 2D+3D vertex coords/segment widths/linetype-gen; shape style; spline control/fit point coords, weight, fit tolerance, tangents; table break-option flags; text alignment point, upside-down, backward; underlay display flags. Corrections: spline Degree -> read-only (editing desynced the knot vector); removed a duplicate leader "Arrowhead" row. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
35468004e6
commit
4d2471cafd
13 files changed
+464
-143
No files matched your search
+36
-11
@@ -7,7 +7,7 @@ use crate::entities::common::{
|
||||
};
|
||||
use crate::entities::traits::TruckConvertible;
|
||||
use crate::scene::convert::acad_to_truck::{TruckEntity, TruckObject};
|
||||
use crate::scene::model::object::{GripApply, GripDef, PropSection};
|
||||
use crate::scene::model::object::{GripApply, GripDef, PropSection, PropValue, Property};
|
||||
use crate::scene::model::wire_model::TangentGeom;
|
||||
|
||||
const TAU: f64 = std::f64::consts::TAU;
|
||||
@@ -344,22 +344,47 @@ fn properties(pline: &LwPolyline) -> Vec<PropSection> {
|
||||
PropSection {
|
||||
title: "Misc".into(),
|
||||
props: vec![
|
||||
ro(
|
||||
"Closed",
|
||||
"closed",
|
||||
if pline.is_closed { "Yes" } else { "No" },
|
||||
),
|
||||
ro(
|
||||
"Linetype generation",
|
||||
"plinegen",
|
||||
if pline.plinegen { "Yes" } else { "No" },
|
||||
),
|
||||
Property {
|
||||
label: "Closed".into(),
|
||||
field: "closed",
|
||||
value: PropValue::BoolToggle {
|
||||
field: "closed",
|
||||
value: pline.is_closed,
|
||||
},
|
||||
},
|
||||
Property {
|
||||
label: "Linetype generation".into(),
|
||||
field: "plinegen",
|
||||
value: PropValue::BoolToggle {
|
||||
field: "plinegen",
|
||||
value: pline.plinegen,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
fn apply_geom_prop(pline: &mut LwPolyline, field: &str, value: &str) {
|
||||
match field {
|
||||
"closed" => {
|
||||
pline.is_closed = if value == "toggle" {
|
||||
!pline.is_closed
|
||||
} else {
|
||||
value == "true"
|
||||
};
|
||||
return;
|
||||
}
|
||||
"plinegen" => {
|
||||
pline.plinegen = if value == "toggle" {
|
||||
!pline.plinegen
|
||||
} else {
|
||||
value == "true"
|
||||
};
|
||||
return;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
let Some(v) = parse_f64(value) else {
|
||||
return;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user