Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Mid point of a link (Read 1593 times)
donalmeida
Junior Member
**
Offline


Yay...

Posts: 65
Joined: Oct 6th, 2009
Mid point of a link
May 26th, 2011 at 6:41pm
Print Post  
We would like to add two control points on the link, near the link text. How do we get to the midpoint of a link? And then add two controls points at that point? (LinkStyle.Polyline).
  

Don Almeida.
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Mid point of a link
Reply #1 - May 27th, 2011 at 10:55am
Print Post  
By default, link text is drawn at this position (points corresponds to ControlPoints):

var pos = points.Count % 2 == 1 ?
     points[points.Count / 2] :
     Utilities.Mid(points[points.Count / 2 - 1], points[points.Count / 2]);

You should insert the new points at index = points.Count / 2.

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