[cairo] creating non-rectangular clips
ldo at geek-central.gen.nz
Wed Jan 13 23:44:55 PST 2016
On Thu, 14 Jan 2016 05:05:35 +0100, Enrico Weigelt, metux IT consult
> My idea now is going through all neighboring windows and create a clip
> that masks out all the overlapping areas.
The documentation for cairo_clip
“Establishes a new clip region by intersecting the current clip region
with the current path as it would be filled by cairo_fill() and
according to the current fill rule”.
So what you want to do is, for each overlapping window, define a path
that would fill _everywhere outside_ that window, and intersect that
path with the current clip region.
To define such a path, you will need two subpaths: one that covers the
largest possible area into which drawing might happen, and another that
covers just the boundary of the window. Give them opposite directions,
and tne winding-number fill rule will produce the desired result. Or
use the even-odd fill rule, then the subpath directions don’t matter.
More information about the cairo