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:
parent
57357aaa12
commit
faa135a7a1
2 changed files with 6 additions and 4 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
|
@ -74,7 +74,7 @@ checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "acadrust"
|
name = "acadrust"
|
||||||
version = "0.4.0"
|
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 = [
|
dependencies = [
|
||||||
"ahash 0.8.12",
|
"ahash 0.8.12",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|
@ -3180,7 +3180,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0b577e2d69827c4740cba2b52efaad1c4cc7c73042860b199710b3575c68438d"
|
checksum = "0b577e2d69827c4740cba2b52efaad1c4cc7c73042860b199710b3575c68438d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytecount",
|
"bytecount",
|
||||||
"memchr 2.8.3",
|
"memchr 1.0.2",
|
||||||
"nom 8.0.0",
|
"nom 8.0.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -361,7 +361,7 @@ fn text_box_geom(ml: &MultiLeader) -> ([f64; 2], [f64; 3]) {
|
||||||
ctx.text_flow_direction,
|
ctx.text_flow_direction,
|
||||||
acadrust::entities::multileader::FlowDirectionType::Vertical
|
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::Left => 0.0,
|
||||||
acadrust::entities::multileader::TextAttachmentPointType::Center => 0.5,
|
acadrust::entities::multileader::TextAttachmentPointType::Center => 0.5,
|
||||||
acadrust::entities::multileader::TextAttachmentPointType::Right => 1.0,
|
acadrust::entities::multileader::TextAttachmentPointType::Right => 1.0,
|
||||||
|
|
@ -1673,7 +1673,9 @@ impl MultiLeaderTess for MultiLeader {
|
||||||
use acadrust::entities::multileader::{
|
use acadrust::entities::multileader::{
|
||||||
TextAttachmentDirectionType, TextAttachmentPointType,
|
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::Left => 0.0,
|
||||||
TextAttachmentPointType::Center => 0.5,
|
TextAttachmentPointType::Center => 0.5,
|
||||||
TextAttachmentPointType::Right => 1.0,
|
TextAttachmentPointType::Right => 1.0,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue