Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/lvgl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1277,11 +1277,11 @@ end
--- @field bg_main_stop integer
--- @field bg_grad_stop integer
--- @field bg_dither_mode integer
--- @field bg_img_src integer
--- @field bg_img_opa integer
--- @field bg_img_recolor integer
--- @field bg_img_recolor_opa integer
--- @field bg_img_tiled integer
--- @field bg_image_src integer
--- @field bg_image_opa integer
--- @field bg_image_recolor integer
--- @field bg_image_recolor_opa integer
--- @field bg_image_tiled integer
--- @field border_color integer | string
--- @field border_opa integer
--- @field border_width integer
Expand Down
4 changes: 2 additions & 2 deletions src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,11 @@ LUALIB_API lv_point_t luavgl_topoint(lua_State *L, int idx)
{
lv_point_t point = {0};
if (lua_istable(L, idx)) {
lua_rawgeti(L, idx, 1);
lua_getfield(L, idx, "x");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally I think using array is simpler.

local pointer = root:Pointer {
    src = SCRIPT_PATH .. "/assets/second.png",
    pivot = { 20, 233 },
    x = -20,

I not sure if this should be unified to key-value style.
It would break the example for sure, like pointer.lua

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you mean, there really doesn't seem to be much to fix.

point.x = lua_tointeger(L, -1);
lua_pop(L, 1);

lua_rawgeti(L, idx, 2);
lua_getfield(L, idx, "y");
point.y = lua_tointeger(L, -1);
lua_pop(L, 1);
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/widgets/img.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ static int image_set_pivot(lua_State *L, lv_obj_t *obj, bool set)
lv_image_get_pivot(obj, &p);
lua_createtable(L, 0, 2);
lua_pushinteger(L, p.x);
lua_seti(L, -2, p.x);
lua_setfield(L, -2, "x");
lua_pushinteger(L, p.y);
lua_seti(L, -2, p.y);
lua_setfield(L, -2, "y");
return 1;
}

Expand Down