Skip to content
Snippets Groups Projects
Commit abd5e8e5 authored by Fabrice Weinberg's avatar Fabrice Weinberg
Browse files

Fix drawRect drawing one pixel more than specified in both dimension

parent 0ab39f1c
No related merge requests found
...@@ -125,8 +125,8 @@ void OLEDDisplay::drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1) { ...@@ -125,8 +125,8 @@ void OLEDDisplay::drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1) {
void OLEDDisplay::drawRect(int16_t x, int16_t y, int16_t width, int16_t height) { void OLEDDisplay::drawRect(int16_t x, int16_t y, int16_t width, int16_t height) {
drawHorizontalLine(x, y, width); drawHorizontalLine(x, y, width);
drawVerticalLine(x, y, height); drawVerticalLine(x, y, height);
drawVerticalLine(x + width, y, height); drawVerticalLine(x + width - 1, y, height);
drawHorizontalLine(x, y + height, width); drawHorizontalLine(x, y + height - 1, width);
} }
void OLEDDisplay::fillRect(int16_t xMove, int16_t yMove, int16_t width, int16_t height) { void OLEDDisplay::fillRect(int16_t xMove, int16_t yMove, int16_t width, int16_t height) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment