aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-06 19:22:59 +0000
committerMartin Kiewitz2009-10-06 19:22:59 +0000
commitd8e10f3e40d292a5b3c904e5432e96d34a08e5df (patch)
tree3a8235db4df63778b779924db005fba6e4ef7145 /engines/sci
parentab4013d1e5fde0a45a509143f772d5d7e09dc24a (diff)
downloadscummvm-rg350-d8e10f3e40d292a5b3c904e5432e96d34a08e5df.tar.gz
scummvm-rg350-d8e10f3e40d292a5b3c904e5432e96d34a08e5df.tar.bz2
scummvm-rg350-d8e10f3e40d292a5b3c904e5432e96d34a08e5df.zip
SCI/newgui: dont allow negative coordinates in draw pattern (fixes bad pixels in kq1)
svn-id: r44714
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/gui/gui_gfx.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp
index 0aa238ca1b..972ee9bb3a 100644
--- a/engines/sci/gui/gui_gfx.cpp
+++ b/engines/sci/gui/gui_gfx.cpp
@@ -859,8 +859,8 @@ void SciGuiGfx::Draw_Pattern(int16 x, int16 y, byte color, byte priority, byte c
Common::Rect rect;
// We need to adjust the given coordinates, because the ones given us do not define upper left but somewhat middle
- y -= size;
- x -= size;
+ y -= size; if (y < 0) y = 0;
+ x -= size; if (x < 0) x = 0;
rect.top = y + _curPort->top; rect.left = x + _curPort->left;
rect.setHeight((size*2)+1); rect.setWidth((size*2)+2);