From 572b65e79b0a2f871c3121e092467e6f645a2dd7 Mon Sep 17 00:00:00 2001 From: Just Call Me Koko <25190487+justcallmekoko@users.noreply.github.com> Date: Wed, 5 Feb 2020 12:57:00 -0500 Subject: [PATCH] Move button datum and deltas to constructor --- Extensions/Button.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Extensions/Button.cpp b/Extensions/Button.cpp index 27a91a1..2667e0a 100644 --- a/Extensions/Button.cpp +++ b/Extensions/Button.cpp @@ -3,7 +3,10 @@ ** Grabbed from Adafruit_GFX library and enhanced to handle any label font ***************************************************************************************/ TFT_eSPI_Button::TFT_eSPI_Button(void) { - _gfx = 0; + _gfx = 0; + _xd = 0; + _yd = 0; + _textdatum = MC_DATUM; } // Classic initButton() function: pass center & size @@ -27,13 +30,10 @@ void TFT_eSPI_Button::initButtonUL( _y1 = y1; _w = w; _h = h; - _xd = 0; - _yd = 0; _outlinecolor = outline; _fillcolor = fill; _textcolor = textcolor; _textsize = textsize; - _textdatum = MC_DATUM; _gfx = gfx; strncpy(_label, label, 9); }