From a95742694c64033d7e0f204e4a538c8ff9f5b20c Mon Sep 17 00:00:00 2001 From: gornekich Date: Tue, 21 May 2024 18:58:02 +0100 Subject: [PATCH] text box: fix reset text offset state after initial text iteration --- applications/services/gui/modules/text_box.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/applications/services/gui/modules/text_box.c b/applications/services/gui/modules/text_box.c index 954847c65..c3bff00d0 100644 --- a/applications/services/gui/modules/text_box.c +++ b/applications/services/gui/modules/text_box.c @@ -227,14 +227,13 @@ static void text_box_prepare_model(Canvas* canvas, TextBoxModel* model) { text_box_seek_next_line(canvas, model); lines_num++; } while(!text_box_end_of_text_reached(model)); + model->text_offset = 0; lines_num++; if(model->focus == TextBoxFocusEnd) { if(lines_num > model->lines_on_screen) { model->text_offset = window_offset[(lines_num - 1) % model->lines_on_screen]; } - } else { - model->text_offset = 0; } if(lines_num > model->lines_on_screen) {