void ComputeCanvasBoundaries() { if (!Commits.Any()) { CanvasBoundaries = new Tuple <double, double, double, double>(0, 0, 0, 0); return; } double i1, i2, i3, i4; i1 = i3 = Commits.First().Location.X; i2 = i4 = Commits.First().Location.Y; foreach (GraphItemModel m in Commits.Cast <GraphItemModel>().Union(Branches)) { i1 = Math.Min(i1, m.Location.X); i2 = Math.Min(i2, m.Location.Y); i3 = Math.Max(i3, m.Location.X); i4 = Math.Max(i4, m.Location.Y); } CanvasBoundaries = new Tuple <double, double, double, double>(i1, i2, i3, i4); }