Update lv_obj.c
This commit is contained in:
committed by
GitHub
parent
dab545e770
commit
c8d1413ece
@@ -309,7 +309,12 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lv_obj_set_pos(new_obj, lv_obj_get_x(copy), lv_obj_get_y(copy));
|
/*Set the same coordinates for non screen objects*/
|
||||||
|
if(lv_obj_get_parent(copy) != NULL && parent != NULL) {
|
||||||
|
lv_obj_set_pos(new_obj, lv_obj_get_x(copy), lv_obj_get_y(copy));
|
||||||
|
} else {
|
||||||
|
lv_obj_set_pos(new_obj, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
LV_LOG_INFO("Object create ready");
|
LV_LOG_INFO("Object create ready");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user