Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Drawing Lines with Flow Diagramming without Snapping (Read 1670 times)
nametable
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Joined: Mar 24th, 2022
Drawing Lines with Flow Diagramming without Snapping
Mar 24th, 2022 at 6:35pm
Print Post  
Hi, I am currently working on a project where I have DiagramLinks that users can create. These links are working fine for the most part. However, I am trying to figure out if it is possible to disable the snapping of DiagramLinks to nodes?

Is it possible to draw freeform lines with DiagramLinks which do not snap to anything?

Initially I thought that the Diagram would have a property somewhere that I could disable, but I have not found one which gives me the desired behavior.

I am using MindFusion Diagramming WPF version 2.5.

Thanks Smiley
  
Back to top
 
IP Logged
 
nametable
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Joined: Mar 24th, 2022
Re: Drawing Lines with Flow Diagramming without Snapping
Reply #1 - Mar 24th, 2022 at 7:48pm
Print Post  
Here is an example showing the snapping I am referring to. After the link is placed however, the link behaves in the way that I want.
  

diagram_link_animation.gif ( 170 KB | 68 Downloads )
diagram_link_animation.gif
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Drawing Lines with Flow Diagramming without Snapping
Reply #2 - Mar 25th, 2022 at 7:12am
Print Post  
Hi,

There is no property for disabling that. You could implement it with some event handling instead -

Code
Select All
Point unalignedStart;
Point unalignedEnd;

void OnLinkCreating(object sender, LinkValidationEventArgs e)
{
	unalignedStart = e.Link.StartPoint;
	unalignedEnd = e.Link.EndPoint;
}

void OnLinkCreated(object sender, LinkEventArgs e)
{
	e.Link.StartPoint = unalignedStart;
	e.Link.EndPoint = unalignedEnd;
	e.Link.UpdateFromPoints();
} 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
nametable
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Joined: Mar 24th, 2022
Re: Drawing Lines with Flow Diagramming without Snapping
Reply #3 - Mar 29th, 2022 at 5:40pm
Print Post  
Thanks!

That method seems to work exactly in the way that I need.

I did however need to use ControlPoints to get and set the point values.

Code
Select All
unalignedStart = e.Link.ControlPoints[0];
unalignedEnd = e.Link.ControlPoints[1];
 



Have a good day.
  

diagram_link_animation_no_snap.gif ( 110 KB | 72 Downloads )
diagram_link_animation_no_snap.gif
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Drawing Lines with Flow Diagramming without Snapping
Reply #4 - Mar 30th, 2022 at 6:59am
Print Post  
Hi,

Apparently StartPoint and EndPoint are available since v2.8.

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