src/gui/painting/qpaintengine_mac.cpp
changeset 30 5dc02b23752f
parent 18 2f34d5167611
--- a/src/gui/painting/qpaintengine_mac.cpp	Wed Jun 23 19:07:03 2010 +0300
+++ b/src/gui/painting/qpaintengine_mac.cpp	Tue Jul 06 15:10:48 2010 +0300
@@ -118,9 +118,10 @@
             QRegion clip = p->paintEngine()->systemClip();
             QTransform native = p->deviceTransform();
             QTransform logical = p->combinedTransform();
+
             if (p->hasClipping()) {
                 QRegion r = p->clipRegion();
-                r.translate(native.dx() - logical.dx(), native.dy() - logical.dy());
+                r.translate(native.dx(), native.dy());
                 if (clip.isEmpty())
                     clip = r;
                 else
@@ -128,10 +129,7 @@
             }
             qt_mac_clip_cg(context, clip, 0);
 
-            QPainterState *state = static_cast<QPainterState *>(pe->state);
-            Q_ASSERT(state);
-            if (!state->redirectionMatrix.isIdentity())
-                CGContextTranslateCTM(context, state->redirectionMatrix.dx(), state->redirectionMatrix.dy());
+            CGContextTranslateCTM(context, native.dx(), native.dy());
         }
     }
     CGContextRetain(context);
@@ -1392,7 +1390,11 @@
         CGContextSetInterpolationQuality(d->hd, (hints & QPainter::SmoothPixmapTransform) ?
                                          kCGInterpolationHigh : kCGInterpolationNone);
     }
-    CGContextSetShouldSmoothFonts(d->hd, hints & QPainter::TextAntialiasing);
+    bool textAntialiasing = (hints & QPainter::TextAntialiasing) == QPainter::TextAntialiasing;
+    if (!textAntialiasing || d->disabledSmoothFonts) {
+        d->disabledSmoothFonts = !textAntialiasing;
+        CGContextSetShouldSmoothFonts(d->hd, textAntialiasing);
+    }
 }
 
 /*