StrokePath flag: #PB_Path_EndCapArrow
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
StrokePath flag: #PB_Path_EndCapArrow
So we can have a nice arrow capping our arc without calculating angles and positions and doing it the long way. I actually assumed this was already in there until I went to use it - "..and when he got there, the cupboard was bare."
BERESHEIT
Re: StrokePath flag: #PB_Path_EndCapArrow
This would not work on all platforms.
quidquid Latine dictum sit altum videtur
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: StrokePath flag: #PB_Path_EndCapArrow
I see. However, seeing how easily it can be implemented "the long way", could it not wrap gdiplus on windows and then do it the long way on platforms with no corresponding functionality? My manual attempt produces output that looks identical to that of the gdiplus version. No rush, it wouldn't be a priority at all.
BERESHEIT
Re: StrokePath flag: #PB_Path_EndCapArrow
Such manual implementations are a headache to get to behave in the exact same way as a native one. This usually leads to lots of bug reports and corrections that need to be made down the line. The devil is in the details in such a case. I have learned this the hard way and therefore try to avoid this whenever possible.
For example: If you look closely at the output of your code, you will notice a slight "gap" between the line and the arrow depending on the angle (this is due to the antialiasing of the edges). There is also different behavior in case the arrow overlaps with the path.
As you demonstrated, it is easy enough to do the manual way if you can live with those limitations. However, a library implementation is held to a higher standard than that.
For example: If you look closely at the output of your code, you will notice a slight "gap" between the line and the arrow depending on the angle (this is due to the antialiasing of the edges). There is also different behavior in case the arrow overlaps with the path.
As you demonstrated, it is easy enough to do the manual way if you can live with those limitations. However, a library implementation is held to a higher standard than that.
quidquid Latine dictum sit altum videtur
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: StrokePath flag: #PB_Path_EndCapArrow
Sure, fair enough. Thanks for the investigation, it's appreciated.
BERESHEIT