From ddd276e681d5e15a49be54da1c92467988cc1b82 Mon Sep 17 00:00:00 2001 From: CommanderRedYT Date: Wed, 15 Feb 2023 17:19:54 +0100 Subject: [PATCH] Fixed clear --- src/widgets/centeredlabel.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/widgets/centeredlabel.cpp b/src/widgets/centeredlabel.cpp index b11b792..bb5f5be 100644 --- a/src/widgets/centeredlabel.cpp +++ b/src/widgets/centeredlabel.cpp @@ -5,7 +5,6 @@ // local includes #include "tftinterface.h" -#include "richtextrenderer.h" namespace espgui { CenteredLabel::CenteredLabel(int x, int y) : @@ -76,7 +75,7 @@ void CenteredLabel::redraw(TftInterface &tft, FontRenderer &fontRenderer, std::s void CenteredLabel::clear(TftInterface &tft, uint16_t bgcolor) { if (m_lastWidth || m_lastHeight) - tft.fillRect(m_x, m_y, m_lastWidth, m_lastHeight, bgcolor); + tft.fillRect(m_x - (m_lastWidth / 2), m_y, m_lastWidth, m_lastHeight, bgcolor); start(tft); }