Honor the user's default zoom when possible rather than always overriding it based on the size of the window

Originally committed to SVN as r4740.
This commit is contained in:
Thomas Goyne 2010-08-13 05:51:26 +00:00
parent 768f74ae3c
commit 9c93198c3b
1 changed files with 5 additions and 6 deletions

View File

@ -1099,13 +1099,12 @@ void FrameMain::LoadVideo(wxString file,bool autoload) {
int vidx = VideoContext::Get()->GetWidth(), vidy = VideoContext::Get()->GetHeight(); int vidx = VideoContext::Get()->GetWidth(), vidy = VideoContext::Get()->GetHeight();
// Set zoom level based on video resolution and window size // Set zoom level based on video resolution and window size
double target_zoom = 1.; double zoom = videoBox->videoDisplay->GetZoom();
wxSize windowSize = GetSize(); wxSize windowSize = GetSize();
if (vidx*3 > windowSize.GetX()*2 || vidy*4 > windowSize.GetY()*3) if (vidx*3*zoom > windowSize.GetX()*4 || vidy*4*zoom > windowSize.GetY()*6)
target_zoom = .5; videoBox->videoDisplay->SetZoom(zoom * .25);
if (vidx*3 > windowSize.GetX()*4 || vidy*4 > windowSize.GetY()*6) else if (vidx*3*zoom > windowSize.GetX()*2 || vidy*4*zoom > windowSize.GetY()*3)
target_zoom = .25; videoBox->videoDisplay->SetZoom(zoom * .5);
videoBox->videoDisplay->SetZoom(target_zoom);
// Check that the video size matches the script video size specified // Check that the video size matches the script video size specified
int scriptx = SubsGrid->ass->GetScriptInfoAsInt(_T("PlayResX")); int scriptx = SubsGrid->ass->GetScriptInfoAsInt(_T("PlayResX"));