mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07: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 geo = new StreamGeometry();
|
||||||
var pen = PENS[line.Color];
|
var pen = PENS[line.Color];
|
||||||
using (var ctx = geo.Open()) {
|
using (var ctx = geo.Open()) {
|
||||||
ctx.BeginFigure(last, false, false);
|
var started = false;
|
||||||
|
|
||||||
var ended = false;
|
var ended = false;
|
||||||
for (int i = 1; i < size; i++) {
|
for (int i = 1; i < size; i++) {
|
||||||
var cur = line.Points[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) {
|
if (cur.Y > bottom) {
|
||||||
cur.Y = bottom;
|
cur.Y = bottom;
|
||||||
ended = true;
|
ended = true;
|
||||||
|
@ -346,11 +355,19 @@ namespace SourceGit.Views.Controls {
|
||||||
var geo = new StreamGeometry();
|
var geo = new StreamGeometry();
|
||||||
var pen = PENS[line.Color];
|
var pen = PENS[line.Color];
|
||||||
using (var ctx = geo.Open()) {
|
using (var ctx = geo.Open()) {
|
||||||
ctx.BeginFigure(last, false, false);
|
var started = false;
|
||||||
|
|
||||||
var ended = false;
|
var ended = false;
|
||||||
for (int i = 1; i < size; i++) {
|
for (int i = 1; i < size; i++) {
|
||||||
var cur = line.Points[i];
|
var cur = line.Points[i];
|
||||||
|
if (cur.Y < top) {
|
||||||
|
last = cur;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!started) {
|
||||||
|
ctx.BeginFigure(last, false, false);
|
||||||
|
}
|
||||||
|
|
||||||
if (cur.Y > bottom) {
|
if (cur.Y > bottom) {
|
||||||
cur.Y = bottom;
|
cur.Y = bottom;
|
||||||
ended = true;
|
ended = true;
|
||||||
|
|
Loading…
Reference in a new issue