euratom-software/calcam

Mouse clicks registered in wrong place under OSX with HiDPI mode

ssilburn opened this issue · 1 comments

Adding here an issue reported by e-mail: using OSX in HiDPI mode with a retina display can cause clicks in image or CAD views in the GUI to be registered in the wrong place. I don't have any OSX machines to test this further so I don't know under what combinations of library versions this is a problem. If encountering this problem, it can be worked around by adding the following code to the on_left_click methods of the CalcamInteractorStyle2D and CalcamInteractorStyle3D classes, in file calcam/gui/vtkinteractorstyles.py:

     clickcoords = self.interactor.GetEventPosition()

     # Factor 2 re-scaling of click coordinates needed for OSX HiDPI mode
     _pxscale = 2.0
     clickcoords = [p*_pxscale for p in clickcoords]

This fix contributed by the user who reported the bug.

This issue goes away when the calcam window is moved to an external screen.