diff options
author | Eugene Sandulenko | 2019-12-26 17:58:52 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2019-12-26 18:00:00 +0100 |
commit | 95f02a8f9a3de18fc42b3cc379fbb56b1218f9a5 (patch) | |
tree | 40d14394ab924cca031524accc3f48c58e6c2948 /graphics/macgui | |
parent | 97abe323c460c678aa1fe6e20a5749cfd66ed2ee (diff) | |
download | scummvm-rg350-95f02a8f9a3de18fc42b3cc379fbb56b1218f9a5.tar.gz scummvm-rg350-95f02a8f9a3de18fc42b3cc379fbb56b1218f9a5.tar.bz2 scummvm-rg350-95f02a8f9a3de18fc42b3cc379fbb56b1218f9a5.zip |
GRAPHICS: MACGUI: Use proper width when rendering MacText
Diffstat (limited to 'graphics/macgui')
-rw-r--r-- | graphics/macgui/mactext.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index 14eb411a23..cb520652b6 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -335,6 +335,8 @@ void MacText::render(int from, int to) { from = MAX<int>(0, from); to = MIN<int>(to, _textLines.size() - 1); + int w = MIN(_maxWidth, _textMaxWidth); + // Clear the screen _surface->fillRect(Common::Rect(0, _textLines[from].y, _surface->w, _textLines[to].y + getLineHeight(to)), _bgcolor); @@ -352,7 +354,7 @@ void MacText::render(int from, int to) { if (_textLines[i].chunks[j].text.empty()) continue; - _textLines[i].chunks[j].getFont()->drawString(_surface, _textLines[i].chunks[j].text, xOffset, _textLines[i].y, _maxWidth, _fgcolor); + _textLines[i].chunks[j].getFont()->drawString(_surface, _textLines[i].chunks[j].text, xOffset, _textLines[i].y, w, _fgcolor); xOffset += _textLines[i].chunks[j].getFont()->getStringWidth(_textLines[i].chunks[j].text); } } |