From 906d94a7422eb679f9051ad31c4cad5a83804799 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 4 Feb 2017 16:05:01 +0100 Subject: GRAPHICS: Enforce font recomputation in MacText --- graphics/macgui/mactext.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'graphics') diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index 4c0229218d..2064681874 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -263,7 +263,7 @@ void MacText::render(int from, int to) { debugN(4, "%2d ", i); for (uint j = 0; j < _textLines[i].chunks.size(); j++) - debugN(4, "[%d] \"%s\"", _textLines[i].chunks[j].fontId, _textLines[i].chunks[j].text.c_str()); + debugN(4, "[%d (%d)] \"%s\" ", _textLines[i].chunks[j].fontId, _textLines[i].chunks[j].textSlant, _textLines[i].chunks[j].text.c_str()); debug(4, "%s", ""); } @@ -280,6 +280,9 @@ int MacText::getLineWidth(int line, bool enforce) { int height = 0; for (uint i = 0; i < _textLines[line].chunks.size(); i++) { + if (enforce) + _textLines[line].chunks[i].font = nullptr; + if (!_textLines[line].chunks[i].text.empty()) width += _textLines[line].chunks[i].getFont()->getStringWidth(_textLines[line].chunks[i].text); -- cgit v1.2.3