[cairo] offsetting a fill image pattern

Theo Veenker Theo.Veenker at let.uu.nl
Tue Mar 25 04:22:51 PDT 2008


Theo Veenker wrote:
> Hi,
> 
> When filling a shape with an image pattern, is it possible to
> control the origin of the image within the shape? For instance
> lets say I have a rectangle of size 100x100 at -50,-50. When
> filling this with an image pattern the image fill starts at 0,0
> which in this case is the center of the rectangle. I like to be
> able to offset the fill within the rectangle without changing
> the anchor point of the rectangle. Can this be done?

Never mind, I found it. Just need to apply a translate on the
pattern's transformation matrix.

Theo



More information about the cairo mailing list