Re: Drawing in a view with alpha < 1.0 shows windows behind
Re: Drawing in a view with alpha < 1.0 shows windows behind
- Subject: Re: Drawing in a view with alpha < 1.0 shows windows behind
- From: Mike Abdullah <email@hidden>
- Date: Tue, 31 Mar 2015 16:14:48 +0100
> On 31 Mar 2015, at 15:59, Charles Jenkins <email@hidden> wrote:
>
> I confused the view with the color, but in essence that’s what I was afraid you were saying: that Yosemite is blending with unrelated content instead of what is layered by your app/view/window/whatever “under” the rectangle you’re trying to fill.
>
> I believe you should file a bug report on this.
Nope, this is the intended design.
The standard drawing model for Cocoa on OS X is that views draw into a single context for the whole window. Normally then views draw their content *atop* any existing content, so as to build up the correct result. e.g. you composite a translucent colour *over* the existing graphics there.
By using NSRectFill you are instead *replacing* whatever is there with your translucent colour. Consequently, whatever is behind the window is now free to appear through that translucency. As Uli said, you want to use a different compositing operation, to give the correct result.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden