diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-12-20 14:28:23 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-12-21 16:18:13 +0000 |
commit | 8533c94a244b7ed14dcfaac69b512901fe10737e (patch) | |
tree | cad6d21420faf2eb98b683b441a395ab7ff5babd | |
parent | b9edbb5d54290331f89a7ced4e4d7807098b61d7 (diff) |
macOS: Take DPR into account when creating CGContexts for a QPixmap
Missing logic when refactoring image manipulation methods into QtGui
in c52bb030907.
Task-number: QTBUG-57723
Change-Id: I7b55d4451d35faf5fd794daa0b80acbd712f30cd
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
-rw-r--r-- | src/gui/painting/qcoregraphics.mm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/painting/qcoregraphics.mm b/src/gui/painting/qcoregraphics.mm index 466b18d59b..804c40ecbb 100644 --- a/src/gui/painting/qcoregraphics.mm +++ b/src/gui/painting/qcoregraphics.mm @@ -495,6 +495,8 @@ QMacCGContext::QMacCGContext(QPaintDevice *paintDevice) : context(0) context = CGBitmapContextCreate(image->bits(), image->width(), image->height(), 8, image->bytesPerLine(), colorspace, flags); CGContextTranslateCTM(context, 0, image->height()); + qreal devicePixelRatio = paintDevice->devicePixelRatioF(); + CGContextScaleCTM(context, devicePixelRatio, devicePixelRatio); CGContextScaleCTM(context, 1, -1); } |