diff options
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem_p.h | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index 55ed62e..1bf8993 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -517,30 +517,20 @@ 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; + QTransform x(transform); + if (!graphicsTransforms.isEmpty()) { + QMatrix4x4 m; + for (int i = 0; i < graphicsTransforms.size(); ++i) + graphicsTransforms.at(i)->applyTo(&m); + x *= m.toTransform(); } - - QMatrix4x4 x(transform); - for (int i = 0; i < graphicsTransforms.size(); ++i) - graphicsTransforms.at(i)->applyTo(&x); x.translate(xOrigin, yOrigin); - x.rotate(rotation, 0, 0, 1); - x.scale(scale); + x.rotate(rotation); + x.scale(scale, scale); x.translate(-xOrigin, -yOrigin); - QTransform t = x.toTransform(); // project the 3D matrix back to 2D. if (postmultiplyTransform) - t *= *postmultiplyTransform; - return t; + x *= *postmultiplyTransform; + return x; } }; |