summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-09-14 00:16:20 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-09-14 00:16:20 (GMT)
commit83dcd6fbb145ce92705905c979fd8965c70f4b3a (patch)
treea8345b0f6c5615807d37b637b56369f55b85f5ea /src/declarative
parentca36badc8925788e06910fab5200633d40e0f328 (diff)
downloadQt-83dcd6fbb145ce92705905c979fd8965c70f4b3a.zip
Qt-83dcd6fbb145ce92705905c979fd8965c70f4b3a.tar.gz
Qt-83dcd6fbb145ce92705905c979fd8965c70f4b3a.tar.bz2
In ParentChange treat flip in x and y as a 180 degree rotation
The two are equivalent, but flip doesn't work in ParentChange. Task-number: QTBUG-13554 Reviewed-by: Michael Brasser
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp5
-rw-r--r--src/declarative/util/qdeclarativestateoperations.cpp5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index 3c09747..ea3da25 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -2699,14 +2699,15 @@ void QDeclarativeParentAnimation::transition(QDeclarativeStateActions &actions,
qreal scale = 1;
qreal rotation = 0;
- if (ok && transform.type() != QTransform::TxRotate) {
+ bool isRotate = (transform.type() == QTransform::TxRotate) || (transform.m11() < 0);
+ if (ok && !isRotate) {
if (transform.m11() == transform.m22())
scale = transform.m11();
else {
qmlInfo(this) << QDeclarativeParentAnimation::tr("Unable to preserve appearance under non-uniform scale");
ok = false;
}
- } else if (ok && transform.type() == QTransform::TxRotate) {
+ } else if (ok && isRotate) {
if (transform.m11() == transform.m22())
scale = qSqrt(transform.m11()*transform.m11() + transform.m12()*transform.m12());
else {
diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp
index 845b3da..a78fc54 100644
--- a/src/declarative/util/qdeclarativestateoperations.cpp
+++ b/src/declarative/util/qdeclarativestateoperations.cpp
@@ -98,14 +98,15 @@ void QDeclarativeParentChangePrivate::doChange(QDeclarativeItem *targetParent, Q
qreal scale = 1;
qreal rotation = 0;
- if (ok && transform.type() != QTransform::TxRotate) {
+ bool isRotate = (transform.type() == QTransform::TxRotate) || (transform.m11() < 0);
+ if (ok && !isRotate) {
if (transform.m11() == transform.m22())
scale = transform.m11();
else {
qmlInfo(q) << QDeclarativeParentChange::tr("Unable to preserve appearance under non-uniform scale");
ok = false;
}
- } else if (ok && transform.type() == QTransform::TxRotate) {
+ } else if (ok && isRotate) {
if (transform.m11() == transform.m22())
scale = qSqrt(transform.m11()*transform.m11() + transform.m12()*transform.m12());
else {