aboutsummaryrefslogtreecommitdiff
path: root/graphics/macgui/mactext.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2017-01-31 19:02:15 +0100
committerEugene Sandulenko2017-01-31 19:02:15 +0100
commit89e8bdc444cb3d223b7970394f78131f9346e53e (patch)
treee68265f50d2b2c39fd82ccabff11e3693270e37b /graphics/macgui/mactext.cpp
parentc4f73012e5f4792aca573c89d80323973e0c8c58 (diff)
downloadscummvm-rg350-89e8bdc444cb3d223b7970394f78131f9346e53e.tar.gz
scummvm-rg350-89e8bdc444cb3d223b7970394f78131f9346e53e.tar.bz2
scummvm-rg350-89e8bdc444cb3d223b7970394f78131f9346e53e.zip
GRAPHICS: More fixes to MacText rich text formatting
Diffstat (limited to 'graphics/macgui/mactext.cpp')
-rw-r--r--graphics/macgui/mactext.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index e7abcc6d01..ed3cddb513 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -119,21 +119,19 @@ void MacText::splitString(Common::String &str) {
Common::Array<Common::String> text;
_textMaxWidth = MAX(_font->wordWrapText(tmp, _maxWidth, text), _textMaxWidth);
+ tmp.clear();
if (text.size()) {
- (_textLines[curLine])[curChunk].text = text[0];
-
if (nextChunk) {
+ (_textLines[curLine])[curChunk].text += text[0];
curChunk++;
_text[curLine] += text[0];
- } else {
- _text.push_back(text[0]);
+
+ continue;
}
- }
- if (text.size() > 1) {
- for (uint i = 1; i < text.size(); i++) {
+ for (uint i = 0; i < text.size(); i++) {
_text.push_back(text[i]);
curLine++;
@@ -144,8 +142,6 @@ void MacText::splitString(Common::String &str) {
}
}
- tmp.clear();
-
if (!nextChunk) // Don't skip next character
s++;
@@ -236,6 +232,14 @@ void MacText::render(int from, int to) {
y += _font->getFontHeight() + _interLinear;
}
+ for (uint i = 0; i < _textLines.size(); i++) {
+ debugN(4, "%2d ", i);
+
+ for (uint j = 0; j < _textLines[i].size(); j++)
+ debugN(4, "[%d] \"%s\"", (_textLines[i])[j].fontId, (_textLines[i])[j].text.c_str());
+
+ debug(4, "");
+ }
}
void MacText::draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff) {