diff --git a/TFT_Drivers/ST7789_2_Rotation.h b/TFT_Drivers/ST7789_2_Rotation.h index d25cc0c..44a363e 100644 --- a/TFT_Drivers/ST7789_2_Rotation.h +++ b/TFT_Drivers/ST7789_2_Rotation.h @@ -5,8 +5,16 @@ switch (rotation) { case 0: // Portrait #ifdef CGRAM_OFFSET - colstart = 0; - rowstart = 0; + if (_init_width == 135) + { + colstart = 52; + rowstart = 40; + } + else + { + colstart = 0; + rowstart = 0; + } #endif writedata(TFT_MAD_COLOR_ORDER); @@ -16,8 +24,16 @@ case 1: // Landscape (Portrait + 90) #ifdef CGRAM_OFFSET - colstart = 0; - rowstart = 0; + if (_init_width == 135) + { + colstart = 40; + rowstart = 53; + } + else + { + colstart = 0; + rowstart = 0; + } #endif writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER); @@ -27,8 +43,16 @@ case 2: // Inverter portrait #ifdef CGRAM_OFFSET - colstart = 0; - rowstart = 80; + if (_init_width == 135) + { + colstart = 53; + rowstart = 40; + } + else + { + colstart = 0; + rowstart = 80; + } #endif writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER); @@ -37,8 +61,16 @@ break; case 3: // Inverted landscape #ifdef CGRAM_OFFSET - colstart = 80; - rowstart = 0; + if (_init_width == 135) + { + colstart = 40; + rowstart = 52; + } + else + { + colstart = 80; + rowstart = 0; + } #endif writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER); diff --git a/TFT_eSPI.h b/TFT_eSPI.h index d4fdd50..68c7c60 100644 --- a/TFT_eSPI.h +++ b/TFT_eSPI.h @@ -16,7 +16,7 @@ #ifndef _TFT_eSPIH_ #define _TFT_eSPIH_ -#define TFT_ESPI_VERSION "2.2.21" +#define TFT_ESPI_VERSION "2.2.22" /*************************************************************************************** ** Section 1: Load required header files diff --git a/library.json b/library.json index cb48502..ebf197a 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "TFT_eSPI", - "version": "2.2.21", + "version": "2.2.22", "keywords": "Arduino, tft, ePaper, display, STM32, ESP8266, NodeMCU, ESP32, M5Stack, ILI9341, ST7735, ILI9163, S6D02A1, ILI9486, ST7789, RM68140", "description": "A TFT and ePaper SPI graphics library with optimisation for ESP8266, ESP32 and STM32", "repository": diff --git a/library.properties b/library.properties index f8677ac..e20d1d6 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=TFT_eSPI -version=2.2.21 +version=2.2.22 author=Bodmer maintainer=Bodmer sentence=TFT graphics library for Arduino processors with performance optimisation for STM32, ESP8266 and ESP32