Skip to content

Commit 54ced9c

Browse files
committed
BF: mouse.getPos gave wrong coords on retina display
also slight change to setup includes
1 parent 90c76a4 commit 54ced9c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

psychopy/event.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,10 @@ def getPos(self):
629629
# get position in window
630630
lastPosPix = numpy.array([w._mouse_x, w._mouse_y])
631631
# set (0,0) to centre
632-
lastPosPix = lastPosPix - numpy.array(self.win.size) / 2
632+
if self.win.useRetina:
633+
lastPosPix = lastPosPix*2 - numpy.array(self.win.size) / 2
634+
else:
635+
lastPosPix = lastPosPix - numpy.array(self.win.size) / 2
633636
self.lastPos = self._pix2windowUnits(lastPosPix)
634637
return copy.copy(self.lastPos)
635638

setupApp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def dyld_find(name, loader=None, **kwargs):
6868
'pyglet', 'pygame', 'pytz', 'OpenGL', 'glfw',
6969
'scipy', 'matplotlib', 'lxml', 'xml', 'openpyxl',
7070
'moviepy', 'imageio',
71-
'_sounddevice_data',
71+
'_sounddevice_data','_soundfile_data',
7272
'cffi','pycparser',
7373
'PIL', # 'Image',
7474
'objc', 'Quartz', 'AppKit', 'QTKit', 'Cocoa',

0 commit comments

Comments
 (0)