From: Vadim Zeitlin Date: Thu, 21 Feb 2002 15:09:13 +0000 (+0000) Subject: applied patch for calculating the tree items size with non default font (patch 520965) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/40e7f56c7160b996f8eb0fcb0ee72ca8f683732c?ds=sidebyside applied patch for calculating the tree items size with non default font (patch 520965) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14338 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 833404dd9f..590ca02113 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -2896,7 +2896,10 @@ void wxGenericTreeCtrl::CalculateSize( wxGenericTreeItem *item, wxDC &dc ) wxCoord text_w = 0; wxCoord text_h = 0; - if (item->IsBold()) + wxTreeItemAttr *attr = item->GetAttributes(); + if ( attr && attr->HasFont() ) + dc.SetFont(attr->GetFont()); + else if ( item->IsBold() ) dc.SetFont(m_boldFont); dc.GetTextExtent( item->GetText(), &text_w, &text_h );