From 7dfccd5b37f0a91c0ff7439d4ebe69545f0a71b4 Mon Sep 17 00:00:00 2001 From: topic2k Date: Fri, 1 May 2020 11:28:19 +0200 Subject: [PATCH] fix calculation of line width If one or more columns are hidden, HitTest would falsely report a hit when clicked right beside the last visible column within the range of the hidden column(s). --- wx/lib/agw/ultimatelistctrl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wx/lib/agw/ultimatelistctrl.py b/wx/lib/agw/ultimatelistctrl.py index 6389fd26..6ff1af1c 100644 --- a/wx/lib/agw/ultimatelistctrl.py +++ b/wx/lib/agw/ultimatelistctrl.py @@ -6696,7 +6696,8 @@ class UltimateListMainWindow(wx.ScrolledWindow): image_width = 0 for c in range(col): - image_x += self.GetColumnWidth(c) + if self.IsColumnShown(c): + image_x += self.GetColumnWidth(c) item = self.GetLine(line) if item.HasImage(col):