mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Eliminate unneeded screen flashing when scrolling menu (#1900)
This commit is contained in:
parent
8b5adb6bc1
commit
a442971b81
@ -173,13 +173,15 @@ bool BtnGridView::set_highlighted(int32_t new_value) {
|
|||||||
highlighted_item = new_value;
|
highlighted_item = new_value;
|
||||||
offset += rows_;
|
offset += rows_;
|
||||||
update_items();
|
update_items();
|
||||||
set_dirty();
|
// refresh whole screen (display flickers) only if scrolling last row up and a blank button is needed at the bottom
|
||||||
|
if ((new_value + rows_ > item_count) && (item_count % rows_) != 0)
|
||||||
|
set_dirty();
|
||||||
} else if ((uint32_t)new_value < offset) {
|
} else if ((uint32_t)new_value < offset) {
|
||||||
// Shift BtnGridView down
|
// Shift BtnGridView down
|
||||||
highlighted_item = new_value;
|
highlighted_item = new_value;
|
||||||
offset = (new_value / rows_) * rows_;
|
offset = (new_value / rows_) * rows_;
|
||||||
update_items();
|
update_items();
|
||||||
set_dirty();
|
// no need to set_dirty() here since all buttons have been repainted
|
||||||
} else {
|
} else {
|
||||||
// Just update highlight
|
// Just update highlight
|
||||||
highlighted_item = new_value;
|
highlighted_item = new_value;
|
||||||
|
Loading…
Reference in New Issue
Block a user