aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2017-02-02 10:10:17 +0100
committerEugene Sandulenko2017-02-02 10:11:07 +0100
commitc30df011309f4028bcd38daeab8d968c69b16ad9 (patch)
tree133b559fa0ea7d9762837b13d07d5cb49580effe
parent1ae539d44de7af5e035161167e54f5a303356a7d (diff)
downloadscummvm-rg350-c30df011309f4028bcd38daeab8d968c69b16ad9.tar.gz
scummvm-rg350-c30df011309f4028bcd38daeab8d968c69b16ad9.tar.bz2
scummvm-rg350-c30df011309f4028bcd38daeab8d968c69b16ad9.zip
GRAPHICS: More optimization for empty strings
-rw-r--r--graphics/macgui/mactext.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 0201b19abd..895d49e450 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -277,7 +277,9 @@ int MacText::getLineWidth(int line, bool enforce) {
int height = 0;
for (uint i = 0; i < _textLines[line].chunks.size(); i++) {
- width += _textLines[line].chunks[i].getFont()->getStringWidth(_textLines[line].chunks[i].text);
+ if (!_textLines[line].chunks[i].text.empty())
+ width += _textLines[line].chunks[i].getFont()->getStringWidth(_textLines[line].chunks[i].text);
+
height = MAX(height, _textLines[line].chunks[i].getFont()->getFontHeight());
}