1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:17:44 +00:00

LibGfx: Move underline closer to text in draw_ui_text()

This commit is contained in:
Andreas Kling 2021-04-05 23:15:09 +02:00
parent 516868e197
commit 6d8ca9871c

View file

@ -1840,7 +1840,7 @@ void Gfx::Painter::draw_ui_text(const StringView& text, const Gfx::IntRect& rect
int width = 0;
for (auto it = utf8_view.begin(); it != utf8_view.end(); ++it) {
if (utf8_view.byte_offset_of(it) >= underline_offset.value()) {
int y = text_rect.bottom() + 2;
int y = text_rect.bottom() + 1;
int x1 = text_rect.left() + width;
int x2 = x1 + font.glyph_or_emoji_width(*it);
draw_line({ x1, y }, { x2, y }, Color::Black);