Permalink
Browse files

Honor 'sublayerTransform' property when rendering sublayers

  • Loading branch information...
jspahrsummers committed Sep 19, 2011
1 parent 0aa0788 commit 4c97580dfb84b2bb40450cb5eba588a16e9f6bb1
Showing with 6 additions and 0 deletions.
  1. +6 −0 Framework/MoreAnimation/MoreAnimation/Classes/MALayer.m
@@ -1021,8 +1021,14 @@ - (void)renderSublayer:(MALayer *)sublayer inContext:(CGContextRef)context allow
@autoreleasepool {
CGContextSaveGState(context);
+ // apply the necessary transformations to get to the sublayer
CGAffineTransform affineTransform = [self affineTransformToLayer:sublayer];
CGContextConcatCTM(context, affineTransform);
+
+ // now apply any sublayer transform that's been set
+ CGAffineTransform sublayerTransform = CATransform3DGetAffineTransform(self.sublayerTransform);
+ CGContextConcatCTM(context, sublayerTransform);
+
[sublayer renderInContext:context allowCaching:allowCaching];
CGContextRestoreGState(context);

0 comments on commit 4c97580

Please sign in to comment.