CALayer contentScale initialization, where to do it?
CALayer contentScale initialization, where to do it?
- Subject: CALayer contentScale initialization, where to do it?
- From: Markus Spoettl <email@hidden>
- Date: Sat, 16 Jun 2012 13:13:15 +0200
Hello,
I have a number of layer hosting custom views (which are all delegate-drawn)
and I'm pulling my hair out to find a good place to initialize the contentScale
layer property.
I usually create the layers (if there's a fixed number of them) in the view's
-initWithFrame:. At that point the view doesn't have a window, so I can't set
contentScale correctly (by getting the window's backingScaleFactor).
One place would be -viewDidMoveToWindow: but I hope there's a better way. For
some views the layer hierarchies and ownerships are complicated and dynamic and
getting the window's backingScaleFactor would require unwanted links back to the
view through a complex object hierarchy in order to get that value.
The comment on -layer:shouldInheritContentsScale:fromWindow: in the
NSLayerDelegateContentsScaleUpdating informal protocol (new in 10.7.4 I think,
NSView.h line 405) seems to indicate the existence of a property or method named
initialContentsScale, though I can't find any mention anywhere else.
Any ideas?
Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________
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