mirror of https://github.com/odrling/Aegisub
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:
parent
08817a3e98
commit
7ac273eca0
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue