Skip to main content

Hello,

This function line.getDownstreamConnection() doesn’t follow line arrow state when a line arrow direction get changed by “swap line ending” or change line arrow style.

 

As far as I understand it (according to this article and screenshot attached below as well), the first and second endpoints are in context of the arrow direction is that true? otherwise, how to get the arrow direction of a line(that applies to multi-directional lines as well)?

 

 

Hello KGV,

I am investigating your question and will have a response soon.


 ​Hello ​@Michael B 

Any updates about this ticket?


EEK!

I apologize for letting this slip KGV. I had an unexpected sudden leave of absence the day after this post and didn't properly hand it off. I am reviewing it now.


Hello KGV,

Yes, you are right. Unfortunately, getDownstreamConnection() does not account for changing the arrow direction or style. Instead, it returns the shape that the line was originally drawn to. This behavior is similar to the DOWNSTREAM shape reference formula, here.

To work around this, you can get the arrowhead style of an endpoint, using something like
lineProxy.getEndpoint2().style . For example, for a default arrow with an arrowhead on Endpoint 2, the result is Arrow. If there is no arrowhead (and so the arrow visually points from Endpoint 2 to Endpoint 1), the result is undefined .
Then, from where the arrowheads are, you can infer the visual direction of a line.

If you would like further help or clarification, we are happy to assist further.

-Nathan


Reply