[cairo] Transformation order

mydevel at free.fr mydevel at free.fr
Sat Dec 2 02:18:18 PST 2006


Hello,

Is there any constraint on the order of transformation applied to a context ?
I thought that

(1)
translate(x,y)
scale(scx,scy)

would be the same as :

(2)
scale(scx,scy)
translate(x/scx,y/scy)

In fact, it is, as long as you don't use the PDF backend and surfaces as 
source pattern.

In PDF (cairo 1.2.4), when you paint a surface source with CAIRO_EXTEND_NONE, 
(1) gives you a repeating pattern whose frequency is 1/scx along X, 1/scy 
along Y ! Whereas (2) works as expected. Common path drawing work the same in 
case (1) and (2).

In other backends, (1) and (2) both give the right result with surface 
sources.

Sincerely,

Romuald.


More information about the cairo mailing list