Re: Flipping coordinate system of a CALayer
Re: Flipping coordinate system of a CALayer
- Subject: Re: Flipping coordinate system of a CALayer
- From: Oleg Krupnov <email@hidden>
- Date: Fri, 16 Jul 2010 11:48:36 +0300
Further investigation has shown that when the custom layer-hosting
view is placed in the parent layer-backed container view, the parent
view internally discards the flipping transform of the child view's
root layer on each call to its -setFrame (which can be quite often).
I have cured this problem by subclassing CALayer of the root layer of
the custom layer-hosting view and overriding its following methods:
- (void)setTransform:(CATransform3D)m
{
CATransform3D flipTransform = CATransform3DIdentity;
flipTransform.m22 = -1.0;
[super setTransform:flipTransform];
}
- (void)setAnchorPoint:(CGPoint)point
{
[super setAnchorPoint:CGPointMake(0.0, 1.0)];
}
This seems to work pretty well so far. If I come up with any problem,
I'll post it here.
And also it doesn't seem like a bad hack (unlike calling private
methods). What do you think?
Thanks,
On Fri, Jul 16, 2010 at 7:01 AM, Scott Anguish <email@hidden> wrote:
>
> On Jul 15, 2010, at 1:24 PM, Kyle Sluder wrote:
>
>> On Thu, Jul 15, 2010 at 9:18 AM, Oleg Krupnov <email@hidden> wrote:
>>> Is this a bug? And how to work around it?
>>
>> There are lots of bugs with flipped layer-hosting views inside of
>> layer-backed views.. See this thread:
>> http://lists.apple.com/archives/cocoa-dev/2010/May/msg00988.html
>>
>> The only workaround I was able to get working was to call a private
>> AppKit method to fix up the layer geometry.
>>
>
> Which is a no-no, and shouldn’t be done. Bad Kyle. No biscuit.
>
>
_______________________________________________
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