[cairo] clipping question

Emmanuel Pacaud emmanuel.pacaud at univ-poitiers.fr
Tue Jun 27 08:44:15 PDT 2006


Le mardi 27 juin 2006 à 15:25 +0000, Fabien Costantini a écrit :
> 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.
> 
> Is there an api permitting to keep track of clipping states 
> so that I could restore my previous state to implement the pop_clip functionnality ?
> 
> Otherwise, I could achieve this functionnality by first calling cairo_reset_clip() 
> then 'replay' all clips surfaces but I'm afraid it will be time consuming.

Use cairo_save/cairo_restore, like explained in cairo documentation :)

	Emmanuel.



More information about the cairo mailing list