From 75ddab6da74a6c71a64eebaf4e79b890efe4c572 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Tue, 7 Jul 2026 08:24:11 +0300 Subject: [PATCH] feat(text): bypass the greek/baseline LOD ladder for SDF text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With OCS_TEXT_SDF on, top-level text took the full path only at ≥5 px and still drew greeked OBB rects / baseline lines when zoomed out — doubling with the SDF glyphs. Force the text LOD height to None while SDF is on so text always falls through to the full path, which is itself suppressed to an empty snap-only wire; SDF then renders it crisply at every zoom. (Block-internal text is unaffected — it is not collected for SDF, so its wire/greek path stays.) Verified in-app: zoomed-out SDF text stays crisp with no greek/baseline double draw. Flag off: unchanged. Co-Authored-By: Claude Opus 4.8 --- src/scene/convert/tess.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/scene/convert/tess.rs b/src/scene/convert/tess.rs index 7847aa0ec..4ed3e2514 100644 --- a/src/scene/convert/tess.rs +++ b/src/scene/convert/tess.rs @@ -613,6 +613,14 @@ pub(crate) fn tessellate_entity( } _ => None, }; + // SDF text renders crisply at every zoom, so bypass the baseline/greek + // LOD ladder entirely — fall through to the full path, which is itself + // suppressed to an empty (snap-only) wire while SDF is on. + let text_height = if crate::scene::text::sdf_atlas::sdf_text_enabled() { + None + } else { + text_height + }; if let Some(h_world) = text_height { let h_px = (h_world as f32) / wpp; // Wrap-expanded line count for MText (Text = 1).