mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-26 16:08:34 +02:00
fixed bug on merge commits layout engine
This commit is contained in:
parent
6cf842c2f6
commit
4f8b3eb044
2 changed files with 7 additions and 3 deletions
|
@ -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;
|
||||
|
|
1
todo.txt
1
todo.txt
|
@ -32,7 +32,6 @@ Pre-publish things:
|
|||
|
||||
extra command ideas:
|
||||
|
||||
git checkout -
|
||||
git branch --contains
|
||||
git log branchA ^branchB
|
||||
git status -sb
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue