Browse Source

Fix an issue with shifted LCD lines

Scott Lahteine 8 years ago
parent
commit
ff6b23cb0f
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      Marlin/ultralcd.cpp

+ 1
- 1
Marlin/ultralcd.cpp View File

223
     static int8_t _countedItems = 0; \
223
     static int8_t _countedItems = 0; \
224
     int8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \
224
     int8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \
225
     if (_countedItems > 0 && encoderLine >= _countedItems - LIMIT) { \
225
     if (_countedItems > 0 && encoderLine >= _countedItems - LIMIT) { \
226
-      encoderLine = _countedItems - LIMIT; \
226
+      encoderLine = max(0, _countedItems - LIMIT); \
227
       encoderPosition = encoderLine * (ENCODER_STEPS_PER_MENU_ITEM); \
227
       encoderPosition = encoderLine * (ENCODER_STEPS_PER_MENU_ITEM); \
228
     }
228
     }
229
 
229
 

Loading…
Cancel
Save