From 4e044d7bd3272e95a95feefb407bb2b1ffba23c8 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 2 Aug 2017 21:46:25 +0200 Subject: 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. --- graphics/macgui/mactextwindow.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'graphics/macgui/mactextwindow.cpp') 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]); -- cgit v1.2.3