diff --git a/aegisub/src/video_display.cpp b/aegisub/src/video_display.cpp index 6179bdd23..7ea5d2fa4 100644 --- a/aegisub/src/video_display.cpp +++ b/aegisub/src/video_display.cpp @@ -388,13 +388,11 @@ void VideoDisplay::DrawOverscanMask(int sizeH,int sizeV,wxColour colour,double a /// @brief Update the size of the display void VideoDisplay::UpdateSize() { - // Loaded? VideoContext *con = VideoContext::Get(); wxASSERT(con); if (!con->IsLoaded()) return; if (!IsShownOnScreen()) return; - // Get size if (freeSize) { GetClientSize(&w,&h); } @@ -402,28 +400,13 @@ void VideoDisplay::UpdateSize() { if (con->GetAspectRatioType() == 0) w = int(con->GetWidth() * zoomValue); else w = int(con->GetHeight() * zoomValue * con->GetAspectRatioValue()); 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); }