X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/655719367ac5e131d9642e5783f3ecf64d1a3385..fc32cd4a59dc7c6cedea430750b2ce2c2a342353:/src/mac/carbon/statbmp.cpp?ds=sidebyside diff --git a/src/mac/carbon/statbmp.cpp b/src/mac/carbon/statbmp.cpp index f8fb079fd4..abe7a951b2 100644 --- a/src/mac/carbon/statbmp.cpp +++ b/src/mac/carbon/statbmp.cpp @@ -59,6 +59,7 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; + InvalidateBestSize(); SetSize(GetBestSize()); Refresh() ; } @@ -73,6 +74,10 @@ void wxStaticBitmap::OnPaint( wxPaintEvent& WXUNUSED(event) ) wxSize wxStaticBitmap::DoGetBestSize() const { - return DoGetSizeFromClientSize( wxSize( m_bitmap.GetWidth() , m_bitmap.GetHeight() ) ) ; + if ( m_bitmap.Ok() ) + return DoGetSizeFromClientSize( wxSize(m_bitmap.GetWidth(), m_bitmap.GetHeight()) ); + + // this is completely arbitrary + return DoGetSizeFromClientSize( wxSize(16, 16) ); }