diff --git a/libraries/TFT/src/utility/Adafruit_ST7735.cpp b/libraries/TFT/src/utility/Adafruit_ST7735.cpp index df91f7d27c8..e2cd7ce8ecc 100644 --- a/libraries/TFT/src/utility/Adafruit_ST7735.cpp +++ b/libraries/TFT/src/utility/Adafruit_ST7735.cpp @@ -444,6 +444,9 @@ void Adafruit_ST7735::drawPixel(int16_t x, int16_t y, uint16_t color) { void Adafruit_ST7735::drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) { + // Needed to achieve correct line length + h++; + // Rudimentary clipping if((x >= _width) || (y >= _height)) return; if((y+h-1) >= _height) h = _height-y; @@ -465,6 +468,9 @@ void Adafruit_ST7735::drawFastVLine(int16_t x, int16_t y, int16_t h, void Adafruit_ST7735::drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) { + // Needed to achieve correct line length + w++; + // Rudimentary clipping if((x >= _width) || (y >= _height)) return; if((x+w-1) >= _width) w = _width-x;