diff options
author | Jose Diez <jose.manuel.diez@gmail.com> | 2015-11-11 13:59:41 +0000 |
---|---|---|
committer | Jose Diez <jose.manuel.diez@gmail.com> | 2015-11-11 13:59:41 +0000 |
commit | 4b1e0997125fcda319facfe630938ba9269ae70c (patch) | |
tree | 68a1385a7437a2690e0b2d7095ea998a972451fd | |
parent | 3ec88a6a3940621d5ca36671887a85487ff15775 (diff) | |
download | imv-4b1e0997125fcda319facfe630938ba9269ae70c.tar.gz |
Avoid reloading an image if the path hasn't changed
-rw-r--r-- | navigator.c | 6 |
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) |