fix screen copy

This commit is contained in:
Gabor Kiss-Vamosi
2019-05-15 07:34:19 +02:00
parent eebe04bd95
commit 6a265896a2
3 changed files with 14 additions and 5 deletions

View File

@@ -359,7 +359,12 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy)
}
#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) {
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");
}