Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to shift/move content area on diagram. (Read 2016 times)
ayushneema
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 37
Joined: Sep 23rd, 2009
How to shift/move content area on diagram.
Oct 12th, 2009 at 9:18am
Print Post  
Hi,
how can i shift my entire content area on diagram.

Thanks
Ayush Neema
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to shift/move content area on diagram.
Reply #1 - Oct 12th, 2009 at 10:17am
Print Post  
Hi,

You could call GetContentBounds(), and from the result find a new value for Diagram.Bounds so that it has the content at the position you need it.

Stoyan
  
Back to top
 
IP Logged
 
ayushneema
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 37
Joined: Sep 23rd, 2009
Re: How to shift/move content area on diagram.
Reply #2 - Oct 12th, 2009 at 10:32am
Print Post  
Hi
Thanks for  replay..
I am using getcontentbound method. but how can i place the rectangle(from getcontentbound) to another location
could you please explain a bit more.
Thanks
Ayush Neema
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to shift/move content area on diagram.
Reply #3 - Oct 14th, 2009 at 11:42am
Print Post  
Set diagram.Bounds = new Rect(newX, newY, oldWidth, oldHeight), where the newX and newY values depend on the content bounds, and the "old" variables contains the original width and height of diagram.Bounds. E.g. if you want the content to appear in the lower right of the diagram, set:

newX = contentBounds.Right - oldWidth;
newY = contentBounds.Bottom - oldHeight;

If you don't want to modify the origin of the diagram coordinate system (the top-left of Bounds), then you could loop over all nodes and add some offset to their coordinate, and over all links and add the same offset to their control points.
  
Back to top
 
IP Logged
 
ayushneema
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 37
Joined: Sep 23rd, 2009
Re: How to shift/move content area on diagram.
Reply #4 - Oct 15th, 2009 at 11:55am
Print Post  
Hi stoyan,
Thanks for clearing the doubts. i make the change and it working fine.

Thanks
Ayush Neema

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint