fixed bug on merge commits layout engine

This commit is contained in:
Peter Cottle 2012-11-04 22:30:19 -08:00
parent 6cf842c2f6
commit 4f8b3eb044
2 changed files with 7 additions and 3 deletions

View file

@ -362,7 +362,6 @@ GitVisuals.prototype.maxWidthRecursive = function(commit) {
};
GitVisuals.prototype.assignBoundsRecursive = function(commit, min, max) {
// I always center myself within my bounds
var myWidthPos = (min + max) / 2.0;
commit.get('visNode').get('pos').x = myWidthPos;
@ -378,7 +377,9 @@ GitVisuals.prototype.assignBoundsRecursive = function(commit, min, max) {
var totalFlex = 0;
var children = commit.get('children');
_.each(children, function(child) {
if (child.isMainParent(commit)) {
totalFlex += child.get('visNode').getMaxWidthScaled();
}
}, this);
var prevBound = min;
@ -386,6 +387,10 @@ GitVisuals.prototype.assignBoundsRecursive = function(commit, min, max) {
// now go through and do everything
// TODO: order so the max width children are in the middle!!
_.each(children, function(child) {
if (!child.isMainParent(commit)) {
return;
}
var flex = child.get('visNode').getMaxWidthScaled();
var portion = (flex / totalFlex) * myLength;
var childMin = prevBound;

View file

@ -32,7 +32,6 @@ Pre-publish things:
extra command ideas:
git checkout -
git branch --contains
git log branchA ^branchB
git status -sb