From 2353544718a1aff4e12c75c823aa4136d2304027 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 5 Mar 2006 13:30:11 +0000 Subject: [PATCH] fix to last custom draw fix: only leave space for the image in the first column git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37817 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/listctrl.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 2406e000c1..9ad44f0969 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -2420,12 +2420,16 @@ static void HandleSubItemPrepaint(LPNMLVCUSTOMDRAW pLVCD, HFONT hfont) } // notice that even if this item doesn't have any image, the list - // control still leaves space for the image if the image list is not - // empty (presumably so that items with and without images align?) - int wImage, hImage; - ImageList_GetIconSize(himl, &wImage, &hImage); + // control still leaves space for the image in the first column if the + // image list is not empty (presumably so that items with and without + // images align?) + if ( it.iImage != -1 || it.iSubItem == 0 ) + { + int wImage, hImage; + ImageList_GetIconSize(himl, &wImage, &hImage); - rc.left += wImage + 2; + rc.left += wImage + 2; + } } ::SetBkMode(hdc, TRANSPARENT); -- 2.45.2