Fix handling of wxALIGN_CENTER in wxMSW DrawItemText()

Test for wxALIGN_CENTER_HORIZONTAL only, not wxALIGN_CENTER, when choosing the
horizontal alignment to use, as the latter includes wxALIGN_CENTER_VERTICAL
and so would wrongly center an item using wxALIGN_CENTER|wxALIGN_RIGHT
horizontally, for example.

See https://github.com/wxWidgets/wxWidgets/pull/97
This commit is contained in:
Tobias Taschner 2015-09-25 21:30:01 +02:00 committed by Vadim Zeitlin
parent 9add303f76
commit 60a3d76045

View File

@ -1000,7 +1000,7 @@ void wxRendererXP::DrawItemText(wxWindow* win,
}
DWORD textFlags = DT_NOPREFIX | DT_END_ELLIPSIS;
if ( align & wxALIGN_CENTER )
if ( align & wxALIGN_CENTER_HORIZONTAL )
textFlags |= DT_CENTER;
else if ( align & wxALIGN_RIGHT )
textFlags |= DT_RIGHT;