summaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qmlstateoperations.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-11-12 03:53:41 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-11-12 03:53:41 (GMT)
commit2744c8f6c824b3eda4b31c1ab1d588ae90ede4e1 (patch)
treedb2ff98f4781c622b710b1b70b6724b6928709f1 /src/declarative/util/qmlstateoperations.cpp
parent49cc2d35d7da4a78d696503930720e88a6403722 (diff)
downloadQt-2744c8f6c824b3eda4b31c1ab1d588ae90ede4e1.zip
Qt-2744c8f6c824b3eda4b31c1ab1d588ae90ede4e1.tar.gz
Qt-2744c8f6c824b3eda4b31c1ab1d588ae90ede4e1.tar.bz2
Autotests.
Diffstat (limited to 'src/declarative/util/qmlstateoperations.cpp')
-rw-r--r--src/declarative/util/qmlstateoperations.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/declarative/util/qmlstateoperations.cpp b/src/declarative/util/qmlstateoperations.cpp
index 03337cb..d1aa748 100644
--- a/src/declarative/util/qmlstateoperations.cpp
+++ b/src/declarative/util/qmlstateoperations.cpp
@@ -76,18 +76,19 @@ void QmlParentChangePrivate::doChange(QmlGraphicsItem *targetParent, QmlGraphics
const QTransform &transform = target->itemTransform(targetParent, &ok);
if (transform.type() >= QTransform::TxShear || !ok) {
qmlInfo(q) << QObject::tr("Unable to preserve appearance under complex transform");
+ ok = false;
}
qreal scale = 1;
qreal rotation = 0;
- if (transform.type() != QTransform::TxRotate) {
+ if (ok && transform.type() != QTransform::TxRotate) {
if (transform.m11() == transform.m22())
scale = transform.m11();
else {
qmlInfo(q) << QObject::tr("Unable to preserve appearance under non-uniform scale");
ok = false;
}
- } else if (transform.type() == QTransform::TxRotate) {
+ } else if (ok && transform.type() == QTransform::TxRotate) {
if (transform.m11() == transform.m22())
scale = qSqrt(transform.m11()*transform.m11() + transform.m12()*transform.m12());
else {
@@ -105,7 +106,7 @@ void QmlParentChangePrivate::doChange(QmlGraphicsItem *targetParent, QmlGraphics
qreal xt = transform.dx();
qreal yt = transform.dy();
- if (target->transformOrigin() != QmlGraphicsItem::TopLeft) {
+ if (ok && target->transformOrigin() != QmlGraphicsItem::TopLeft) {
qreal tempxt = target->transformOriginPoint().x();
qreal tempyt = target->transformOriginPoint().y();
QTransform t;