On Mon, 5 Nov 2007 19:57:58 +0200, Donn wrote:
> Thanks. Having fun so far!

That warms my heart.

> 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.)

Center of the "surface" is what I would have said, (a "context" is an
extra piece of state that allows one to direct drawing operations to a
particular surface).

> I guess this will be a width/2, height/2 extra transform, but I'm not sure.

Yes, after ctx.translate(width/2, height/2) a user-space coordinate of
(0,0) will map to a device-space position at the center of the target
surface.

Do note that in general cairo doesn't allow you to query for surface
dimensions, (though it does for an image surface), so you'll generally
need to hang on to the width and height yourself.

-Carl



Attachment: pgpDOmTPjfxwd.pgp
Description: PGP signature

_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to