From ee8d9dea03c6ec0be3b3be99680dbbd40f286a9e Mon Sep 17 00:00:00 2001 From: ysj1173886760 <1173886760@qq.com> Date: Wed, 14 Apr 2021 21:50:57 +0800 Subject: [PATCH] GRAPHICS: MACGUI: set fgcolor as default format color when we are in win95 mode --- graphics/macgui/mactext.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index 9d949bbb97a..758ee130d6f 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -204,8 +204,6 @@ 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; } @@ -215,6 +213,10 @@ MacText::MacText(const Common::String &s, MacWindowManager *wm, const MacFont *m void MacText::init() { _defaultFormatting.wm = _wm; + // try to set fgcolor as default color in chunks + if (_wm->_mode & kWMModeWin95) { + _defaultFormatting.fgcolor = _fgcolor; + } _currentFormatting = _defaultFormatting; _composeSurface->clear(_bgcolor); @@ -952,7 +954,7 @@ void MacText::draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int render(); if (x + w < _surface->w || y + h < _surface->h) - g->fillRect(Common::Rect(x, y, x + w, y + w), _bgcolor); + g->fillRect(Common::Rect(x, y, x + w, y + h), _bgcolor); g->blitFrom(*_surface, Common::Rect(MIN(_surface->w, x), MIN(_surface->h, y), MIN(_surface->w, x + w), MIN(_surface->h, y + h)), Common::Point(xoff, yoff));