mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:28:11 +00:00
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.
This commit is contained in:
parent
33466aba65
commit
6e671f78a8
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue