From: Vadim Zeitlin Date: Sat, 14 Nov 2009 15:51:50 +0000 (+0000) Subject: Restore the use of correct alignment in wxDVC renderers. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9e9cfb91150fee916b286ffa29fa4b5a0885849f Restore the use of correct alignment in wxDVC renderers. The code from old CalculateAlignment() was somehow lost during the refactoring, restore it in wxDataViewCustomRendererBase::RenderText(). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62639 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index af4987ae39..38abe9c159 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -797,8 +797,17 @@ wxDataViewCustomRendererBase::RenderText(const wxString& text, ); } + // get the alignment to use + int align = GetAlignment(); + if ( align == wxDVR_DEFAULT_ALIGNMENT ) + { + // if we don't have an explicit alignment ourselves, use that of the + // column in horizontal direction and default vertical alignment + align = GetOwner()->GetAlignment() | wxALIGN_CENTRE_VERTICAL; + } + dc->DrawLabel(ellipsizedText.empty() ? text : ellipsizedText, - rectText, GetAlignment()); + rectText, align); } //-----------------------------------------------------------------------------