From 988bc8b3068967b4a699c8993d694e69a93b63ae Mon Sep 17 00:00:00 2001 From: Sean D'Epagnier Date: Fri, 26 Aug 2016 16:42:16 -0400 Subject: [PATCH] correct text extent to not require active painter --- src/qt/dc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index 839e9e395d..e84e1c6abd 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -347,9 +347,11 @@ void wxQtDCImpl::DoGetTextExtent(const wxString& string, wxCoord *externalLeading, const wxFont *theFont ) const { - QFont f = m_qtPainter->font(); + QFont f; if (theFont != NULL) f = theFont->GetHandle(); + else + f = m_font.GetHandle(); QFontMetrics metrics(f); if (x != NULL || y != NULL)