Source/GGBLayer.m
changeset 15 73f8c889f053
parent 14 4585c74d809c
child 16 28392c9a969f
     1.1 --- a/Source/GGBLayer.m	Tue Jul 08 20:32:52 2008 -0700
     1.2 +++ b/Source/GGBLayer.m	Wed Jul 09 17:07:45 2008 -0700
     1.3 @@ -124,6 +124,30 @@
     1.4  }
     1.5  
     1.6  
     1.7 +- (CATransform3D) aggregateTransform
     1.8 +{
     1.9 +    CATransform3D xform = CATransform3DIdentity;
    1.10 +    for( CALayer *layer=self; layer; layer=layer.superlayer ) {
    1.11 +        xform = CATransform3DConcat(layer.transform,xform);
    1.12 +        xform = CATransform3DConcat(layer.sublayerTransform,xform);
    1.13 +    }
    1.14 +    return xform;
    1.15 +}
    1.16 +
    1.17 +
    1.18 +NSString* StringFromTransform3D( CATransform3D xform )
    1.19 +{
    1.20 +    NSMutableString *str = [NSMutableString string];
    1.21 +    const CGFloat *np = (const CGFloat*)&xform;
    1.22 +    for( int i=0; i<16; i++ ) {
    1.23 +        if( i>0 && (i%4)==0 )
    1.24 +            [str appendString: @"\n"];
    1.25 +        [str appendFormat: @"%7.2f ", *np++];
    1.26 +    }
    1.27 +    return str;
    1.28 +}
    1.29 +
    1.30 +
    1.31  
    1.32  #if TARGET_OS_IPHONE
    1.33