mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-08-04 13:14:46 +02:00
Fix deleteSprite
Fixes #736 and also delete color map even if the sprite has not been created.
This commit is contained in:
@@ -125,7 +125,7 @@ void* TFT_eSprite::getPointer(void)
|
||||
|
||||
/***************************************************************************************
|
||||
** Function name: created
|
||||
** Description: Returns true is sprite has been created
|
||||
** Description: Returns true if sprite has been created
|
||||
***************************************************************************************/
|
||||
bool TFT_eSprite::created(void)
|
||||
{
|
||||
@@ -376,18 +376,18 @@ uint16_t TFT_eSprite::getPaletteColor(uint8_t index)
|
||||
***************************************************************************************/
|
||||
void TFT_eSprite::deleteSprite(void)
|
||||
{
|
||||
if (!_created ) return;
|
||||
|
||||
if (_colorMap != nullptr)
|
||||
{
|
||||
free(_colorMap);
|
||||
_colorMap = nullptr;
|
||||
}
|
||||
|
||||
if (_created)
|
||||
{
|
||||
free(_img8_1);
|
||||
|
||||
_img8 = nullptr;
|
||||
|
||||
_created = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#ifndef _TFT_eSPIH_
|
||||
#define _TFT_eSPIH_
|
||||
|
||||
#define TFT_ESPI_VERSION "2.2.18"
|
||||
#define TFT_ESPI_VERSION "2.2.19"
|
||||
|
||||
/***************************************************************************************
|
||||
** Section 1: Load required header files
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "TFT_eSPI",
|
||||
"version": "2.2.18",
|
||||
"version": "2.2.19",
|
||||
"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":
|
||||
|
@@ -1,5 +1,5 @@
|
||||
name=TFT_eSPI
|
||||
version=2.2.18
|
||||
version=2.2.19
|
||||
author=Bodmer
|
||||
maintainer=Bodmer
|
||||
sentence=TFT graphics library for Arduino processors with performance optimisation for STM32, ESP8266 and ESP32
|
||||
|
Reference in New Issue
Block a user