Skip to content

Commit

Permalink
Made the initial window sizing nicer.
Browse files Browse the repository at this point in the history
  • Loading branch information
davisking committed Jun 19, 2011
1 parent 6088abc commit d9cd30a
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tools/imglab/src/metadata_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 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);
}
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)
{
set_size(needed_width, needed_height);
}


display.set_image(img);
}

Expand Down

0 comments on commit d9cd30a

Please sign in to comment.