Fixed a bug where the imglab tool would sometimes start out with an annoyingly

small window when the first image was bigger than the screen.
This commit is contained in:
Davis King 2014-07-20 14:47:05 -04:00
parent 6d55fcc260
commit a6dc296219
2 changed files with 7 additions and 6 deletions

View File

@ -17,7 +17,7 @@
#include <dlib/dir_nav.h>
const char* VERSION = "0.8";
const char* VERSION = "0.9";

View File

@ -449,11 +449,12 @@ load_image_and_set_size(
if (needed_width < 300) needed_width = 300;
if (needed_height < 300) needed_height = 300;
if (needed_width+50 < screen_width &&
needed_height+50 < screen_height)
{
set_size(needed_width, needed_height);
}
if (needed_width > 100 + screen_width)
needed_width = screen_width - 100;
if (needed_height > 100 + screen_height)
needed_height = screen_height - 100;
set_size(needed_width, needed_height);
display.set_image(img);