From 3fdd9fa601e4040328bee9037fcfaf9205db5578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Baku=20=E9=BA=A6?= Date: Wed, 14 Jun 2023 14:03:57 +0900 Subject: [PATCH] Use TFT_eSprite.drawNumber for the current position (#118) I would suggest using `drawNumber` instead of drawString to align each digit of the number to the same width and erase the jittering effect when the current position is changed. --- firmware/src/display_task.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/src/display_task.cpp b/firmware/src/display_task.cpp index 7777210..0a78536 100644 --- a/firmware/src/display_task.cpp +++ b/firmware/src/display_task.cpp @@ -62,7 +62,7 @@ void DisplayTask::run() { } spr_.setFreeFont(&Roboto_Light_60); - spr_.drawString(String() + state.current_position, TFT_WIDTH / 2, TFT_HEIGHT / 2 - VALUE_OFFSET, 1); + spr_.drawNumber(state.current_position, TFT_WIDTH / 2, TFT_HEIGHT / 2 - VALUE_OFFSET, 1); spr_.setFreeFont(&DESCRIPTION_FONT); int32_t line_y = TFT_HEIGHT / 2 + DESCRIPTION_Y_OFFSET; char* start = state.config.text;