From ac1df672aaa60d5db732c328b8c070fb39825ae0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 27 Oct 2022 01:48:39 +0200 Subject: [PATCH] Fix drawing of icons for non-root wxTreeCtrl items Fix y coordinate value passed to wxDC::DrawBitmap() by restoring the parentheses accidentally removed in 6dd4e73ea3 (Add wxDrawImageBitmap() helper and use it in wx{List,Tree}Ctrl, 2022-10-25). (cherry picked from commit 2a13fd238ea499a3e4b089f3ca3a327e94ddb4d9) See #23255. --- src/generic/treectlg.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index ae35a7d5284..f2a97ca91e6 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -2708,7 +2708,7 @@ void wxGenericTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc) dc, item->GetX(), item->GetY() + - total_h > state_h ? (total_h-state_h)/2 : 0); + (total_h > state_h ? (total_h-state_h)/2 : 0)); } if ( image != NO_IMAGE ) @@ -2719,7 +2719,7 @@ void wxGenericTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc) dc, item->GetX() + state_w, item->GetY() + - total_h > image_h ? (total_h-image_h)/2 : 0); + (total_h > image_h ? (total_h-image_h)/2 : 0)); } dc.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT); -- 2.33.6