mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
fix(btnmatrix): make ORed values work correctly with lv_btnmatrix_has_btn_ctrl (#2571)
This commit replaces the current `actual & expected` check in `lv_btnmatrix_has_btn_ctrl` with `(actual & expected) == expected`. This is required to make the function work with ORed control flags because otherwise a parity in *any* bit will result in a return value of `true` even if not all expected bits are set.
This commit is contained in:
parent
47734c4abe
commit
51f3310592
@ -32,6 +32,7 @@
|
||||
- fix(zoom) multiplication overflow with zoom calculations on 16-bit platforms
|
||||
- feat(msgbox): omit title label unless needed
|
||||
- feat(msgbox): add function to get selected button index
|
||||
- fix(btnmatrix): make ORed values work correctly with lv_btnmatrix_has_btn_ctrl
|
||||
|
||||
## v8.0.2 (16.07.2021)
|
||||
- fix(theme) improve button focus of keyboard
|
||||
|
@ -331,7 +331,7 @@ bool lv_btnmatrix_has_btn_ctrl(lv_obj_t * obj, uint16_t btn_id, lv_btnmatrix_ctr
|
||||
lv_btnmatrix_t * btnm = (lv_btnmatrix_t *)obj;;
|
||||
if(btn_id >= btnm->btn_cnt) return false;
|
||||
|
||||
return (btnm->ctrl_bits[btn_id] & ctrl) ? true : false;
|
||||
return ((btnm->ctrl_bits[btn_id] & ctrl) == ctrl) ? true : false;
|
||||
}
|
||||
|
||||
bool lv_btnmatrix_get_one_checked(const lv_obj_t * obj)
|
||||
|
Loading…
x
Reference in New Issue
Block a user