fix: correct hatch geometry workflow

This commit is contained in:
Hakan Seven committed 2026-08-21 20:52:03 +03:00
1 parent f83037271c
commit 4bc02b6b4a
11 files changed
+401 -255

No files matched your search

+11 -7
View File
@@ -3490,23 +3490,27 @@ impl OpenCADStudio {
.unwrap_or(false)
{
if let Some(model) = self.tabs[i].scene.hatches.get(&handle).cloned() {
let annotative = self.tabs[i]
.scene
.document
.get_entity(handle)
.is_some_and(|entity| {
let entity = self.tabs[i].scene.document.get_entity(handle);
let annotative = entity.is_some_and(|entity| {
crate::scene::annotative::is_annotative(
&self.tabs[i].scene.document,
entity,
)
});
let (scale, angle) = match entity {
Some(acadrust::EntityType::Hatch(hatch)) => (
hatch.pattern_scale as f32,
hatch.pattern_angle.to_degrees() as f32,
),
_ => (model.scale, model.angle_offset.to_degrees()),
};
use crate::command::CadCommand;
use crate::modules::draw::draw::hatchedit::HatcheditCommand;
let cmd: Box<dyn CadCommand> = Box::new(HatcheditCommand::with_handle(
handle,
model.name.clone(),
model.scale,
model.angle_offset.to_degrees(),
scale,
angle,
annotative,
));
self.command_line.push_info(&cmd.prompt());