mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-08 20:07:11 +00:00
GRAPHICS: MACGUI: Use proper width when rendering MacText
This commit is contained in:
parent
97abe323c4
commit
95f02a8f9a
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user