Skip to content

Commit dea814c

Browse files
committed
feat: 添加 PathIndex 属性以支持提交路径索引的计算
1 parent 0f46b5b commit dea814c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/Models/Commit.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ public static double OpacityForNotMerged
6161
/// </summary>
6262
public int Index { get; set; } = 0;
6363

64+
public int PathIndex { get; set; } = 0;
65+
6466
public int Color { get; set; } = 0;
6567
public double Opacity => IsMerged ? 1 : OpacityForNotMerged;
6668
public FontWeight FontWeight => IsCurrentHead ? FontWeight.Bold : FontWeight.Regular;

src/Models/CommitGraph.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ public static CommitGraph Parse(List<Commit> commits, bool firstParentOnlyEnable
149149
temp.Paths.Add(major.Path);
150150
}
151151

152+
if (major != null)
153+
commit.PathIndex = temp.Paths.IndexOf(major.Path);
154+
152155
// Calculate link position of this commit.
153156
var position = new Point(major?.LastX ?? offsetX, offsetY);
154157
var dotColor = major?.Path.Color ?? 0;

0 commit comments

Comments
 (0)