Redraw Diagram Links

Hi,

I am having an issue with GoXam. I created a Diagram with nodes and links. The redraw goes fine at the point where im adding it. When i scroll down into the Diagram the links are not right. The links dont connect to their nodes, there more to the right or left of the node.

If i move the node around then the link redraws and it looks fine.

Any idea ?

Bye,
Klaas Speijer

From your description it seems that you had a diagram that looked good and then you added some nodes and links – I assume that’s why you say “redraw”.

How did you add those nodes and links? Did you make sure to add everything inside a transaction?

<p style=“margin: 0cm 1.5pt 0.75pt;” =“Msonormal”>Hi Walter,


<p style=“margin: 0.75pt 1.5pt;” =“Msonormal”>Thanks for your fast
response. Yes that is what i mean… It only looks bad when i add alot and then
scroll down on the diagram. The the lines dont connect


<p style=“margin: 0.75pt 1.5pt 0pt;” =“Msonormal”>I override this function: DropOnto. here i check some
stuff and then i use AddLink(fromData,FromPort,ToData,ToPort).

And that is all i do, what is a transaction ? is it necessary?

I added a picture with the bad links.

Cya,
Klaas.

By transaction I mean calling StartTransaction, modifying the model or its data, and then calling CommitTransaction. You can call those two methods on either the model itself or (for convenience) on the diagram.

Is the only place that you are modifying the model in your override of DraggingTool.DropOnto? That’s called within a transaction, so you don’t need to do anything about it.

Is your Diagram.Layout a LayeredDigraphLayout? You might want to set its SetsPortSpots=“False” and then explicitly set the go:Node.FromSpot and go:Node.ToSpot on each of the ports of your node. For example, the Flowgrammer sample does this.

Is your Link Route.Routing=“AvoidsNodes”? If so, try setting it to “Orthogonal”. Do you get the same results?