diff options
author | Harry Jeffery <harry@exec64.co.uk> | 2015-11-28 01:24:40 +0000 |
---|---|---|
committer | Harry Jeffery <harry@exec64.co.uk> | 2015-11-28 01:24:40 +0000 |
commit | 9086e6353212da91f4eb0a4efda361aa03850e42 (patch) | |
tree | 8779d153f24fa170f789e2ed5cb724b420773771 | |
parent | d34017591017697df1d813a01062edecefc747c5 (diff) | |
download | imv-9086e6353212da91f4eb0a4efda361aa03850e42.tar.gz |
Hack image changing logic back into shape
-rw-r--r-- | src/main.c | 25 |
1 files changed, 16 insertions, 9 deletions
@@ -290,6 +290,7 @@ int main(int argc, char** argv) } double last_time = SDL_GetTicks() / 1000.0; + int is_new_image = 1; int quit = 0; while(!quit) { @@ -371,6 +372,7 @@ int main(int argc, char** argv) } imv_loader_load_path(&ldr, current_path); + is_new_image = 1; } FIBITMAP *bmp = imv_loader_get_image(&ldr); @@ -378,15 +380,20 @@ int main(int argc, char** argv) imv_texture_set_image(&tex, bmp); FreeImage_Unload(bmp); - const char *current_path = imv_navigator_get_current_path(&nav); - char title[256]; - snprintf(&title[0], sizeof(title), "imv - [%i/%i] [%ix%i] %s", - nav.cur_path + 1, nav.num_paths, - tex.width, tex.height, current_path); - imv_viewport_set_title(&view, title); - imv_viewport_scale_to_window(&view, &tex); - if(g_options.actual) { - imv_viewport_scale_to_actual(&view, &tex); + if(is_new_image) { + is_new_image = 0; + const char *current_path = imv_navigator_get_current_path(&nav); + char title[256]; + snprintf(&title[0], sizeof(title), "imv - [%i/%i] [%ix%i] %s", + nav.cur_path + 1, nav.num_paths, + tex.width, tex.height, current_path); + imv_viewport_set_title(&view, title); + imv_viewport_scale_to_window(&view, &tex); + if(g_options.actual) { + imv_viewport_scale_to_actual(&view, &tex); + } + } else { + imv_viewport_updated(&view, &tex); } } |