Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Align to grid (Read 3378 times)
Dexter
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 62
Joined: Jun 25th, 2009
Align to grid
Aug 28th, 2009 at 8:06am
Print Post  
Hi there,
Is it possible to set the alignment to grid of a node to it center. Now align to grid set the sides of every newly created or modified diagram item aligned to the nearest grid points. I want to align the center of the node to the nearest grid point.
It is possible to do this?

Regards,
Dexter
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Align to grid
Reply #1 - Aug 28th, 2009 at 8:12am
Print Post  
Hi,

You will have to disable the automatic AlignToGrid feature. In NodeCreated calculate the node center point, call diagram.AlignToGridPoint(center), and move the node with the same offset as the one between the original center and the aligned point.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Dexter
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 62
Joined: Jun 25th, 2009
Re: Align to grid
Reply #2 - Sep 7th, 2009 at 1:53pm
Print Post  
It does not work. If I disable the AligToGrid then the method returns the same point and the offset will be 0. At create I solve the problem, but now at update bounds if I write the same code the movement will be from grid line i to grid line i+2 so no grid i+1. What I am doing wrong?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Align to grid
Reply #3 - Sep 7th, 2009 at 2:18pm
Print Post  
Then in NodeCreated enable AlignToGrid temporarily before calling AlignPointToGrid.

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