diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-09-06 06:48:16 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-09-06 06:51:54 (GMT) |
commit | c3848a886448a15ae87801099849018d761026ed (patch) | |
tree | f270551764d8473a1120649a8aad20f309859e38 /src/declarative | |
parent | dc7f31dbd698e00cd25d36b4568b03dd83032ecc (diff) | |
download | Qt-c3848a886448a15ae87801099849018d761026ed.zip Qt-c3848a886448a15ae87801099849018d761026ed.tar.gz Qt-c3848a886448a15ae87801099849018d761026ed.tar.bz2 |
Fix AnchorAnimation for multiple AnchorChanges with dependancies.
When rewinding, don't reapply bindings, only values. This is consistent
with how we handle rewinding other property bindings.
Task-number: QTBUG-13398
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/util/qdeclarativestateoperations.cpp | 17 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativetransitionmanager.cpp | 2 |
2 files changed, 3 insertions, 16 deletions
diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp index 6e6f0cb..845b3da 100644 --- a/src/declarative/util/qdeclarativestateoperations.cpp +++ b/src/declarative/util/qdeclarativestateoperations.cpp @@ -1427,6 +1427,7 @@ void QDeclarativeAnchorChanges::clearBindings() if (!d->target) return; + //### should this (saving "from" values) be moved to saveCurrentValues()? d->fromX = d->target->x(); d->fromY = d->target->y(); d->fromWidth = d->target->width(); @@ -1486,22 +1487,8 @@ void QDeclarativeAnchorChanges::rewind() return; QDeclarativeItemPrivate *targetPrivate = QDeclarativeItemPrivate::get(d->target); - //restore previous anchors - if (d->rewindLeft.anchorLine != QDeclarativeAnchorLine::Invalid) - targetPrivate->anchors()->setLeft(d->rewindLeft); - if (d->rewindRight.anchorLine != QDeclarativeAnchorLine::Invalid) - targetPrivate->anchors()->setRight(d->rewindRight); - if (d->rewindHCenter.anchorLine != QDeclarativeAnchorLine::Invalid) - targetPrivate->anchors()->setHorizontalCenter(d->rewindHCenter); - if (d->rewindTop.anchorLine != QDeclarativeAnchorLine::Invalid) - targetPrivate->anchors()->setTop(d->rewindTop); - if (d->rewindBottom.anchorLine != QDeclarativeAnchorLine::Invalid) - targetPrivate->anchors()->setBottom(d->rewindBottom); - if (d->rewindVCenter.anchorLine != QDeclarativeAnchorLine::Invalid) - targetPrivate->anchors()->setVerticalCenter(d->rewindVCenter); - if (d->rewindBaseline.anchorLine != QDeclarativeAnchorLine::Invalid) - targetPrivate->anchors()->setBaseline(d->rewindBaseline); + //restore previous values (but not previous bindings, i.e. anchors) d->target->setX(d->rewindX); d->target->setY(d->rewindY); if (targetPrivate->widthValid) { diff --git a/src/declarative/util/qdeclarativetransitionmanager.cpp b/src/declarative/util/qdeclarativetransitionmanager.cpp index 9f198e4..d82c4bb 100644 --- a/src/declarative/util/qdeclarativetransitionmanager.cpp +++ b/src/declarative/util/qdeclarativetransitionmanager.cpp @@ -176,7 +176,7 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> & if (action.event->isReversable()) { action.event->clearBindings(); action.event->rewind(); - action.event->clearBindings(); + action.event->clearBindings(); //### shouldn't be needed } continue; } |