Some way of "clipping" content in Cairo

Do you know some way of clipping content in Cairo?
I’ve tried to use

cairo_rectangle (cairo->getCairoContext(), rect.x, rect.y, rect.width, rect.height);
cairo_clip(cairo->getCairoContext());

and it seems to work, but only once per frame.
Any ideas of how to draw and clip multiple times in the same frame / cairo context?
Thanks

my cairo memory is a little hazy, but can’t you clip w/ groups ?

1 Like

Thank you!
Groups working here.

			if (uiC->pBool["clip"]) {
				cairo_push_group(cx);
			}

			l.draw();

			if (uiC->pBool["clip"]) {
				cairo_pop_group_to_source(cx);
				cairo_rectangle(cx, rect.x, rect.y, rect.width, rect.height);
				cairo_fill(cx);
			}