mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
fix: wrong graph when there's only one commit
This commit is contained in:
parent
ead2af7d65
commit
1dd782bc42
1 changed files with 10 additions and 6 deletions
|
@ -191,6 +191,7 @@ namespace SourceGit.Models
|
|||
}
|
||||
|
||||
isMerged = isMerged || l.IsMerged;
|
||||
major.IsMerged = isMerged;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -202,12 +203,17 @@ namespace SourceGit.Models
|
|||
}
|
||||
|
||||
// Create new curve for branch head
|
||||
if (major == null && commit.Parents.Count > 0)
|
||||
if (major == null)
|
||||
{
|
||||
offsetX += UNIT_WIDTH;
|
||||
major = new PathHelper(commit.Parents[0], isMerged, colorIdx, new Point(offsetX, offsetY));
|
||||
unsolved.Add(major);
|
||||
temp.Paths.Add(major.Path);
|
||||
|
||||
if (commit.Parents.Count > 0)
|
||||
{
|
||||
major = new PathHelper(commit.Parents[0], isMerged, colorIdx, new Point(offsetX, offsetY));
|
||||
unsolved.Add(major);
|
||||
temp.Paths.Add(major.Path);
|
||||
}
|
||||
|
||||
colorIdx = (colorIdx + 1) % _penCount;
|
||||
}
|
||||
|
||||
|
@ -216,11 +222,9 @@ namespace SourceGit.Models
|
|||
int dotColor = 0;
|
||||
if (major != null)
|
||||
{
|
||||
major.IsMerged = isMerged;
|
||||
position = new Point(major.LastX, offsetY);
|
||||
dotColor = major.Path.Color;
|
||||
}
|
||||
|
||||
Dot anchor = new Dot() { Center = position, Color = dotColor };
|
||||
if (commit.IsCurrentHead)
|
||||
anchor.Type = DotType.Head;
|
||||
|
|
Loading…
Reference in a new issue