Currently, the arrow tip have a sharp point (V). This feature is added to give the functionality to give a curve at the tip with a custom radius which can be given explicitly
In all the directions, right now the arrow is formed by joining two straight lines. In this PR, i have added an arc between two straight lines to form a curve with a custom radius.
As shown in the diagram, i have taken an arc of a small circle with center (0,0), radius R and an angle of 90°. So, the points on the circle between arc is created will be (-R Sin 45°, R Cos 45°) and (R Sin 45°, R Cos 45°). And Cos45° and Sin 45° value is 1/√ 2.
So the exact point of the start of the curve would be (target.dx - R/√ 2 , target.dy + arrow_tip_length - (R - R/√ 2)). As the distance of the start position on y axis will be -> target.dy + arrow_tip_length - (R - R Cos45°) . Hence, i have created a straight line first upto this point , then added a curve to the point (target.dx + R/√ 2 , target.dy + arrow_tip_length - (R - R/√ 2)) with radius R. Then a straight line as before to the point on the rectangle. Similarly, I have added this in all the directions with proper points and angles.
Default value arrowTipRadius(R) is set to be 0 which will give a sharp tip as before since there will be no arc in that case. Then developer can give custom arrowTipRadius for the curve.
Currently, the arrow tip have a sharp point (V). This feature is added to give the functionality to give a curve at the tip with a custom radius which can be given explicitly
In all the directions, right now the arrow is formed by joining two straight lines. In this PR, i have added an arc between two straight lines to form a curve with a custom radius. As shown in the diagram, i have taken an arc of a small circle with center (0,0), radius R and an angle of 90°. So, the points on the circle between arc is created will be (-R Sin 45°, R Cos 45°) and (R Sin 45°, R Cos 45°). And Cos45° and Sin 45° value is 1/√ 2. So the exact point of the start of the curve would be (target.dx - R/√ 2 , target.dy + arrow_tip_length - (R - R/√ 2)). As the distance of the start position on y axis will be -> target.dy + arrow_tip_length - (R - R Cos45°) . Hence, i have created a straight line first upto this point , then added a curve to the point (target.dx + R/√ 2 , target.dy + arrow_tip_length - (R - R/√ 2)) with radius R. Then a straight line as before to the point on the rectangle. Similarly, I have added this in all the directions with proper points and angles. Default value arrowTipRadius(R) is set to be 0 which will give a sharp tip as before since there will be no arc in that case. Then developer can give custom arrowTipRadius for the curve.