Merge pull request #230 from aHVzY2g/pr/228

fix pr #228 int float casting & made fillRect 2px smaller
This commit is contained in:
Kevin Hester
2020-06-25 11:41:40 -07:00
committed by GitHub

View File

@@ -740,9 +740,9 @@ void Screen::adjustBrightness(){
} else { } else {
brightness++; brightness++;
} }
int width = (brightness / 254) * SCREEN_WIDTH; int width = brightness / (254.00 / SCREEN_WIDTH);
dispdev.drawRect( 0, 30, SCREEN_WIDTH, 4); dispdev.drawRect( 0, 30, SCREEN_WIDTH, 4);
dispdev.fillRect(0, 30, width, 4); dispdev.fillRect(0, 31, width, 2);
dispdev.display(); dispdev.display();
dispdev.setBrightness(brightness); dispdev.setBrightness(brightness);
} }