Source/Bit.m
changeset 23 efe5d4523a23
parent 16 28392c9a969f
     1.1 --- a/Source/Bit.m	Mon Jul 14 21:00:15 2008 -0700
     1.2 +++ b/Source/Bit.m	Thu Jul 31 13:23:44 2008 -0700
     1.3 @@ -79,6 +79,12 @@
     1.4          forKeyPath: @"transform.scale"];
     1.5  }
     1.6  
     1.7 +- (void) scaleBy: (CGFloat)scale
     1.8 +{
     1.9 +    self.transform = CATransform3DConcat(self.transform,
    1.10 +                                         CATransform3DMakeScale(scale, scale, scale));
    1.11 +}
    1.12 +
    1.13  
    1.14  - (int) rotation
    1.15  {
    1.16 @@ -101,16 +107,19 @@
    1.17  - (void) setPickedUp: (BOOL)up
    1.18  {
    1.19      if( up != _pickedUp ) {
    1.20 -        CGFloat shadow, radius, opacity, z, scale;
    1.21 +        CGFloat shadow, radius, opacity, z;
    1.22          CGSize offset;
    1.23 +        CATransform3D transform;
    1.24 +        
    1.25          if( up ) {
    1.26              shadow = 0.8;
    1.27              offset = CGSizeMake(2,2);
    1.28              radius = 8;
    1.29              opacity = kPickedUpOpacity;
    1.30 -            scale = kPickedUpScale;
    1.31              z = kPickedUpZ;
    1.32              _restingZ = self.zPosition;
    1.33 +            _restingTransform = self.transform;
    1.34 +            transform = CATransform3DScale(_restingTransform, kPickedUpScale, kPickedUpScale, kPickedUpScale);
    1.35  #if !TARGET_OS_IPHONE
    1.36              _restingShadowOpacity = self.shadowOpacity;
    1.37              _restingShadowOffset  = self.shadowOffset;
    1.38 @@ -123,7 +132,7 @@
    1.39              radius = _restingShadowRadius;
    1.40  #endif
    1.41              opacity = 1;
    1.42 -            scale = 1.0/kPickedUpScale;
    1.43 +            transform = _restingTransform;
    1.44              z = _restingZ;
    1.45          }
    1.46  
    1.47 @@ -134,7 +143,7 @@
    1.48          self.shadowRadius = radius;
    1.49  #endif
    1.50          self.opacity = opacity;
    1.51 -        self.scale *= scale;
    1.52 +        self.transform = transform;
    1.53          _pickedUp = up;
    1.54      }
    1.55  }