Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic zooming and scroll bar issue (Read 1934 times)
deanhully
YaBB Newbies
*
Offline



Posts: 26
Joined: Aug 25th, 2008
zooming and scroll bar issue
Feb 27th, 2009 at 3:11pm
Print Post  
Hi Stoyo,

I am using the following code to do a zoom that is anchored to the center of the screen. It works pretty well but one problem I have is when you zoom in far enough for nodes to go off the left edge of the screen the horizontal scrollbar doesn't appear.  If I do a select all and move every node a little then the scrollbar updates correctly.

Any thoughts?

TIA

Code
Select All
		Dim VisibleRect As RectangleF = mDiagramView.ClientToDoc(mDiagramView.ClientRectangle)

	    VisibleRect = New RectangleF(0, 0, VisibleRect.Width * 0.9, VisibleRect.Height * 0.9)


		mDiagramView.ZoomToRect(VisibleRect)
		mDiagramView.Diagram.Bounds = New RectangleF(VisibleRect.Width * 0.1 / 2 + mDiagramView.Diagram.Bounds.X, mDiagramView.Diagram.Bounds.Y + VisibleRect.Height * 0.1 / 2, mDiagramView.Diagram.Bounds.Width, mDiagramView.Diagram.Bounds.Height) ' VisibleRect.Width, VisibleRect.Height)


 

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: zooming and scroll bar issue
Reply #1 - Feb 27th, 2009 at 3:20pm
Print Post  
Hi,

The scroll range depends on the Bounds size and not on where the nodes are, Bounds should be larger than the visible rect for scrollbars to appear. Additionally, try using the ScrollTo method to center the view, instead of setting Bounds.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint