Re: creating non-rectangular clips

Lawrence D'Oliveiro <[email protected]>
Newsgroups gmane.comp.lib.cairo
Organization Geek Central
Message-ID <[email protected]>
On Thu, 14 Jan 2016 05:05:35 +0100, Enrico Weigelt, metux IT consult
wrote:

> 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
<http://cairographics.org/manual/cairo-cairo-t.html#cairo-clip> says
“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.
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.