Browse Source

Wrappers now catch negative width or height in setScissor (bug #125)

Bart van Strien 14 years ago
parent
commit
cb1efac715
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/modules/graphics/opengl/wrap_Graphics.cpp

+ 3 - 0
src/modules/graphics/opengl/wrap_Graphics.cpp

@@ -133,6 +133,9 @@ namespace opengl
 		int w = luaL_checkint(L, 3);
 		int h = luaL_checkint(L, 4);
 
+		if (w < 0 || h < 0)
+			return luaL_error(L, "Can't set scissor with negative width and/or height.");
+
 		instance->setScissor(x, y, w, h);
 		return 0;
 	}