fix(widgets): no need to set the same state
This commit is contained in:
parent
1b5e5bb798
commit
31678227b9
1 changed files with 5 additions and 1 deletions
|
@ -59,10 +59,14 @@ void set_bongo_state(struct zmk_widget_bongo_cat *widget, struct zmk_position_st
|
|||
} else {
|
||||
if (current_bongo_state ^ (bongo_state_left | bongo_state_right)) {
|
||||
tmp = bongo_state_none;
|
||||
widget->is_right = !widget->is_right; /* flip side when return to none state */
|
||||
widget->is_right = !widget->is_right; /* switch hand when return to none state */
|
||||
}
|
||||
}
|
||||
|
||||
if (current_bongo_state == tmp) {
|
||||
return;
|
||||
}
|
||||
|
||||
current_bongo_state = tmp;
|
||||
lv_img_set_src(widget->obj, images[current_bongo_state]);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue