|
505 | 505 | this.height = 0;
|
506 | 506 | this.width = 0;
|
507 | 507 | this.commits = [];
|
508 |
| - this.path = []; // Path to draw, this is an array of points {x, y, type("start"|"join"|"end")} |
| 508 | + this.path = []; // Path to draw, this is an array of points {x, y, type("start"|"joint"|"end")} |
509 | 509 |
|
510 | 510 | // Column number calculation for auto-color & auto-offset
|
511 | 511 | if (typeof options.column === "number") {
|
|
757 | 757 | var point = {
|
758 | 758 | x: commit.x,
|
759 | 759 | y: commit.y,
|
760 |
| - type: "join" |
| 760 | + type: "joint" |
761 | 761 | };
|
762 | 762 |
|
763 | 763 | if (!isFirstBranch && isPathBeginning) {
|
764 | 764 | this.pushPath(this.startPoint);
|
765 |
| - |
766 |
| - // Trace path from parent branch if it has commits already |
767 |
| - if (this.parentBranch.commits.length > 0) { |
| 765 | + // Add a path joint to startpoint + template spacing |
| 766 | + // So that line will not go through commit of other branches |
| 767 | + if ((this.parent.orientation === "vertical-reverse") || (this.parent.orientation === "vertical")) { |
768 | 768 | this.pushPath({
|
769 |
| - x: this.startPoint.x - this.parentBranch.offsetX + this.offsetX - this.template.commit.spacingX, |
770 |
| - y: this.startPoint.y - this.parentBranch.offsetY + this.offsetY - this.template.commit.spacingY, |
771 |
| - type: "join" |
| 769 | + x: commit.x, |
| 770 | + y: this.startPoint.y - this.template.commit.spacingY, |
| 771 | + type: "joint" |
| 772 | + }); |
| 773 | + } else { |
| 774 | + this.pushPath({ |
| 775 | + x: this.startPoint.x - this.template.commit.spacingX, |
| 776 | + y: commit.y, |
| 777 | + type: "joint" |
772 | 778 | });
|
773 |
| - |
774 |
| - var parent = _clone(this.startPoint); |
775 |
| - parent.type = "join"; |
776 |
| - this.parentBranch.pushPath(parent); |
777 | 779 | }
|
778 | 780 | } else if (isPathBeginning) {
|
779 | 781 | point.type = "start";
|
|
932 | 934 | var endOfBranch = {
|
933 | 935 | x: this.offsetX + this.template.commit.spacingX * (targetCommit.showLabel ? 3 : 2) - this.parent.commitOffsetX,
|
934 | 936 | y: this.offsetY + this.template.commit.spacingY * (targetCommit.showLabel ? 3 : 2) - this.parent.commitOffsetY,
|
935 |
| - type: "join" |
| 937 | + type: "joint" |
936 | 938 | };
|
937 | 939 | this.pushPath(_clone(endOfBranch));
|
938 | 940 |
|
|
994 | 996 | } else if (lastPoint.x === point.x && lastPoint.y === point.y) {
|
995 | 997 | if (lastPoint.type !== "start" && point.type === "end") {
|
996 | 998 | lastPoint.type = "end";
|
997 |
| - } else if (point.type === "join") { |
| 999 | + } else if (point.type === "joint") { |
998 | 1000 |
|
999 | 1001 | } else {
|
1000 | 1002 | this.path.push(point);
|
1001 | 1003 | }
|
1002 | 1004 | } else {
|
1003 |
| - if (point.type === "join") { |
| 1005 | + if (point.type === "joint") { |
1004 | 1006 | if ((point.x - lastPoint.x) * this.template.commit.spacingX < 0) {
|
1005 | 1007 | this.path.push(point);
|
1006 | 1008 | } else if ((point.y - lastPoint.y) * this.template.commit.spacingY < 0) {
|
|
0 commit comments