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 (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