fix(mleader): read the attachment anchor from the annotation context

The horizontal attachment point was read from the entity-level field,
which only exists from R2010 on; older records (R2007 and earlier) left
it at the default and centre/right-attached leaders shifted. The
annotation context carries the same value in every version, so anchor
from there for both the render and the width-grip geometry.

acadrust bump also brings: the R2007 MULTILEADER tail gating (leaders no
longer render upside-down), the R2004-R2006 inline SAB payload read, the
v1-SAT wireframe point_present decode (3D solids/regions land in place
on R2000/R2004), and the XCLIPFRAME default of 2 so clip-frame borders
draw on files whose header omits the variable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Fable 5 committed 2026-07-23 08:15:51 +03:00
1 parent 57357aaa12
commit faa135a7a1
2 files changed
+6 -4

No files matched your search

Generated
+2 -2
View File
@@ -74,7 +74,7 @@ checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618"
[[package]]
name = "acadrust"
version = "0.4.0"
source = "git+https://github.com/OpenAEC-Foundation/acadifc?branch=main#1497d7ab8be725e0bed84ce31e85fa20646ddc51"
source = "git+https://github.com/OpenAEC-Foundation/acadifc?branch=main#45bba7d04cdb602b8e20aef714b5d5b0fa0f50b1"
dependencies = [
"ahash 0.8.12",
"anyhow",
@@ -3180,7 +3180,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b577e2d69827c4740cba2b52efaad1c4cc7c73042860b199710b3575c68438d"
dependencies = [
"bytecount",
"memchr 2.8.3",
"memchr 1.0.2",
"nom 8.0.0",
]
+4 -2
View File
@@ -361,7 +361,7 @@ fn text_box_geom(ml: &MultiLeader) -> ([f64; 2], [f64; 3]) {
ctx.text_flow_direction,
acadrust::entities::multileader::FlowDirectionType::Vertical
);
let h_anchor: f32 = match ml.text_attachment_point {
let h_anchor: f32 = match ctx.text_attachment_point {
acadrust::entities::multileader::TextAttachmentPointType::Left => 0.0,
acadrust::entities::multileader::TextAttachmentPointType::Center => 0.5,
acadrust::entities::multileader::TextAttachmentPointType::Right => 1.0,
@@ -1673,7 +1673,9 @@ impl MultiLeaderTess for MultiLeader {
use acadrust::entities::multileader::{
TextAttachmentDirectionType, TextAttachmentPointType,
};
let h_anchor: f32 = match ml.text_attachment_point {
// The context's attachment point exists in every DWG version;
// the entity-level copy only exists from R2010 on.
let h_anchor: f32 = match ctx.text_attachment_point {
TextAttachmentPointType::Left => 0.0,
TextAttachmentPointType::Center => 0.5,
TextAttachmentPointType::Right => 1.0,