mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:07:45 +00:00
Revert "LibGfx: Remove bogus baseline adjustment in Painter's draw_text_line()"
This reverts commit 2b2915656d
.
While this adjustment is bogus, it is currently responsible for putting
CenterLeft aligned scalable text in the right position.
This is going to take a bunch of work to get right.
This commit is contained in:
parent
2b2915656d
commit
5c5e4b5ae5
1 changed files with 5 additions and 0 deletions
|
@ -1365,6 +1365,11 @@ void draw_text_line(IntRect const& a_rect, Utf8View const& text, Font const& fon
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
if (is_vertically_centered_text_alignment(alignment)) {
|
||||
int distance_from_baseline_to_bottom = (font.pixel_size() - 1) - font.baseline();
|
||||
rect.translate_by(0, distance_from_baseline_to_bottom / 2);
|
||||
}
|
||||
|
||||
auto point = rect.location();
|
||||
int space_width = font.glyph_width(' ') + font.glyph_spacing();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue