Skip to content

Commit

Permalink
fix: avoid boundary refresh on clamped scrolling text
Browse files Browse the repository at this point in the history
  • Loading branch information
Otrebor671 committed Dec 20, 2024
1 parent 6419717 commit d5cf8a0
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ static void button_up_handler() {
if (scroll_text_ctx->current_idx == 0) {
if (scroll_text_ctx->scroll_type == GENERAL_SCROLLING_TEXT_INFINITE) {
scroll_text_ctx->current_idx = scroll_text_ctx->text_len - 1;
} else {
return;
}
} else {
scroll_text_ctx->current_idx--;
Expand All @@ -142,12 +144,14 @@ static void button_up_handler() {

static void button_down_handler() {
if (scroll_text_ctx->current_idx >= scroll_text_ctx->text_len - 1) {
if (scroll_text_ctx->scroll_type == GENERAL_SCROLLING_TEXT_INFINITE) {
scroll_text_ctx->current_idx = 0;
}
if (scroll_text_ctx->finish_cb) {
scroll_text_ctx->finish_cb();
}
if (scroll_text_ctx->scroll_type == GENERAL_SCROLLING_TEXT_INFINITE) {
scroll_text_ctx->current_idx = 0;
} else {
return;
}
} else {
scroll_text_ctx->current_idx++;
}
Expand Down

0 comments on commit d5cf8a0

Please sign in to comment.