From 6e3e8911c1a065867d4d6000f42f5d05ca5fec4a Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 1 Feb 2017 18:58:35 +0100 Subject: GRAPHICS: MacText fixes for in-the middle style change splitting --- graphics/macgui/mactext.cpp | 12 ++++++++---- 1 file 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; } } -- cgit v1.2.3