Skip to content

Commit

Permalink
Fix Oculars plugin mouse bug on retina display
Browse files Browse the repository at this point in the history
On OSX with retina display, the Oculars would wrongly accept
mouse events that it is not supposed to.  I removed some
pixelPerPixel factors to fix it.  Works on my iMac, but
untested on other devices!
  • Loading branch information
guillaumechereau committed Nov 30, 2017
1 parent 91a689e commit 9dc5fac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/Oculars/src/Oculars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ void Oculars::handleMouseClicks(class QMouseEvent* event)
if (guiPanel)
{
// Remove all events on the sky within Ocular GUI Panel.
if (event->x()*ppx>guiPanel->pos().x() && event->y()*ppx>(prj->getViewportHeight()-guiPanel->size().height()))
if (event->x()>guiPanel->pos().x() && event->y()>(prj->getViewportHeight()-guiPanel->size().height()))
{
event->setAccepted(true);
return;
Expand All @@ -406,8 +406,8 @@ void Oculars::handleMouseClicks(class QMouseEvent* event)
{
float wh = prj->getViewportWidth()/2.; // get half of width of the screen
float hh = prj->getViewportHeight()/2.; // get half of height of the screen
float mx = event->x()*ppx-wh; // point 0 in center of the screen, axis X directed to right
float my = event->y()*ppx-hh; // point 0 in center of the screen, axis Y directed to bottom
float mx = event->x()-wh; // point 0 in center of the screen, axis X directed to right
float my = event->y()-hh; // point 0 in center of the screen, axis Y directed to bottom

double inner = 0.5 * params.viewportFovDiameter * ppx;
// See if we need to scale the mask
Expand Down

0 comments on commit 9dc5fac

Please sign in to comment.