Skip to content

Commit 9c5430e

Browse files
committed
feat(arc): add rotate_obj_to_angle
1 parent 604a1a6 commit 9c5430e

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/widgets/arc.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,23 @@ static const luavgl_table_t arc_property_table = {
135135
.array = arc_property_ops,
136136
};
137137

138+
static int luavgl_arc_rotate_obj_to_angle(lua_State *L)
139+
{
140+
lv_obj_t *obj = luavgl_to_obj(L, 1), *obj_to_rotate = luavgl_to_obj(L, 2);
141+
142+
int32_t r_offset = 0;
143+
if (lua_isinteger(L, 3)) {
144+
r_offset = lua_tointeger(L, 3);
145+
}
146+
lv_arc_rotate_obj_to_angle(obj, obj_to_rotate, r_offset);
147+
return 0;
148+
}
149+
138150
static const rotable_Reg luavgl_arc_methods[] = {
139151
{"__property", LUA_TLIGHTUSERDATA, {.ptr = &arc_property_table}},
152+
153+
{"rotate_obj_to_angle",
154+
LUA_TFUNCTION, {.ptr = luavgl_arc_rotate_obj_to_angle}},
140155
{},
141156
};
142157

0 commit comments

Comments
 (0)