From bd4f0aa570b795afaf8c5a5b3837082b995b797f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 5 Jan 2020 10:59:11 +0100 Subject: GRAPHICS: MACGUI: Fix text height for one line texts --- graphics/macgui/mactext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'graphics/macgui/mactext.cpp') diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index 0df403ac8c..916219fe73 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -395,7 +395,7 @@ int MacText::getLineWidth(int line, bool enforce) { height = MAX(height, _textLines[line].chunks[i].getFont()->getFontHeight()); } - if (!hastext) + if (!hastext && _textLines.size() > 1) height = height > 3 ? height - 3 : 0; _textLines[line].width = width; -- cgit v1.2.3 From 5a06fcecddd0fec6336a24b8f84ca73b055f8bdd Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 5 Jan 2020 11:34:17 +0100 Subject: GRAPHICS: MACGUI: Generate MacText surface for empty texts --- graphics/macgui/mactext.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'graphics/macgui/mactext.cpp') diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index 916219fe73..2fc9b8dd33 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -69,8 +69,7 @@ MacText::MacText(Common::U32String s, MacWindowManager *wm, const MacFont *macFo _currentFormatting = _defaultFormatting; - if (!_str.empty()) - splitString(_str); + splitString(_str); recalcDims(); @@ -101,8 +100,7 @@ MacText::MacText(const Common::String &s, MacWindowManager *wm, const MacFont *m _currentFormatting = _defaultFormatting; - if (!_str.empty()) - splitString(_str); + splitString(_str); recalcDims(); @@ -114,13 +112,11 @@ void MacText::setMaxWidth(int maxWidth) { _textLines.clear(); - if (!_str.empty()) { - splitString(_str); + splitString(_str); - recalcDims(); + recalcDims(); - _fullRefresh = true; - } + _fullRefresh = true; } static const Common::U32String::value_type *readHex(uint16 *res, const Common::U32String::value_type *s, int len) { -- cgit v1.2.3