Skip to content

Commit 6e69d31

Browse files
committed
Fix pointer coordinate mapping
Previously was using the already mapped x coord to compute the new y coord
1 parent 11fae09 commit 6e69d31

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

api_drivers/py_api_drivers/frozen/indev/pointer_framework.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,13 @@ def _get_coords(self):
8080
def _calc_coords(self, x, y):
8181
if self.is_calibrated:
8282
cal = self._cal
83-
x = int(round(x * cal.alphaX + y * cal.betaX + cal.deltaX))
84-
y = int(round(x * cal.alphaY + y * cal.betaY + cal.deltaY))
83+
xt, yt = x, y # preserve raw coords
84+
85+
xs = xt * cal.alphaX + yt * cal.betaX + cal.deltaX
86+
ys = xt * cal.alphaY + yt * cal.betaY + cal.deltaY
87+
88+
x = int(round(xs))
89+
y = int(round(ys))
8590

8691
if cal.mirrorX:
8792
x = self._orig_width - x - 1

0 commit comments

Comments
 (0)