[cairo] Drawing an arrow

Emmanuel Pacaud emmanuel.pacaud at lapp.in2p3.fr
Wed Nov 24 02:08:13 PST 2010


Le mercredi 24 novembre 2010 à 10:50 +0100, donn a écrit : 
> On 23/11/2010 19:09, Stefan Salewski wrote:
> > Can you imagine building an arrow of 3 or more line segments?
> The OP is a question I would like to see answered too. The problem is 
> how to find the three points to define the arrow. If you have a 
> bezier-curve, so the line is some S shape, how do you get the arrow to 
> point along the direction that the curve sort of ends in?

You may want to have a look here:

http://git.gnome.org/browse/lasem/tree/src/lsmsvgview.c from line 851

and here:

http://git.gnome.org/browse/lasem/tree/src/lsmsvgmarkerelement.c from
line 44

It's the code for the drawing of svg markers along a curve (it comes
from librsvg), with the auto-angle property handling.

Emmanuel.



More information about the cairo mailing list