forked from mia/Aegisub
Make detached video work again.
Originally committed to SVN as r3651.
This commit is contained in:
parent
85d3ea9277
commit
05c9ffde7a
1 changed files with 6 additions and 23 deletions
|
@ -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);
|
||||||
}
|
|
||||||
int _w,_h;
|
|
||||||
if (w <= 1 || h <= 1) return;
|
|
||||||
locked = true;
|
|
||||||
|
|
||||||
// Set the size for this control
|
|
||||||
SetSizeHints(w,h,w,h);
|
SetSizeHints(w,h,w,h);
|
||||||
SetClientSize(w,h);
|
|
||||||
GetSize(&_w,&_h);
|
locked = true;
|
||||||
wxASSERT(_w > 0);
|
|
||||||
wxASSERT(_h > 0);
|
|
||||||
SetSizeHints(_w,_h,_w,_h);
|
|
||||||
box->VideoSizer->Fit(box);
|
box->VideoSizer->Fit(box);
|
||||||
|
|
||||||
// Layout
|
|
||||||
box->GetParent()->Layout();
|
box->GetParent()->Layout();
|
||||||
SetClientSize(w,h);
|
|
||||||
GetSize(&_w,&_h);
|
|
||||||
SetMaxSize(wxSize(_w,_h));
|
|
||||||
|
|
||||||
// Refresh
|
|
||||||
locked = false;
|
locked = false;
|
||||||
|
}
|
||||||
Refresh(false);
|
Refresh(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue