mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-26 16:08:34 +02:00
z index reflow better
This commit is contained in:
parent
bbd081591d
commit
7f7681320e
2 changed files with 37 additions and 9 deletions
|
@ -72,7 +72,9 @@ GitVisuals.prototype.toScreenCoords = function(pos) {
|
|||
**************************************/
|
||||
|
||||
GitVisuals.prototype.refreshTree = function() {
|
||||
// this method can only be called after graphics are rendered
|
||||
this.calculateTreeCoords();
|
||||
this.calculateGraphicsCoords();
|
||||
|
||||
this.animateAll();
|
||||
};
|
||||
|
@ -84,12 +86,15 @@ GitVisuals.prototype.refreshTreeHarsh = function() {
|
|||
};
|
||||
|
||||
GitVisuals.prototype.animateAll = function(speed) {
|
||||
this.zIndexReflow();
|
||||
|
||||
this.animateEdges(speed);
|
||||
this.animateNodePositions(speed);
|
||||
this.animateRefs(speed);
|
||||
};
|
||||
|
||||
GitVisuals.prototype.calculateTreeCoords = function() {
|
||||
// this method can only contain things that dont rely on graphics
|
||||
if (!this.rootCommit) {
|
||||
throw new Error('grr, no root commit!');
|
||||
}
|
||||
|
@ -100,6 +105,12 @@ GitVisuals.prototype.calculateTreeCoords = function() {
|
|||
this.calcBranchStacks();
|
||||
};
|
||||
|
||||
GitVisuals.prototype.calculateGraphicsCoords = function() {
|
||||
this.visBranchCollection.each(function(visBranch) {
|
||||
visBranch.updateName();
|
||||
});
|
||||
};
|
||||
|
||||
GitVisuals.prototype.calcBranchStacks = function() {
|
||||
var branches = gitEngine.getBranches();
|
||||
var map = {};
|
||||
|
@ -313,6 +324,14 @@ GitVisuals.prototype.collectionChanged = function() {
|
|||
};
|
||||
|
||||
GitVisuals.prototype.zIndexReflow = function() {
|
||||
_.each(this.visNodeMap, function(visNode) {
|
||||
visNode.toFront();
|
||||
});
|
||||
|
||||
this.visBranchCollection.each(function(vBranch) {
|
||||
vBranch.nonTextToFront();
|
||||
});
|
||||
|
||||
this.visBranchCollection.each(function(vBranch) {
|
||||
vBranch.textToFront();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue