summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowscursor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/windows/qwindowscursor.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowscursor.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/platforms/windows/qwindowscursor.cpp b/src/plugins/platforms/windows/qwindowscursor.cpp
index d952fde978..1bebe88df7 100644
--- a/src/plugins/platforms/windows/qwindowscursor.cpp
+++ b/src/plugins/platforms/windows/qwindowscursor.cpp
@@ -103,9 +103,9 @@ QWindowsPixmapCursorCacheKey::QWindowsPixmapCursorCacheKey(const QCursor &c)
HCURSOR QWindowsCursor::createPixmapCursor(QPixmap pixmap, const QPoint &hotSpot, qreal scaleFactor)
{
HCURSOR cur = 0;
- scaleFactor /= pixmap.devicePixelRatioF();
- if (!qFuzzyCompare(scaleFactor, 1)) {
- pixmap = pixmap.scaled((scaleFactor * QSizeF(pixmap.size())).toSize(),
+ const qreal pixmapScaleFactor = scaleFactor / pixmap.devicePixelRatioF();
+ if (!qFuzzyCompare(pixmapScaleFactor, 1)) {
+ pixmap = pixmap.scaled((pixmapScaleFactor * QSizeF(pixmap.size())).toSize(),
Qt::KeepAspectRatio, Qt::SmoothTransformation);
}
QBitmap mask = pixmap.mask();
@@ -119,8 +119,8 @@ HCURSOR QWindowsCursor::createPixmapCursor(QPixmap pixmap, const QPoint &hotSpot
ICONINFO ii;
ii.fIcon = 0;
- ii.xHotspot = DWORD(hotSpot.x());
- ii.yHotspot = DWORD(hotSpot.y());
+ ii.xHotspot = DWORD(qRound(hotSpot.x() * scaleFactor));
+ ii.yHotspot = DWORD(qRound(hotSpot.y() * scaleFactor));
ii.hbmMask = im;
ii.hbmColor = ic;