Vertical/Horizontal Document centering


How to perfectly have a centered document in GoView (vertical/horizontal as MiddleCenter) ?
I tried to override OnLayout method to update the DocPosition from GoView.ClientSize : unsuccessful…


Are you able to scroll by hand that selected node to be the center of the view? If not, then that is why your code doesn’t succeed either.

Basically this is a policy that is implemented by GoView.LimitDocPosition, which is similar to the restriction for a Word or WordPad or InternetExplorer user not to be able to scroll the first or the last line of a document to be in the center of the window.

But if you change GoView.SheetStyle to some non-None value, LimitDocPosition does not restrict how GoView.DocPosition can be set.

I have only 3 nodes representing a comparison : left node, operator, right node.
The nodes cannot move on the view, we only have the possibility to Drag&Drop items from a toolbox to the left and right nodes.

What I want (if it is possible) : GoView has to center vertical/horizontal my document from the GoView.ClientSize…

ps : I use a GoLayoutLayeredDigraph

Here’s some code samples for centering:

Thanks Jake !