On Jan 3, 2013, at 12:46 AM, Markus Spoettl <ms_li...@shiftoption.com> wrote:

> Hello,
> 
>  I'm having a hard time understanding a problem with CALayer's 
> -renderInContext:
> 
> I have a custom UIView with custom delegate-drawn sublayers. Almost 
> everything renders correctly when I do this:
> 
> [[view layer] renderInContext:aContext];
> 
> (the context is set up correctly and produces the expected result - an 
> image). But some parts of the original view (which is visible on screen when 
> rendering) are missing.
> 
> I've been debugging this one for quite a while until I realized that missing 
> layers are not missing but somehow their zPosition got messed up so they 
> ended up below another sibling layer.
> 
> Since the affected layers need to be siblings in the same parent layer I 
> can't fix this by making them sub-layers to enforce the hierarchy.
> 
> Why does this happen and how can I fix it?


My best guess would be that -renderInContext: always renders in the same order 
you get from the -sublayers array, without the zPosition sorting you get on 
display. This is probably a bug, but your best work around would be to sort the 
sublayers array yourself rather than relying upon zPosition to do so.
--
David Duncan


_______________________________________________

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