X-Git-Url: http://git.ithinksw.org/ITKit.git/blobdiff_plain/bec169d590a50f357ce6227732fcbd8111e6aa3d..22ddc2ccf5a32acf25445656e9c14e22a62835c9:/ITTSWBackgroundView.m diff --git a/ITTSWBackgroundView.m b/ITTSWBackgroundView.m index e0b1b6e..94731aa 100755 --- a/ITTSWBackgroundView.m +++ b/ITTSWBackgroundView.m @@ -1,33 +1,45 @@ - #import "ITGrayRoundedView.h" +#import "ITGrayRoundedView.h" @implementation ITGrayRoundedView +- (id)initWithFrame:(NSRect)frameRect +{ + if ( (self = [super initWithFrame:frameRect]) ) { + _path = [[NSBezierPath bezierPath] retain]; + } + + return self; +} + - (void)drawRect:(NSRect)theRect { - NSBezierPath *path = [NSBezierPath bezierPath]; float vh = NSHeight(theRect); float vw = NSWidth(theRect); - [path moveToPoint:NSMakePoint( 0.0, (vh - 24.0) )]; // first point - [path curveToPoint:NSMakePoint( 24.0, vh ) + + [_path autorelease]; + _path = [[NSBezierPath bezierPath] retain]; + + [_path moveToPoint:NSMakePoint( 0.0, (vh - 24.0) )]; // first point + [_path curveToPoint:NSMakePoint( 24.0, vh ) controlPoint1:NSMakePoint( 0.0, (vh - 11.0) ) controlPoint2:NSMakePoint( 11.0, vh )]; // top-left curve - [path lineToPoint:NSMakePoint( (vw - 24.0), vh )]; // top line - [path curveToPoint:NSMakePoint( vw, (vh - 24.0) ) + [_path lineToPoint:NSMakePoint( (vw - 24.0), vh )]; // top line + [_path curveToPoint:NSMakePoint( vw, (vh - 24.0) ) controlPoint1:NSMakePoint( (vw - 11.0), vh ) controlPoint2:NSMakePoint( vw, (vh - 11.0) )]; // top-right curve - [path lineToPoint:NSMakePoint( vw, 24.0 )]; // right line - [path curveToPoint:NSMakePoint( (vw - 24.0), 0.0 ) + [_path lineToPoint:NSMakePoint( vw, 24.0 )]; // right line + [_path curveToPoint:NSMakePoint( (vw - 24.0), 0.0 ) controlPoint1:NSMakePoint( vw, 11.0 ) controlPoint2:NSMakePoint( (vw - 11.0), 0.0 )]; // bottom-right curve - [path lineToPoint:NSMakePoint( 24.0, 0.0 )]; // bottom line - [path curveToPoint:NSMakePoint( 0.0, 24.0 ) + [_path lineToPoint:NSMakePoint( 24.0, 0.0 )]; // bottom line + [_path curveToPoint:NSMakePoint( 0.0, 24.0 ) controlPoint1:NSMakePoint( 11.0, 0.0 ) controlPoint2:NSMakePoint( 0.0, 11.0 )]; // bottom-left curve - [path closePath]; // left line + [_path closePath]; // left line [[NSColor colorWithCalibratedWhite:0.0 alpha:0.15] set]; - [path fill]; + [_path fill]; } - (BOOL)isOpaque