Skip to content

Commit

Permalink
Merge pull request #2392 from billdawson/timob-9495
Browse files Browse the repository at this point in the history
TIMOB-9495 Take autoreverse into account when remembering the scale/rota...
  • Loading branch information
Opie Cyrus committed Jun 15, 2012
2 parents 13a27ee + 0e3881d commit 9143f49
Showing 1 changed file with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,18 @@ public AnimationSet render(TiViewProxy viewProxy, View view, int x, int y, int w

// Remember the toX, toY
if (tiView != null) {
tiView.setAnimatedXScale(params[1]);
tiView.setAnimatedYScale(params[3]);
float rememberX = params[1];
float rememberY = params[3];

// But if autoreverse is in effect, then
// set back to the fromX, fromY
if (autoreverse != null && autoreverse.booleanValue()) {
rememberX = fromX;
rememberY = fromY;
}

tiView.setAnimatedXScale(rememberX);
tiView.setAnimatedYScale(rememberY);
}

} else {
Expand All @@ -307,7 +317,13 @@ public AnimationSet render(TiViewProxy viewProxy, View view, int x, int y, int w
}

// And remember for next time.
tiView.setAnimatedRotationDegrees(toDegrees);
if (autoreverse == null || !autoreverse.booleanValue()) {
tiView.setAnimatedRotationDegrees(toDegrees);
} else {
// Because the animation will autoreverse, we
// want to save the original degrees.
tiView.setAnimatedRotationDegrees(fromDegrees);
}

}

Expand Down

0 comments on commit 9143f49

Please sign in to comment.