mirror of
https://github.com/love2d/love.git
synced 2026-08-14 01:20:56 +02:00
Fixed love.graphics.setScissor and love.graphics.setColorMask to not error if a single nil argument is given (resolves issue #709)
This commit is contained in:
@@ -83,7 +83,7 @@ int w_getDimensions(lua_State *L)
|
||||
|
||||
int w_setScissor(lua_State *L)
|
||||
{
|
||||
if (lua_gettop(L) == 0)
|
||||
if (lua_gettop(L) <= 1 && lua_isnoneornil(L, 1))
|
||||
{
|
||||
instance->setScissor();
|
||||
return 0;
|
||||
@@ -688,7 +688,7 @@ int w_setColorMask(lua_State *L)
|
||||
{
|
||||
bool mask[4];
|
||||
|
||||
if (lua_gettop(L) == 0)
|
||||
if (lua_gettop(L) <= 1 && lua_isnoneornil(L, 1))
|
||||
{
|
||||
// Enable all color components if no argument is given.
|
||||
mask[0] = mask[1] = mask[2] = mask[3] = true;
|
||||
@@ -848,7 +848,7 @@ int w_setLineJoin(lua_State *L)
|
||||
Graphics::LineJoin join;
|
||||
const char *str = luaL_checkstring(L, 1);
|
||||
if (!Graphics::getConstant(str, join))
|
||||
return luaL_error(L, "Invalid line join: %s", str);
|
||||
return luaL_error(L, "Invalid line join mode: %s", str);
|
||||
|
||||
instance->setLineJoin(join);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user