Skip to content

Commit

Permalink
+ Fixed METRO version build
Browse files Browse the repository at this point in the history
  • Loading branch information
panthernet committed Jan 13, 2016
1 parent 291c541 commit 4686030
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 45 deletions.
3 changes: 3 additions & 0 deletions GraphX.Controls/Controls/GraphArea.cs
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,9 @@ await DispatcherHelper.CheckBeginInvokeOnUi(() =>
if (!localLogicCore.GenerateAlgorithmStorage(vertexSizes, vertexPositions))
return;

//clear routing info
localLogicCore.Graph.Edges.ForEach(a => a.RoutingPoints = null);

var resultCoords = localLogicCore.Compute(cancellationToken);

#if WPF
Expand Down
6 changes: 4 additions & 2 deletions GraphX.Controls/Models/DefaultLabelFactory.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

using System.Windows;
using System.Windows;
#if METRO
using Windows.UI.Xaml;
#endif

namespace GraphX.Controls.Models
{
Expand Down
3 changes: 3 additions & 0 deletions GraphX.Controls/Models/Interfaces/ILabelFactory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System.Windows;
#if METRO
using Windows.UI.Xaml;
#endif

namespace GraphX.Controls.Models
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,58 +83,18 @@ private void DoOrthogonalEdgeRouting(double offsetY)
new Point(0, 0)
};
}

if ((Parameters.Direction == LayoutDirection.LeftToRight || Parameters.Direction == LayoutDirection.RightToLeft) && sourcePosition.Y != targetPosition.Y)
else if ((Parameters.Direction == LayoutDirection.LeftToRight || Parameters.Direction == LayoutDirection.RightToLeft) && sourcePosition.Y != targetPosition.Y)
{
_edgeRoutingPoints[edge] =
new[]
{
new Point(0, 0),
new Point(sourcePosition.X + sourceSize.Width /2, targetPosition.Y + targetSize.Height / 2),
new Point(sourcePosition.X + sourceSize.Width/2, targetPosition.Y + targetSize.Height/2),
new Point(0, 0)
};
}


}
/* foreach (var edge in VisitedGraph.Edges)
{
Point[] orthoRoutePoints = new Point[2];
var sourceVertex = _vertexMap[edge.Source];
var targetVertex = _vertexMap[edge.Target];
bool notSwitched = (sourceVertex.LayerIndex < targetVertex.LayerIndex);
int sourceIndex = notSwitched ? 0 : 1;
int targetIndex = notSwitched ? 1 : 0;
orthoRoutePoints[sourceIndex] = new Point()
{
X = sourceVertex.HorizontalPosition,
Y = _layerPositions[sourceVertex.LayerIndex] + _layerHeights[sourceVertex.LayerIndex] + Parameters.LayerDistance / 2.0
};
orthoRoutePoints[targetIndex] = new Point()
{
X = targetVertex.HorizontalPosition,
Y = _layerPositions[targetVertex.LayerIndex] - Parameters.LayerDistance / 2.0
};
_edgeRoutingPoints[edge] = orthoRoutePoints;
}
foreach (var kvp in _dummyVerticesOfEdges)
{
Point[] orthoRoutePoints = _edgeRoutingPoints[kvp.Key];
var routePoints = new Point[kvp.Value.Count + 4];
routePoints[0] = orthoRoutePoints[0];
routePoints[kvp.Value.Count + 3] = orthoRoutePoints[1];
for (int i = 0; i < kvp.Value.Count; i++)
{
var vertex = kvp.Value[i];
routePoints[i+2] = new Point(vertex.HorizontalPosition, vertex.VerticalPosition);
}
routePoints[1] = new Point(routePoints[2].X, routePoints[0].Y);
routePoints[kvp.Value.Count + 2] = new Point(routePoints[kvp.Value.Count + 1].X, routePoints[kvp.Value.Count + 3].Y);
_edgeRoutingPoints[kvp.Key] = routePoints;
else _edgeRoutingPoints[edge] = null;
}
*/
}

private void DoTraditionalEdgeRouting()
Expand Down

0 comments on commit 4686030

Please sign in to comment.