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

Bill Spitzak spitzak at d2.com
Fri Nov 14 10:08:15 PST 2003


This is the intended behavior, right?

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. In some 
ways it is better to think of the path and point as being a form of marking 
on the surface, just like colored in pixels even though it is invisible until 
you do a fill or stroke.

This would allow you to do transforms (in particular resets to the identity) 
to draw portions of the path. It would also allow device-specific extensions 
to add things to the path even if they are written in ways that require 
initializing the transform (it is better to say "the transform must be the 
identity" than to say "this feature ignores the current transform"). And it 
would save the expense of copying the path in save/restore.

On Friday 14 November 2003 09:07 am, Jesse Andrews wrote:
> I'll look at it later today.  As far as an example, in the code, I have
> the basic "tree/plant" lsystem coded (but commented).  Set the
> iterations down to 1 or 2 (4 takes FOREVER since save/restore are slow
> at least for me).
>
> The order that the path is being drawn (in logo psuedo code):
>
> new path
>
>   forward
>   save state
>   rotate
>   forward
>   restore state
>   forward
>
> stroke
>
> But what is happening on the screen is:
>
>    forward
>    rotate
>    forward
>    (un rotate -- I guess this is happening by restore state...)
>    forward
>
> Hmm...
>
> It seems like the restore does NOT reload the position, but does reload
> the rotation.

-- 
                   ,~,~,~,~ ~ ~ ~ ~
     /\_       _|_========___         Bill Spitzak
 ~~~/\/\\~~~~~~\____________/~~~~~~~~ spitzak at d2.com




More information about the cairo mailing list