diff options
author | VelocityRa | 2017-04-02 01:59:32 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2017-07-17 23:45:22 +0200 |
commit | b127beb03c68a2b8161bb20930093c29b951b091 (patch) | |
tree | ec3e6e0fbca96ef5aa3dcacd45b3a13df8ff5ef3 /graphics | |
parent | f2f420e15fb1b7f1e8e9897550bbc0abbca438c8 (diff) | |
download | scummvm-rg350-b127beb03c68a2b8161bb20930093c29b951b091.tar.gz scummvm-rg350-b127beb03c68a2b8161bb20930093c29b951b091.tar.bz2 scummvm-rg350-b127beb03c68a2b8161bb20930093c29b951b091.zip |
GRAPHICS: Fix bug in MacText::draw() on calculating bounding rect size
Change is _surface->w to _surface->h in the fourth arg to Common::Rect
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/macgui/mactext.cpp | 4 | ||||
-rw-r--r-- | graphics/macgui/mactextwindow.cpp | 7 | ||||
-rw-r--r-- | graphics/macgui/mactextwindow.h | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index 672d1f5b6e..a3154ca460 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -333,8 +333,8 @@ void MacText::draw(ManagedSurface *g, int x, int y, int w, int h, int xoff, int g->fillRect(Common::Rect(x, y, x + w, y + w), _bgcolor); } - g->blitFrom(*_surface, Common::Rect(MIN<int>(_surface->w, x), MIN<int>(_surface->h, y), - MIN<int>(_surface->w, x + w), MIN<int>(_surface->w, y + w)), + g->blitFrom(*_surface, Common::Rect(MIN<int>(_surface->w, x), MIN<int>(_surface->h, y), + MIN<int>(_surface->w, x + w), MIN<int>(_surface->h, y + w)), Common::Point(xoff, yoff)); } diff --git a/graphics/macgui/mactextwindow.cpp b/graphics/macgui/mactextwindow.cpp index fc41be4fd0..a96aa5a0a4 100644 --- a/graphics/macgui/mactextwindow.cpp +++ b/graphics/macgui/mactextwindow.cpp @@ -20,7 +20,9 @@ * */ + #include "graphics/macgui/macwindowmanager.h" +#include "graphics/macgui/macfontmanager.h" #include "graphics/macgui/mactextwindow.h" namespace Graphics { @@ -33,4 +35,9 @@ MacTextWindow::MacTextWindow(MacWindowManager *wm) : MacTextWindow::~MacTextWindow() { } +const Font *MacTextWindow::getTextWindowFont() { + // TODO: make this have an actual effect + return _wm->_fontMan->getFont(Graphics::MacFont(kMacFontChicago, 8)); +} + } // End of namespace Graphics diff --git a/graphics/macgui/mactextwindow.h b/graphics/macgui/mactextwindow.h index 2e1cf4f3fe..b63f135e02 100644 --- a/graphics/macgui/mactextwindow.h +++ b/graphics/macgui/mactextwindow.h @@ -29,6 +29,8 @@ class MacTextWindow : public MacWindow { public: MacTextWindow(MacWindowManager *wm); ~MacTextWindow(); + + const Font *getTextWindowFont(); }; } // End of namespace Graphics |