react-xarrows
react-xarrows copied to clipboard
Dividing with 0 if curvness is 0 and absDx
Describe the bug & Expected behavior If there is a straight arrow with curvness 0 and the x-coordinates of start and end point are identical, there is an NaN excpetion. I already fixed it. It occurs in the GetPosition.tsx File line 107. YOu are dividing with 0 because absDx is 0 in that case. I wrote:
let headAngel = absDx===0 ? Math.atan(absDy) : Math.atan(absDy / absDx);
I tested it with ur Example and it seams to work just fine and the Head Angle seams to be calculated correctly.
To Reproduce In your Example FewArrows I set the curvness of the blue Arrow to 0, so it is straight and overlayed box2 and box1
Screenshots
