Links hiding port


#1

When adding a link from a port, i cant seem to add more because the link seems to be on top of the port…same goes for my ContextMenus that stop showing up because i cant right-click on the objet covered by the link…is there a way to put the links on the last layer?


#2

From the FAQ:

I’m having trouble trying to draw a new link from a port if there is already a link connected there—usually the link gets selected instead.

Links (and in fact strokes in general) try to be relatively easy to pick by widening the region where GoObject.ContainsPoint returns true. If the user had to place the mouse pointer exactly on the pixels of narrow lines, it would be too hard to select a link. So when the user does a mouse down on a port that already has a link, it is quite possible that that point is close enough to the link that the link gets selected first instead of the port handling the mouse down event.

One solution is to make sure the links are “behind” the ports. The easiest way to do that is to have a separate document layer for links, and to have that layer be behind the default layer containing the nodes.

doc.LinksLayer = doc.Layers.CreateNewLayerBefore(doc.Layers.Default)<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />