[pygtk] Re: [cairo] pycairo - translate question

Donn donn.ingle at gmail.com
Tue Nov 6 02:57:58 WST 2007


> Yes, definitely the right list. Welcome, Donn!
Thanks. Having fun so far!

> What you're looking for is save/restore, like so:
Excellent. Saved!

> Often I will code all of my draw_something functions to also call
> save() at the beginning and restore() at the end, which helps them to
> act idempotently, (things like change to the source pattern won't
> accidentally leak out, for example).
Good tip. Also good new word "idempotently"! It has grandeur and a touch of 
humility :D

> I hope that helps. And have fun with cairo!
It has, and I have one more quick question:

Is there a way to set the drawing origin of a set of <pycairo drawing 
commands> such that it starts at 0,0 but in the center of the "page"? (Or 
should that be "context", I am still fuzzy about that.)
I guess this will be a width/2, height/2 extra transform, but I'm not sure.

\d


More information about the pygtk mailing list