Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Why does a simple horizontal link have 2 segments? (Read 1883 times)
jlj30
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 183
Joined: Sep 4th, 2011
Why does a simple horizontal link have 2 segments?
Jun 10th, 2013 at 2:51pm
Print Post  
Hi,

I'm trying to place images on link segments based on user preference - e.g., First Segment, Longest Segment, Last Segment.

If I examine the SegmentCount property of the link and the ControlPoints.Count property, I come up with: 2 segments and 3 control points.  Here are the x/y coordinate pairs for my simple link:

66.5 / 71 , 103.5 / 71 , 103.5 / 71

As you can see, if I wanted to get the Last Segment for this link, I'd be looking at a single pixel Sad

Can you explain why this is so.
Also is there a simple way to find the longest segment (perhaps you've already provided someone with the necessary code).

As usual, thanks in advance for any help in understanding this.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Why does a simple horizontal link have 2 segments?
Reply #1 - Jun 10th, 2013 at 4:53pm
Print Post  
Hi,

Cascading links always have at least two segments, to let the link grow both horizontally and vertically when you move its nodes. Just ignore the second segment if you detect its points coincide.

You can loop over consecutive pairs of points in the link's ControlPoints collection and call Utilities.Distance to find the longest segment.

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