Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Moving anchor points, but links not updating (Read 3356 times)
SavyCat
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 38
Joined: Sep 4th, 2007
Moving anchor points, but links not updating
Feb 29th, 2008 at 12:10pm
Print Post  
Hi guys, not sure if this is a bug or not. In my program I create a shape node with one anchor point. I then link that node to another node. After that, I add another anchor point to the original node and re-arrange all the anchor points so that they are evenly spaced on the node. This works fine - but the link that was created on the first point is not updating to the new position...Is it my responsibilty to change its position? If so - how would you recommend I do that?
  
Back to top
 
IP Logged
 
SavyCat
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 38
Joined: Sep 4th, 2007
Re: Moving anchor points, but links not updating
Reply #1 - Feb 29th, 2008 at 12:10pm
Print Post  
Forgot to say thanks Smiley
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Moving anchor points, but links not updating
Reply #2 - Feb 29th, 2008 at 12:29pm
Print Post  
Try setting the OriginAnchor to -1, and then setting it back to its original value.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
SavyCat
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 38
Joined: Sep 4th, 2007
Re: Moving anchor points, but links not updating
Reply #3 - Mar 3rd, 2008 at 9:54am
Print Post  
Ah, that did the trick. Thanks Stoyo
  
Back to top
 
IP Logged
 
SavyCat
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 38
Joined: Sep 4th, 2007
Re: Moving anchor points, but links not updating
Reply #4 - Mar 3rd, 2008 at 10:32am
Print Post  
It looks like I found a bug. it seems to me that the origin indices are not getting reset when a point is removed. Try something like this:

Code
Select All
List<int> indicesBefore = new List<int>();
foreach (outgoing link)
		indicesBefore.add(links origin index);

//Remove a point

List<int> indicesAfter = new List<int>();
foreach (outgoing link)
		indicesAfter.add(links origin index);
 



  
Back to top
 
IP Logged
 
SavyCat
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 38
Joined: Sep 4th, 2007
Re: Moving anchor points, but links not updating
Reply #5 - Mar 3rd, 2008 at 10:32am
Print Post  
It looks like I found a bug. it seems to me that the origin indices are not getting reset when a point is removed. Try something like this:

Code
Select All
List<int> indicesBefore = new List<int>();
foreach (outgoing link)
		indicesBefore.add(links origin index);

//Remove a point

List<int> indicesAfter = new List<int>();
foreach (outgoing link)
		indicesAfter.add(links origin index);
 



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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Moving anchor points, but links not updating
Reply #6 - Mar 3rd, 2008 at 12:23pm
Print Post  
We haven't designed the AnchorPattern objects to allow dynamic modification while they are in use. The control expects that you would define the AnchorPattern objects in your application initialization code, and then use them without changes in run-time (just like Shape definitions). So if you need to add or remove points dynamically, or change their positions, you will have to take care of updating the DiagramLink objects affected by these operations.

Stoyan
  
Back to top
 
IP Logged
 
SavyCat
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 38
Joined: Sep 4th, 2007
Re: Moving anchor points, but links not updating
Reply #7 - Mar 3rd, 2008 at 12:57pm
Print Post  
Gotcha. Well, I managed a way around it. Thanks though.
  
Back to top
 
IP Logged
 
SavyCat
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 38
Joined: Sep 4th, 2007
Re: Moving anchor points, but links not updating
Reply #8 - Mar 3rd, 2008 at 1:01pm
Print Post  
Hey Stoyo, id rather not start a new thread for this little  question. But how can I cancel a user from using the inplace editor?
I dont want the user being able to rename the links. Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Moving anchor points, but links not updating
Reply #9 - Mar 3rd, 2008 at 1:23pm
Print Post  
Hi,

If you need to disable that just for the links, handle LinkTextEditing and set e.Cancel = true.

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