From 6e671f78a82bc3d9785bd35307cec72a84b6dcda Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 12 Jul 2019 19:52:43 +0200 Subject: [PATCH] Painter: Don't add line spacing after the very last line in draw_text(). This means that single-line draw_text() calls don't get any additional line spacing added. Which makes things look right. --- SharedGraphics/Painter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharedGraphics/Painter.cpp b/SharedGraphics/Painter.cpp index 4001876f41..0676d47da3 100644 --- a/SharedGraphics/Painter.cpp +++ b/SharedGraphics/Painter.cpp @@ -640,7 +640,7 @@ void Painter::draw_text(const Rect& rect, const StringView& text, const Font& fo static const int line_spacing = 4; int line_height = font.glyph_height() + line_spacing; - Rect bounding_rect { 0, 0, 0, lines.size() * line_height }; + Rect bounding_rect { 0, 0, 0, (lines.size() * line_height) - line_spacing }; for (auto& line : lines) { auto line_width = font.width(line);