summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorKari Pihkala <kari.pihkala@gmail.com>2014-08-02 09:59:18 +0300
committerJake Petroules <jake.petroules@theqtcompany.com>2015-09-06 23:19:03 +0000
commit6413ceeccff9078bc8ec2dcb63b445c031c420dd (patch)
treecdf80826edf167db9b95bf9c75a8e6e95cebc9e6 /src/plugins
parentcb12da0387458fb63a80a4f59d5ddb24d33ad59b (diff)
Fix default hotspot of a hidpi QCursor
The hotspot is defined in device independent coordinates, so the default coordinates need to be divided by device pixel ratio. Also, modify the scaling of cursor's pixmap to use SmoothTransformation to generate cleaner looking lodpi cursors from hidpi cursors. Change-Id: Ia938fd1e476e19e796f30712e23b06a5efed9964 Task-number: QTBUG-34116 Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/cocoa/qcocoacursor.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoacursor.mm b/src/plugins/platforms/cocoa/qcocoacursor.mm
index 922809f90d..f08386d18e 100644
--- a/src/plugins/platforms/cocoa/qcocoacursor.mm
+++ b/src/plugins/platforms/cocoa/qcocoacursor.mm
@@ -304,7 +304,7 @@ NSCursor *QCocoaCursor::createCursorFromPixmap(const QPixmap pixmap, const QPoin
NSImage *nsimage;
if (pixmap.devicePixelRatio() > 1.0) {
QSize layoutSize = pixmap.size() / pixmap.devicePixelRatio();
- QPixmap scaledPixmap = pixmap.scaled(layoutSize);
+ QPixmap scaledPixmap = pixmap.scaled(layoutSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
nsimage = static_cast<NSImage *>(qt_mac_create_nsimage(scaledPixmap));
CGImageRef cgImage = qt_mac_toCGImage(pixmap.toImage());
NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage];