Drawing an arrow with custom EndCapStyle suggestion


This applies to the current development tip. It is currently not possible to create a path with PathStrokeStyle with an Arrowhead and a custom EndCapStyle. This is because createStrokeWithArrowHeads always wants to draw arrowheads on both sides. The get only one side one can choose a head size of 0, but in that case the custom EndCapStyle is ignored and the resulting path just gets a square end.

My suggestion would be to revert to the custom endCapStyle for ArrowHead startWidth/endWidth == 0. To do that two lines in juce_PathStrokeType need to be changed. Line 452 should be:

          if (arrowhead != nullptr && arrowhead->startWidth > 0.f)

Line 494 should be:

          if (arrowhead != nullptr && arrowhead->endWidth > 0.f)


Hi pflugshaupt, Sounds like a reasonable suggestion. Thank you for spotting this. I’ve just pushed this to develop.