1 #import "ITImageCell.h"
4 @implementation ITImageCell
7 - (id)initImageCell:(NSImage *)image
9 if ( (self = [super initImageCell:image]) ) {
10 _scalesSmoothly = YES;
18 - (void)drawWithFrame:(NSRect)rect inView:(NSView *)controlView
20 NSImageInterpolation interpolation;
22 if ( _scalesSmoothly ) {
23 interpolation = [[NSGraphicsContext currentContext] imageInterpolation];
24 [[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationHigh];
27 [super drawWithFrame:rect inView:controlView];
29 if ( _scalesSmoothly ) {
30 [[NSGraphicsContext currentContext] setImageInterpolation:interpolation];
34 - (BOOL)scalesSmoothly
36 return _scalesSmoothly;
39 - (void)setScalesSmoothly:(BOOL)flag
41 _scalesSmoothly = flag;
42 [[self controlView] setNeedsDisplay:YES];