From 39fe01afa3778ced55abf13a8db607f9c14f9c53 Mon Sep 17 00:00:00 2001 From: Bodmer Date: Tue, 6 Oct 2020 14:26:13 +0100 Subject: [PATCH] Update Animated_dial.ino Correct error in example that became apparent with recent library updates. --- examples/Sprite/Animated_dial/Animated_dial.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/Sprite/Animated_dial/Animated_dial.ino b/examples/Sprite/Animated_dial/Animated_dial.ino index 33b7d50..9ecd5b9 100644 --- a/examples/Sprite/Animated_dial/Animated_dial.ino +++ b/examples/Sprite/Animated_dial/Animated_dial.ino @@ -89,7 +89,7 @@ void setup() { spr.setTextColor(TFT_WHITE, bg_color); spr.setTextDatum(MC_DATUM); spr.setTextPadding(spr_width); - spr.drawNumber(0, spr_width/2, 0); + spr.drawNumber(0, spr_width/2, spr.fontHeight()/2); spr.pushSprite(DIAL_CENTRE_X - spr_width / 2, DIAL_CENTRE_Y - spr.fontHeight() / 2); // Plot the label text @@ -203,7 +203,7 @@ void plotNeedle(int16_t angle, uint16_t ms_delay) } // Update the number at the centre of the dial - spr.drawNumber(old_angle+120, spr_width/2, 0); + spr.drawNumber(old_angle+120, spr_width/2, spr.fontHeight()/2); spr.pushSprite(120 - spr_width / 2, 120 - spr.fontHeight() / 2); // Slow needle down slightly as it approaches the new position