mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
Warn if lv_obj_set_pos
is called on a screen object
This commit is contained in:
parent
43a06b41be
commit
b9697df3a1
@ -725,6 +725,11 @@ void lv_obj_set_pos(lv_obj_t * obj, lv_coord_t x, lv_coord_t y)
|
||||
|
||||
/*Convert x and y to absolute coordinates*/
|
||||
lv_obj_t * par = obj->par;
|
||||
|
||||
if(par == NULL) {
|
||||
LV_LOG_WARN("lv_obj_set_pos: not changing position of screen object");
|
||||
return;
|
||||
}
|
||||
|
||||
x = x + par->coords.x1;
|
||||
y = y + par->coords.y1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user