feat(props): uniform-scale checkbox for block references
A selected INSERT's Geometry section gains a "Uniform scale" box (#427): while the three factors are equal it is checked and the panel shows a single Scale row that writes all three axes; unchecking expands the familiar Scale X/Y/Z rows without touching the values (remembered per entity), and re-checking collapses Y/Z onto X as an undoable CHPROP step. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
d154a01cb4
commit
8821bb7131
4 changed files with 82 additions and 0 deletions
|
|
@ -2622,6 +2622,32 @@ impl OpenCADStudio {
|
|||
crate::scene::view::dispatch::toggle_invisible(entity);
|
||||
}
|
||||
}
|
||||
// Uniform-scale checkbox on a block reference
|
||||
// (#427): checking collapses Y/Z onto X; unchecking
|
||||
// only switches the panel to per-axis rows.
|
||||
"ins_uniform" => {
|
||||
let scales = match self.tabs[i].scene.document.get_entity(handle) {
|
||||
Some(acadrust::EntityType::Insert(ins)) => {
|
||||
Some((ins.x_scale(), ins.y_scale(), ins.z_scale()))
|
||||
}
|
||||
_ => None,
|
||||
};
|
||||
let Some((sx, sy, sz)) = scales else { continue };
|
||||
let eq = (sx - sy).abs() < 1e-12 && (sx - sz).abs() < 1e-12;
|
||||
let checked =
|
||||
eq && !self.props_asym_scale.contains(&handle.value());
|
||||
if checked {
|
||||
self.props_asym_scale.insert(handle.value());
|
||||
} else {
|
||||
self.props_asym_scale.remove(&handle.value());
|
||||
if let Some(acadrust::EntityType::Insert(ins)) =
|
||||
self.tabs[i].scene.document.get_entity_mut(handle)
|
||||
{
|
||||
ins.set_y_scale(sx);
|
||||
ins.set_z_scale(sx);
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
if let Some(entity) =
|
||||
self.tabs[i].scene.document.get_entity_mut(handle)
|
||||
|
|
|
|||
Loading…
Reference in a new issue