Changeset 3881

Show
Ignore:
Timestamp:
03/05/06 19:36:20 (3 years ago)
Author:
morris
Message:

Style

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Footagehead/trunk/FHImage.m

    r3879 r3881  
    234234#pragma mark - 
    235235 
    236  
    237 static inline double radians (double degrees) {return degrees * M_PI/180;} 
    238  
    239236- (void)drawInRect:(NSRect)rect atAngle:(float)angle { 
    240237        NSImageRep              *imageRep; 
    241238        CGContextRef    cgContext; 
    242239        CGRect                  cgRect; 
     240        CGPoint                 cgPoint; 
    243241        BOOL                    restore = NO; 
    244242         
     
    253251                        CGContextScaleCTM(cgContext, 1.0f, -1.0f); 
    254252                } else { 
    255                         float x = rect.origin.x + (rect.size.width / 2.0f); 
    256                         float y = rect.origin.y + (rect.size.height / 2.0f); 
    257                         CGContextTranslateCTM(cgContext, x, y); 
    258                         CGContextRotateCTM(cgContext, radians(angle)); 
    259                         CGContextTranslateCTM(cgContext, -x, -y); 
     253                        cgPoint.x = rect.origin.x + (rect.size.width / 2.0f); 
     254                        cgPoint.y = rect.origin.y + (rect.size.height / 2.0f); 
     255 
     256                        CGContextTranslateCTM(cgContext, cgPoint.x, cgPoint.y); 
     257                        CGContextRotateCTM(cgContext, angle * M_PI / 180.0f); 
     258                        CGContextTranslateCTM(cgContext, -cgPoint.x, -cgPoint.y); 
    260259                } 
    261260