From c7cca2dd74bcfb0a2020fbb537fd47b50b2775c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 27 Mar 2013 11:48:25 +0100 Subject: [PATCH] Make QMacStyle paint right side up again. 491dcbfac8 accidentally removed the y-axis inversion for the widget case. Move it back to the common code path. Change-Id: Ie6bbe6f442ca342347af77071da3a743b5655159 Reviewed-by: Jens Bache-Wiig --- src/widgets/styles/qmacstyle_mac.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index e39679ba658..1ea0e274181 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -6531,6 +6531,10 @@ QMacCGContext::QMacCGContext(QPainter *p) context = CGBitmapContextCreate((void *) image->bits(), image->width(), image->height(), 8, image->bytesPerLine(), colorspace, flags); + // Invert y axis. + CGContextTranslateCTM(context, 0, image->height()); + CGContextScaleCTM(context, 1, -1); + const qreal devicePixelRatio = image->devicePixelRatio(); if (devType == QInternal::Widget) { @@ -6555,10 +6559,6 @@ QMacCGContext::QMacCGContext(QPainter *p) CGContextScaleCTM(context, devicePixelRatio, devicePixelRatio); CGContextTranslateCTM(context, native.dx() / devicePixelRatio, native.dy() / devicePixelRatio); } else { - // Invert y axis. - CGContextTranslateCTM(context, 0, image->height()); - CGContextScaleCTM(context, 1, -1); - // Scale to paint in device-independent pixels. CGContextScaleCTM(context, devicePixelRatio, devicePixelRatio); }