Fix problems with how VideoDisplay's size was being set resulting in the border being subtracted from the video size and the video always taking up the full width of the box even at very low zoom levels. Updates #1137, #1140.

Originally committed to SVN as r4077.
This commit is contained in:
Thomas Goyne 2010-01-31 18:49:37 +00:00
parent 08817a3e98
commit 7ac273eca0

View file

@ -387,11 +387,24 @@ void VideoDisplay::UpdateSize() {
if (con->GetAspectRatioType() == 0) w = int(con->GetWidth() * zoomValue); if (con->GetAspectRatioType() == 0) w = int(con->GetWidth() * zoomValue);
else w = int(con->GetHeight() * zoomValue * con->GetAspectRatioValue()); else w = int(con->GetHeight() * zoomValue * con->GetAspectRatioValue());
h = int(con->GetHeight() * zoomValue); h = int(con->GetHeight() * zoomValue);
SetSizeHints(w,h,w,h);
// Sizers ignore SetClientSize/SetSize, so only use them to calculate
// what size is required after including the borders
SetClientSize(w,h);
GetSize(&w,&h);
wxSize size(w,h);
SetMinSize(size);
SetMaxSize(size);
locked = true; locked = true;
box->VideoSizer->Fit(box); box->VideoSizer->Fit(box);
box->GetParent()->Layout(); box->GetParent()->Layout();
// The sizer makes us use the full width, which at very low zoom levels
// results in stretched video, so after using the sizer to update the
// parent window sizes, reset our size to the correct value
SetSize(w,h);
locked = false; locked = false;
} }
Refresh(false); Refresh(false);