I have a NSButton
sibling on top of a NSImageView
.
Whenever I click the window, there are some rendering issues. It looks like this:
As you can see, the white edges are the problem.
Strangely, this problem even persists if I override drawRect:
.
Nothing gets rendered at all, but whenever I click it, those white edges appear.
Also, when the background-image changes, the button gets redrawn and the edges disappear.
Any idea what might cause this?
I found out that this actually happens with every single instance of NSView
and it actually clears part of the buffer (you can see the desktop wallpaper):
I also just found out that this does not happen if I layer-back the windows content-view.
Well, this question was impossible for anyone to answer.
My window had a custom contentView
, which was just drawing a view with rounded corners.
Instead of using self.bounds
, I used dirtyRect
to draw the background.
So when the contentView
wanted to redraw the background of the controls that were updated, those rounded corners were cut out.