fix 1.14" tft rotation 3

This commit is contained in:
lady ada 2022-01-10 16:26:52 -05:00
parent 84a5b431af
commit bcc7e08752

View file

@ -103,7 +103,7 @@ void Adafruit_ST7789::init(uint16_t width, uint16_t height, uint8_t mode) {
commonInit(NULL); commonInit(NULL);
if (width == 174 && height == 320) { if (width == 172 && height == 320) {
// 1.47" display // 1.47" display
_rowstart = _rowstart2 = 0; _rowstart = _rowstart2 = 0;
_colstart = _colstart2 = 34; _colstart = _colstart2 = 34;
@ -112,11 +112,10 @@ void Adafruit_ST7789::init(uint16_t width, uint16_t height, uint8_t mode) {
_rowstart = 20; _rowstart = 20;
_rowstart2 = 0; _rowstart2 = 0;
_colstart = _colstart2 = 0; _colstart = _colstart2 = 0;
} else if (width < 240) { } else if (width == 135 && height == 240) {
// 1.14" display // 1.14" display
_rowstart = _rowstart2 = (int)((320 - height + 1) / 2); _rowstart = _rowstart2 = (int)((320 - height + 1) / 2);
_colstart = (int)((240 - width + 1) / 2); _colstart2 = _colstart = (int)((240 - width + 1) / 2);
_colstart2 = (int)((240 - width) / 2);
} else { } else {
// 1.3", 1.54", and 2.0" displays // 1.3", 1.54", and 2.0" displays
_rowstart = (320 - height); _rowstart = (320 - height);