From 87c7345cd0595cb05be3eed1d8498744ceea9cf4 Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Sun, 27 Feb 2011 15:09:13 +0000 Subject: [PATCH] Fixed drawing glitch with vertical MSW toolbars. In case of a certain amount of whitespace at the bottom of a vertical toolbar it would not be drawn correctly: the more whitespace the more painting would be clipped starting from the left (covering the whole height of the toolbar) until the toolbar would look completely empty. This was reproducible using the toolbar sample, setting the toolbar on the left or right edge of the window and then increasing the height of the window sufficiently. Regression since r62971. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67074 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/toolbar.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 5ab71b53b5..38067f00d0 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -1722,10 +1722,18 @@ bool wxToolBar::HandlePaint(WXWPARAM wParam, WXLPARAM lParam) { // for some reason TB_GETITEMRECT returns a rectangle 1 pixel // shorter than the full window size (at least under Windows 7) - // but we need to erase the full height below + // but we need to erase the full width/height below RECT rcItem = wxGetTBItemRect(GetHwnd(), toolIndex); - rcItem.top = 0; - rcItem.bottom = rectTotal.height; + if ( IsVertical() ) + { + rcItem.left = 0; + rcItem.right = rectTotal.width; + } + else + { + rcItem.top = 0; + rcItem.bottom = rectTotal.height; + } rgnDummySeps.Union(wxRectFromRECT(rcItem)); } -- 2.45.2