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:
committed by
Vadim Zeitlin
parent
9add303f76
commit
60a3d76045
@@ -1000,7 +1000,7 @@ void wxRendererXP::DrawItemText(wxWindow* win,
|
|||||||
}
|
}
|
||||||
|
|
||||||
DWORD textFlags = DT_NOPREFIX | DT_END_ELLIPSIS;
|
DWORD textFlags = DT_NOPREFIX | DT_END_ELLIPSIS;
|
||||||
if ( align & wxALIGN_CENTER )
|
if ( align & wxALIGN_CENTER_HORIZONTAL )
|
||||||
textFlags |= DT_CENTER;
|
textFlags |= DT_CENTER;
|
||||||
else if ( align & wxALIGN_RIGHT )
|
else if ( align & wxALIGN_RIGHT )
|
||||||
textFlags |= DT_RIGHT;
|
textFlags |= DT_RIGHT;
|
||||||
|
Reference in New Issue
Block a user