From 170be709feb2e58fed0df824cbaaad347aeb85f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sat, 8 Apr 2023 21:08:49 +0200 Subject: [PATCH] menu sliding to last px --- Core/Src/app_gui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/Src/app_gui.c b/Core/Src/app_gui.c index 5e01d66..ed38be5 100644 --- a/Core/Src/app_gui.c +++ b/Core/Src/app_gui.c @@ -357,9 +357,9 @@ static void screen_menu(GuiEvent event, const char **options, menu_callback_t cb if (tickNow - menu->change_time >= pdMS_TO_TICKS(500)) { const uint32_t textlen = strlen(options[menu->pos]) * 6; if (textlen >= FBW - 2) { - if (textlen - menu->text_slide > FBW - 2) { + if (textlen - menu->text_slide > FBW - 1) { menu->text_slide += 1; - if (textlen - menu->text_slide > FBW - 2) { + if (textlen - menu->text_slide >= FBW - 1) { menu->slide_end_time = tickNow; } } else if (tickNow - menu->slide_end_time >= pdMS_TO_TICKS(500)) {