mirror of
https://github.com/love2d/love.git
synced 2026-08-19 20:19:42 +02:00
Make love.graphics.setCanvas(nil) error
This helps detect typoes, setCanvas() still works as before
This commit is contained in:
@@ -745,8 +745,9 @@ int w_setCanvas(lua_State *L)
|
|||||||
// discard stencil testing
|
// discard stencil testing
|
||||||
instance->discardStencil();
|
instance->discardStencil();
|
||||||
|
|
||||||
// called with nil or none -> reset to default buffer
|
// called with none -> reset to default buffer
|
||||||
if (lua_isnoneornil(L,1))
|
// nil is an error, to help people with typoes
|
||||||
|
if (lua_isnone(L,1))
|
||||||
{
|
{
|
||||||
Canvas::bindDefaultCanvas();
|
Canvas::bindDefaultCanvas();
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user