I am adding a special CALayer to the layer of my NSView. I can create my 
special CALayer, configure it, and add it the center of my NSView layer's 
heir-achy perfectly fine. However, as soon as I resize my main view, the 
special CALayer's bounds change. I specified the following autoresizing mask 
for my centered layer:



_playLayer = [PlayerButtons genericPlayButton];

[_playLayer setAutoresizingMask:kCALayerMinXMargin | kCALayerMaxXMargin | 
kCALayerMinYMargin | kCALayerMaxYMargin];

[_playLayer setPosition:CGPointMake(CGRectGetMidX([[self layer] frame]), 

                                                CGRectGetMidY([[self layer] 
frame]))]; 

According to this code, the CALayer should be centered, and as the NSView's 
bounds change, the CALayer's frame should adjust to stay centered in the view 
while the layer's bounds don't change. However, my special CALayer's bounds 
grow as I expand my main view.



Patrick


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to