Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Control the display of ShapeNode (Read 1976 times)
D
Full Member
***
Offline


I Love MindFusion!

Posts: 158
Joined: Mar 16th, 2020
Control the display of ShapeNode
Apr 8th, 2020 at 2:07am
Print Post  
Since I set diagram.Bounds = "-600, -600,1500,1500", and imageNode = diagram.Factory.CreateShapeNode (0, 0, imageWidth, imageHeight); the imageNode is not in the view display range by default. I want to change this situation. I want the imageNode to be displayed in the display range of the view by default. How can I achieve this?
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Control the display of ShapeNode
Reply #1 - Apr 8th, 2020 at 5:10am
Print Post  
Hi,

diagram.ZoomToRect(imageNode.Bounds, true); will zoom to and center on the node. If you don't want zooming, use diagram.ScrollX and diagram.ScrollY properties to bring the node into view. Use math to find out the needed ScrollX/ScrollY values.

Regards,
Lyubo
MindFusion
  
Back to top
 
IP Logged
 
D
Full Member
***
Offline


I Love MindFusion!

Posts: 158
Joined: Mar 16th, 2020
Re: Control the display of ShapeNode
Reply #2 - Apr 8th, 2020 at 5:59am
Print Post  
Yes, you are right. I have implemented using this method:diagram.ZoomToRect(imageNode.Bounds, true);. Smiley Thanks a lot for you, Lyubo.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint