Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/flipperzero-firmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhedger <hedger@users.noreply.github.com>2022-05-08 19:33:47 +0300
committerGitHub <noreply@github.com>2022-05-08 19:33:47 +0300
commit23cff2a7d2a2e1483cea10f7d6ace84222e2ed72 (patch)
tree133029ec7dc8bb3c39f03178dd353e86b130a716 /applications/subghz/views
parent51efe8b805d813b62e41e4a5bf309fdfa6e407c7 (diff)
[FL-2526] SubGhz: fixed receiver list scrolling #1207
Diffstat (limited to 'applications/subghz/views')
-rw-r--r--applications/subghz/views/receiver.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/applications/subghz/views/receiver.c b/applications/subghz/views/receiver.c
index fc66e4fd..7b19cbcf 100644
--- a/applications/subghz/views/receiver.c
+++ b/applications/subghz/views/receiver.c
@@ -68,14 +68,13 @@ static void subghz_view_receiver_update_offset(SubGhzViewReceiver* subghz_receiv
size_t history_item = model->history_item;
uint16_t bounds = history_item > 3 ? 2 : history_item;
- if(history_item > 3 && model->idx >= history_item - 1) {
+ if(history_item > 3 && model->idx >= (int16_t)(history_item - 1)) {
model->list_offset = model->idx - 3;
} else if(model->list_offset < model->idx - bounds) {
- model->list_offset = CLAMP(
- (uint16_t)(model->list_offset + 1), (uint16_t)(history_item - bounds), 0);
- } else if(model->list_offset > model->idx - bounds) {
model->list_offset =
- CLAMP((uint16_t)(model->idx - 1), (uint16_t)(history_item - bounds), 0);
+ CLAMP(model->list_offset + 1, (int16_t)(history_item - bounds), 0);
+ } else if(model->list_offset > model->idx - bounds) {
+ model->list_offset = CLAMP(model->idx - 1, (int16_t)(history_item - bounds), 0);
}
return true;
});