diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-05-14 02:16:54 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-05-14 02:16:54 (GMT) |
commit | 376ca20965e7546f0d25218858583ccde872f2fb (patch) | |
tree | 14dec84e9e626cbc5e93dcec1e3a5963a154f876 | |
parent | 169e7558fd731abdfceed00e5b2ca03c634e8d5d (diff) | |
download | Qt-376ca20965e7546f0d25218858583ccde872f2fb.zip Qt-376ca20965e7546f0d25218858583ccde872f2fb.tar.gz Qt-376ca20965e7546f0d25218858583ccde872f2fb.tar.bz2 |
Revert "Fix crash in ParentAnimation."
This reverts commit 8f800ea5611be333ae15f932dfea50bc80852c03.
-rw-r--r-- | src/declarative/util/qdeclarativeanimation.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 195939f..0f7c946 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -2535,15 +2535,14 @@ void QDeclarativeParentAnimation::transition(QDeclarativeStateActions &actions, myAction.event = vpc; viaData->pc << vpc; viaData->actions << myAction; - int index = i; - bool invertedIndex = (direction == QDeclarativeAbstractAnimation::Forward) && action.reverseEvent; QDeclarativeAction dummyAction; - QDeclarativeAction &xAction = pc->xIsSet() ? actions[invertedIndex ? --index : ++i] : dummyAction; - QDeclarativeAction &yAction = pc->yIsSet() ? actions[invertedIndex ? --index : ++i] : dummyAction; - QDeclarativeAction &sAction = pc->scaleIsSet() ? actions[invertedIndex ? --index : ++i] : dummyAction; - QDeclarativeAction &rAction = pc->rotationIsSet() ? actions[invertedIndex ? --index : ++i] : dummyAction; + QDeclarativeAction &xAction = pc->xIsSet() ? actions[++i] : dummyAction; + QDeclarativeAction &yAction = pc->yIsSet() ? actions[++i] : dummyAction; + QDeclarativeAction &sAction = pc->scaleIsSet() ? actions[++i] : dummyAction; + QDeclarativeAction &rAction = pc->rotationIsSet() ? actions[++i] : dummyAction; + bool forward = (direction == QDeclarativeAbstractAnimation::Forward); QDeclarativeItem *target = pc->object(); - QDeclarativeItem *targetParent = action.reverseEvent ? pc->originalParent() : pc->parent(); + QDeclarativeItem *targetParent = forward ? pc->parent() : pc->originalParent(); //### this mirrors the logic in QDeclarativeParentChange. bool ok; @@ -2585,9 +2584,9 @@ void QDeclarativeParentAnimation::transition(QDeclarativeStateActions &actions, qreal w = target->width(); qreal h = target->height(); if (pc->widthIsSet()) - w = actions[invertedIndex ? --index : ++i].toValue.toReal(); + w = actions[++i].toValue.toReal(); if (pc->heightIsSet()) - h = actions[invertedIndex ? --index : ++i].toValue.toReal(); + h = actions[++i].toValue.toReal(); const QPointF &transformOrigin = d->computeTransformOrigin(target->transformOrigin(), w,h); qreal tempxt = transformOrigin.x(); |