We are using GoToolLinkingNew-PickNearestPort()
to highlight valid connection ports. This is
working fine for all the scenarios except one.
If the node containing valid target port
is part of a collapsed subgraph, it is still
getting highlighed. Could you suggest on
how to prevent highlighting of ports of nodes
which are part of collapsed subgraph.
Demo1 highlights the “Snap to” port in red, and avoids collapsed ports.
Which SubGraph class are you using? Have you modified Collpase() at all?
GoToolLinking.PickNearestPort depends on GoToolLinking.IsValidLink. Have you overridden that method?
GoToolLinking.IsValidLink depends on GoPort.IsValidLink. Have you overridden that method?
GoPort.IsValidLink depends on several properties and methods, including GoPort.CanLinkFrom and GoPort.CanLinkTo, which include checks for visibility. Have you overridden those methods?
Call the base function first, if it returns true, then run your logic that may conclude false.