Fixed BigValueDisplay
This commit is contained in:
@ -26,7 +26,11 @@ std::string richTextEscape(std::string_view subject)
|
|||||||
int16_t renderRichText(TftInterface &tft, std::string_view str, int32_t poX, int32_t poY, uint16_t color, uint16_t bgcolor, uint8_t font)
|
int16_t renderRichText(TftInterface &tft, std::string_view str, int32_t poX, int32_t poY, uint16_t color, uint16_t bgcolor, uint8_t font)
|
||||||
{
|
{
|
||||||
FontRenderer fontRenderer{tft};
|
FontRenderer fontRenderer{tft};
|
||||||
|
return renderRichText(tft, fontRenderer, str, poX, poY, color, bgcolor, font);
|
||||||
|
}
|
||||||
|
|
||||||
|
int16_t renderRichText(TftInterface &tft, FontRenderer &fontRenderer, std::string_view str, int32_t poX, int32_t poY, uint16_t color, uint16_t bgcolor, uint8_t font)
|
||||||
|
{
|
||||||
if (str.empty())
|
if (str.empty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
// forward declares
|
// forward declares
|
||||||
namespace espgui { class TftInterface; }
|
namespace espgui { class TftInterface; class FontRenderer; }
|
||||||
|
|
||||||
namespace espgui {
|
namespace espgui {
|
||||||
|
|
||||||
@ -13,5 +13,6 @@ void richTextEscape(std::string &subject);
|
|||||||
std::string richTextEscape(std::string_view subject);
|
std::string richTextEscape(std::string_view subject);
|
||||||
|
|
||||||
int16_t renderRichText(TftInterface &tft, std::string_view str, int32_t poX, int32_t poY, uint16_t color, uint16_t bgcolor, uint8_t font);
|
int16_t renderRichText(TftInterface &tft, std::string_view str, int32_t poX, int32_t poY, uint16_t color, uint16_t bgcolor, uint8_t font);
|
||||||
|
int16_t renderRichText(TftInterface &tft, FontRenderer &fontRenderer, std::string_view str, int32_t poX, int32_t poY, uint16_t color, uint16_t bgcolor, uint8_t font);
|
||||||
|
|
||||||
} // namespace espgui
|
} // namespace espgui
|
||||||
|
@ -38,7 +38,7 @@ void Label::redraw(TftInterface &tft, FontRenderer &fontRenderer, std::string_vi
|
|||||||
!forceRedraw)
|
!forceRedraw)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const auto renderedWidth = renderRichText(tft, str, m_x, m_y, color, bgcolor, font);
|
const auto renderedWidth = renderRichText(tft, fontRenderer, str, m_x, m_y, color, bgcolor, font);
|
||||||
const auto renderedHeight = fontRenderer.fontHeight(font);
|
const auto renderedHeight = fontRenderer.fontHeight(font);
|
||||||
|
|
||||||
if (renderedWidth < m_lastWidth)
|
if (renderedWidth < m_lastWidth)
|
||||||
|
Reference in New Issue
Block a user