mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Fixup oled drawing for fill area
This commit is contained in:
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user