From 700af3aa7f4e7253b50f6c81be2221c6c307f2b8 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 21 Sep 2020 16:32:25 +0200 Subject: [PATCH] Sketcher: [skip ci] fix computing of hotspot of sketcher icons on Windows --- src/Mod/Sketcher/Gui/DrawSketchHandler.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp b/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp index 365677c2de..ed5ad61c55 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp +++ b/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp @@ -110,8 +110,13 @@ void DrawSketchHandler::setSvgCursor(const QString & cursorName, int x, int y, c qreal pRatio = devicePixelRatio(); bool isRatioOne = (pRatio == 1.0); qreal defaultCursorSize = isRatioOne ? 64 : 32; +#if defined(Q_OS_WIN32) + qreal hotX = x; + qreal hotY = y; +#else qreal hotX = x * pRatio; qreal hotY = y * pRatio; +#endif qreal cursorSize = defaultCursorSize * pRatio; QPixmap pointer = Gui::BitmapFactory().pixmapFromSvg(cursorName.toStdString().c_str(), QSizeF(cursorSize, cursorSize), colorMapping);