[Cairo] py-cairo example & Context save/restore quesiton

Jesse David Andrews jdandr2 at uky.edu
Fri Nov 14 10:57:01 PST 2003


I was under the impression that postscript did _NOT_ save the current
path.  (I used this property as the basis for LPS:
http://sweb.uky.edu/~jdandr2/lps which is a similar product to cls -
cairo lindenmayer system except it takes text files and compiles them to
postscript)

Again, I'll dive into once I get home (postscript manuals are there ...)

Jesse

On Fri, 14 Nov 2003, Carl Worth wrote:

> On Nov 14, Bill Spitzak wrote:
>  > In fact, although I know you are saving and restoring it now, I was thinking
>  > that even the current path should not be modified by save/restore.
>
> A design goal of cairo has been to not deviate from the PostScript
> model without extremely convincing evidence for doing so. I haven't
> seen a compelling reason not to remain compatible with the PostScript
> model saving/restoring the current path.
>
>  > This would allow you to do transforms (in particular resets to the identity)
>  > to draw portions of the path.
>
> This is still possible, though the user will have to save/restore the
> matrix manually. My last email had an example, (turtle.py), that
> showed that path modifications between save/restore are not visible
> after the restore.
>
> Here is a "fix" to that example that shows how to get the same
> sequence of forward/rotate calls to yield the desired result. Instead
> of save/restore, this code manually saves the current matrix then
> restores it afterwards. (Note that if you actually wanted to make a
> more complete logo-like system, you might want a stack of matrix
> objects).
>
> -Carl
>
>
>





More information about the cairo mailing list