enhance: better commit graph

This commit is contained in:
leo 2024-07-08 18:10:26 +08:00
parent 7ee3db500a
commit 8fa19ecd0c
No known key found for this signature in database
2 changed files with 8 additions and 3 deletions

View file

@ -61,8 +61,13 @@ namespace SourceGit.Models
} }
else if (x < LastX) else if (x < LastX)
{ {
if (y > LastY + halfHeight) var testY = LastY + halfHeight;
Add(new Point(LastX, LastY + halfHeight)); if (y > testY)
Add(new Point(LastX, testY));
if (!isEnd)
y += halfHeight;
Add(new Point(x, y)); Add(new Point(x, y));
} }
else if (isEnd) else if (isEnd)

View file

@ -193,7 +193,7 @@ namespace SourceGit.Views
if (i < size - 1) if (i < size - 1)
{ {
var midY = (last.Y + cur.Y) / 2; var midY = (last.Y + cur.Y) / 2;
ctx.CubicBezierTo(new Point(last.X, midY + 2), new Point(cur.X, midY - 2), cur); ctx.CubicBezierTo(new Point(last.X, midY + 4), new Point(cur.X, midY - 4), cur);
} }
else else
{ {