forked from Bodmer/TFT_eSPI
fixes oida
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#include <algorithm>
|
||||
|
||||
/***************************************************************************************
|
||||
** Code for the GFX button UI element
|
||||
** Grabbed from Adafruit_GFX library and enhanced to handle any label font
|
||||
@@ -60,7 +62,7 @@ void TFT_eSPI_Button::drawButton(bool inverted, std::string_view long_name) {
|
||||
text = _fillcolor;
|
||||
}
|
||||
|
||||
uint8_t r = min(_w, _h) / 4; // Corner radius
|
||||
uint8_t r = std::min(_w, _h) / 4; // Corner radius
|
||||
_gfx->fillRoundRect(_x1, _y1, _w, _h, r, fill);
|
||||
_gfx->drawRoundRect(_x1, _y1, _w, _h, r, outline);
|
||||
|
||||
@@ -69,7 +71,7 @@ void TFT_eSPI_Button::drawButton(bool inverted, std::string_view long_name) {
|
||||
_y1 + (_h / 4));
|
||||
_gfx->setTextColor(text);
|
||||
_gfx->setTextSize(_textsize);
|
||||
_gfx->print(_label);
|
||||
// _gfx->print(_label);
|
||||
}
|
||||
else {
|
||||
_gfx->setTextColor(text, fill);
|
||||
|
@@ -224,7 +224,7 @@
|
||||
// SPI BUS
|
||||
#else
|
||||
#if CONFIG_TFT_MISO == -1
|
||||
#error "Invalid MISO pin. Check TFT_eSPI configuration"
|
||||
//#error "Invalid MISO pin. Check TFT_eSPI configuration"
|
||||
#else
|
||||
#define TFT_MISO CONFIG_TFT_MISO
|
||||
#endif
|
||||
|
10
TFT_eSPI.cpp
10
TFT_eSPI.cpp
@@ -4187,16 +4187,6 @@ void TFT_eSPI::fillRectHGradient(int16_t x, int16_t y, int16_t w, int16_t h, uin
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************************
|
||||
** Function name: color565
|
||||
** Description: convert three 8 bit RGB levels to a 16 bit colour value
|
||||
***************************************************************************************/
|
||||
uint16_t TFT_eSPI::color565(uint8_t r, uint8_t g, uint8_t b)
|
||||
{
|
||||
return ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3);
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************************
|
||||
** Function name: color8to16
|
||||
** Description: convert 8 bit colour to a 16 bit 565 colour value
|
||||
|
@@ -29,6 +29,7 @@
|
||||
//Standard support
|
||||
#include <SPI.h>
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
/***************************************************************************************
|
||||
|
Reference in New Issue
Block a user