aboutsummaryrefslogtreecommitdiff
path: root/engines/wage
diff options
context:
space:
mode:
authorEugene Sandulenko2016-02-23 11:02:07 +0100
committerEugene Sandulenko2016-02-23 11:18:44 +0100
commit64e21078dae76e900ed2c8e338e27fe57b4cae4d (patch)
treeca5d9de688293044de22758e2f4ea4f116f01592 /engines/wage
parentd516cac634eff061e863c7acb036562039faabb9 (diff)
downloadscummvm-rg350-64e21078dae76e900ed2c8e338e27fe57b4cae4d.tar.gz
scummvm-rg350-64e21078dae76e900ed2c8e338e27fe57b4cae4d.tar.bz2
scummvm-rg350-64e21078dae76e900ed2c8e338e27fe57b4cae4d.zip
WAGE: Fix crash when border is off-screen. Bug Hunt was affected.
Diffstat (limited to 'engines/wage')
-rw-r--r--engines/wage/gui.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index afb30c78a3..9c80435b70 100644
--- a/engines/wage/gui.cpp
+++ b/engines/wage/gui.cpp
@@ -395,6 +395,14 @@ void Gui::paintBorder(Graphics::Surface *g, Common::Rect &r, WindowType windowTy
font->drawString(g, _scene->_name, x + (width - w) / 2 + 5, y + yOff, w, kColorBlack);
}
+ if (x < 0) {
+ width += x;
+ x = 0;
+ }
+ if (y < 0) {
+ height += y;
+ y = 0;
+ }
if (x + width > _screen.w)
width = _screen.w - x;
if (y + height > _screen.h)