diff --git a/source/Core/Drivers/OLED.cpp b/source/Core/Drivers/OLED.cpp index fd88ec9f..d251564a 100644 --- a/source/Core/Drivers/OLED.cpp +++ b/source/Core/Drivers/OLED.cpp @@ -706,7 +706,7 @@ void OLED::fillArea(int16_t x, int8_t y, uint8_t wide, uint8_t height, const uin if (x <= -wide) { return; // cutoffleft } - if (x > 96) { + if (x > OLED_WIDTH) { return; // cutoff right } @@ -717,21 +717,17 @@ void OLED::fillArea(int16_t x, int8_t y, uint8_t wide, uint8_t height, const uin if (x < 0) { visibleStart -= x; // subtract negative value == add absolute value } - if (x + wide > 96) { - visibleEnd = 96 - x; + if (x + wide > OLED_WIDTH) { + visibleEnd = OLED_WIDTH - x; } - if (y == 0) { - // Splat first line of data + uint8_t rowsDrawn = 0; + while (height > 0) { for (uint8_t xx = visibleStart; xx < visibleEnd; xx++) { - stripPointers[0][xx + x] = value; - } - } - if (y == 8 || height == 16) { - // Splat the second line - for (uint8_t xx = visibleStart; xx < visibleEnd; xx++) { - stripPointers[1][x + xx] = value; + stripPointers[(y / 8) + rowsDrawn][x + xx] = value; } + height -= 8; + rowsDrawn++; } } diff --git a/source/Core/Threads/UI/drawing/mono_128x32/draw_homescreen_simplified.cpp b/source/Core/Threads/UI/drawing/mono_128x32/draw_homescreen_simplified.cpp index b97043c6..3c8c1816 100644 --- a/source/Core/Threads/UI/drawing/mono_128x32/draw_homescreen_simplified.cpp +++ b/source/Core/Threads/UI/drawing/mono_128x32/draw_homescreen_simplified.cpp @@ -49,7 +49,6 @@ void ui_draw_homescreen_simplified(TemperatureType_t tipTemp) { } } else { // Draw in missing tip symbol - if (OLED::getRotation()) { // in right handed mode we want to draw over the first part OLED::drawArea(54, 0, 56, 32, disconnectedTipF);