weird part with rebase animation

This commit is contained in:
Peter Cottle 2012-09-30 14:57:49 -07:00
parent 01b9b1132d
commit 1bbdb5d6a0
4 changed files with 80 additions and 6 deletions

View file

@ -28,8 +28,7 @@ AnimationFactory.prototype.genCommitBirthAnimation = function(animationQueue, co
// this takes care of refs and all that jazz, and updates all the positions
gitVisuals.refreshTree(time);
visNode.setBirthPosition();
visNode.setOutgoingEdgesBirthPosition();
visNode.setBirth();
visNode.parentInFront();
visNode.animateUpdatedPosition(bounceTime, 'bounce');
@ -41,3 +40,34 @@ AnimationFactory.prototype.genCommitBirthAnimation = function(animationQueue, co
duration: Math.max(time, bounceTime)
}));
};
AnimationFactory.prototype.genCommitBirthAnimationInSequence = function(animationQueue, index, commits) {
if (!animationQueue) { throw new Error("rawrr"); }
var time = GRAPHICS.defaultAnimationTime * 1.0;
var bounceTime = time * 2.0;
var toHide = commits.slice(index + 1);
var visNode = commits[index].get('visNode');
var animation = function() {
visNode.parentInFront();
visNode.animateUpdatedPosition(bounceTime, 'bounce');
visNode.animateOutgoingEdges(time);
};
animationQueue.add(new Animation({
closure: animation,
duration: Math.max(time, bounceTime)
}));
};
AnimationFactory.prototype.refreshTree = function(animationQueue) {
animationQueue.add(new Animation({
closure: function() {
console.log('refreshing tree from here');
gitVisuals.refreshTree();
}
}));
};