summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-05-14 03:56:45 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-05-14 03:58:00 (GMT)
commit0d608587f35f7659376a728cf8ee6b4b71ec9d5a (patch)
tree38050e8fc4d6d387416afea8a653b31f28078e80 /src/declarative
parent677d06cecb44c482c72d1e987e3f923a73fcedd2 (diff)
downloadQt-0d608587f35f7659376a728cf8ee6b4b71ec9d5a.zip
Qt-0d608587f35f7659376a728cf8ee6b4b71ec9d5a.tar.gz
Qt-0d608587f35f7659376a728cf8ee6b4b71ec9d5a.tar.bz2
Reduce the chance of AnchorAnimation animating geometry changes it
isn't responsible for.
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/util/qdeclarativestateoperations.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp
index a6fcaf3..0326f6d 100644
--- a/src/declarative/util/qdeclarativestateoperations.cpp
+++ b/src/declarative/util/qdeclarativestateoperations.cpp
@@ -1241,24 +1241,28 @@ QList<QDeclarativeAction> QDeclarativeAnchorChanges::additionalActions()
Q_D(QDeclarativeAnchorChanges);
QList<QDeclarativeAction> extra;
+ QDeclarativeAnchors::Anchors combined = d->anchorSet->d_func()->usedAnchors | d->anchorSet->d_func()->resetAnchors;
+ bool hChange = combined & QDeclarativeAnchors::Horizontal_Mask;
+ bool vChange = combined & QDeclarativeAnchors::Vertical_Mask;
+
if (d->target) {
QDeclarativeAction a;
- if (d->fromX != d->toX) {
+ if (hChange && d->fromX != d->toX) {
a.property = QDeclarativeProperty(d->target, QLatin1String("x"));
a.toValue = d->toX;
extra << a;
}
- if (d->fromY != d->toY) {
+ if (vChange && d->fromY != d->toY) {
a.property = QDeclarativeProperty(d->target, QLatin1String("y"));
a.toValue = d->toY;
extra << a;
}
- if (d->fromWidth != d->toWidth) {
+ if (hChange && d->fromWidth != d->toWidth) {
a.property = QDeclarativeProperty(d->target, QLatin1String("width"));
a.toValue = d->toWidth;
extra << a;
}
- if (d->fromHeight != d->toHeight) {
+ if (vChange && d->fromHeight != d->toHeight) {
a.property = QDeclarativeProperty(d->target, QLatin1String("height"));
a.toValue = d->toHeight;
extra << a;