MGR: Fix bug which sometimes made project description text in Simple View too wide to read.

This commit is contained in:
Charlie Fenton 2014-08-30 01:57:59 -07:00
parent efe63f2a14
commit a2ad7e7f50
1 changed files with 3 additions and 3 deletions

View File

@ -85,14 +85,14 @@ void CScrolledTextBox::SetValue(const wxString& s) {
totalWidth = GetSize().GetWidth();
totalLines = Wrap(t, totalWidth, &lineHeight);
m_TextSizer->FitInside(this);
bool hasSB = IsScrollbarShown(wxVERTICAL);
if (hasSB) {
SetScrollRate(1, lineHeight);
int scrollLines = GetScrollLines(wxVERTICAL); // Returns 0 if no scrollbar
if (scrollLines > 0) {
int sbwidth = wxSystemSettings::GetMetric(wxSYS_VSCROLL_X);
// It has a vertical scroll bar, so wrap again for reduced width
m_TextSizer->Clear(true);
totalLines = Wrap(t, totalWidth - sbwidth - SCROLLBARSPACER, &lineHeight);
m_TextSizer->FitInside(this);
SetScrollRate(1, lineHeight);
}
}