GRAPHICS: MACGUI: Fix crash on backspace in MacTextWindow input

This commit is contained in:
Eugene Sandulenko 2017-07-31 20:08:11 +02:00
parent 5149226255
commit da9e02cebb

View File

@ -179,7 +179,7 @@ void MacTextWindow::drawInput() {
// And add new input line to the text
appendText(_inputText, _font);
_cursorX = _fontRef->getStringWidth(text[_inputTextHeight - 1]);
_cursorX = _inputText.empty() ? 0 : _fontRef->getStringWidth(text[_inputTextHeight - 1]);
updateCursorPos();
}