Skip to content

Commit

Permalink
Add connection marker
Browse files Browse the repository at this point in the history
  • Loading branch information
rdymade committed Dec 6, 2023
1 parent 3adda93 commit 89922b5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/WHMapper/Models/Custom/Node/EveSystemLinkModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ private void SetLabel(SystemLinkSize size)
public EveSystemLinkModel(WHSystemLink whLink,EveSystemNodeModel sourcePort, EveSystemNodeModel targetPort)
: base (sourcePort, targetPort)
{
var linkMarker = new LinkMarker("M 0 4 C 1.5 5.5 3.5 6 6 6 L 6 -6 C 3.5 -6 1.5 -5.5 0 -4 L 0 4", 6);
SourceMarker = linkMarker;
TargetMarker = linkMarker;
_whLink = whLink;
SetLabel(_whLink.Size);

Expand Down
12 changes: 12 additions & 0 deletions src/WHMapper/Pages/Mapper/CustomNode/EveSystemLink.razor
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
@using Blazor.Diagrams.Components.Renderers
@using System.Globalization

@{
var result = Link.PathGeneratorResult;
if (result == null)
return;

var d = result.FullPath.ToString();
var sourcePos = result.SourceMarkerPosition;
var sourceAng = result.SourceMarkerAngle;
var targetPos = result.TargetMarkerPosition;
var targetAng = result.TargetMarkerAngle;
}


Expand All @@ -27,6 +32,13 @@

<path d="@d" fill="none" stroke-width="4" stroke="@WHColorHelper?.GetLinkStatusColor(Link.MassStatus)" />

<g transform="translate(@sourcePos.X.ToString(CultureInfo.InvariantCulture), @sourcePos.Y.ToString(CultureInfo.InvariantCulture)) rotate(@sourceAng)">
<path d="@Link.SourceMarker.Path" fill="grey"/>
</g>

<g transform="translate(@targetPos.X.ToString(CultureInfo.InvariantCulture), @targetPos.Y.ToString(CultureInfo.InvariantCulture)) rotate(@targetAng)">
<path d="@Link.TargetMarker.Path" fill="grey"/>
</g>

@foreach (var label in Link.Labels)
{
Expand Down

0 comments on commit 89922b5

Please sign in to comment.