Skip to content

Commit

Permalink
+ Fix for edge pointers visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
panthernet committed Mar 12, 2018
1 parent 37a47c6 commit 66b546e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Examples/ShowcaseApp.WPF/Pages/GeneralGraph.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public GeneralGraph()

ggLogic.DefaultEdgeRoutingAlgorithm = EdgeRoutingAlgorithmTypeEnum.SimpleER;
ggLogic.EdgeCurvingEnabled = true;
gg_Area.ShowAllEdgesArrows(true);
gg_Area.ShowAllEdgesArrows();

ZoomControl.SetViewFinderVisibility(gg_zoomctrl, Visibility.Visible);

Expand Down
4 changes: 2 additions & 2 deletions Examples/ShowcaseApp.WPF/Templates/GeneralTemplate.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@
Fill="Black"
Stretch="Uniform" />
</controls:DefaultEdgePointer>
<controls:DefaultEdgePointer x:Name="PART_EdgePointerForSource" NeedRotation="true">
<!--<controls:DefaultEdgePointer x:Name="PART_EdgePointerForSource" NeedRotation="true">
<Path Width="15"
Height="15"
Data="M2,0.5 L1,1 1,0"
Fill="Red"
Stretch="Uniform" />
</controls:DefaultEdgePointer>
</controls:DefaultEdgePointer>-->
<Path x:Name="PART_SelfLoopedEdge"
Width="10"
Height="10"
Expand Down
2 changes: 1 addition & 1 deletion Examples/UAP.SimpleGraph/UAP.SimpleGraph.nuget.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\panthernet\.nuget\packages\;C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">ProjectJson</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">4.5.0</NuGetToolVersion>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">4.6.0</NuGetToolVersion>
</PropertyGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
Expand Down
26 changes: 24 additions & 2 deletions GraphX.Controls/Controls/EdgeControlBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,11 @@ private static void showarrows_changed(object sender, DependencyPropertyChangedE
if (ctrl == null)
return;

if (ctrl.EdgePointerForSource != null && !ctrl.IsSelfLooped)
/*if (ctrl.EdgePointerForSource != null && !ctrl.IsSelfLooped)
if (ctrl.ShowArrows) ctrl.EdgePointerForSource.Show(); else ctrl.EdgePointerForSource.Hide();
if (ctrl.EdgePointerForTarget != null && !ctrl.IsSelfLooped)
if (ctrl.ShowArrows) ctrl.EdgePointerForTarget.Show(); else ctrl.EdgePointerForTarget.Hide();
if (ctrl.ShowArrows) ctrl.EdgePointerForTarget.Show(); else ctrl.EdgePointerForTarget.Hide();*/
//calcs will be later
ctrl.UpdateEdge(false);
}

Expand Down Expand Up @@ -563,6 +564,16 @@ internal virtual void UpdateEdgeRendering(bool updateLabel = true)
{
if (!IsTemplateLoaded)
ApplyTemplate();
if (ShowArrows)
{
EdgePointerForSource?.Show();
EdgePointerForTarget?.Show();
}
else
{
EdgePointerForSource?.Hide();
EdgePointerForTarget?.Hide();
}
PrepareEdgePath(true, null, updateLabel);
if (LinePathObject == null) return;
LinePathObject.Data = Linegeometry;
Expand Down Expand Up @@ -866,6 +877,17 @@ public virtual void PrepareEdgePathFromMousePointer(bool useCurrentCoords = fals
if (_updateLabelPosition)
EdgeLabelControls.Where(l => l.ShowLabel).ForEach(l => l.UpdatePosition());

if (ShowArrows)
{
EdgePointerForSource?.Show();
EdgePointerForTarget?.Show();
}
else
{
EdgePointerForSource?.Hide();
EdgePointerForTarget?.Hide();
}

if (LinePathObject == null) return;
LinePathObject.Data = Linegeometry;
LinePathObject.StrokeDashArray = StrokeDashArray;
Expand Down

0 comments on commit 66b546e

Please sign in to comment.