# HG changeset patch # User Sebastien Jodogne # Date 1540217579 -7200 # Node ID 93c65e3a6bb16eb0a4efc3d0957ab83f166bda8c # Parent 668d5ad73c7481982cf819eb6304a57539924bde fix diff -r 668d5ad73c74 -r 93c65e3a6bb1 Core/Images/Font.cpp --- a/Core/Images/Font.cpp Mon Oct 22 14:20:21 2018 +0200 +++ b/Core/Images/Font.cpp Mon Oct 22 16:12:59 2018 +0200 @@ -354,7 +354,7 @@ // Compute the text extent unsigned int x = 0; - unsigned int countLines = 0; + unsigned int y = 0; for (size_t i = 0; i < s.size(); i++) { @@ -362,8 +362,7 @@ { // Go to the next line x = 0; - - countLines ++; + y += (maxHeight_ + 1); } else { @@ -372,9 +371,10 @@ { x += c->second->advance_; - if (countLines == 0) + unsigned int bottom = y + c->second->top_ + c->second->height_; + if (bottom > height) { - countLines = 1; + height = bottom; } if (x > width) @@ -384,8 +384,6 @@ } } } - - height = countLines * (maxHeight_ + 1); }