From 4b1e0997125fcda319facfe630938ba9269ae70c Mon Sep 17 00:00:00 2001 From: Jose Diez Date: Wed, 11 Nov 2015 13:59:41 +0000 Subject: Avoid reloading an image if the path hasn't changed --- navigator.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/navigator.c b/navigator.c index fcb6c52..408c53c 100644 --- a/navigator.c +++ b/navigator.c @@ -126,6 +126,7 @@ const char *imv_navigator_get_current_path(struct imv_navigator *nav) void imv_navigator_next_path(struct imv_navigator *nav) { + int prev_path = nav->cur_path; if(nav->num_paths == 0) { return; } @@ -134,11 +135,12 @@ void imv_navigator_next_path(struct imv_navigator *nav) nav->cur_path = 0; } nav->last_move_direction = 1; - nav->changed = 1; + nav->changed = prev_path != nav->cur_path; } void imv_navigator_prev_path(struct imv_navigator *nav) { + int prev_path = nav->cur_path; if(nav->num_paths == 0) { return; } @@ -147,7 +149,7 @@ void imv_navigator_prev_path(struct imv_navigator *nav) nav->cur_path = nav->num_paths - 1; } nav->last_move_direction = -1; - nav->changed = 1; + nav->changed = prev_path != nav->cur_path; } void imv_navigator_remove_current_path(struct imv_navigator *nav) -- cgit v1.2.3