Skip to content

Commit

Permalink
BF: mouse.getPos gave wrong coords on retina display
Browse files Browse the repository at this point in the history
also slight change to setup includes
  • Loading branch information
peircej committed Mar 21, 2018
1 parent 90c76a4 commit 54ced9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion psychopy/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,10 @@ def getPos(self):
# get position in window
lastPosPix = numpy.array([w._mouse_x, w._mouse_y])
# set (0,0) to centre
lastPosPix = lastPosPix - numpy.array(self.win.size) / 2
if self.win.useRetina:
lastPosPix = lastPosPix*2 - numpy.array(self.win.size) / 2
else:
lastPosPix = lastPosPix - numpy.array(self.win.size) / 2
self.lastPos = self._pix2windowUnits(lastPosPix)
return copy.copy(self.lastPos)

Expand Down
2 changes: 1 addition & 1 deletion setupApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def dyld_find(name, loader=None, **kwargs):
'pyglet', 'pygame', 'pytz', 'OpenGL', 'glfw',
'scipy', 'matplotlib', 'lxml', 'xml', 'openpyxl',
'moviepy', 'imageio',
'_sounddevice_data',
'_sounddevice_data','_soundfile_data',
'cffi','pycparser',
'PIL', # 'Image',
'objc', 'Quartz', 'AppKit', 'QTKit', 'Cocoa',
Expand Down

0 comments on commit 54ced9c

Please sign in to comment.