diff --git a/docs/changes.txt b/docs/changes.txt index 9aa667e0be..f43e582e44 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -407,6 +407,7 @@ MSW: - Fix Cygwin 1.7 build (David Gangola). - Allow using wxDC::DrawText() with multiline texts. +- Fix wxBitmapButton best size determination broken in 2.9.1. All (GUI): diff --git a/src/msw/bmpbuttn.cpp b/src/msw/bmpbuttn.cpp index aea2db8f61..217b1aec63 100644 --- a/src/msw/bmpbuttn.cpp +++ b/src/msw/bmpbuttn.cpp @@ -136,6 +136,13 @@ bool wxBitmapButton::Create(wxWindow *parent, SetBitmapLabel(bitmap); + if ( !size.IsFullySpecified() ) + { + // As our bitmap has just changed, our best size has changed as well so + // reset the initial size using the new value. + SetInitialSize(size); + } + return true; }