Track mixed paper and viewport dimension references

This commit is contained in:
Christopher Overbeck committed 2026-09-15 16:00:11 -05:00
1 parent bd00d679a9
commit 5424a19482
28 files changed
+823 -846

No files matched your search

+4 -8
View File
@@ -255,12 +255,9 @@ pub fn set_on_entity(entity: &mut EntityType, code: i16, value: Option<XDataValu
}
let legacy = common.extended_data.get_record("ACAD_DSTYLE").is_some()
&& common
.extended_data
.get_record("ACAD")
.is_some_and(|rec| {
!matches!(rec.values.first(), Some(XDataValue::String(n)) if n == "DSTYLE")
});
&& common.extended_data.get_record("ACAD").is_some_and(
|rec| !matches!(rec.values.first(), Some(XDataValue::String(n)) if n == "DSTYLE"),
);
let app = if legacy { "ACAD_DSTYLE" } else { "ACAD" };
let values = if kept.is_empty() {
@@ -281,8 +278,7 @@ pub fn set_on_entity(entity: &mut EntityType, code: i16, value: Option<XDataValu
let mut rebuilt = ExtendedData::new();
for record in common.extended_data.records() {
if record.application_name != app
&& !(!legacy && record.application_name == "ACAD_DSTYLE")
if record.application_name != app && !(!legacy && record.application_name == "ACAD_DSTYLE")
{
rebuilt.add_record(record.clone());
}
+10 -6
View File
@@ -1638,11 +1638,12 @@ pub(crate) fn dimension_in_paper_space(dimension: &Dimension, document: &CadDocu
if !owner.is_valid() {
return false;
}
document.objects.values().any(|object| matches!(object,
acadrust::objects::ObjectType::Layout(layout)
if layout.name != "Model" && layout.block_record == owner
))
document.objects.values().any(|object| {
matches!(object,
acadrust::objects::ObjectType::Layout(layout)
if layout.name != "Model" && layout.block_record == owner
)
})
}
/// The value a dimension's text reports for its measurement: the raw
@@ -1654,7 +1655,10 @@ pub(crate) fn dimension_in_paper_space(dimension: &Dimension, document: &CadDocu
/// use when they want the number the user reads.
pub(crate) fn displayed_measurement(dimension: &Dimension, style: Option<&DimStyle>) -> f64 {
let raw = dimension.measurement();
if matches!(dimension, Dimension::Angular2Ln(_) | Dimension::Angular3Pt(_)) {
if matches!(
dimension,
Dimension::Angular2Ln(_) | Dimension::Angular3Pt(_)
) {
return raw;
}
let lfac = style.map(|s| s.dimlfac).unwrap_or(1.0);