Skip to content

Commit 725b7fc

Browse files
committed
Keep section_index in Glyph to maintain support for MarkdownLabel
1 parent 80d664f commit 725b7fc

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

crates/epaint/src/text/text_layout.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -666,9 +666,11 @@ fn galley_from_rows(
666666
num_indices += row.visuals.mesh.indices.len();
667667

668668
row.section_index_at_start = u32::MAX; // No longer in use.
669-
for glyph in &mut row.glyphs {
670-
glyph.section_index = u32::MAX; // No longer in use.
671-
}
669+
670+
// MEMBRANE: Keep these values since we use them to render Markdown
671+
// for glyph in &mut row.glyphs {
672+
// glyph.section_index = u32::MAX; // No longer in use.
673+
// }
672674
}
673675

674676
let mut galley = Galley {

crates/epaint/src/text/text_layout_types.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,8 @@ pub struct Glyph {
677677
/// Only used during layout, then set to an invalid value in order to
678678
/// enable the paragraph-concat optimization path without having to
679679
/// adjust `section_index` when concatting.
680-
pub(crate) section_index: u32,
680+
/// MEMBRANE: Keep these values since we use them to render Markdown
681+
pub section_index: u32,
681682
}
682683

683684
impl Glyph {

0 commit comments

Comments
 (0)