@@ -23,6 +23,7 @@ LiquidCrystalRenderer::LiquidCrystalRenderer(LiquidCrystal& lcd, uint8_t dimX, u
2323 this ->forwardChar = ' >' ;
2424 this ->editChar = ' =' ;
2525 this ->drewTitleThisTime = false ;
26+ this ->titleRequired = true ;
2627}
2728
2829void LiquidCrystalRenderer::initialise () {
@@ -123,7 +124,7 @@ void LiquidCrystalRenderer::render() {
123124 else {
124125 MenuItem* item = menuMgr.getCurrentMenu ();
125126
126- bool titleNeeded = menuMgr.getCurrentMenu () == menuMgr.getRoot ();
127+ bool titleNeeded = titleRequired && menuMgr.getCurrentMenu () == menuMgr.getRoot ();
127128
128129 // first we find the first currently active item in our single linked list
129130 int activeOffs = offsetOfCurrentActive (item);
@@ -148,7 +149,8 @@ void LiquidCrystalRenderer::render() {
148149 if (lastOffset != toOffsetBy) locRedrawMode = MENUDRAW_COMPLETE_REDRAW;
149150 lastOffset = toOffsetBy;
150151
151- while (item != NULL && toOffsetBy--) {
152+ while (item != NULL && toOffsetBy) {
153+ if (item->isVisible ()) toOffsetBy = toOffsetBy - 1 ;
152154 item = item->getNext ();
153155 }
154156 }
@@ -159,10 +161,13 @@ void LiquidCrystalRenderer::render() {
159161
160162 // and then we start drawing items until we run out of screen or items
161163 while (item && cnt < dimY) {
162- if (locRedrawMode != MENUDRAW_NO_CHANGE || item->isChanged ()) {
163- renderMenuItem (cnt, item);
164- }
165- ++cnt;
164+ if (item->isVisible ())
165+ {
166+ if (locRedrawMode != MENUDRAW_NO_CHANGE || item->isChanged ()) {
167+ renderMenuItem (cnt, item);
168+ }
169+ ++cnt;
170+ }
166171 item = item->getNext ();
167172 }
168173 }
0 commit comments