[cairo] clipping question

Vladimir Vukicevic vladimirv at gmail.com
Tue Jun 27 17:31:20 PDT 2006


On 6/27/06, Fabien Costantini <fab672000 at yahoo.fr> wrote:
> Hi,
> I would like to push and pop clipping rectangular surfaces in a given context.
>
> For the rectangle clip accumulation,
> I suppose I must use
> cairo_clip(), then cairo_clip_preserve()
>
> But then If i want to remove the latest rectangle i accumulated
> with  cairo_clip_preserve() what am i supposed to do ?
> If I use cairo_reset_clip() I remove all clipping.

cairo_clip_preserve() doesn't do what you think it does; it's
analogous to fill_preserve() and stroke_preserve() in that it doesn't
reset the current path, unlike clip()/fill()/stroke().  You want to
use cairo_save() and cairo_restore(); they're relatively lightweight.

   - Vlad


More information about the cairo mailing list