Skip to content

Commit

Permalink
GRAPHICS: MACGUI: fix the bug dumping when initializing Wage Engine
Browse files Browse the repository at this point in the history
  • Loading branch information
ysj1173886760 authored and sev- committed Apr 1, 2021
1 parent 0dcde7c commit 2ab965e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion graphics/macgui/mactext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ void MacText::splitString(const Common::U32String &str, int curLine) {

for (int i = 1; i < (int)word.size(); i++) {
word_width += word[i].getFont()->getStringWidth(word[i].text);
debugN(9, "\"%s\"", Common::toPrintable(word[i].text.encode()).c_str());
D(9, "** word \"%s\" textslant [%d]", Common::toPrintable(word[i].text.encode()).c_str(), word[i].textSlant);
}

int cur_width = getLineWidth(curLine, true);
Expand Down Expand Up @@ -868,10 +868,12 @@ void MacText::appendText(const Common::U32String &str, int fontId, int fontSize,
_str += fontRun.toString();
_str += str;
}

splitString(str);
recalcDims();

render(oldLen - 1, _textLines.size());

_contentIsDirty = true;

if (_editable) {
Expand Down

0 comments on commit 2ab965e

Please sign in to comment.