Skip to content

Commit 39fe01a

Browse files
committed
Update Animated_dial.ino
Correct error in example that became apparent with recent library updates.
1 parent 22ca819 commit 39fe01a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/Sprite/Animated_dial/Animated_dial.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void setup() {
8989
spr.setTextColor(TFT_WHITE, bg_color);
9090
spr.setTextDatum(MC_DATUM);
9191
spr.setTextPadding(spr_width);
92-
spr.drawNumber(0, spr_width/2, 0);
92+
spr.drawNumber(0, spr_width/2, spr.fontHeight()/2);
9393
spr.pushSprite(DIAL_CENTRE_X - spr_width / 2, DIAL_CENTRE_Y - spr.fontHeight() / 2);
9494

9595
// Plot the label text
@@ -203,7 +203,7 @@ void plotNeedle(int16_t angle, uint16_t ms_delay)
203203
}
204204

205205
// Update the number at the centre of the dial
206-
spr.drawNumber(old_angle+120, spr_width/2, 0);
206+
spr.drawNumber(old_angle+120, spr_width/2, spr.fontHeight()/2);
207207
spr.pushSprite(120 - spr_width / 2, 120 - spr.fontHeight() / 2);
208208

209209
// Slow needle down slightly as it approaches the new position

0 commit comments

Comments
 (0)