• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Drawing in a view with alpha < 1.0 shows windows behind
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Lee Ann Rucker <email@hidden>
  • Date: Tue, 31 Mar 2015 22:38:04 +0000
  • Thread-topic: Drawing in a view with alpha < 1.0 shows windows behind

It also depends on your window’s transparency settings, which you don’t always control - Apple changed that on the window that holds the toolbar accessory in fullscreen, changing my patterned grab zone into a bunch of tiny ungrabbable holes :(

On Mar 31, 2015, at 2:53 PM, Eyal Redler <email@hidden> wrote:

> Thanks Uli, Using
> NSRectFillUsingOperation( box, NSCompositeSourceAtop )
> did the trick.
>
> Thanks to all who answered. I've been developing for mac for over 20 years and I find it really odd that I've never came across this behaviour.
>
> Eyal
>
>
>> On Mar 31, 2015, at 4:42 PM, Uli Kusterer <email@hidden> wrote:
>>
>>
>>> On 31 Mar 2015, at 14:39, Eyal Redler <email@hidden> wrote:
>>> I'm working on a custom view. I'm using the following code to draw the view
>>>
>>> 	[[NSColor colorWithDeviceRed:(float)42/255
>>> 						   green:(float)49/255
>>> 							blue:(float)58/255
>>> 						   alpha:0.5] set];
>>> 	NSRectFill([self bounds]);
>>>
>>> 	[[NSColor colorWithDeviceRed:(float)242/255
>>> 						   green:(float)110/255
>>> 							blue:(float)80/255
>>> 						   alpha:1.0] set];
>>>
>>> 	NSFrameRect([self bounds]);
>>
>> NSRectFill uses the context's default compositing operation, which usually is NSCompositeCopy. You probably want to use NSRectFillUsingOperation( box, NSCompositeSourceAbove ) or so. (this is from memory, it might be a different compositing mode, but it's definitely not "Copy")
>
> _______________________________________________
>
> 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


_______________________________________________

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


References: 
 >Re: Drawing in a view with alpha < 1.0 shows windows behind (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Re: NSAppleScript Problem
  • Next by Date: Bundle ID not found while Submitting App for Validation...
  • Previous by thread: Re: Drawing in a view with alpha < 1.0 shows windows behind
  • Next by thread: Re: Drawing in a view with alpha < 1.0 shows windows behind
  • Index(es):
    • Date
    • Thread