[cairo] Cairo is non-deterministic?

Carl Worth cworth at cworth.org
Tue Jan 3 14:03:40 PST 2006


On Tue, 3 Jan 2006 22:56:21 +0100, Dirk Schönberger wrote:
> With avoiding "leaking" CTM modifictaions you mean that I could write
> create_star like the following
> 
> void create_star (int numsides)
> {
>    gsave
>    moveto (0, 1)
>    for (int i=0; i<numsides; i++)
>    {
>      rotate(360/numsides)
>      lineto (0, 1)
>    }
>   grestore
> }

Yes.

> which should work in Cairo and PDF, but not in Postscript?

Correct.

In all three systems, adding the gsave/grestore will prevent the
"leaking". But with PostScript, adding those calls means that the
current path will be unaffected by a call to create_star, so that that
function has no effect whatsoever.

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060103/252abff1/attachment.pgp


More information about the cairo mailing list