• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Flipping coordinate system of a CALayer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Flipping coordinate system of a CALayer
      • From: Oleg Krupnov <email@hidden>
References: 
 >Flipping coordinate system of a CALayer (From: Oleg Krupnov <email@hidden>)
 >Re: Flipping coordinate system of a CALayer (From: Kyle Sluder <email@hidden>)
 >Re: Flipping coordinate system of a CALayer (From: Scott Anguish <email@hidden>)

  • Prev by Date: Re: Data Protection on iOS 4 with Core Data
  • Next by Date: Re: how to deploy the sqlite file in my Cocoa application installation
  • Previous by thread: [moderator] Re: Flipping coordinate system of a CALayer
  • Next by thread: Re: Flipping coordinate system of a CALayer
  • Index(es):
    • Date
    • Thread