mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 21:59:17 +00:00
GRAPHICS: MACGUI: set fgcolor as default color, fix the behaviour for appendText when _str is empty
This commit is contained in:
parent
803cd6d715
commit
a98097e8d2
@ -204,6 +204,8 @@ MacText::MacText(const Common::String &s, MacWindowManager *wm, const MacFont *m
|
||||
if (macFont) {
|
||||
_defaultFormatting = MacFontRun(_wm, macFont->getId(), macFont->getSlant(), macFont->getSize(), 0, 0, 0);
|
||||
_defaultFormatting.font = wm->_fontMan->getFont(*macFont);
|
||||
// try to set fgcolor as default color in chunks
|
||||
_defaultFormatting.fgcolor = _fgcolor;
|
||||
} else {
|
||||
_defaultFormatting.font = NULL;
|
||||
}
|
||||
@ -864,6 +866,15 @@ void MacText::appendText(const Common::U32String &str, int fontId, int fontSize,
|
||||
|
||||
_currentFormatting = fontRun;
|
||||
|
||||
// we check _str here, if _str is empty but _textLines is not empty, and they are not the end of paragraph
|
||||
// then we remove those empty lines
|
||||
// too many special check may cause some strange problem in the future
|
||||
if (_str.empty()) {
|
||||
while (!_textLines.empty() && !_textLines.back().paragraphEnd) {
|
||||
removeLastLine();
|
||||
}
|
||||
}
|
||||
|
||||
if (!skipAdd) {
|
||||
_str += fontRun.toString();
|
||||
_str += str;
|
||||
|
Loading…
Reference in New Issue
Block a user