LibGfx+LibWeb: Don't include start.x in GlyphRun width

For some reason we were including x offset of start position into glyph
run width. This is not correct and would be revealed by the upcoming
changes.
This commit is contained in:
Aliaksandr Kalenik 2025-04-19 23:36:03 +02:00 committed by Andreas Kling
commit 16e883a9a3
Notes: github-actions[bot] 2025-04-21 07:52:47 +00:00
2 changed files with 2 additions and 2 deletions

View file

@ -554,7 +554,7 @@ Optional<InlineLevelIterator::Item> InlineLevelIterator::next_without_lookahead(
auto shape_features = create_and_merge_font_features();
auto glyph_run = Gfx::shape_text({ x, 0 }, letter_spacing.to_float(), chunk.view, chunk.font, text_type, shape_features);
CSSPixels chunk_width = CSSPixels::nearest_value_for(glyph_run->width());
CSSPixels chunk_width = CSSPixels::nearest_value_for(glyph_run->width() + x);
// NOTE: We never consider `content: ""` to be collapsible whitespace.
bool is_generated_empty_string = text_node.is_generated() && chunk.length == 0;