Grid snap location

I have set the grid in goView to GridSnapDrag = Jump and GridStyle=Line
And I have added a node:
GoRectangle r = new GoRectangle();
r.Selectable = true;
r.Brush = Brushes.MediumSpringGreen;
r.Size = new SizeF(40, 40);
doc.Add®;
When I move the node it snap to the top left corner, but I would like it to snap to the center. But I Just cant figure out how to do this.
I have tried the demo1 app and all objects also snap to the top,left. Except the Graph Nodes and the nodes with a star icon like MultiPortNode, they snap to the center the way I would like, but I can not locate the code that does this.
I home anyone can help me here.

The easiest solution is to override the Location property on your objects to be where you want, such as at the Center:
public override PointF Location {
get { return this.Center; }
set { this.Center = value; }
}
If you look at the definition of FlowCharter.GraphNode, you’ll see it has the same override. GoNode has a similar override predefined–but using the Center of its SelectionObject, not the Center of the whole GoNode, which is why you see that behavior with many of the example node classes.
More sophisticated solutions are possible by overriding methods in GoGrid, but you probably don’t care about that now…