Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions api_drivers/py_api_drivers/frozen/indev/pointer_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,13 @@ def _get_coords(self):
raise NotImplementedError

def _calc_coords(self, x, y):
if self.is_calibrated:
if self.is_calibrated:
cal = self._cal

# save original x value for use in y calculation
xt = x
x = int(round(x * cal.alphaX + y * cal.betaX + cal.deltaX))
y = int(round(x * cal.alphaY + y * cal.betaY + cal.deltaY))
y = int(round(xt * cal.alphaY + y * cal.betaY + cal.deltaY))

if cal.mirrorX:
x = self._orig_width - x - 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def calibrate(indev, cal_data):
target.remove_flag(lv.obj.FLAG.CHECKABLE) # NOQA
target.remove_flag(lv.obj.FLAG.SCROLLABLE) # NOQA

instruction_text = 'Press and hold\n red square'
for i in range(3):
print('point', i + 1, 'of 3')

Expand All @@ -119,7 +120,7 @@ def calibrate(indev, cal_data):
lcd_bus._pump_main_thread() # NOQA
time.sleep_ms(2000) # NOQA

label.set_text('Press and hold\n red circle')
label.set_text(instruction_text)
label.center()
lcd_bus._pump_main_thread() # NOQA

Expand All @@ -142,7 +143,7 @@ def calibrate(indev, cal_data):
if text_on:
label.set_text('')
else:
label.set_text('Press and hold\n red circle')
label.set_text(instruction_text)
label.center()

text_on = not text_on
Expand Down Expand Up @@ -209,6 +210,7 @@ def calibrate(indev, cal_data):
# else:
# mirror_y = False

# The 3 point method uses an affine transformation so mirroring should not be needed.
mirror_x = False
mirror_y = False

Expand Down