mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09:43 +00:00
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:
parent
2b7b7d4d23
commit
16e883a9a3
Notes:
github-actions[bot]
2025-04-21 07:52:47 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 16e883a9a3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4409
2 changed files with 2 additions and 2 deletions
|
@ -59,7 +59,7 @@ RefPtr<GlyphRun> shape_text(FloatPoint baseline_start, float letter_spacing, Utf
|
||||||
point.translate_by(letter_spacing, 0);
|
point.translate_by(letter_spacing, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto run = adopt_ref(*new Gfx::GlyphRun(move(glyph_run), font, text_type, point.x()));
|
auto run = adopt_ref(*new Gfx::GlyphRun(move(glyph_run), font, text_type, point.x() - baseline_start.x()));
|
||||||
hb_buffer_reset(buffer);
|
hb_buffer_reset(buffer);
|
||||||
return run;
|
return run;
|
||||||
}
|
}
|
||||||
|
|
|
@ -554,7 +554,7 @@ Optional<InlineLevelIterator::Item> InlineLevelIterator::next_without_lookahead(
|
||||||
auto shape_features = create_and_merge_font_features();
|
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);
|
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.
|
// NOTE: We never consider `content: ""` to be collapsible whitespace.
|
||||||
bool is_generated_empty_string = text_node.is_generated() && chunk.length == 0;
|
bool is_generated_empty_string = text_node.is_generated() && chunk.length == 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue