From 929520091f44aabddb0e63880cbdbe87466c96dd Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Tue, 23 Apr 2019 23:50:49 +0300 Subject: [PATCH] Use wx' builtin when calculating relative coordinates --- gui/display.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gui/display.py b/gui/display.py index 38668ea09..5a77dd3cb 100644 --- a/gui/display.py +++ b/gui/display.py @@ -275,10 +275,9 @@ class Display(wx.ListCtrl): def getRow(self, pointAbs, fallback=None): if pointAbs == wx.Point(-1, -1): return -1 - pointBase = self.GetScreenPosition() - pointRel = pointAbs - pointBase - # HitTest is buggy as hell, do some workarounds here - # https://github.com/wxWidgets/Phoenix/issues/232 + pointRel = self.ScreenToClient(pointAbs) + # HitTest seems to ignore header row, do some workarounds here + # https://github.com/wxWidgets/Phoenix/issues/1213 row = self.HitTest(pointRel)[0] if row != -1: return row - 1