Adding Links with route manually calculated

Hi Walter,

To be able to display a route with only one node in the diagram, I’m define manually points for the route, after calling method 'public Link AddLinkForData(object linkdata, IDiagramModel model);

Route contains only 2 points, placed in the following order, first From coordinate, second To Coordinate.

As you can in the image above, I’ve got the result expected.

However when I add a new link when only the second point of the route (To) is in the viewport, then in this case the link is not visible in the viewport.
If I check at the link attributes in Visual Studio, ActualHeight and ActualWidth attributes are null.

Any idea why I have this problem?

Sincerely

JJ

What are the ActualWidth and ActualHeight of the first Link? The one that had both route points in the viewport.

Is that seemingly missing Link actually in the visual tree?

You’re doing everything in a transaction, yes?

Does the problem happen when the “from” point is in the viewport but the “to” point isn’t?

Does the link data object have the route information in it? How are you assigning the Link.Route?

What are the ActualWidth and ActualHeight of the first Link? The one that had both route points in the viewport.

It correspond to :
Actualwidth = |Point1.X - Point2.X|
ActualHeightt = |Point1.Y - Point2.Y|
with Point1 and Point2, point added to the Route

Is that seemingly missing Link actually in the visual tree?

Link is not present in visual tree as you can see in copy screen below (Right part)., when only second route point is in the viewport.

You’re doing everything in a transaction, yes?

It makes no differences if I do it within a transaction. At least I see no differences with or without transaction.

Does the problem happen when the “from” point is in the viewport but the “to” point isn’t?

No, if only the first route point is in the viewport, it works fine.
If by setting point in the route when the first point to be displayed is the to point I exchange both points (it means that I add first the to point) the link is displayed but the direction on the file is wrongly displayed.

Does the link data object have the route information in it? How are you assigning the Link.Route?
Route is calculated separately and data are copied to the route like this :

var link = AddLinkForData(item); // link is added
link.Route.AddPoint(points.Item1); // points is a Tuple<Point, Point>, item1 = from, item2 = to
link.Route.AddPoint(points.Item2);

Here an example where only second route point is in the viewport, and when only first route point is in the viewport.

Resume:
Route is always set like link.Route.Points.{‘From’, ‘to’}.
Link is not displayed when first point specified to the route is not present in the viewport.

Ah, after several attempts, I was able to reproduce the problem. Thanks for describing it. Now we just need to track down the bug and fix it.

As a work-around for now, you can execute this statement when initializing your Diagram:

myDiagram.InitialLayoutCompleted += (s, e) => { myDiagram.Panel.Unsupported(23, false); };

This disables the built-in virtualization optimization.

Try one of the DLLs that is at: [EDIT: deleted due to release of v3.0.4]

Hi Walter,

with workaround or dll bug is fixed.

Do you have an idea when new dll will be released?

You can use that DLL in production, if you like.

I think an actual release should wait until you and we have more confidence that there aren’t any other related or similar bugs.