Skip to content

Commit

Permalink
Add Route property to BaseLinkModel
Browse files Browse the repository at this point in the history
  • Loading branch information
zHaytam committed Oct 22, 2023
1 parent 1e6fb86 commit 9836fa3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/Blazor.Diagrams.Core/Models/Base/BaseLinkModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ protected BaseLinkModel(string id, Anchor source, Anchor target) : base(id)
public Anchor Source { get; private set; }
public Anchor Target { get; private set; }
public Diagram? Diagram { get; internal set; }
public Point[]? Route { get; private set; }
public PathGeneratorResult? PathGeneratorResult { get; private set; }
public bool IsAttached => Source is not PositionAnchor && Target is not PositionAnchor;
public Router? Router { get; set; }
Expand Down Expand Up @@ -129,11 +130,13 @@ private void GeneratePath()
var target = Target.GetPosition(this, route);
if (source != null && target != null)
{
Route = route;
PathGeneratorResult = pathGenerator.GetResult(Diagram, this, route, source, target);
return;
}
}

Route = null;
PathGeneratorResult = null;
}

Expand Down
5 changes: 3 additions & 2 deletions src/Blazor.Diagrams/wwwroot/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ var s = {
}
},
unobserve: (element, id) => {
if (!element) return;
s.ro.unobserve(element);
if (element) {
s.ro.unobserve(element);
}
delete s.tracked[id];
delete s.canvases[id];
}
Expand Down
2 changes: 1 addition & 1 deletion src/Blazor.Diagrams/wwwroot/script.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified src/Blazor.Diagrams/wwwroot/script.min.js.gz
Binary file not shown.

0 comments on commit 9836fa3

Please sign in to comment.