mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 19:20:09 +00:00
[lua] Minor changes
This commit is contained in:
parent
c4ed8c1450
commit
11324c207d
@ -30,8 +30,7 @@ gfx::Point Point_new(lua_State* L, int index)
|
||||
// Convert {x=int,y=int} or {int,int} into a Point
|
||||
else if (lua_istable(L, index)) {
|
||||
const int type = lua_getfield(L, index, "x");
|
||||
if (type != LUA_TNONE &&
|
||||
type != LUA_TNIL) {
|
||||
if (VALID_LUATYPE(type)) {
|
||||
lua_getfield(L, index, "y");
|
||||
pt.x = lua_tointeger(L, -2);
|
||||
pt.y = lua_tointeger(L, -1);
|
||||
|
@ -29,8 +29,7 @@ gfx::Rect Rectangle_new(lua_State* L, int index)
|
||||
// Convert { x, y, width, height } into a Rectangle
|
||||
else if (lua_istable(L, index)) {
|
||||
const int type = lua_getfield(L, index, "x");
|
||||
if (type != LUA_TNONE &&
|
||||
type != LUA_TNIL) {
|
||||
if (VALID_LUATYPE(type)) {
|
||||
lua_getfield(L, index, "y");
|
||||
lua_getfield(L, index, "width");
|
||||
lua_getfield(L, index, "height");
|
||||
|
@ -30,8 +30,7 @@ gfx::Size Size_new(lua_State* L, int index)
|
||||
// Convert {x=int,y=int} or {int,int} into a Size
|
||||
else if (lua_istable(L, index)) {
|
||||
const int type = lua_getfield(L, index, "width");
|
||||
if (type != LUA_TNONE &&
|
||||
type != LUA_TNIL) {
|
||||
if (VALID_LUATYPE(type)) {
|
||||
lua_getfield(L, index, "height");
|
||||
sz.w = lua_tointeger(L, -2);
|
||||
sz.h = lua_tointeger(L, -1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user