Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Question about Diagram.GetLinkAt method (Read 1283 times)
CanadaProgrammer
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 113
Joined: Jun 30th, 2011
Question about Diagram.GetLinkAt method
Jul 25th, 2011 at 1:59am
Print Post  
Click a link, the link can be selected. Then I call method GetLinkAt of class Diagram but get nothing (null value). Code like below:
this.DiagramCtrl.GetLinkAt(docPt, 0);

if I call method like below I can get the link
this.DiagramCtrl.GetLinkAt(docPt, 2);

If I can click a link and choose it then I think Diagram must know what I clicked. Why this.DiagramCtrl.GetLinkAt(docPt, 0) return null value and this.DiagramCtrl.GetLinkAt(docPt, 2) can return the link? I do not know what is the best value of 2rd parameter should be.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Question about Diagram.GetLinkAt method
Reply #1 - Jul 25th, 2011 at 6:49am
Print Post  
The second parameter specifies the maximum distance, within which to consider the point as lying on the link. If you specify 0, only points lying exactly on the link will hit-test successfully.

The control uses the Diagram.LinkHitDistance value in order to hit-test links when users interact with the diagram. The default value of this property is 0 (which indicates a distance of 5 mm). Therefore if you want to use the default distance when hit-testing links, you have to specify 5 as a second argument of GetLinkAt (assuming you are using millimeters as units of measure).

I hope this helps.

Regards,
Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint