Changeset 14 for trunk/Cocoa/F-Script Anywhere/Source/NJRLabeledImageCell.m
- Timestamp:
- 10/20/02 04:41:17 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cocoa/F-Script Anywhere/Source/NJRLabeledImageCell.m
r7 r14 96 96 - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { 97 97 if (image != nil) { 98 NSSize imageSize , repSize;98 NSSize imageSize; 99 99 NSRect imageFrame; 100 NSArray *imageReps;101 int i, repCount;102 100 NSImageRep *preferredRep, *rep; 103 101 … … 107 105 if (preferredRep != nil && abs([preferredRep size].width - imageSize.width) < 1 && abs([preferredRep size].height != imageSize.height) < 1) { 108 106 [self setImage: [imageCacheSource cachedImage]]; 109 // NSLog(@"%@ accepting cached image: %@", [self stringValue], preferredRep);107 FSALog(@"%@ accepting cached image: %@", [self stringValue], preferredRep); 110 108 } else { 111 // NSLog(@"%@ rejecting cached image: %@", [self stringValue], preferredRep); 112 imageReps = [image representations]; 113 repCount = [imageReps count]; 109 NSArray *imageReps = [image representations]; 110 int i, repCount = [imageReps count]; 111 NSSize repSize; 112 114 113 preferredRep = [imageReps objectAtIndex: 0]; 114 FSALog(@"%@ rejecting cached image: %@", [self stringValue], preferredRep); 115 115 for (i = 1 ; i < repCount ; i++) { 116 116 rep = [imageReps objectAtIndex: i]; … … 140 140 */ 141 141 // Begin workaround code for bug in OS X 10.1 (removeRepresentation: has no effect) 142 // This uses a lot more memory because the icons aren't shared - punting.143 142 if ([preferredRep size].width > imageSize.width || [preferredRep size].height > imageSize.height) { 144 143 NSImage *scaledImage = [[NSImage alloc] initWithSize: imageSize]; 145 144 NSRect rect = { NSZeroPoint, imageSize }; 146 // NSLog(@"rescaling %@", [self stringValue]); 145 FSALog(@"rescaling %@", [self stringValue]); 146 [scaledImage setFlipped: [controlView isFlipped]]; // XXX this works, but is correct? 147 147 [scaledImage lockFocus]; 148 148 [preferredRep drawInRect: rect];
Note:
See TracChangeset
for help on using the changeset viewer.