fix branching lines

This commit is contained in:
Raghu Rajagopalan 2016-04-28 11:27:52 +05:30
parent 6521cc81fe
commit 75c9debb5e

View File

@ -218,6 +218,7 @@ function renderCommitHistory(svg, commitid, branches, direction) {
renderCommitHistory(svg, commitid[0], branches, direction);
branchNum++;
renderCommitHistory(svg, commitid[1], branches, direction);
branchNum--;
}
}
@ -268,11 +269,12 @@ exports.draw = function(txt, id, ver) {
});
svg.attr('height', function() {
if (direction === 'BT') return Object.keys(allCommitsDict).length * config.nodeSpacing;
return branches.length * config.branchOffset;
});
svg.attr('width', function() {
return Object.keys(allCommitsDict).length * config.nodeSpacing;
return (branches.length + 1) * config.branchOffset;
});
//svg.attr('width', function() {
//if (direction === 'LR') return Object.keys(allCommitsDict).length * config.nodeSpacing + config.leftMargin;
//return (branches.length + 1) * config.branchOffset;
//});
} catch (e) {
log.error('Error while rendering gitgraph');
log.error(e.message);