fix(Menu): handle negative selection index properly
This commit is contained in:
committed by
Peter Feerick
parent
d2676abc61
commit
c41b1cb458
+6
@@ -176,6 +176,12 @@ void MenuBody::setIndex(int index)
|
||||
|
||||
lv_obj_invalidate(lvobj);
|
||||
lv_table_t* table = (lv_table_t*)lvobj;
|
||||
|
||||
if (index < 0) {
|
||||
table->row_act = LV_TABLE_CELL_NONE;
|
||||
table->col_act = LV_TABLE_CELL_NONE;
|
||||
return;
|
||||
}
|
||||
|
||||
table->row_act = index;
|
||||
table->col_act = 0;
|
||||
|
||||
Reference in New Issue
Block a user