From: Robin Dunn Date: Wed, 3 Jul 2002 21:34:48 +0000 (+0000) Subject: Made wxBU_EXACTFIT work as documented instead of being ignored. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/188b9f2e382136c9e9b5371ccce509a3c4387bef Made wxBU_EXACTFIT work as documented instead of being ignored. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16023 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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 */