From f530b4c0da93662841650ced281551dd3ab27cb7 Mon Sep 17 00:00:00 2001 From: Karl Blomster Date: Wed, 4 Feb 2009 23:22:10 +0000 Subject: [PATCH] Modified Harukalover's patch from yesterday so the frame number is sanitized after entry, not during. Originally committed to SVN as r2722. --- aegisub/dialog_jumpto.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aegisub/dialog_jumpto.cpp b/aegisub/dialog_jumpto.cpp index bf75a3aa5..c52699917 100644 --- a/aegisub/dialog_jumpto.cpp +++ b/aegisub/dialog_jumpto.cpp @@ -127,6 +127,7 @@ void DialogJumpTo::OnOK (wxCommandEvent &event) { OnClose(true); } // On Key pressed void DialogJumpTo::OnKey(wxCommandEvent &event) { EndModal(0); + if (jumpframe > VideoContext::Get()->GetLength()-1) jumpframe = VideoContext::Get()->GetLength()-1; VideoContext::Get()->JumpToFrame(jumpframe); } @@ -135,6 +136,7 @@ void DialogJumpTo::OnKey(wxCommandEvent &event) { // On OK button pressed void DialogJumpTo::OnClose(bool ok) { EndModal(0); + if (jumpframe > VideoContext::Get()->GetLength()-1) jumpframe = VideoContext::Get()->GetLength()-1; if (ok) VideoContext::Get()->JumpToFrame(jumpframe); } @@ -147,7 +149,6 @@ void DialogJumpTo::OnEditTime (wxCommandEvent &event) { // Update frame long newframe = VFR_Output.GetFrameAtTime(JumpTime->time.GetMS()); - if (newframe > VideoContext::Get()->GetLength()-1) newframe = VideoContext::Get()->GetLength()-1; if (jumpframe != newframe) { jumpframe = newframe; JumpFrame->SetValue(wxString::Format(_T("%i"),jumpframe)); @@ -167,7 +168,7 @@ void DialogJumpTo::OnEditFrame (wxCommandEvent &event) { // Update frame JumpFrame->GetValue().ToLong(&jumpframe); - if (jumpframe > VideoContext::Get()->GetLength()-1) jumpframe = VideoContext::Get()->GetLength()-1; + JumpFrame->SetValue(wxString::Format(_T("%i"),jumpframe)); // Update time