Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Focus node which is outside my view area. (Read 806 times)
Ankur shah
Junior Member
**
Offline


I Love MindFusion!

Posts: 63
Joined: Mar 16th, 2017
Focus node which is outside my view area.
Jul 10th, 2019 at 5:24am
Print Post  
If my diagram node goes out of my canvas and canvas is having scroll bar. How we focus on the node which is outside from view area. I need to get this node in to my view area. How can we achieve this?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Focus node which is outside my view area.
Reply #1 - Jul 10th, 2019 at 7:10am
Print Post  
Check if diagram.getViewport() rectangle contains node.getBounds() to find if the node's currently visible. If it isn't, call diagram.scrollTo() to scroll to the node's position, maybe with half the viewport's size subtracted to center on the node.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint