[cairo] Subtractive Clipping Again

Travis Griggs tgriggs at cincom.com
Sat Apr 28 12:09:42 PDT 2007


On Apr 28, 2007, at 12:04, Travis Griggs wrote:

> I was fascinated by the discussion this last week of subtractive  
> clipping. Cool stuff. So much so, that I wanted to use something  
> like it for an example in my StS presentation next week.
>
> My goal is to draw an image with a "cheese grater" effect. That is  
> with holes punched in it where the background shows through. But I  
> can't seem to make it work. No matter what I do, I get the  
> opposite. A bunch circles showing the image.
>
> What I have is a highlevel function that builds a clockwise  
> rectangle with rounded corners and sets that as the clip. That's  
> the "outer bounds". Then in my specific example routine, I path a  
> bunch of circles with (newSubPath, arc_negative(2PI), close)  
> sequences. And then a clip again. Is the problem that the outer  
> bounds and all of these sub circles needed to part of the same path  
> at the time I send clip?
>
> I'll see if I can't try to concoct that and cross my fingers.

Yup, that was it. Has to be part of the same path. It would be handy  
if one could query the path that was used to set the clip. But I  
assume that's lost after the clip.

--
Travis Griggs
Objologist
"Only one thing is impossible for God: to find any sense in any  
copyright law on the planet." - Mark Twain


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/cairo/attachments/20070428/8d1f0274/attachment.html


More information about the cairo mailing list