diff options
author | Tor Arne Vestbø <tor.arne.vestbo@nokia.com> | 2010-04-29 13:43:00 (GMT) |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@nokia.com> | 2010-04-30 12:43:21 (GMT) |
commit | 37a36bcc768fb8ec1cdcca03d4d4cfba6fcc8bb9 (patch) | |
tree | fed91a5d7813f7b8e8d3b442d1e50bad32d724d2 /src/gui | |
parent | 777fd03ca38f3ced43d2e2da45ddfa1f9a4d2456 (diff) | |
download | Qt-37a36bcc768fb8ec1cdcca03d4d4cfba6fcc8bb9.zip Qt-37a36bcc768fb8ec1cdcca03d4d4cfba6fcc8bb9.tar.gz Qt-37a36bcc768fb8ec1cdcca03d4d4cfba6fcc8bb9.tar.bz2 |
Fix wrong translation and clip for the raster paint-engine on Mac
When setting up the CGContextRef for a painter we need to take
into account both the redirection-transform and the transform
on the painter.
Reviewed-by: Gunnar
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/painting/qpaintengine_mac.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gui/painting/qpaintengine_mac.cpp b/src/gui/painting/qpaintengine_mac.cpp index ac2fcf4..14ba94e 100644 --- a/src/gui/painting/qpaintengine_mac.cpp +++ b/src/gui/painting/qpaintengine_mac.cpp @@ -118,9 +118,10 @@ QMacCGContext::QMacCGContext(QPainter *p) 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 @@ QMacCGContext::QMacCGContext(QPainter *p) } 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); |