From fca7657e60906a6d9e5637a906515e37822ccd13 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 29 Sep 2011 04:38:34 +0000 Subject: [PATCH] Don't let the user drag the audio sash below the bottom of the window as it's rather hard to drag back afterwards Originally committed to SVN as r5675. --- aegisub/src/frame_main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aegisub/src/frame_main.cpp b/aegisub/src/frame_main.cpp index 8cda5bf30..bceb3d005 100644 --- a/aegisub/src/frame_main.cpp +++ b/aegisub/src/frame_main.cpp @@ -640,10 +640,10 @@ void FrameMain::OnAudioBoxResize(wxSashEvent &event) { if (event.GetDragStatus() == wxSASH_STATUS_OUT_OF_RANGE) return; - wxRect rect = event.GetDragRect(); + int new_height = std::min(event.GetDragRect().GetHeight(), Panel->GetSize().GetHeight() - 1); - OPT_SET("Audio/Display Height")->SetInt(rect.GetHeight()); - audioSash->SetMinSize(wxSize(-1, rect.GetHeight())); + OPT_SET("Audio/Display Height")->SetInt(new_height); + audioSash->SetMinSize(wxSize(-1, new_height)); Panel->Layout(); }