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 <jens.bache-wiig@digia.com>
This commit is contained in:
Morten Johan Sørvig 2013-03-27 11:48:25 +01:00 committed by The Qt Project
parent ba3418ae75
commit c7cca2dd74

View File

@ -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);
}