Avoid invalidating the best size in wxStaticBitmap unnecessarily
This is just a micro-optimization: there is no need to call InvalidateBestSize() if the size of the bitmap doesn't actually change (as will most often be the case when this method is called after the control creation).
This commit is contained in:
@@ -287,7 +287,9 @@ void wxStaticBitmap::SetImageNoCopy( wxGDIImage* image)
|
||||
sizeNew = image->GetSize();
|
||||
|
||||
Free();
|
||||
InvalidateBestSize();
|
||||
|
||||
if ( sizeNew != sizeOld )
|
||||
InvalidateBestSize();
|
||||
|
||||
m_isIcon = image->IsKindOf( wxCLASSINFO(wxIcon) );
|
||||
// the image has already been copied
|
||||
|
Reference in New Issue
Block a user