Use wx' builtin when calculating relative coordinates

This commit is contained in:
DarkPhoenix
2019-04-23 23:50:49 +03:00
parent d4847112a9
commit 929520091f

View File

@@ -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