From c8e42c744873c7d27eea7e0f0e99e6d2da8a9793 Mon Sep 17 00:00:00 2001 From: Adam Wonak Date: Sat, 21 Jun 2025 15:45:11 -0700 Subject: [PATCH] use appropriate string width method. --- examples/Gravity/display.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/Gravity/display.h b/examples/Gravity/display.h index 3291238..b9994ed 100644 --- a/examples/Gravity/display.h +++ b/examples/Gravity/display.h @@ -82,13 +82,13 @@ constexpr int CHANNEL_BOX_HEIGHT = 14; // Helper function to draw centered text void drawCenteredText(const char* text, int y, const uint8_t* font) { gravity.display.setFont(font); - int textWidth = gravity.display.getUTF8Width(text); + int textWidth = gravity.display.getStrWidth(text); gravity.display.drawStr(SCREEN_CENTER_X - (textWidth / 2), y, text); } // Helper function to draw right-aligned text void drawRightAlignedText(const char* text, int y) { - int textWidth = gravity.display.getUTF8Width(text); + int textWidth = gravity.display.getStrWidth(text); int drawX = (SCREEN_WIDTH - textWidth) - MENU_BOX_PADDING; gravity.display.drawStr(drawX, y, text); }