mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-22 20:37:19 -08:00
optimize<CommitGraph>: do NOT render lines not visible in view
This commit is contained in:
parent
e7a7c0518e
commit
c165cab3c0
1 changed files with 21 additions and 4 deletions
|
@ -283,11 +283,20 @@ namespace SourceGit.Views.Controls {
|
|||
var geo = new StreamGeometry();
|
||||
var pen = PENS[line.Color];
|
||||
using (var ctx = geo.Open()) {
|
||||
ctx.BeginFigure(last, false, false);
|
||||
|
||||
var started = false;
|
||||
var ended = false;
|
||||
for (int i = 1; i < size; i++) {
|
||||
var cur = line.Points[i];
|
||||
if (cur.Y < top) {
|
||||
last = cur;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!started) {
|
||||
ctx.BeginFigure(last, false, false);
|
||||
started = true;
|
||||
}
|
||||
|
||||
if (cur.Y > bottom) {
|
||||
cur.Y = bottom;
|
||||
ended = true;
|
||||
|
@ -346,11 +355,19 @@ namespace SourceGit.Views.Controls {
|
|||
var geo = new StreamGeometry();
|
||||
var pen = PENS[line.Color];
|
||||
using (var ctx = geo.Open()) {
|
||||
ctx.BeginFigure(last, false, false);
|
||||
|
||||
var started = false;
|
||||
var ended = false;
|
||||
for (int i = 1; i < size; i++) {
|
||||
var cur = line.Points[i];
|
||||
if (cur.Y < top) {
|
||||
last = cur;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!started) {
|
||||
ctx.BeginFigure(last, false, false);
|
||||
}
|
||||
|
||||
if (cur.Y > bottom) {
|
||||
cur.Y = bottom;
|
||||
ended = true;
|
||||
|
|
Loading…
Reference in a new issue