- [FIX] clip(x,y,w,h) works as expected.
- [NEW] clip() with no arguments resets clipping region. - [FIX] cls() respects clipping region (but now it's slower) - [FIX] pset's and pget now respect clipping region correctly
This commit is contained in:
14
lua.cpp
14
lua.cpp
@@ -259,11 +259,15 @@ extern "C" {
|
||||
}
|
||||
|
||||
static int cpp_clip(lua_State *L) {
|
||||
int x = luaL_checknumber(L, 1);
|
||||
int y = luaL_checknumber(L, 2);
|
||||
int w = luaL_checknumber(L, 3);
|
||||
int h = luaL_checknumber(L, 4);
|
||||
clip(x, y, w, h);
|
||||
if (lua_gettop(L) == 0) {
|
||||
clip();
|
||||
} else {
|
||||
int x = luaL_checknumber(L, 1);
|
||||
int y = luaL_checknumber(L, 2);
|
||||
int w = luaL_checknumber(L, 3);
|
||||
int h = luaL_checknumber(L, 4);
|
||||
clip(x, y, w, h);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user