[cairo] Locking font / pen space

Bill Spitzak spitzak at gmail.com
Mon Aug 30 10:37:08 PDT 2010


Arjen Nienhuis wrote:

> If I do this with cairo:
> 
> cairo_paint (cr);
> cairo_translate(cr, 100, 0);
> cairo_paint (cr);
> 
> I end up with 1 copy of the source (maybe more opaque) right?

Yes.

> So this code: 
> 
> cairo_show_text (cr, "X");
> cairo_translate(cr, 100, 0);
> cairo_show_text (cr, "X");
>  
> should end up with one 'X'? Or do you want to change pattern transforms 
> to make them consistent?

No because show_text uses the current point as well, and that is translated.

Pattern transforms could be fixed to be consistent by adding a "move 0,0 
in the pattern to the current point". Might be a good idea, certainly a 
lot of users expect to get translations without having to reselect the 
pattern.


More information about the cairo mailing list