Protect against neg x drawing

This commit is contained in:
3djc
2019-07-05 12:40:25 +02:00
parent 575d87f70c
commit c0b3aa0ba6
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ void lcdPutPattern(coord_t x, coord_t y, const uint8_t * pattern, uint8_t width,
assert(lines <= 5); assert(lines <= 5);
for (int8_t i=0; i<width+2; i++) { for (int8_t i=0; i<width+2; i++) {
if (x<LCD_W) { if (x >= 0 && x<LCD_W) {
uint8_t b[5] = { 0 }; uint8_t b[5] = { 0 };
if (i==0) { if (i==0) {
if (x==0 || !inv) { if (x==0 || !inv) {
+1 -1
View File
@@ -166,7 +166,7 @@ void menuTextView(event_t event)
#else #else
// TODO? // TODO?
#endif #endif
lcdDrawText(LCD_W/2-strlen(getBasename(title))*FW/2, 0, getBasename(title)); lcdDrawText(LCD_W/2, 0, getBasename(title), CENTERED);
lcdInvertLine(0); lcdInvertLine(0);
if (lines_count > LCD_LINES-1) { if (lines_count > LCD_LINES-1) {