Links not straight

Hi,
I use inherited GoLabeledLinks between inherited GoTextNodes.
I override the ComputeMove on my GoTextNodes so that the center of the nodes always will be snapped to a 5x5-grid. This way I thought my links between the nodes would always be straight as long as the connected nodes center points were on the same horizontal line.
However, the links often have an anoying breakpoint in the middle (indicating that the ports are not really on the same horizontal line I guess).
How can I avoid this?
Regards / Mattias

I tried a subclass of GoTextNode with the following override, and the Orthogonal links connecting the sides of several instances of this class, each with different height labels (due to different numbers of lines of text). I also set GoView.GridCellSize to 5x5 and GoView.GridSnapDrag to Jump. public override PointF Location { get { return this.Center; } set { this.Center = value; } } Everything looked fine and straight to me. Perhaps you didn't implement your override of ComputeMove correctly?

Hi again,
when I debug I can see that the Center-property of both nodes are multiples of 5 so I think ComputeMove is OK.
The problem arises only when the height of the connected nodes differ. Did you try different heights?
Regards / Mattias

Yes, I did try different height nodes.
You might as well check that the Centers of the ports are also have the same Y values modulo 5.
What behavior do you get if you try overriding Location instead of ComputeMove?

Hi again, no solution yet :-(
The problem seems to be that when I set the Height and Width to integer values the port position is not set to the center of the node side (not even when i tried to set the port location from the node.LayoutChildren).
I did a test:
I draw a red GoStroke-line on the node (which has integer size-values) with the same position as the node (+20 on X) and length same as the Height of the node (i.e. integer). When I zoom these object in I can see that the line is actually longer then the height of the node (using the debugger I can still see that node.Height equals line.Height)??? When I select the node in the view, the surrounding rectangle (indicating selection) touches the red line bottom but not the bottom and the right side of the node.
Conclusion: The visible height (let’s call it v-height) of the node does not reflect the property Height of the same node. The port position seems to be automatically set to the center of v-height (i.e. not the Height property).
I’m now giving up trying to set integer-sizes so you do not have to spend time answering this if you do not want, but if there is an explanation to this behaviour I’m all ears.
Regards / Mattias

Did you set GoTextNode.AutoResizes to false? You didn’t say you were trying to set the size of the node except indirectly by changing the text.
If you left it true, the default, then the Height of the GoTextNode.Background shape will be the same as the Height of the Label plus the margins. Since the Height of the GoText Label is not likely to be integral, the height of the Background, and thus the height of the whole node, is not likely to be integral.
If you want to set the size of the node, you ought to set GoTextNode.AutoResizes to false and then set the GoTextNode.Background.Size.
But what I said earlier I still stand by: when I overrode the Location property and set GoView.GridSnapDrag, all Orthogonal links connecting the nodes were perfectly straight when the nodes were in the same grid cell row, no matter how many lines of text were in the labels.