diff options
author | Eugene Sandulenko | 2017-02-01 18:58:35 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2017-02-01 18:58:35 +0100 |
commit | 6e3e8911c1a065867d4d6000f42f5d05ca5fec4a (patch) | |
tree | 6144cbf17bc0708abc6bcad85540d8d0b420f3c6 /graphics/macgui | |
parent | 6fbb82f85be523c6433bdffca86b73544d108422 (diff) | |
download | scummvm-rg350-6e3e8911c1a065867d4d6000f42f5d05ca5fec4a.tar.gz scummvm-rg350-6e3e8911c1a065867d4d6000f42f5d05ca5fec4a.tar.bz2 scummvm-rg350-6e3e8911c1a065867d4d6000f42f5d05ca5fec4a.zip |
GRAPHICS: MacText fixes for in-the middle style change splitting
Diffstat (limited to 'graphics/macgui')
-rw-r--r-- | graphics/macgui/mactext.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index c1704c12d7..11dd7d22fe 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -109,9 +109,8 @@ void MacText::splitString(Common::String &str) { _currentFormatting.setValues(_wm, fontId, textSlant, unk3f, fontSize, palinfo1, palinfo2, palinfo3); - if (_textLines[curLine].chunks[curChunk].text.empty()) { + if (curLine == 0 && curChunk == 0 && _textLines[curLine].chunks[curChunk].text.empty()) { _textLines[curLine].chunks[curChunk] = _currentFormatting; - continue; } else { _textLines[curLine].chunks.push_back(_currentFormatting); } @@ -138,7 +137,12 @@ void MacText::splitString(Common::String &str) { _textLines[curLine].chunks[curChunk].text += text[0]; curChunk++; - _text[curLine] += text[0]; + _textLines[curLine].chunks.push_back(_currentFormatting); + + if (_text.size() == curLine) + _text.push_back(text[0]); + else + _text[curLine] += text[0]; nextChunk = false; @@ -156,7 +160,7 @@ void MacText::splitString(Common::String &str) { curChunk = 0; } } else { - if (nextChunk) { // No text, replacing formatting + if (nextChunk && 0) { // No text, replacing formatting _textLines[curLine].chunks[curChunk] = _currentFormatting; } } |