From 54ebe9b37ab0e67053b40a33398c46925443d179 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Fri, 13 Jan 2012 20:18:29 +0000 Subject: [PATCH] Fix incorrect (un)wrapping of the subs edit box toolbar on video zoom changes The size of the contents is not updated until after SubsEditBox::OnSize is called, so the wrapping logic was being done based on the previous available area, rather than the new size. Originally committed to SVN as r6284. --- aegisub/src/subs_edit_box.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aegisub/src/subs_edit_box.cpp b/aegisub/src/subs_edit_box.cpp index 8f25e5c6d..7f018fe85 100644 --- a/aegisub/src/subs_edit_box.cpp +++ b/aegisub/src/subs_edit_box.cpp @@ -551,19 +551,19 @@ void SubsEditBox::CommitTimes(TimeField field) { } void SubsEditBox::OnSize(wxSizeEvent &evt) { - int topWidth = TopSizer->GetSize().GetWidth(); + int availableWidth = GetVirtualSize().GetWidth(); int midMin = MiddleSizer->GetMinSize().GetWidth(); int botMin = MiddleBotSizer->GetMinSize().GetWidth(); if (splitLineMode) { - if (topWidth >= midMin + botMin) { + if (availableWidth > midMin + botMin) { MainSizer->Detach(MiddleBotSizer); MiddleSizer->Add(MiddleBotSizer,0,wxALIGN_CENTER_VERTICAL); splitLineMode = false; } } else { - if (topWidth < midMin) { + if (availableWidth < midMin) { MiddleSizer->Detach(MiddleBotSizer); MainSizer->Insert(2,MiddleBotSizer,0,wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM,3); splitLineMode = true;