diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-10-26 00:36:45 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-10-26 01:03:23 (GMT) |
commit | 1a299a9631a2d1b4e07cedfece7af5318a766fe6 (patch) | |
tree | bde51d4c5acdc7cd975322932bdbea02bcda59bb /src/gui/graphicsview | |
parent | 0d6104d763f4cb32ac6117b3f951afcb73fc50e6 (diff) | |
download | Qt-1a299a9631a2d1b4e07cedfece7af5318a766fe6.zip Qt-1a299a9631a2d1b4e07cedfece7af5318a766fe6.tar.gz Qt-1a299a9631a2d1b4e07cedfece7af5318a766fe6.tar.bz2 |
Optimize QGraphicsRotation's use of QMatrix4x4
Previous code was creating a full 3D rotation matrix and then
projecting back to 2D. This change combines the two steps into
one to avoid calculating matrix components that will be dropped.
Reviewed-by: Sarah Smith
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r-- | src/gui/graphicsview/qgraphicstransform.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicstransform.cpp b/src/gui/graphicsview/qgraphicstransform.cpp index a0b5493..93dc196 100644 --- a/src/gui/graphicsview/qgraphicstransform.cpp +++ b/src/gui/graphicsview/qgraphicstransform.cpp @@ -547,9 +547,7 @@ void QGraphicsRotation::applyTo(QMatrix4x4 *matrix) const return; matrix->translate(d->origin); - QMatrix4x4 m; - m.rotate(d->angle, d->axis.x(), d->axis.y(), d->axis.z()); - *matrix *= m.toTransform(1024.0f); // Project back to 2D. + matrix->projectedRotate(d->angle, d->axis.x(), d->axis.y(), d->axis.z()); matrix->translate(-d->origin); } |