fix(obj): swap lv_obj_move_forground/background
This commit is contained in:
@@ -194,11 +194,11 @@ void lv_obj_move_foreground(lv_obj_t * obj)
|
||||
|
||||
lv_obj_invalidate(parent);
|
||||
|
||||
int32_t i;
|
||||
for(i = lv_obj_get_child_id(obj) - 1; i > 0; i--) {
|
||||
parent->spec_attr->children[i] = parent->spec_attr->children[i-1];
|
||||
uint32_t i;
|
||||
for(i = lv_obj_get_child_id(obj); i < lv_obj_get_child_cnt(parent) - 1; i++) {
|
||||
parent->spec_attr->children[i] = parent->spec_attr->children[i + 1];
|
||||
}
|
||||
parent->spec_attr->children[0] = obj;
|
||||
parent->spec_attr->children[lv_obj_get_child_cnt(parent) - 1] = obj;
|
||||
|
||||
/*Notify the new parent about the child*/
|
||||
lv_signal_send(parent, LV_SIGNAL_CHILD_CHG, obj);
|
||||
@@ -214,11 +214,11 @@ void lv_obj_move_background(lv_obj_t * obj)
|
||||
|
||||
lv_obj_invalidate(parent);
|
||||
|
||||
uint32_t i;
|
||||
for(i = lv_obj_get_child_id(obj); i < lv_obj_get_child_cnt(parent) - 1; i++) {
|
||||
parent->spec_attr->children[i] = parent->spec_attr->children[i + 1];
|
||||
int32_t i;
|
||||
for(i = lv_obj_get_child_id(obj) - 1; i > 0; i--) {
|
||||
parent->spec_attr->children[i] = parent->spec_attr->children[i-1];
|
||||
}
|
||||
parent->spec_attr->children[lv_obj_get_child_cnt(parent) - 1] = obj;
|
||||
parent->spec_attr->children[0] = obj;
|
||||
|
||||
/*Notify the new parent about the child*/
|
||||
lv_signal_send(parent, LV_SIGNAL_CHILD_CHG, obj);
|
||||
|
||||
Reference in New Issue
Block a user