mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-26 16:08:34 +02:00
snapshots done
This commit is contained in:
parent
b22f439a43
commit
b106e22ac3
3 changed files with 102 additions and 39 deletions
|
@ -81,16 +81,34 @@ GitVisuals.prototype.toScreenCoords = function(pos) {
|
|||
|
||||
**************************************/
|
||||
|
||||
GitVisuals.prototype.genSnapshot = function() {
|
||||
this.fullCalc();
|
||||
|
||||
var snapshot = {};
|
||||
_.each(this.visNodeMap, function(visNode) {
|
||||
snapshot[visNode.get('id')] = visNode.getAttributes();
|
||||
}, this);
|
||||
|
||||
this.visBranchCollection.each(function(visBranch) {
|
||||
snapshot[visBranch.getID()] = visBranch.getAttributes();
|
||||
}, this);
|
||||
|
||||
this.edgeCollection.each(function(visEdge) {
|
||||
snapshot[visEdge.getID()] = visEdge.getAttributes();
|
||||
}, this);
|
||||
|
||||
return snapshot;
|
||||
};
|
||||
|
||||
GitVisuals.prototype.refreshTree = function(speed) {
|
||||
// this method can only be called after graphics are rendered
|
||||
this.calcTreeCoords();
|
||||
this.calcGraphicsCoords();
|
||||
this.fullCalc();
|
||||
|
||||
this.animateAll(speed);
|
||||
};
|
||||
|
||||
GitVisuals.prototype.refreshTreeHarsh = function() {
|
||||
this.calcTreeCoords();
|
||||
this.fullCalc();
|
||||
|
||||
this.animateAll(0);
|
||||
};
|
||||
|
@ -103,6 +121,11 @@ GitVisuals.prototype.animateAll = function(speed) {
|
|||
this.animateRefs(speed);
|
||||
};
|
||||
|
||||
GitVisuals.prototype.fullCalc = function() {
|
||||
this.calcTreeCoords();
|
||||
this.calcGraphicsCoords();
|
||||
};
|
||||
|
||||
GitVisuals.prototype.calcTreeCoords = function() {
|
||||
// this method can only contain things that dont rely on graphics
|
||||
if (!this.rootCommit) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue