diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index 9030ff8f4a..e3933cc65f 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -1354,9 +1354,11 @@ void wxComboCtrlBase::PositionTextCtrl( int textCtrlXAdjust, int textCtrlYAdjust else { // If it has border, have textctrl fill the entire text field. + int w = m_tcArea.width - m_widthCustomPaint; + if (w < 0) w = 0; m_text->SetSize( m_tcArea.x + m_widthCustomPaint, m_tcArea.y, - m_tcArea.width - m_widthCustomPaint, + w, m_tcArea.height ); } } diff --git a/src/gtk/collpane.cpp b/src/gtk/collpane.cpp index ac2b928d80..386a031b9e 100644 --- a/src/gtk/collpane.cpp +++ b/src/gtk/collpane.cpp @@ -271,7 +271,9 @@ void wxCollapsiblePane::OnSize(wxSizeEvent &ev) // here we need to resize the pane window otherwise, even if the GtkExpander container // is expanded or shrunk, the pane window won't be updated! - m_pPane->SetSize(ev.GetSize().x, ev.GetSize().y - m_szCollapsed.y); + int w = ev.GetSize().y - m_szCollapsed.y; + if (w < 0) w = 0; + m_pPane->SetSize(ev.GetSize().x, w); // we need to explicitly call m_pPane->Layout() or else it won't correctly relayout // (even if SetAutoLayout(true) has been called on it!)