Values of Locations

I am wanting to understand the value system used to locate ports around a node. I have been using GoObject.MiddleRight, etc. I know there are numerical values, and these seem to follow the pattern of two “circles” around the node, the inner circle being the corners (tl - 2, tr - 4, br - 8, bl - 16), where each value is 2 times the previous. And the outer circle being the centers (tc - 32, mr - 64, bc - 128, ml - 256).

So some questions:

  1. What is the meaning of these values/locations? Why was this pattern chosen?

  2. Can you use arbitrary values to position a port exactly where you want it, e.g., 38 to be just right of 32? What is the arbitrary value layout?

  1. They are powers of 2 so they can be used as bitmasks. (see GoGrid.UnboundedSpots, for example)
2. no. (I suppose you could override GetSpotLocation, GetSpotOpposite, etc. but we don't have any samples of that.)

In other words, you can define your own spots to mean whatever you want them to mean, by overriding those GoObject methods relating to spots. That’s why the spots are integers instead of being an enumerated type.