[cairo] Re: How to use clipping?

Carl Worth cworth at east.isi.edu
Tue Aug 3 11:48:56 PDT 2004

On Tue, 3 Aug 2004 13:47:54 -0400 (EDT), Sebastien Lemieux wrote:
>   Thanks for the fast reply!  I guess I'm still missing something, here is 
> a sample of code I wrote (the none cairo_ calls are just wrappers in the 
> object class and all work is done on the cairo_t *mImage):

Your code actually looks just fine [*].

> I've included the resulting image as a png where we can see that the 
> diagonal line is drawn both within and beyond the clipping region.  The 
> last stroke() draws both the clipping rectangle and the diagonal line.

That's a bug, and I was able to reproduce it. There is an optimization
in cairo in which it examines the clipping region and uses a faster code
path for pixel-aligned rectangular portions of the region. There must be
something broken in that right now.

I just committed a fix to disable the optimization. So if you update to
the latest version in CVS, you should get correct results, (though this
clipping will be much slower than it should be). We'll try to fix and
re-enable the optimization as soon as we can.

Thanks for your report,


More information about the cairo mailing list