summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/pictureflow/pictureflow.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index ae1ec2b224..97b71ee9d0 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -531,6 +531,7 @@ static int itilt;
531static PFreal offsetX; 531static PFreal offsetX;
532static PFreal offsetY; 532static PFreal offsetY;
533static int number_of_slides; 533static int number_of_slides;
534static bool is_initial_slide = true;
534 535
535static struct pf_slide_cache pf_sldcache; 536static struct pf_slide_cache pf_sldcache;
536 537
@@ -2903,13 +2904,19 @@ static inline struct dim *surface(const int slide_index)
2903 { 2904 {
2904 int j = 0; 2905 int j = 0;
2905 do { 2906 do {
2906 if (pf_sldcache.cache[i].index == slide_index) 2907 if (pf_sldcache.cache[i].index == slide_index) {
2908 if (is_initial_slide && slide_index == center_index)
2909 is_initial_slide = false;
2907 return get_slide(pf_sldcache.cache[i].hid); 2910 return get_slide(pf_sldcache.cache[i].hid);
2911 }
2908 i = pf_sldcache.cache[i].next; 2912 i = pf_sldcache.cache[i].next;
2909 j++; 2913 j++;
2910 } while (i != pf_sldcache.used && j < SLIDE_CACHE_SIZE); 2914 } while (i != pf_sldcache.used && j < SLIDE_CACHE_SIZE);
2911 } 2915 }
2912 return get_slide(empty_slide_hid); 2916 if (is_initial_slide && slide_index == center_index)
2917 return NULL;
2918 else
2919 return get_slide(empty_slide_hid);
2913} 2920}
2914 2921
2915/** 2922/**
@@ -3245,6 +3252,7 @@ static bool sort_albums(int new_sorting, bool from_settings)
3245 rb->buflib_init(&buf_ctx, (void *)pf_idx.buf, pf_idx.buf_sz); 3252 rb->buflib_init(&buf_ctx, (void *)pf_idx.buf, pf_idx.buf_sz);
3246 empty_slide_hid = read_pfraw(EMPTY_SLIDE, 0); 3253 empty_slide_hid = read_pfraw(EMPTY_SLIDE, 0);
3247 initialize_slide_cache(); 3254 initialize_slide_cache();
3255 is_initial_slide = true;
3248 create_pf_thread(); 3256 create_pf_thread();
3249 3257
3250 /* Go to previously selected slide */ 3258 /* Go to previously selected slide */
@@ -4455,7 +4463,8 @@ static int pictureflow_main(const char* selected_file)
4455 4463
4456 4464
4457 /* Copy offscreen buffer to LCD and give time to other threads */ 4465 /* Copy offscreen buffer to LCD and give time to other threads */
4458 mylcd_update(); 4466 if (is_initial_slide == false)
4467 mylcd_update();
4459 rb->yield(); 4468 rb->yield();
4460 4469
4461 /*/ Handle buttons */ 4470 /*/ Handle buttons */