From 0d608587f35f7659376a728cf8ee6b4b71ec9d5a Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 14 May 2010 13:56:45 +1000 Subject: Reduce the chance of AnchorAnimation animating geometry changes it isn't responsible for. --- src/declarative/util/qdeclarativestateoperations.cpp | 12 ++++++++---- 1 file 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 QDeclarativeAnchorChanges::additionalActions() Q_D(QDeclarativeAnchorChanges); QList 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; -- cgit v0.12