aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Diez <jose.manuel.diez@gmail.com>2015-11-11 13:59:41 +0000
committerJose Diez <jose.manuel.diez@gmail.com>2015-11-11 13:59:41 +0000
commit4b1e0997125fcda319facfe630938ba9269ae70c (patch)
tree68a1385a7437a2690e0b2d7095ea998a972451fd
parent3ec88a6a3940621d5ca36671887a85487ff15775 (diff)
downloadimv-4b1e0997125fcda319facfe630938ba9269ae70c.tar.gz
Avoid reloading an image if the path hasn't changed
-rw-r--r--navigator.c6
1 files 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)