From 974c75272c321f9f1d85bcf58e876f28daa63c10 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 31 Dec 2018 15:35:36 +0100 Subject: [PATCH] Don't invalidate best size unnecessarily in wxControl::SetFont() There is no reason to do it if the font didn't change at all. --- src/common/ctrlcmn.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/ctrlcmn.cpp b/src/common/ctrlcmn.cpp index 3b0627b903..cb1c0fcf41 100644 --- a/src/common/ctrlcmn.cpp +++ b/src/common/ctrlcmn.cpp @@ -118,8 +118,12 @@ void wxControlBase::InitCommandEvent(wxCommandEvent& event) const bool wxControlBase::SetFont(const wxFont& font) { + if ( !wxWindow::SetFont(font) ) + return false; + InvalidateBestSize(); - return wxWindow::SetFont(font); + + return true; } // wxControl-specific processing after processing the update event