summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index 49361cf..55ed62e 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -517,6 +517,19 @@ struct QGraphicsItemPrivate::TransformData
return transform * *postmultiplyTransform;
}
+ if (graphicsTransforms.isEmpty()) {
+ // Faster, and higher precision if there are no graphics
+ // transforms.
+ QTransform x(transform);
+ x.translate(xOrigin, yOrigin);
+ x.rotate(rotation);
+ x.scale(scale, scale);
+ x.translate(-xOrigin, -yOrigin);
+ if (postmultiplyTransform)
+ x *= *postmultiplyTransform;
+ return x;
+ }
+
QMatrix4x4 x(transform);
for (int i = 0; i < graphicsTransforms.size(); ++i)
graphicsTransforms.at(i)->applyTo(&x);