X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d78f09e27d52880a5074c265e400d851470eb6a8..f44b23b6f7dca21b1171b15560e2058b9b811ec4:/src/msw/button.cpp diff --git a/src/msw/button.cpp b/src/msw/button.cpp index cb5cce446f..172cf7de5b 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -147,11 +147,16 @@ wxSize wxButton::DoGetBestSize() const // the button height is proportional to the height of the font used int hBtn = BUTTON_HEIGHT_FROM_CHAR_HEIGHT(hChar); - wxSize sz = GetDefaultSize(); - if (wBtn > sz.x) sz.x = wBtn; - if (hBtn > sz.y) sz.y = hBtn; + if (!HasFlag(wxBU_EXACTFIT)) + { + wxSize sz = GetDefaultSize(); + if (wBtn > sz.x) sz.x = wBtn; + if (hBtn > sz.y) sz.y = hBtn; + return sz; + } + else + return wxSize(wBtn, hBtn); - return sz; } /* static */