Skip to content

Commit caea0ec

Browse files
committed
fix index check
1 parent 14a6203 commit caea0ec

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/items.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* -*- C++ -*- */
2-
32
#ifndef RSITE_ARDUINO_MENU_SYSTEM_ITEMS
43
#define RSITE_ARDUINO_MENU_SYSTEM_ITEMS
54

src/nav.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ navCmd navNode::doNavigation(navCmd cmd) {
2424
idx_t osel=sel;
2525
idx_t nsel=sel;
2626
navCmd rCmd=cmd;
27+
bool changed=false;
2728
switch(cmd.cmd) {
2829
/*case scrlDownCmd:
2930
if (!target->isVariant())
@@ -52,15 +53,16 @@ navCmd navNode::doNavigation(navCmd cmd) {
5253
case selCmd:
5354
case idxCmd: {
5455
idx_t at=(idx_t)cmd.param;//-'1';send us numeric index pls!
55-
if (at>=0&&at<=sz()-1) {
56+
if (at>=0&&at<sz()) {
57+
changed=true;
5658
nsel=at;
5759
}
5860
}
5961
break;
6062
case noCmd:
6163
default: break;
6264
}
63-
if(osel!=nsel||cmd.cmd==selCmd||cmd.cmd==idxCmd) {//selection changed, must have been and idx/sel or an up/down movement
65+
if(osel!=nsel||changed) {//selection changed, must have been and idx/sel or an up/down movement
6466
if (target->sysStyles()&(_parentDraw|_isVariant)) {
6567
target->dirty=true;
6668
} else {

0 commit comments

Comments
 (0)