From 86abf43122c0b41371d1f6eee7311079ed7cf2bb Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 3 Jan 2017 16:53:35 -0800 Subject: [PATCH] QMacCGContext: Take paint device pixel ratio into account This seems to have been omitted in c52bb0309071bed9e040c79d87f764bac6a396b8. Change-Id: If8cde889af75934c85d9b21bd22095b7e5a4bf32 Task-number: QTBUG-57894 Reviewed-by: Jake Petroules --- src/gui/painting/qcoregraphics.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/painting/qcoregraphics.mm b/src/gui/painting/qcoregraphics.mm index 466b18d59b..803328c10f 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()); + const qreal devicePixelRatio = paintDevice->devicePixelRatioF(); + CGContextScaleCTM(context, devicePixelRatio, devicePixelRatio); CGContextScaleCTM(context, 1, -1); }