diff options
author | Eugene Sandulenko | 2017-08-02 21:46:25 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2017-08-04 21:54:19 +0200 |
commit | 4e044d7bd3272e95a95feefb407bb2b1ffba23c8 (patch) | |
tree | 6a8f1f663186fbb770a80f0e5119414c1e07cffc /graphics/macgui/mactextwindow.cpp | |
parent | 59d6b63b0f63949717e9621578b97c58c1d09ce6 (diff) | |
download | scummvm-rg350-4e044d7bd3272e95a95feefb407bb2b1ffba23c8.tar.gz scummvm-rg350-4e044d7bd3272e95a95feefb407bb2b1ffba23c8.tar.bz2 scummvm-rg350-4e044d7bd3272e95a95feefb407bb2b1ffba23c8.zip |
GRAPHICS: MACGUI: Do not add input line to the original MacText content
During resize we were replaying all MacText appends, which was including
whole history of the input. Eek.
Diffstat (limited to 'graphics/macgui/mactextwindow.cpp')
-rw-r--r-- | graphics/macgui/mactextwindow.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/graphics/macgui/mactextwindow.cpp b/graphics/macgui/mactextwindow.cpp index 3a90908b5c..7b1c1e59c4 100644 --- a/graphics/macgui/mactextwindow.cpp +++ b/graphics/macgui/mactextwindow.cpp @@ -78,8 +78,8 @@ void MacTextWindow::resize(int w, int h) { MacWindow::resize(w, h); } -void MacTextWindow::appendText(Common::String str, const MacFont *macFont) { - _mactext->appendText(str, macFont->getId(), macFont->getSize(), macFont->getSlant()); +void MacTextWindow::appendText(Common::String str, const MacFont *macFont, bool skipAdd) { + _mactext->appendText(str, macFont->getId(), macFont->getSize(), macFont->getSlant(), skipAdd); _contentIsDirty = true; @@ -188,6 +188,9 @@ void MacTextWindow::undrawInput() { for (uint i = 0; i < _inputTextHeight; i++) _mactext->removeLastLine(); + if (_inputTextHeight) + appendText("\n", _font, true); + _inputTextHeight = 0; } @@ -201,7 +204,7 @@ void MacTextWindow::drawInput() { _inputTextHeight = MAX(1u, text.size()); // We always have line to clean // And add new input line to the text - appendText(_inputText, _font); + appendText(_inputText, _font, true); _cursorX = _inputText.empty() ? 0 : _fontRef->getStringWidth(text[_inputTextHeight - 1]); |