mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-10 12:44:53 +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
|
// Convert {x=int,y=int} or {int,int} into a Point
|
||||||
else if (lua_istable(L, index)) {
|
else if (lua_istable(L, index)) {
|
||||||
const int type = lua_getfield(L, index, "x");
|
const int type = lua_getfield(L, index, "x");
|
||||||
if (type != LUA_TNONE &&
|
if (VALID_LUATYPE(type)) {
|
||||||
type != LUA_TNIL) {
|
|
||||||
lua_getfield(L, index, "y");
|
lua_getfield(L, index, "y");
|
||||||
pt.x = lua_tointeger(L, -2);
|
pt.x = lua_tointeger(L, -2);
|
||||||
pt.y = lua_tointeger(L, -1);
|
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
|
// Convert { x, y, width, height } into a Rectangle
|
||||||
else if (lua_istable(L, index)) {
|
else if (lua_istable(L, index)) {
|
||||||
const int type = lua_getfield(L, index, "x");
|
const int type = lua_getfield(L, index, "x");
|
||||||
if (type != LUA_TNONE &&
|
if (VALID_LUATYPE(type)) {
|
||||||
type != LUA_TNIL) {
|
|
||||||
lua_getfield(L, index, "y");
|
lua_getfield(L, index, "y");
|
||||||
lua_getfield(L, index, "width");
|
lua_getfield(L, index, "width");
|
||||||
lua_getfield(L, index, "height");
|
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
|
// Convert {x=int,y=int} or {int,int} into a Size
|
||||||
else if (lua_istable(L, index)) {
|
else if (lua_istable(L, index)) {
|
||||||
const int type = lua_getfield(L, index, "width");
|
const int type = lua_getfield(L, index, "width");
|
||||||
if (type != LUA_TNONE &&
|
if (VALID_LUATYPE(type)) {
|
||||||
type != LUA_TNIL) {
|
|
||||||
lua_getfield(L, index, "height");
|
lua_getfield(L, index, "height");
|
||||||
sz.w = lua_tointeger(L, -2);
|
sz.w = lua_tointeger(L, -2);
|
||||||
sz.h = lua_tointeger(L, -1);
|
sz.h = lua_tointeger(L, -1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user