fix: resolve ByBlock color, linetype, and lineweight through INSERT chain

Block sub-entities with ByBlock color now inherit their INSERT's resolved
color instead of rendering as the default white. ByBlock linetype inherits
the INSERT's linetype pattern, and ByBlock lineweight inherits the INSERT's
effective line weight.

Implemented via render_style_for_block_sub(), called in tessellate_entity()
when expanding INSERT exploded entities.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Sonnet 4.6 committed 2026-04-26 22:07:24 +03:00
1 parent 464bb8905f
commit 045ab96eab
2 files changed
+43 -2

No files matched your search

+7 -1
View File
@@ -2630,6 +2630,9 @@ fn tessellate_entity(
if let EntityType::Insert(ins) = e {
let is_mirrored = ins.x_scale() * ins.y_scale() < 0.0;
// Resolve the INSERT's own style so ByBlock sub-entities can inherit it.
let (ins_color, ins_pat_len, ins_pat, ins_lw_px, _) =
render::render_style_for(document, e);
return ins
.explode_from_document(document)
.iter()
@@ -2638,7 +2641,10 @@ fn tessellate_entity(
.map(|sub| crate::modules::home::modify::explode::fix_mirrored_arc(sub, is_mirrored))
.flat_map(|sub| {
let (sub_color, sub_pattern_length, sub_pattern, sub_line_weight_px, sub_aci) =
render::render_style_for(document, &sub);
render::render_style_for_block_sub(
document, &sub,
ins_color, ins_pat_len, ins_pat, ins_lw_px,
);
let sub_aabb = entity_aabb(&sub);
let mut wire = tessellate::tessellate(
document,