summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-07-12 19:52:43 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-07-12 19:54:10 +0200
commit6e671f78a82bc3d9785bd35307cec72a84b6dcda (patch)
treeaf8150664b1e620b7ef6875fbab348b6c0edf891
parent33466aba65ec8b1970077d9c7f7e8e928e07170c (diff)
downloadserenity-6e671f78a82bc3d9785bd35307cec72a84b6dcda.zip
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.
-rw-r--r--SharedGraphics/Painter.cpp2
1 files changed, 1 insertions, 1 deletions
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);