Page 1 of 1

Strange Behavior of Links in TSimpleGraph

PostPosted: March 22nd, 2017, 10:15 am
by simone
Dear Kambiz, Dear All,

Using TSimpleGraph I noticed a strange behavior in linking between nodes.

I have two rectangles in the graph R1 and R2. In the first I placed a litte square S1 in the left-upper corner,
in the second I placed a little square S2 in the right-lower corner. I draw a link between R1 and S1, and
a link between R2 ad S2. Why the second link is invisible?

I uploaded a screenshot to figure this situation.

This behavior creates some problems in my application, that is based on TSimpleGraph. Is it possible
to change it?

Thanks in advance. Simone.

Re: Strange Behavior of Links in TSimpleGraph

PostPosted: March 29th, 2017, 6:36 am
by Kambiz
Hi Simone,

The endpoints of links between two nodes are determined based on the center points of the nodes.
To change the behavior, you need to subclass TGraphLink and override its RelativeHookAnchor method.