Nodes on top


#1

How can I programaticly ensure that nodes are always displayed on top of links in a diagram?


#2

Well, the easiest solution is to make sure all of the links are in layers that are behind all layers that contain nodes.
Since by convention you should be adding links to the GoDocument’s LinksLayer, this is normally just a matter of making sure the LinksLayer is behind the default layer:
doc.LinksLayer = doc.Layers.CreateNewLayerBefore(doc.Layers.Default)
The User Guide (about page 35) talks about this and related issues in more detail.