diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index e8105277a4..6feabfa945 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -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; }