Made the initial window sizing nicer.

This commit is contained in:
Davis King 2011-06-19 14:01:52 -04:00
parent 6088abcedf
commit d9cd30a64f
1 changed files with 14 additions and 14 deletions

View File

@ -297,23 +297,23 @@ load_image_and_set_size(
message_box("Error loading image", e.what());
}
if (display.width() < img.nc() ||
display.height() < img.nr() )
unsigned long screen_width, screen_height;
get_display_size(screen_width, screen_height);
unsigned long needed_width = display.left() + img.nc() + 4;
unsigned long needed_height = display.top() + img.nr() + 4;
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)
{
unsigned long screen_width, screen_height;
get_display_size(screen_width, screen_height);
unsigned long needed_width = display.left() + img.nc() + 4;
unsigned long needed_height = display.top() + img.nr() + 4;
if (needed_width+50 < screen_width &&
needed_height+50 < screen_height)
{
set_size(needed_width, needed_height);
}
set_size(needed_width, needed_height);
}
display.set_image(img);
}