Changeset 3881
- Timestamp:
- 03/05/06 19:36:20 (3 years ago)
- Files:
-
- Footagehead/trunk/FHImage.m (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Footagehead/trunk/FHImage.m
r3879 r3881 234 234 #pragma mark - 235 235 236 237 static inline double radians (double degrees) {return degrees * M_PI/180;}238 239 236 - (void)drawInRect:(NSRect)rect atAngle:(float)angle { 240 237 NSImageRep *imageRep; 241 238 CGContextRef cgContext; 242 239 CGRect cgRect; 240 CGPoint cgPoint; 243 241 BOOL restore = NO; 244 242 … … 253 251 CGContextScaleCTM(cgContext, 1.0f, -1.0f); 254 252 } 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); 260 259 } 261 260
