forked from 1b-agent/opencadstudio-upstream
fix(hatch): sync color from entity in synced_hatch_models
Color was read from the stale HatchModel cache instead of the live entity, so property-panel color changes appeared on boundaries (wire) but not on the hatch fill pattern. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
ca07268c7c
commit
4b5f4c7ee8
1 file changed
+20
-19
+20
-19
@@ -1864,27 +1864,28 @@ impl Scene {
|
||||
&& self.belongs_to_visible_block(handle, c.owner_handle, layout_block)
|
||||
})
|
||||
.map(|(&handle, model)| {
|
||||
let mut m = if let Some(EntityType::Hatch(dxf)) = self.document.get_entity(handle) {
|
||||
let mut m = model.clone();
|
||||
match &mut m.pattern {
|
||||
hatch_model::HatchPattern::Pattern(_) => {
|
||||
m.angle_offset = dxf.pattern_angle as f32;
|
||||
let anno = if self.current_layout == "Model" {
|
||||
self.annotation_scale
|
||||
} else {
|
||||
1.0
|
||||
};
|
||||
m.scale = dxf.pattern_scale as f32 * anno;
|
||||
let entity = self.document.get_entity(handle);
|
||||
let mut m = model.clone();
|
||||
if let Some(e) = entity {
|
||||
m.color = self.render_style(e).0;
|
||||
if let EntityType::Hatch(dxf) = e {
|
||||
match &mut m.pattern {
|
||||
hatch_model::HatchPattern::Pattern(_) => {
|
||||
m.angle_offset = dxf.pattern_angle as f32;
|
||||
let anno = if self.current_layout == "Model" {
|
||||
self.annotation_scale
|
||||
} else {
|
||||
1.0
|
||||
};
|
||||
m.scale = dxf.pattern_scale as f32 * anno;
|
||||
}
|
||||
hatch_model::HatchPattern::Gradient { angle_deg, .. } => {
|
||||
*angle_deg = dxf.pattern_angle.to_degrees() as f32;
|
||||
}
|
||||
hatch_model::HatchPattern::Solid => {}
|
||||
}
|
||||
hatch_model::HatchPattern::Gradient { angle_deg, .. } => {
|
||||
*angle_deg = dxf.pattern_angle.to_degrees() as f32;
|
||||
}
|
||||
hatch_model::HatchPattern::Solid => {}
|
||||
}
|
||||
m
|
||||
} else {
|
||||
model.clone()
|
||||
};
|
||||
}
|
||||
if self.selected.contains(&handle) {
|
||||
m.color = [0.15, 0.55, 1.00, m.color[3]];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user