Hole Punching

Just a reminder note for if I ever run into the issue (or want the effect).  NSRectFill sets the current color to the pixels of a rect replacing anything below them.  So if you use a color with an alpha value less then 1, a “hole” will be punched completely through the window.  An NSBezierPath ([[NSBezierPath bezierPathWithRect: rect] fill]) or NSRectFillUsingOperation(NSRect aRect, 
NSCompositingOperation op) should be used instead.

Leave a Reply