Make detached video work again.

Originally committed to SVN as r3651.
This commit is contained in:
Thomas Goyne 2009-10-09 02:21:30 +00:00
parent 85d3ea9277
commit 05c9ffde7a

View file

@ -388,13 +388,11 @@ void VideoDisplay::DrawOverscanMask(int sizeH,int sizeV,wxColour colour,double a
/// @brief Update the size of the display /// @brief Update the size of the display
void VideoDisplay::UpdateSize() { void VideoDisplay::UpdateSize() {
// Loaded?
VideoContext *con = VideoContext::Get(); VideoContext *con = VideoContext::Get();
wxASSERT(con); wxASSERT(con);
if (!con->IsLoaded()) return; if (!con->IsLoaded()) return;
if (!IsShownOnScreen()) return; if (!IsShownOnScreen()) return;
// Get size
if (freeSize) { if (freeSize) {
GetClientSize(&w,&h); GetClientSize(&w,&h);
} }
@ -402,28 +400,13 @@ 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);
locked = true;
box->VideoSizer->Fit(box);
box->GetParent()->Layout();
locked = false;
} }
int _w,_h;
if (w <= 1 || h <= 1) return;
locked = true;
// Set the size for this control
SetSizeHints(w,h,w,h);
SetClientSize(w,h);
GetSize(&_w,&_h);
wxASSERT(_w > 0);
wxASSERT(_h > 0);
SetSizeHints(_w,_h,_w,_h);
box->VideoSizer->Fit(box);
// Layout
box->GetParent()->Layout();
SetClientSize(w,h);
GetSize(&_w,&_h);
SetMaxSize(wxSize(_w,_h));
// Refresh
locked = false;
Refresh(false); Refresh(false);
} }