Fix computation in scrollMargin

as per issue #62

The function does not work as the computation of middle was incorrect.
it either needed to be
 uint16_t middle = ILI9341_TFTHEIGHT - top - bottom;

or what I prefer and did:
uint16_t middle = ILI9341_TFTHEIGHT - (top + bottom);
This commit is contained in:
Kurt Eckhardt committed 2021-05-14 08:10:45 -07:00
1 parent 8b01d82133
commit d2694821a3
1 file changed
+1 -1
+1 -1
View File
@@ -277,7 +277,7 @@ void Adafruit_ILI9341::scrollTo(uint16_t y) {
void Adafruit_ILI9341::setScrollMargins(uint16_t top, uint16_t bottom) {
// TFA+VSA+BFA must equal 320
if (top + bottom <= ILI9341_TFTHEIGHT) {
uint16_t middle = ILI9341_TFTHEIGHT - top + bottom;
uint16_t middle = ILI9341_TFTHEIGHT - (top + bottom);
uint8_t data[6];
data[0] = top >> 8;
data[1] = top & 0xff;