File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
api_drivers/py_api_drivers/frozen/indev Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -78,10 +78,13 @@ def _get_coords(self):
7878 raise NotImplementedError
7979
8080 def _calc_coords (self , x , y ):
81- if self .is_calibrated :
81+ if self .is_calibrated :
8282 cal = self ._cal
83+
84+ # save original x value for use in y calculation
85+ xt = x
8386 x = int (round (x * cal .alphaX + y * cal .betaX + cal .deltaX ))
84- y = int (round (x * cal .alphaY + y * cal .betaY + cal .deltaY ))
87+ y = int (round (xt * cal .alphaY + y * cal .betaY + cal .deltaY ))
8588
8689 if cal .mirrorX :
8790 x = self ._orig_width - x - 1
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ def calibrate(indev, cal_data):
109109 target .remove_flag (lv .obj .FLAG .CHECKABLE ) # NOQA
110110 target .remove_flag (lv .obj .FLAG .SCROLLABLE ) # NOQA
111111
112+ instruction_text = 'Press and hold\n red square'
112113 for i in range (3 ):
113114 print ('point' , i + 1 , 'of 3' )
114115
@@ -119,7 +120,7 @@ def calibrate(indev, cal_data):
119120 lcd_bus ._pump_main_thread () # NOQA
120121 time .sleep_ms (2000 ) # NOQA
121122
122- label .set_text ('Press and hold \n red circle' )
123+ label .set_text (instruction_text )
123124 label .center ()
124125 lcd_bus ._pump_main_thread () # NOQA
125126
@@ -142,7 +143,7 @@ def calibrate(indev, cal_data):
142143 if text_on :
143144 label .set_text ('' )
144145 else :
145- label .set_text ('Press and hold \n red circle' )
146+ label .set_text (instruction_text )
146147 label .center ()
147148
148149 text_on = not text_on
@@ -209,6 +210,7 @@ def calibrate(indev, cal_data):
209210 # else:
210211 # mirror_y = False
211212
213+ # The 3 point method uses an affine transformation so mirroring should not be needed.
212214 mirror_x = False
213215 mirror_y = False
214216
You can’t perform that action at this time.
0 commit comments