Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Loosing DiagramLink.OriginAnchor and DiagramLink.DestinationAnchor after SendToBack (Read 2362 times)
Christoph_F
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 5
Joined: Jan 13th, 2012
Loosing DiagramLink.OriginAnchor and DiagramLink.DestinationAnchor after SendToBack
Jun 29th, 2012 at 9:33am
Print Post  
Hi,

for some reason the connected DiagramLinks which are connected to a DiagramNode loose the information of the OriginAnchor and DestinationAnchor after the DiagramNode was sent to back.

I get the links on the DiagramNode using GetAllLinks(). And the DiagramLinks are added in code:
Code
Select All
var diagramLink = new DiagramLink(diagram)
                                      {
                                          Origin = originDiagramNode,
                                          OriginAnchor = originAnchorIndex,
                                          Destination = destinationDiagramNode,
                                          DestinationAnchor = destinationAnchorIndex,
                                          CascadeOrientation = Orientation.Auto,
                                          CustomDraw = CustomDraw.Full,
                                          Shape = LinkShape.Cascading,
                                          Dynamic = false,
                                          AutoRoute = true,
                                          StrokeThickness = 10.0,
                                          HeadPen = new Pen(Brushes.Black, 10.0),
                                          Stroke = Brushes.Black,
                                          HandlesStyle = HandlesStyle.SquareHandles,
                                          HeadShape = ArrowHeads.Arrow,
                                          ClipToBounds = false
                                      };

diagram.Links.Add(diagramLink);
 



After adding the link the OriginAnchor and the DestinationAnchor are correct.

Anyone ancounter this behavior before?

thanks,
Christoph
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Loosing DiagramLink.OriginAnchor and DiagramLink.DestinationAnchor after SendToBack
Reply #1 - Jun 29th, 2012 at 10:09am
Print Post  
Hi,

What does "send to back" involve in your application? Links could detach from anchor points when they are modified by user or auto-routed. Try setting RoutingOptions.Anchoring to Keep, SnapToAnchor to CreateOrModify and/or AllowUnanchoredLinks to false to see if any of these options helps in your case.

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


I Love MindFusion!

Posts: 5
Joined: Jan 13th, 2012
Re: Loosing DiagramLink.OriginAnchor and DiagramLink.DestinationAnchor after SendToBack
Reply #2 - Jun 29th, 2012 at 10:22am
Print Post  
I tried these options but that did not help...

Also it is not just "SendToBack" but also other interactions (adding another element etc.) brings the same strange behavior but not all the time.

So I am stuck. At the moment I manually figure out the correct anchor point by finding the nearest (based on the start/end point of the link ControlPoints) but it would be a smarter way if I could use the Origin/DestinationAnchor directly.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Loosing DiagramLink.OriginAnchor and DiagramLink.DestinationAnchor after SendToBack
Reply #3 - Jun 29th, 2012 at 12:04pm
Print Post  
Could you attach here a small test project showing what's wrong with anchor points?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint