summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem_p.h
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-06-15 09:57:36 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-06-15 09:57:36 (GMT)
commit336dfcef05cb63df0a6d550b59a4badc7a0f01c1 (patch)
treea218ec97413e0c8ebc9600ac5db9b2adea485b32 /src/gui/graphicsview/qgraphicsitem_p.h
parente44d64510e019e5d3b379b704cfb824e0d7ccc9d (diff)
downloadQt-336dfcef05cb63df0a6d550b59a4badc7a0f01c1.zip
Qt-336dfcef05cb63df0a6d550b59a4badc7a0f01c1.tar.gz
Qt-336dfcef05cb63df0a6d550b59a4badc7a0f01c1.tar.bz2
Merge of master
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem_p.h')
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index b8b947d..12b6fe0 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -461,23 +461,35 @@ struct QGraphicsItemPrivate::TransformData {
qreal verticalShear;
qreal xOrigin;
qreal yOrigin;
+ bool onlyTransform;
TransformData() :
xScale(1.0), yScale(1.0), xRotation(0.0), yRotation(0.0), zRotation(0.0),
- horizontalShear(0.0), verticalShear(0.0), xOrigin(0.0), yOrigin(0.0)
+ horizontalShear(0.0), verticalShear(0.0), xOrigin(0.0), yOrigin(0.0),
+ onlyTransform(true)
{}
- QTransform computedFullTransform() const
+ QTransform computedFullTransform(QTransform *postmultiplyTransform = 0) const
{
- QTransform x;
- x.translate(xOrigin, yOrigin);
- x = transform * x;
+ if (onlyTransform) {
+ if (!postmultiplyTransform)
+ return transform;
+ QTransform x(transform);
+ x *= *postmultiplyTransform;
+ return x;
+ }
+
+ QTransform x(transform);
+ if (xOrigin != 0 || yOrigin != 0)
+ x *= QTransform::fromTranslate(xOrigin, yOrigin);
x.rotate(xRotation, Qt::XAxis);
x.rotate(yRotation, Qt::YAxis);
x.rotate(zRotation, Qt::ZAxis);
x.shear(horizontalShear, verticalShear);
x.scale(xScale, yScale);
x.translate(-xOrigin, -yOrigin);
+ if (postmultiplyTransform)
+ x *= *postmultiplyTransform;
return x;
}
};