Always correctly invalid best size when bitmap changes.
Previously it was done only when the initial bitmap was set, not when it was subsequently changed. Closes #11018. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61509 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -959,16 +959,18 @@ void wxButton::DoSetBitmap(const wxBitmap& bitmap, State which)
|
||||
m_imageData = new wxODButtonImageData(this, bitmap);
|
||||
MakeOwnerDrawn();
|
||||
}
|
||||
|
||||
// if a bitmap was assigned to the bitmap, its best size must be
|
||||
// changed to account for it
|
||||
InvalidateBestSize();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_imageData->SetBitmap(bitmap, which);
|
||||
}
|
||||
|
||||
// it should be enough to only invalidate the best size when the normal
|
||||
// bitmap changes as all bitmaps assigned to the button should be of the
|
||||
// same size anyhow
|
||||
if ( which == State_Normal )
|
||||
InvalidateBestSize();
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user