From 60a3d7604598ba15e4dc8e86f8f6e4b400acc73e Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Fri, 25 Sep 2015 21:30:01 +0200 Subject: [PATCH] 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 --- src/msw/renderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/renderer.cpp b/src/msw/renderer.cpp index 2bd7934c79..a9ab26d01b 100644 --- a/src/msw/renderer.cpp +++ b/src/msw/renderer.cpp @@ -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;