[PATCH] Fix drawing of icons for non-root wxTreeCtrl items
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 26 Oct 2022 23:48:39 +0000 (01:48 +0200)
committerScott Talbert <swt@techie.net>
Fri, 24 Feb 2023 00:23:10 +0000 (19:23 -0500)
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.

Gbp-Pq: Name fix-drawing-icons-wxtreectrl.patch

src/generic/treectlg.cpp

index ae35a7d52844ac699fef3e7643a5107b4b47c160..f2a97ca91e6628ca5d76d0b5948e9080747a215f 100644 (file)
@@ -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);