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
This commit is contained in:
VelocityRa 2017-04-02 01:59:32 +03:00 committed by Eugene Sandulenko
parent f2f420e15f
commit b127beb03c
3 changed files with 11 additions and 2 deletions

View File

@ -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));
}

View File

@ -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

View File

@ -29,6 +29,8 @@ class MacTextWindow : public MacWindow {
public:
MacTextWindow(MacWindowManager *wm);
~MacTextWindow();
const Font *getTextWindowFont();
};
} // End of namespace Graphics