fix(annotation): apply object context scaling

This commit is contained in:
Hakan Seven 2026-08-02 03:02:11 +03:00
commit 5909540ebf
4 changed files with 103 additions and 9 deletions

View file

@ -361,6 +361,20 @@ pub(crate) fn tessellate_entity(
let e = contextual.as_ref();
let h = e.common().handle;
let sel = selected.contains(&h);
// Per-object annotation contexts store each representation relative to the
// native/default scale. Resolve that ratio once before TEXT/MTEXT,
// DIMENSION, and MULTILEADER reach their independent tessellation paths.
let anno_scale = if matches!(
e,
EntityType::Text(_)
| EntityType::MText(_)
| EntityType::Dimension(_)
| EntityType::MultiLeader(_)
) {
crate::scene::annotative::effective_annotation_scale(document, e, anno_scale)
} else {
anno_scale
};
// Frustum + LOD cull for non-Insert, non-Viewport entities. Insert is
// handled separately (its WCS bbox depends on the block defn AABB ×

View file

@ -156,11 +156,8 @@ pub fn tessellate(
// oversized text). Annotative-ness is resolved centrally from the entity's
// per-object context, legacy XDATA, or annotative style (see
// `scene::annotative::is_annotative`) so the bake and the panel agree.
let anno_scale = if crate::scene::annotative::is_annotative(document, entity) {
anno_scale
} else {
1.0
};
let anno_scale =
crate::scene::annotative::effective_annotation_scale(document, entity, anno_scale);
// A HATCH is drawn as a fill by the hatch pipeline and highlighted via a
// fill tint when selected (issue #71), so it carries no boundary outline in