[cairo] Patterns and clipping

Benjamin Otte otte at redhat.com
Mon Jun 7 11:20:20 PDT 2010

Yes, this is by design. No surface extends beyond its extents.


On Mon, 2010-06-07 at 11:59 -0300, Ian Britten wrote:
> Hi all,
> [ cairo 1.8.6, 64-bit Linux ]
> When drawing a pattern (eg: EXTEND_REPEAT to fill a polygon), is
> is possible for any part of the pattern to extend past the
> temporary surface it was created on?
> Let me explain:
> - I have a PDF (vector) surface.
> - I create a similar temporary surface (eg: 10x10), and draw a
>    diagonal line from one corner to another.
> - Note the data points I use fall within the temporary surface.
> - I draw the line with a thick lineweight, so that in theory, the
>    lineweight extends past the edge of the surface, at the corners.
> - I set that (with EXTEND_REPEAT) as the source on my PDF surface.
> Now, because I'm working entirely with vectors, I had (naively)
> hoped that the vectors would be 'replayed' when the pattern was
> tiled within my polygon.  Specifically, I had hoped the line would
> be redrawn with it's lineweight, and would thus bleeding out past
> the edge of the temporary tile/surface I had created.
> What actually seems to be happening is that my line is being
> cropped at the edge of the surface/pattern, as if it was being
> rasterized before being tiled onto the surface. (See attached).
> Or, maybe the pattern sets a clip region before drawing itself?
> Now, if I was working with an image surface, I would see this
> happening, but I guess I had imagined the vector pattern would
> just 'record' and 'replay' what had been rendered.
> Could someone confirm that this is by-design, and isn't an
> oversight?  I could imagine various cases where a pattern might
> bleed out past the actual geometry rendered to it (such as via
> cap styles, arcs/curves, lineweights, etc), and want to make sure
> I proceed correctly.
> Many thanks!
> Ian
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo

More information about the cairo mailing list