Re: global clip for a cairo context
Uli Schlachter <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <[email protected]> |
Am 02.01.2016 um 17:48 schrieb Enrico Weigelt, metux IT consult: > On 02.01.2016 15:25, Uli Schlachter wrote: >> P.S.: Actually, I'd do something like this: >> >> cairo_save(cr); >> cairo_translate(cr, widget->x, widget->y); >> cairo_rectangle(cr, 0, 0, widget->width, widget->height); >> cairo_clip(cr); >> widget->paint_callback(cr, widget->width, widget->height); >> cairo_restore(cr); > > Does that also work when the widget uses these operations itself ? Yeah, it does. cairo_save/restore save the whole state of the cairo context except for the current path (if you want, you can clear that with cairo_new_path()). Internally, a linked list is used to chain these together. Uli -- "In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move." -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo