Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

improve performance: not to redraw history graph if commit/refs not c…

…hanged
  • Loading branch information...
commit aa1ac2896d2b1e94e1a81049b1b69d9654a13414 1 parent c0cbd4a
@yysun authored
View
1  DataServices/Commit.cs
@@ -16,6 +16,5 @@ public class Commit
public DateTime CommitDate { get; set; }
public string CommitDateRelative { get; set; }
internal bool deleted { get; set; }
- internal int lane { get; set; }
}
}
View
3  DataServices/RepositoryGraph.cs
@@ -53,7 +53,7 @@ public List<Commit> Commits
PlotCommitList<PlotLane> pcl = new PlotCommitList<PlotLane>();
pcl.Source(plotWalk);
- pcl.FillTo(10000);
+ pcl.FillTo(200);
commits = pcl.Select(c => new Commit
{
@@ -64,7 +64,6 @@ public List<Commit> Commits
CommitterEmail = c.GetCommitterIdent().GetEmailAddress(),
CommitDate = c.GetCommitterIdent().GetWhen(),
Message = c.GetShortMessage(),
- lane=c.GetLane().GetPosition(),
}).ToList();
commits.ForEach(commit => commit.ChildIds =
View
14 GitFileStatusTracker.cs
@@ -123,6 +123,8 @@ public GitFileStatus GetFileStatus(string fileName)
private GitFileStatus GetFileStatusNoCache(string fileName)
{
+ if (Directory.Exists(fileName)) return GitFileStatus.Ignored;
+
var fileNameRel = GetRelativeFileNameForGit(fileName);
var dirCache = repository.ReadDirCache();
TreeWalk treeWalk = new TreeWalk(this.repository) { Recursive = true };
@@ -305,12 +307,14 @@ public byte[] GetFileContent(string fileName)
{
var head = repository.Resolve(Constants.HEAD);
RevTree revTree = head == null ? null : new RevWalk(repository).ParseTree(head);
-
- var entry = TreeWalk.ForPath(repository, fileName, revTree);
- if (!entry.IsSubtree)
+ if (revTree != null)
{
- var blob = repository.Open(entry.GetObjectId(0));
- if (blob != null) return blob.GetCachedBytes();
+ var entry = TreeWalk.ForPath(repository, fileName, revTree);
+ if (!entry.IsSubtree)
+ {
+ var blob = repository.Open(entry.GetObjectId(0));
+ if (blob != null) return blob.GetCachedBytes();
+ }
}
}
catch (Exception ex)
View
47 HistoryView.xaml
@@ -21,36 +21,35 @@
<Grid x:Name="Main">
- <Grid x:Name="graph">
- <Grid.RowDefinitions>
- <RowDefinition Height="60" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
-
- <my:HistoryGraph Grid.Row="1" x:Name="HistoryGraph" />
- <Grid>
- <Label Content="Branches" Height="28" HorizontalAlignment="Left" Margin="6,2,0,0" Name="label1" VerticalAlignment="Top" FontSize="10" />
- <Label Content="Tags" Height="28" HorizontalAlignment="Left" Margin="6,26,0,0" Name="label2" VerticalAlignment="Top" FontSize="10" />
- <ListBox x:Name="branchList" Margin="60,4,160,36" ItemsPanel="{DynamicResource ItemsPanelTemplate1}" ItemTemplate="{DynamicResource DataTemplate1}"
+ <Grid x:Name="graph">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="60" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
+
+ <Grid>
+ <Grid.Background>
+ <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
+ <GradientStop Color="#FFF2F2F2" Offset="0" />
+ <GradientStop Color="#FFDBDBDB" Offset="1" />
+ <GradientStop Color="#FFD8D5D5" Offset="0.331" />
+ </LinearGradientBrush>
+ </Grid.Background>
+ <Label Content="Branches" Height="28" HorizontalAlignment="Left" Margin="6,2,0,0" Name="label1" VerticalAlignment="Top" FontSize="10" />
+ <Label Content="Tags" Height="28" HorizontalAlignment="Left" Margin="6,26,0,0" Name="label2" VerticalAlignment="Top" FontSize="10" />
+ <ListBox x:Name="branchList" Margin="60,4,160,36" ItemsPanel="{DynamicResource ItemsPanelTemplate1}" ItemTemplate="{DynamicResource DataTemplate1}"
Background="#00000000" BorderBrush="{x:Null}" Height="20" ItemContainerStyle="{DynamicResource ListBoxItemStyle1}"
ScrollViewer.HorizontalScrollBarVisibility="hidden" PreviewMouseDown="branchList_PreviewMouseDown" />
-
- <ListBox x:Name="tagList" Margin="60,26,160,14" ItemsPanel="{DynamicResource ItemsPanelTemplate1}" ItemTemplate="{DynamicResource DataTemplate1}"
+ <ListBox x:Name="tagList" Margin="60,26,160,14" ItemsPanel="{DynamicResource ItemsPanelTemplate1}" ItemTemplate="{DynamicResource DataTemplate1}"
Background="#00000000" BorderBrush="{x:Null}" Height="20" ItemContainerStyle="{DynamicResource ListBoxItemStyle1}"
ScrollViewer.HorizontalScrollBarVisibility="hidden" PreviewMouseDown="branchList_PreviewMouseDown" />
<CheckBox Content="Show simplified graph" HorizontalAlignment="Right" Margin="0,8,14,0" Name="checkBox1" Click="checkBox1_Click" Template="{DynamicResource ShowSimpleGraphCheckBoxControlTemplate}" VerticalAlignment="Top" ToolTip="Toggle View" />
<Label Content="Simplified view: off" HorizontalAlignment="Right" Margin="0,0,12,4" Name="lableView" VerticalAlignment="Bottom" FontSize="9.333" />
- <Grid.Background>
- <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
- <GradientStop Color="#FFF2F2F2" Offset="0" />
- <GradientStop Color="#FFDBDBDB" Offset="1" />
- <GradientStop Color="#FFD8D5D5" Offset="0.331" />
- </LinearGradientBrush>
- </Grid.Background>
- </Grid>
- <Button Content="Button" HorizontalAlignment="Right" Margin="0,8,43,28" Template="{DynamicResource SaveButtonControlTemplate}" Click="button1_Click" ToolTip="Export graph ..." />
- <Button Content="Button" HorizontalAlignment="Right" Margin="0,8,72,28" Template="{DynamicResource CompareButtonControlTemplate}" ToolTip="Select two commits to compare ..." Name="btnCompare" Click="btnCompare_Click" />
- <Button Content="0" HorizontalAlignment="Right" Margin="0,8,100,0" Name="btnCommitCount" VerticalAlignment="Top" Template="{DynamicResource CommitCountControlTemplate}" RenderTransformOrigin="-1.125,0.438" Click="btnCommitCount_Click" ToolTip="Click to clear selection" />
+ <Button Content="Button" HorizontalAlignment="Right" Margin="0,8,43,28" Template="{DynamicResource SaveButtonControlTemplate}" Click="button1_Click" ToolTip="Export graph ..." />
+ <Button Content="Button" HorizontalAlignment="Right" Margin="0,8,72,28" Template="{DynamicResource CompareButtonControlTemplate}" ToolTip="Select two commits to compare ..." Name="btnCompare" Click="btnCompare_Click" />
+ <Button Content="0" HorizontalAlignment="Right" Margin="0,8,100,0" Name="btnCommitCount" VerticalAlignment="Top" Template="{DynamicResource CommitCountControlTemplate}" RenderTransformOrigin="-1.125,0.438" Click="btnCommitCount_Click" ToolTip="Click to clear selection" />
+ </Grid>
+ <my:HistoryGraph Grid.Row="1" x:Name="HistoryGraph" />
</Grid>
<my:CommitDetails x:Name="details" Visibility="Collapsed" Background="White">
View
79 HistoryView.xaml.cs
@@ -27,11 +27,6 @@ public HistoryView(HistoryToolWindow toolWindow)
this.selectedCommits = new ObservableCollection<string>();
}
- public void InsertNewEditor(object editor)
- {
- //diffEditorHost.Content = editor;
- }
-
DateTime lastTimeRefresh = DateTime.Now.AddDays(-1);
internal void Refresh(GitFileStatusTracker tracker)
@@ -69,11 +64,6 @@ internal void Refresh(GitFileStatusTracker tracker)
}
}
- private void OpenFile(string fileName)
- {
- this.toolWindow.SetDisplayedFile(fileName);
- }
-
private void button1_Click(object sender, RoutedEventArgs e)
{
var dlg = new Microsoft.Win32.SaveFileDialog();
@@ -112,46 +102,73 @@ private void ShowCommitDetails(string id)
var animation = new DoubleAnimation(0, new Duration(animationDuration));
animation.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseOut };
this.details.RenderTransform.BeginAnimation(TranslateTransform.XProperty, animation);
-
this.details.Show(this.tracker, id);
}
}
private void CloseCommitDetails_Executed(object sender, ExecutedRoutedEventArgs e)
{
- var animationDuration = TimeSpan.FromSeconds(.2);
- var animation = new DoubleAnimation(this.ActualWidth+100, new Duration(animationDuration));
- animation.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseIn };
- animation.Completed += (o, _) => this.details.Visibility = Visibility.Hidden;
- this.details.RenderTransform.BeginAnimation(TranslateTransform.XProperty, animation);
+ try
+ {
+ var animationDuration = TimeSpan.FromSeconds(.2);
+ var animation = new DoubleAnimation(this.ActualWidth + 200, new Duration(animationDuration));
+ animation.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseIn };
+ animation.Completed += (o, _) => this.details.Visibility = Visibility.Collapsed;
+ this.details.RenderTransform.BeginAnimation(TranslateTransform.XProperty, animation);
+ }
+ catch (Exception ex)
+ {
+ Log.WriteLine("History Tool Window - CloseCommitDetails_Executed: {0}", ex.ToString());
+ }
}
private void OpenCommitDetails_Executed(object sender, ExecutedRoutedEventArgs e)
{
- ShowCommitDetails(e.Parameter as string);
+ try
+ {
+ ShowCommitDetails(e.Parameter as string);
+ }
+ catch (Exception ex)
+ {
+ Log.WriteLine("History Tool Window - OpenCommitDetails_Executed: {0}", ex.ToString());
+ }
}
private void SelectCommit_Executed(object sender, ExecutedRoutedEventArgs e)
{
- var commit = e.Parameter as string;
- if (this.selectedCommits.Contains(commit))
- selectedCommits.Remove(commit);
- else
- this.selectedCommits.Add(commit);
+ try
+ {
+ var commit = e.Parameter as string;
+ if (this.selectedCommits.Contains(commit))
+ selectedCommits.Remove(commit);
+ else
+ this.selectedCommits.Add(commit);
- SetSelectedCommitCount();
+ SetSelectedCommitCount();
+ }
+ catch (Exception ex)
+ {
+ Log.WriteLine("History Tool Window - SelectCommit_Executed: {0}", ex.ToString());
+ }
}
private void btnCompare_Click(object sender, RoutedEventArgs e)
{
- this.details.RenderTransform.SetValue(TranslateTransform.XProperty, this.ActualWidth);
- this.details.Visibility = Visibility.Visible;
- var animationDuration = TimeSpan.FromSeconds(.5);
- var animation = new DoubleAnimation(0, new Duration(animationDuration));
- animation.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseOut };
- this.details.RenderTransform.BeginAnimation(TranslateTransform.XProperty, animation);
-
- this.details.Show(this.tracker, this.selectedCommits[0], this.selectedCommits[1]);
+ try
+ {
+ this.details.RenderTransform.SetValue(TranslateTransform.XProperty, this.ActualWidth);
+ this.details.Visibility = Visibility.Visible;
+ var animationDuration = TimeSpan.FromSeconds(.5);
+ var animation = new DoubleAnimation(0, new Duration(animationDuration));
+ animation.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseOut };
+ this.details.RenderTransform.BeginAnimation(TranslateTransform.XProperty, animation);
+
+ this.details.Show(this.tracker, this.selectedCommits[0], this.selectedCommits[1]);
+ }
+ catch (Exception ex)
+ {
+ Log.WriteLine("History Tool Window - btnCompare_Click: {0}", ex.ToString());
+ }
}
private void SetSelectedCommitCount()
View
325 UI/HistoryGraph.xaml.cs
@@ -12,6 +12,7 @@
using System.Windows.Xps;
using System.Windows.Xps.Packaging;
using GitScc.DataServices;
+using System.Text;
namespace GitScc.UI
{
@@ -59,6 +60,7 @@ private void canvasContainer_MouseMove(object sender, MouseEventArgs e)
this.canvasContainer.SetValue(Canvas.TopProperty, newPoint.Y);
}
}
+
private void AdjustCanvasSize(double scale)
{
this.canvasContainer.Width = (PADDING * 2 + maxX * GRID_WIDTH);
@@ -69,6 +71,8 @@ private void AdjustCanvasSize(double scale)
this.canvasContainer.SetValue(Canvas.LeftProperty, 0.0);
this.canvasContainer.SetValue(Canvas.TopProperty, 0.0);
+
+ this.scrollRoot.ScrollToRightEnd();
}
private void scrollRoot_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
@@ -102,6 +106,7 @@ private void scrollRoot_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
const int GRID_HEIGHT = 180;
const int GRID_WIDTH = 300;
int maxX, maxY;
+ string lastHash = null;
private GitFileStatusTracker tracker;
private bool showSimplifiedGraph;
@@ -109,209 +114,217 @@ private void scrollRoot_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
internal void Show(GitFileStatusTracker tracker)
{
this.tracker = tracker;
- maxX = maxY = 0;
-
+
loading.Visibility = Visibility.Visible;
Action act = () =>
{
try
{
- canvasContainer.Children.Clear();
-
IList<GraphNode> commits = null;
+ string hash = null;
+
if (tracker != null && tracker.HasGitRepository)
{
this.tracker.RepositoryGraph.IsSimplified = showSimplifiedGraph;
commits = tracker.RepositoryGraph.Nodes;
+ hash = GetHashCode(commits);
}
- if (commits != null && commits.Count > 0)
+ bool changed = lastHash == null ? hash != null : !lastHash.Equals(hash);
+
+ if (changed)
{
- maxX = commits.Count();
- maxY = commits.Max(c => c.X);
+ lastHash = hash;
- for (int i = commits.Count() - 1; i >= 0; i--)
- {
- var commit = commits[i];
+ canvasContainer.Children.Clear();
+ maxX = maxY = 0;
- #region Add commit box
+ if (changed && commits != null && commits.Count > 0)
+ {
+ maxX = commits.Count();
+ maxY = commits.Max(c => c.X);
- var box = new CommitBox();
- box.DataContext = new
+ for (int i = commits.Count() - 1; i >= 0; i--)
{
- Id = commit.Id,
- ShortId = commit.Id.Substring(0, 5),
- Comments = commit.Message,
- Author = commit.CommitterName,
- Date = commit.CommitDateRelative,
- };
-
- double left = GetScreenX(maxX - commit.Y);
- double top = GetScreenY(commit.X);
+ var commit = commits[i];
- Canvas.SetLeft(box, left);
- Canvas.SetTop(box, top);
- Canvas.SetZIndex(box, 10);
+ #region Add commit box
- this.canvasContainer.Children.Add(box);
-
- #endregion
-
- #region Add Branches
-
- var m = 0;
- foreach (var name in commit.Refs.Where(r => r.Type == RefTypes.Branch || r.Type == RefTypes.HEAD))
- {
- var control = new CommitHead
+ var box = new CommitBox();
+ box.DataContext = new
{
- DataContext = new { Text = name },
+ Id = commit.Id,
+ ShortId = commit.Id.Substring(0, 5),
+ Comments = commit.Message,
+ Author = commit.CommitterName,
+ Date = commit.CommitDateRelative,
};
- Canvas.SetLeft(control, left + CommitBox.WIDTH + 4);
- Canvas.SetTop(control, top + m++ * 30);
+ double left = GetScreenX(maxX - commit.Y);
+ double top = GetScreenY(commit.X);
- this.canvasContainer.Children.Add(control);
- }
- #endregion
+ Canvas.SetLeft(box, left);
+ Canvas.SetTop(box, top);
+ Canvas.SetZIndex(box, 10);
- #region Add Tags
- m = 0;
- foreach (var name in commit.Refs.Where(r => r.Type == RefTypes.Tag))
- {
- var control = new CommitTag
- {
- DataContext = new { Text = name },
- };
-
- Canvas.SetLeft(control, left + m++ * 100); // TODO: get width of the control
- Canvas.SetTop(control, top - 24);
+ this.canvasContainer.Children.Add(box);
- this.canvasContainer.Children.Add(control);
- }
+ #endregion
- #endregion
+ #region Add Branches
- #region Add Remote Branches
- m = 0;
- foreach (var name in commit.Refs.Where(r => r.Type == RefTypes.RemoteBranch))
- {
- var control = new CommitRemote
+ var m = 0;
+ foreach (var name in commit.Refs.Where(r => r.Type == RefTypes.Branch || r.Type == RefTypes.HEAD))
{
- DataContext = new { Text = name },
- };
-
- Canvas.SetLeft(control, left + m++ * 100); // TODO: get width of the control
- Canvas.SetTop(control, top + CommitBox.HEIGHT + 4);
+ var control = new CommitHead
+ {
+ DataContext = new { Text = name },
+ };
- this.canvasContainer.Children.Add(control);
- }
- #endregion
- }
+ Canvas.SetLeft(control, left + CommitBox.WIDTH + 4);
+ Canvas.SetTop(control, top + m++ * 30);
- #region Add commit links
+ this.canvasContainer.Children.Add(control);
+ }
+ #endregion
- var links = tracker.RepositoryGraph.Links;
-
- foreach (var link in links)
- {
- // current node
- double x1 = link.Y1;
- double y1 = link.X1;
+ #region Add Tags
+ m = 0;
+ foreach (var name in commit.Refs.Where(r => r.Type == RefTypes.Tag))
+ {
+ var control = new CommitTag
+ {
+ DataContext = new { Text = name },
+ };
- // parent node
- double x2 = link.Y2;
- double y2 = link.X2;
+ Canvas.SetLeft(control, left + m++ * 100); // TODO: get width of the control
+ Canvas.SetTop(control, top - 24);
- bool flip = links.Any(lnk => lnk.X1 == x2 && lnk.Y2 == y2 && lnk.X1 == lnk.X2);
+ this.canvasContainer.Children.Add(control);
+ }
- x1 = GetScreenX(maxX - x1);
- y1 = GetScreenY(y1) + CommitBox.HEIGHT / 2;
- x2 = GetScreenX(maxX - x2) + CommitBox.WIDTH;
- y2 = GetScreenY(y2) + CommitBox.HEIGHT / 2;
+ #endregion
- if (y1 == y2)
- {
- var line = new Line
- {
- Stroke = new SolidColorBrush(Color.FromArgb(255, 153, 182, 209)),
- StrokeThickness = 4,
- };
- line.X1 = x1;
- line.Y1 = y1;
- line.X2 = x2;
- line.Y2 = y2;
- this.canvasContainer.Children.Add(line);
- }
- else if (y1 > y2 && !flip)
- {
- var x3 = x2 - CommitBox.WIDTH / 2;
- var path = new Path
+ #region Add Remote Branches
+ m = 0;
+ foreach (var name in commit.Refs.Where(r => r.Type == RefTypes.RemoteBranch))
{
- Stroke = new SolidColorBrush(Color.FromArgb(255, 153, 182, 209)),
- StrokeThickness = 4,
- };
+ var control = new CommitRemote
+ {
+ DataContext = new { Text = name },
+ };
- PathSegmentCollection pscollection = new PathSegmentCollection();
+ Canvas.SetLeft(control, left + m++ * 100); // TODO: get width of the control
+ Canvas.SetTop(control, top + CommitBox.HEIGHT + 4);
- pscollection.Add(new LineSegment(new Point(x2, y1), true));
+ this.canvasContainer.Children.Add(control);
+ }
+ #endregion
+ }
- BezierSegment curve = new BezierSegment(
- new Point(x2, y1), new Point(x3, y1), new Point(x3, y2), true);
- pscollection.Add(curve);
+ #region Add commit links
- PathFigure pf = new PathFigure
- {
- StartPoint = new Point(x1, y1),
- Segments = pscollection,
- };
- PathFigureCollection pfcollection = new PathFigureCollection();
- pfcollection.Add(pf);
- PathGeometry pathGeometry = new PathGeometry();
- pathGeometry.Figures = pfcollection;
- path.Data = pathGeometry;
+ var links = tracker.RepositoryGraph.Links;
- this.canvasContainer.Children.Add(path);
- }
- else
+ foreach (var link in links)
{
- var x3 = x1 + CommitBox.WIDTH / 2;
- var path = new Path
- {
- Stroke = new SolidColorBrush(Color.FromArgb(255, 153, 182, 209)),
- StrokeThickness = 4,
- };
+ // current node
+ double x1 = link.Y1;
+ double y1 = link.X1;
- PathSegmentCollection pscollection = new PathSegmentCollection();
+ // parent node
+ double x2 = link.Y2;
+ double y2 = link.X2;
- BezierSegment curve = new BezierSegment(
- new Point(x3, y1), new Point(x3, y2), new Point(x1, y2), true);
- pscollection.Add(curve);
+ bool flip = links.Any(lnk => lnk.X1 == x2 && lnk.Y2 == y2 && lnk.X1 == lnk.X2);
- pscollection.Add(new LineSegment(new Point(x2, y2), true));
+ x1 = GetScreenX(maxX - x1);
+ y1 = GetScreenY(y1) + CommitBox.HEIGHT / 2;
+ x2 = GetScreenX(maxX - x2) + CommitBox.WIDTH;
+ y2 = GetScreenY(y2) + CommitBox.HEIGHT / 2;
- PathFigure pf = new PathFigure
+ if (y1 == y2)
{
- StartPoint = new Point(x3, y1),
- Segments = pscollection,
- };
- PathFigureCollection pfcollection = new PathFigureCollection();
- pfcollection.Add(pf);
- PathGeometry pathGeometry = new PathGeometry();
- pathGeometry.Figures = pfcollection;
- path.Data = pathGeometry;
-
- this.canvasContainer.Children.Add(path);
+ var line = new Line
+ {
+ Stroke = new SolidColorBrush(Color.FromArgb(255, 153, 182, 209)),
+ StrokeThickness = 4,
+ };
+ line.X1 = x1;
+ line.Y1 = y1;
+ line.X2 = x2;
+ line.Y2 = y2;
+ this.canvasContainer.Children.Add(line);
+ }
+ else if (y1 > y2 && !flip)
+ {
+ var x3 = x2 - CommitBox.WIDTH / 2;
+ var path = new Path
+ {
+ Stroke = new SolidColorBrush(Color.FromArgb(255, 153, 182, 209)),
+ StrokeThickness = 4,
+ };
+
+ PathSegmentCollection pscollection = new PathSegmentCollection();
+
+ pscollection.Add(new LineSegment(new Point(x2, y1), true));
+
+ BezierSegment curve = new BezierSegment(
+ new Point(x2, y1), new Point(x3, y1), new Point(x3, y2), true);
+ pscollection.Add(curve);
+
+ PathFigure pf = new PathFigure
+ {
+ StartPoint = new Point(x1, y1),
+ Segments = pscollection,
+ };
+ PathFigureCollection pfcollection = new PathFigureCollection();
+ pfcollection.Add(pf);
+ PathGeometry pathGeometry = new PathGeometry();
+ pathGeometry.Figures = pfcollection;
+ path.Data = pathGeometry;
+
+ this.canvasContainer.Children.Add(path);
+ }
+ else
+ {
+ var x3 = x1 + CommitBox.WIDTH / 2;
+ var path = new Path
+ {
+ Stroke = new SolidColorBrush(Color.FromArgb(255, 153, 182, 209)),
+ StrokeThickness = 4,
+ };
+
+ PathSegmentCollection pscollection = new PathSegmentCollection();
+
+ BezierSegment curve = new BezierSegment(
+ new Point(x3, y1), new Point(x3, y2), new Point(x1, y2), true);
+ pscollection.Add(curve);
+
+ pscollection.Add(new LineSegment(new Point(x2, y2), true));
+
+ PathFigure pf = new PathFigure
+ {
+ StartPoint = new Point(x3, y1),
+ Segments = pscollection,
+ };
+ PathFigureCollection pfcollection = new PathFigureCollection();
+ pfcollection.Add(pf);
+ PathGeometry pathGeometry = new PathGeometry();
+ pathGeometry.Figures = pfcollection;
+ path.Data = pathGeometry;
+
+ this.canvasContainer.Children.Add(path);
+ }
}
+
+ #endregion
}
- #endregion
+ AdjustCanvasSize(this.Scaler.ScaleX);
}
- AdjustCanvasSize(this.Scaler.ScaleX);
-
- this.scrollRoot.ScrollToRightEnd();
-
}
catch (Exception ex)
{
@@ -323,6 +336,18 @@ internal void Show(GitFileStatusTracker tracker)
this.Dispatcher.BeginInvoke(act, DispatcherPriority.ApplicationIdle);
}
+ private string GetHashCode(IList<GraphNode> commits)
+ {
+ if (commits == null) return null;
+ var sb = new StringBuilder();
+ foreach (var c in commits)
+ {
+ sb.Append(c.Id.Substring(5));
+ foreach (var r in c.Refs) sb.Append(r.Id.Substring(5));
+ }
+ return sb.ToString();
+ }
+
private double GetScreenX(double x)
{
return PADDING + (x-1) * GRID_WIDTH;
Please sign in to comment.
Something went wrong with that request. Please try again.