Child nodes resize SubGraph


A feature of the GoSubGraph is that if a child is moved towards a sub-graph boundry and ‘beyond’ it, the boundry is simply resized to make the sub-graph still fully contain that child.
But in some cases, i wish to restraint that boundry from resizing, and in order to keep that child visually still within the borders of the sub-graph, i need to restraint the movement of the child as well.
how can i achieve that?


I haven’t tried this, but you can override your object’s GoObject.ComputeMove method to look to see if the new location would cause any of its boundaries to go beyond the bounds (minus margins) of the parent subgraph (if any). If so, you can return the location you would prefer.
The LimitedNode example class in the Demo1 sample does something like this, except it arbitrarily limits the location between two values, regardless of the size of the node.