mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-14 07:18:35 -07:00
File list offset fix
This commit is contained in:
@@ -265,8 +265,7 @@ void archive_file_array_load(ArchiveBrowserView* browser, int8_t dir) {
|
||||
offset_new = model->item_idx - FILE_LIST_BUF_LEN / 4 * 1;
|
||||
}
|
||||
if(offset_new > 0) {
|
||||
offset_new =
|
||||
CLAMP(offset_new, (int32_t)model->item_cnt - FILE_LIST_BUF_LEN, 0);
|
||||
offset_new = CLAMP(offset_new, (int32_t)model->item_cnt, 0);
|
||||
} else {
|
||||
offset_new = 0;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#define TAB_RIGHT InputKeyRight // Default tab swith direction
|
||||
#define TAB_DEFAULT ArchiveTabFavorites // Start tab
|
||||
#define FILE_LIST_BUF_LEN 100
|
||||
#define FILE_LIST_BUF_LEN 50
|
||||
|
||||
static const char* tab_default_paths[] = {
|
||||
[ArchiveTabFavorites] = "/app:favorites",
|
||||
|
||||
@@ -527,7 +527,7 @@ static bool file_browser_view_input_callback(InputEvent* event, void* context) {
|
||||
model->list_loading = true;
|
||||
int32_t load_offset = CLAMP(
|
||||
model->item_idx - ITEM_LIST_LEN_MAX / 4 * 3,
|
||||
(int32_t)model->item_cnt - ITEM_LIST_LEN_MAX,
|
||||
(int32_t)model->item_cnt,
|
||||
0);
|
||||
file_browser_worker_load(
|
||||
browser->worker, load_offset, ITEM_LIST_LEN_MAX);
|
||||
@@ -538,7 +538,7 @@ static bool file_browser_view_input_callback(InputEvent* event, void* context) {
|
||||
model->list_loading = true;
|
||||
int32_t load_offset = CLAMP(
|
||||
model->item_idx - ITEM_LIST_LEN_MAX / 4 * 1,
|
||||
(int32_t)model->item_cnt - ITEM_LIST_LEN_MAX,
|
||||
(int32_t)model->item_cnt,
|
||||
0);
|
||||
file_browser_worker_load(
|
||||
browser->worker, load_offset, ITEM_LIST_LEN_MAX);
|
||||
|
||||
Reference in New Issue
Block a user