Don't invalidate best size unnecessarily in wxControl::SetFont()

There is no reason to do it if the font didn't change at all.
This commit is contained in:
Vadim Zeitlin
2018-12-31 15:35:36 +01:00
parent 6f0c5f65b6
commit 974c75272c

View File

@@ -118,8 +118,12 @@ void wxControlBase::InitCommandEvent(wxCommandEvent& event) const
bool wxControlBase::SetFont(const wxFont& font) bool wxControlBase::SetFont(const wxFont& font)
{ {
if ( !wxWindow::SetFont(font) )
return false;
InvalidateBestSize(); InvalidateBestSize();
return wxWindow::SetFont(font);
return true;
} }
// wxControl-specific processing after processing the update event // wxControl-specific processing after processing the update event