Skip to content

Commit 1314a34

Browse files
committed
Fix #625
pushRect() reinstated to pair with readRect() so swapBytes does not need to be changed from true to false before calling.
1 parent 7e4566f commit 1314a34

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

TFT_eSPI.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -860,14 +860,14 @@ void TFT_eSPI::readRect(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *da
860860

861861

862862
/***************************************************************************************
863-
** Function name: push rectangle (for SPI Interface II i.e. IM [3:0] = "1101")
863+
** Function name: push rectangle
864864
** Description: push 565 pixel colours into a defined area
865865
***************************************************************************************/
866866
void TFT_eSPI::pushRect(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *data)
867867
{
868-
// Function deprecated, remains for backwards compatibility
869-
// New pushImage() is better as it will crop partly off-screen image blocks
868+
bool swap = _swapBytes; _swapBytes = false;
870869
pushImage(x, y, w, h, data);
870+
_swapBytes = swap;
871871
}
872872

873873

TFT_eSPI.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#ifndef _TFT_eSPIH_
1717
#define _TFT_eSPIH_
1818

19-
#define TFT_ESPI_VERSION "2.2.6"
19+
#define TFT_ESPI_VERSION "2.2.7"
2020

2121
/***************************************************************************************
2222
** Section 1: Load required header files
@@ -450,7 +450,7 @@ class TFT_eSPI : public Print {
450450
// The next functions can be used as a pair to copy screen blocks (or horizontal/vertical lines) to another location
451451
// Read a block of pixels to a data buffer, buffer is 16 bit and the size must be at least w * h
452452
void readRect(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *data);
453-
// Write a block of pixels to the screen - this is a deprecated alternative to pushImage()
453+
// Write a block of pixels to the screen which have been read by readRect()
454454
void pushRect(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *data);
455455

456456
// These are used to render images or sprites stored in RAM arrays (used by Sprite class for 16bpp Sprites)

library.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "TFT_eSPI",
3-
"version": "2.2.6",
3+
"version": "2.2.7",
44
"keywords": "Arduino, tft, ePaper, display, STM32, ESP8266, NodeMCU, ESP32, M5Stack, ILI9341, ST7735, ILI9163, S6D02A1, ILI9486, ST7789, RM68140",
55
"description": "A TFT and ePaper SPI graphics library with optimisation for ESP8266, ESP32 and STM32",
66
"repository":

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=TFT_eSPI
2-
version=2.2.6
2+
version=2.2.7
33
author=Bodmer
44
maintainer=Bodmer
55
sentence=TFT graphics library for Arduino processors with performance optimisation for STM32, ESP8266 and ESP32

0 commit comments

Comments
 (0)