From 7f909a152734b116c3c0af3ae4c6431138800309 Mon Sep 17 00:00:00 2001 From: Bodmer Date: Sun, 3 Dec 2017 02:55:43 +0000 Subject: [PATCH] Fix bug in 16 bit transparent Sprite --- TFT_eSPI.cpp | 5 +++-- library.json | 2 +- library.properties | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/TFT_eSPI.cpp b/TFT_eSPI.cpp index 8091383..70939c2 100644 --- a/TFT_eSPI.cpp +++ b/TFT_eSPI.cpp @@ -613,7 +613,8 @@ void TFT_eSPI::pushSprite(int32_t x, int32_t y, uint32_t w, uint32_t h, uint16_t data += dx + dy * w; int32_t xe = x + dw - 1, ye = y + dh - 1; - + + transp = transp >> 8 | transp << 8; while (dh--) { int32_t len = dw; @@ -626,7 +627,7 @@ void TFT_eSPI::pushSprite(int32_t x, int32_t y, uint32_t w, uint32_t h, uint16_t if (transp != *ptr) { if (move) { move = false; setAddrWindow(px, y, xe, ye); } - SPI.write16(*ptr>>8 | *ptr <<8); + SPI.write16(*ptr>>8 | *ptr<<8); } else move = true; px++; diff --git a/library.json b/library.json index 6e1aae2..f7d7113 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "TFT_eSPI", - "version": "0.17.16", + "version": "0.17.17", "keywords": "TFT, ESP8266, NodeMCU, ESP32, ILI9341, ST7735, ILI9163, S6D02A1, ILI9486", "description": "A TFT SPI graphics library for ESP8266", "repository": diff --git a/library.properties b/library.properties index e1a4888..787cc6f 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=TFT_eSPI -version=0.17.16 +version=0.17.17 author=Bodmer maintainer=Bodmer sentence=A fast TFT library for ESP8266 processors and the Arduino IDE