Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Can't connect DiagramLink to ShapeNode (Shape.Triangle) with diagram.AlignToGrid = ture. (Read 1657 times)
NIkolayev_Egor
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 9
Joined: Jan 22nd, 2019
Can't connect DiagramLink to ShapeNode (Shape.Triangle) with diagram.AlignToGrid = ture.
Oct 22nd, 2019 at 8:01am
Print Post  
Hello.

I have next diagram -

https://ibb.co/ZKKZRzQ

diagram.AlignToGrid = ture
diagram.GridSizeX = 20
diagram.GridSizeY = 20
ruler.Unit="Pixel",

DiagramLink 1,

DiagramNode.Bounds.Left = 200 (coordinate of left side)
DiagramNode.AllowIncomingLinks = false
DiagramNode.AllowOutgoingLinks = false

ShapeNode.Bounds.Left = 200 (coordinate of left side)
ShapeNode.Shape = "Triangle"
ShapeNode.Constraints.KeepInsideParent = true;
ShapeNode.RotationAngle(90);
ShapeNode.HandlesStyle = HandlesStyle.MoveOnly;
ShapeNode.EnabledHandles = AdjustmentHandles.Move;

--------------------------------------------------
I am trying to connect "DiagramLink 1" to left side of ShapeNode but without any result.
I can connect "DiagramLink 1" only to right point of ShapeNode (coordinate of right point X - 220). But I don't need it.
If ShapeNode change to Rectangle (not Triangle) with side 20 pixels - all working fine. But I don't need it.
  
Back to top
 
IP Logged
 
NIkolayev_Egor
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 9
Joined: Jan 22nd, 2019
Re: Can't connect DiagramLink to ShapeNode (Shape.Triangle) with diagram.AlignToGrid = ture.
Reply #1 - Oct 22nd, 2019 at 8:12am
Print Post  
As I understand we have incorrect result from GetTargetNode-function in DiagramLink.cs in my case. We should get ShapeNode, but we get it’s parent – DiagramNode.
But DiagramNode.AllowIncomingLinks = false, DiagramNode.AllowOutgoingLinks = false.
So AllowModify-function return false.

Best regards.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3148
Joined: Oct 19th, 2005
Re: Can't connect DiagramLink to ShapeNode (Shape.Triangle) with diagram.AlignToGrid = ture.
Reply #2 - Oct 22nd, 2019 at 6:01pm
Print Post  
Hi,

That node seems to have the Arrowheads.Triangle shape whose base line is defined at 95% of bounding rectangle for whatever reason, so the aligned grid point does not lie within the rotated triangle. You could use Shapes.Alternative instead (also a triangle), its baseline is at 100% and the grid point lies exactly on it - then the link connects in my test project.

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


I Love MindFusion!

Posts: 9
Joined: Jan 22nd, 2019
Re: Can't connect DiagramLink to ShapeNode (Shape.Triangle) with diagram.AlignToGrid = ture.
Reply #3 - Nov 18th, 2019 at 7:40am
Print Post  
Ok. May be it was a problem in my code.
I found easy solution. Now I am using recatngular shapenodes with image of triangle inside.
All working fine in this case.

Many thanks and best regards.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint