1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 04:34:43 +04:00

Text Box: fix displaying text with end text focus (#3658)

* text box: fix reset text offset state after initial text iteration
* debug: add tests for text box view debug app
* hal: flash: removed redundant #else

Co-authored-by: hedger <hedger@nanode.su>
This commit is contained in:
gornekich
2024-05-22 18:14:33 +01:00
committed by GitHub
parent e0797131ec
commit 11070c9e5e
3 changed files with 30 additions and 4 deletions

View File

@@ -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) {