LibGfx+LibWeb: Add some extra fields to glyph run data

We currently have a mixup in LibWeb between code unit offset and glyph
offset during hit testing. These extra fields will allow us to correct
this discrepency.
This commit is contained in:
Timothy Flynn 2025-08-19 13:33:45 -04:00 committed by Andreas Kling
commit 047f521c4c
Notes: github-actions[bot] 2025-08-22 12:08:06 +00:00
3 changed files with 33 additions and 8 deletions

View file

@ -395,7 +395,10 @@ void InlineFormattingContext::generate_line_boxes()
glyphs.remove(last_glyph_index - 1, remove_item_count);
glyphs.append(Gfx::DrawGlyph {
.position = last_glyph_position,
.glyph_id = glyph_run->font().glyph_id_for_code_point(ellipsis_codepoint) });
.length_in_code_units = AK::UnicodeUtils::code_unit_length_for_code_point(ellipsis_codepoint),
.glyph_width = glyph_run->font().glyph_width(ellipsis_codepoint),
.glyph_id = glyph_run->font().glyph_id_for_code_point(ellipsis_codepoint),
});
}
}
}