fix(model): respect typed height on cylinder and primitive creation

This commit is contained in:
Karim Jerbi committed 2026-10-05 13:23:25 +01:00
1 parent fc19afa715
commit c35b902f3a
2 files changed
+109 -6

No files matched your search

+20 -5
View File
@@ -2866,8 +2866,6 @@ impl CadCommand for PrimitiveCommand {
ConeStep::BaseCenter
| ConeStep::BaseRadius
| ConeStep::EllipseFirst
| ConeStep::Height
| ConeStep::HeightAfterTopRadius
);
}
if self.shape == Shape::Pyramid {
@@ -2875,17 +2873,34 @@ impl CadCommand for PrimitiveCommand {
self.pyramid_step,
PyramidStep::BaseCenter
| PyramidStep::BaseRadius
| PyramidStep::Height
| PyramidStep::HeightAfterTopRadius
);
}
self.shape.rectangular()
&& matches!(
self.box_step,
BoxStep::FirstCorner | BoxStep::OppositeCorner | BoxStep::Height
BoxStep::FirstCorner | BoxStep::OppositeCorner
)
}
fn dyn_commit_as_text(&self) -> bool {
if self.shape == Shape::Cone {
return matches!(
self.cone_step,
ConeStep::Height | ConeStep::HeightAfterTopRadius
);
}
if self.shape == Shape::Pyramid {
return matches!(
self.pyramid_step,
PyramidStep::Height | PyramidStep::HeightAfterTopRadius
);
}
if self.shape.rectangular() {
return matches!(self.box_step, BoxStep::Height);
}
self.height_step
}
fn on_text_input(&mut self, raw: &str) -> Option<CmdResult> {
if self.shape == Shape::Sphere {
let token = raw.trim();