fix(widgets): no need to set the same state

This commit is contained in:
down 2022-06-19 16:18:29 +07:00
parent 1b5e5bb798
commit 31678227b9

View file

@ -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]);
}