Adium

Changeset 21559

Show
Ignore:
Timestamp:
11/07/2007 01:26:45 AM (1 year ago)
Author:
boredzo
Message:

Reverted r21558, which was definitely faster, but unfixed #8181. Refs #8181.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Frameworks/AIUtilities Framework/Source/AIImageAdditions.m

    r21558 r21559  
    212212- (NSImage *)imageByScalingToSize:(NSSize)size fraction:(float)delta flipImage:(BOOL)flipImage proportionally:(BOOL)proportionally allowAnimation:(BOOL)allowAnimation 
    213213{ 
    214         [self setDataRetained:YES]; 
    215214        NSSize  originalSize = [self size]; 
    216215         
     
    233232                        } 
    234233                } 
    235                  
     234 
     235                NSImage *imageToDraw = [self copy]; 
     236 
    236237                newRect = NSMakeRect(0,0,size.width,size.height); 
    237238                newImage = [[NSImage alloc] initWithSize:size]; 
     
    241242                NSImageRep      *bestRep; 
    242243                if (allowAnimation && 
    243                         (bestRep = [self bestRepresentationForDevice:nil]) && 
     244                        (bestRep = [imageToDraw bestRepresentationForDevice:nil]) && 
    244245                        [bestRep isKindOfClass:[NSBitmapImageRep class]] &&  
    245246                        (delta == 1.0) && 
     
    252253                        //Highest quality interpolation 
    253254                        [[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationHigh]; 
    254                         [self drawInRect:newRect 
    255                                        fromRect:NSMakeRect(0,0,originalSize.width,originalSize.height) 
    256                                   operation:NSCompositeCopy 
    257                                        fraction:delta]; 
     255                        [imageToDraw drawInRect:newRect 
     256                                       fromRect:NSMakeRect(0,0,originalSize.width,originalSize.height) 
     257                                      operation:NSCompositeCopy 
     258                                       fraction:delta]; 
    258259                         
    259260                        [newImage unlockFocus]; 
    260261                } 
     262 
     263                [imageToDraw release]; 
    261264 
    262265                return [newImage autorelease];