Group elements shift during layout

I have inherited a gonode and manually added a Port, Top and bottom Labels and an centered Icon. The port itself is wider and taller then the contents with a boarder around it.

During a forced directed layout the text and icon shift around +- a Pixel relatitive to the ports boarder and even that seems to change it's brush width. As a result the movement seems choppy? If I grab the node with the mouse and move it manually all the contents move clearly and are paint correctly like a solid group.
I havent tried it with the older 2.6 version, but I I could download it if need be.
Regards,
Frank
Example Code of node creation
Public Class InstNode Inherits GoNode
Public Sub New
Me.Size = New SizeF(64, 16 + 62 + 16)
Me.Shadowed = False Me.Reshapable = False Me.Resizable = False Image = New GoImage() Port = New InstNodePort Port.Style = GoPortStyle.Rectangle Port.BrushColor = Color.White Port.Width = Me.Bounds.Width Port.Top = Me.Bounds.Top Port.Height = Me.Bounds.Height Port.Movable = False Port.Selectable = False Port.Visible = True TopLable.Text = "X" ' Hack to set Height for Font TopLable.ResizesRealtime = False TopLable.AutoRescales = False TopLable.AutoResizes = False TopLable.Left = Me.Bounds.Left + 1 TopLable.Width = Me.Bounds.Width - 1 TopLable.Top = Me.Bounds.Top TopLable.Alignment = 1 TopLable.Movable = False TopLable.Selectable = False TopLable.Bordered = False BottomLable.Text = "X" ' Hack to set Height for Font BottomLable.ResizesRealtime = False BottomLable.AutoRescales = False BottomLable.AutoResizes = False BottomLable.Left = Me.Bounds.Left + 1 BottomLable.Width = Me.Bounds.Width - 2 BottomLable.Top = Me.Bounds.Bottom - BottomLable.Size.Height - 1 BottomLable.Alignment = 1 BottomLable.Movable = False BottomLable.Selectable = False BottomLable.Bordered = False Image.Center = Me.Center Image.Movable = False Image.Selectable = False Image.Resizable = False Image.Reshapable = False Me.Add(Port) Me.Add(TopLable) Me.Add(BottomLable) Me.Add(Image)
End Sub

Is that the whole class?

Sorry no - just the new override to show how i created the go objects and added them.

I'll have to make a smalled cleaner example - Do you need to see them timer code for the forced layout too?
Thanks

ah, I “get” this a little more now. You’re saying as the animation of the forced layout happens, the parts of the nodes “wiggle” with respect to each other as the node moves?

Jake,

Wiggle! Thats whe word! Yes, How do I get rid of it?
Also
There seems to be a flicker during the paint which looks like the eval repainting in the corner. I guess that will go away with a license?
Thanks Again,
Frank

Yes, there shouldn’t be any flicker, that may be the eval marker.

if you start our Interactive Force demo, and create a node 1 and 2, then link them. Drag the "1" node, you'll notice the the "2" shifts a pixel relative to the node as it gets dragged along. If that's what you're seeing, that's just the vagaries of Windows Text drawing and pixel round-off error. It's nothing about how you've created the node.
Why is it then if I grab the node and move it with the mouse that it's clean?
Why does the Force routine draw on a different grid\Res then the mouse move?

Is this basically what your node looks like? (I copied your code, but didn’t add an icon.)

> Why is it then if I grab the node and move it with the mouse that it's clean?
My guess is that the node being dragged is being moved in units of discrete pixels (because that's the resolution of the mousemove event). But, the node on the other end of the link is being dragged in a floating point resolution....
---------
try this: Run Demo1. Delete all the objects except the GoEllipse with the label "a longer label".
Hit F4 to bring up the properties box. change the Left property to 505.5, then to 505.6. At least on my display, that moves the label without moving the ellipse.
I will try you test, but your pixel \ Floating Point theory sounds correct.
Just seems like the movement should aign itself to the pixel grid. It would make the UI so much smoother.
Can you ask the programmers if they can change this in the beta?
BTW Cool product, So far I like the object Model.
Also - Does the 3.5 beta version contain any WPF hooks
Thanks Again.

The GoLayout algorithms just work on documents – they don’t know anything about GoViews, really. If they did try to assign integral coordinate values to nodes, what would happen when the user zoomed in or out a bit?

After all, there might be more than one GoView displaying the same GoDocument whose nodes are being moved about. Each GoView can have its own DocScale and DocPosition (i.e. scale and translation), so it’s impossible to assign a position to any node and expect it to have integral coordinate screen points on all of the views.

Finally, Windows is well known for having idiosyncratic text rendering. See http://www.nwoods.com/forum/forum_posts.asp?TID=2132.

Walter - From the near 4000 posts on the forum I presume your one of the developers and Questioning you is probably useless since you’ve had your head in the code for years.

I didn't think about multiple GoViews and other things you pointed out. I'm new to the product and haven't dove in that deep yet.
The one thing I will add I would think even if you had multiple views open they would all still have the same final screen resoltion (unless the app was maximized across two different res desktops). It just look shotty when you can grab a click and drag a node all over the place and it redraws perfectly and then the auto layout wiggles.
Is I write this I remember something I read in the doc's about the grid. Do the nodes snap to the grid during auto layout and could that lead to a possible hack if the grid was set to the screen res or whatever grid the mouse follows?
Thanks again
Frank

Another thing you could try is changing how GoView draws text. Try setting GoView.TextRenderingHint to AntiAlias. I think the default value is ClearTypeGridFit. The TextRenderingHint values that do grid fitting are probably what is bothering you.

There are four other GoView properties that also affect rendering of lines and of images: SmoothingMode, InterpolationMode, CompositingQuality, and PixelOffsetMode. All five properties just correspond to GDI+ graphics settings that GoView specifies when it paints.

The GoLayout algorithms don’t heed any GoGrids that are in the document. Naturally they don’t heed any GoGrids that are in the view either, such as the GoView.Grid.