From 0658601c41dd38f7019f049f59c8ad3ca3f651f0 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Sat, 18 Jul 2026 17:57:23 +0300 Subject: [PATCH] fix(block): render constant attributes; bump acadrust for multiline attrs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A CONSTANT ATTDEF has no per-insert ATTRIB — its value belongs to the block itself — so block expansion must draw it instead of skipping every ATTDEF. Non-constant templates are still skipped (the insert supplies their ATTRIB). Also bumps acadrust to decode the embedded MTEXT of R2018 multiline attributes, so a value like "A\PB" renders both lines. Co-Authored-By: Claude Opus 4.8 --- Cargo.lock | 2 +- src/scene/cache/block_cache.rs | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 025188582..080d3fcc5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -73,7 +73,7 @@ checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" [[package]] name = "acadrust" version = "0.4.0" -source = "git+https://github.com/OpenAEC-Foundation/acadifc?branch=main#eb691c931bf06aade25bf94823d0ed444c952b08" +source = "git+https://github.com/OpenAEC-Foundation/acadifc?branch=main#7c106c2f6512530571ffcfad6a5fcfbbcc45d677" dependencies = [ "ahash 0.8.12", "anyhow", diff --git a/src/scene/cache/block_cache.rs b/src/scene/cache/block_cache.rs index eb5549728..07cf549c8 100644 --- a/src/scene/cache/block_cache.rs +++ b/src/scene/cache/block_cache.rs @@ -312,9 +312,15 @@ fn build_defn( continue; } match entity { - EntityType::Block(_) - | EntityType::BlockEnd(_) - | EntityType::AttributeDefinition(_) => continue, + EntityType::Block(_) | EntityType::BlockEnd(_) => continue, + // A non-constant ATTDEF is only a template — the insert supplies an + // ATTRIB with the real value (tessellated separately). A CONSTANT + // attribute has no ATTRIB; its value lives in the block itself, so + // it must render as part of the block content (unless flagged + // invisible). + EntityType::AttributeDefinition(ad) if !ad.flags.constant || ad.flags.invisible => { + continue + } EntityType::Insert(nested_ins) => { subs.push(LocalSub::Nested(build_nested_ref(nested_ins, doc, bg_color))); }