Skip to content

Commit

Permalink
fixes 0003130: FreeCAD 0.17 Qt5 bugs with external display
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Apr 4, 2019
1 parent 228876f commit 64cb745
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Mod/Sketcher/Gui/ViewProviderSketch.cpp
Expand Up @@ -1195,11 +1195,17 @@ bool ViewProviderSketch::mouseMove(const SbVec2s &cursorPos, Gui::View3DInventor
return true;
}
case STATUS_SKETCH_UseRubberBand: {
// Here we must use the device-pixel-ratio to compute the correct y coordinate (#0003130)
#if QT_VERSION >= 0x050000
qreal dpr = viewer->getGLWidget()->devicePixelRatioF();
#else
qreal dpr = 1;
#endif
newCursorPos = cursorPos;
rubberband->setCoords(prvCursorPos.getValue()[0],
viewer->getGLWidget()->height() - prvCursorPos.getValue()[1],
viewer->getGLWidget()->height()*dpr - prvCursorPos.getValue()[1],
newCursorPos.getValue()[0],
viewer->getGLWidget()->height() - newCursorPos.getValue()[1]);
viewer->getGLWidget()->height()*dpr - newCursorPos.getValue()[1]);
viewer->redraw();
return true;
}
Expand Down

0 comments on commit 64cb745

Please sign in to comment.