summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-10-01 19:11:27 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-10-01 19:11:27 (GMT)
commit5ded009ffd168b5e56ba559af27aecaed9aa2549 (patch)
treef4125a77a66df55bedc25773bdb417d9820cf28c /src
parentfd7120425d38c2aa54a6ae11712526021260790f (diff)
downloadpowder-5ded009ffd168b5e56ba559af27aecaed9aa2549.zip
powder-5ded009ffd168b5e56ba559af27aecaed9aa2549.tar.gz
Fix bug with drawing rectangles outside the game region
Diffstat (limited to 'src')
-rw-r--r--src/luaconsole.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/luaconsole.c b/src/luaconsole.c
index 1e03919..9a7613e 100644
--- a/src/luaconsole.c
+++ b/src/luaconsole.c
@@ -688,9 +688,9 @@ int luatpt_drawrect(lua_State* l)
if (x<0 || y<0 || x>=XRES+BARSIZE || y>=YRES+MENUSIZE)
return luaL_error(l, "Screen coordinates out of range (%d,%d)", x, y);
- if(x+w > XRES)
+ if(x+w > XRES+BARSIZE)
w = XRES-x;
- if(y+h > YRES)
+ if(y+h > YRES+MENUSIZE)
h = YRES-y;
if (r<0) r = 0;
if (r>255) r = 255;