Created
October 20, 2009 18:13
-
-
Save tolmasky/214474 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSRect rect = [self bounds]; | |
CGRect bounds = CGRectInset(*(CGRect *)&rect, SHADOW_HORIZONTAL_INSET - 0.5, SHADOW_VERTICAL_INSET - 0.5); | |
NSShadow * shadow = [[NSShadow alloc] init]; | |
[shadow setShadowColor:[NSColor colorWithCalibratedWhite:0.0 alpha:0.5]]; | |
[shadow setShadowOffset:NSMakeSize(0.0, -10.0)]; | |
[shadow setShadowBlurRadius:100.0]; | |
[[NSColor whiteColor] setFill]; | |
[[NSColor colorWithCalibratedWhite:0.0 alpha:0.2] setStroke]; | |
CGContextBeginPath(context); | |
CGContextAddArc(context, CGRectGetMinX(bounds) + 5.0, CGRectGetMaxY(bounds) - 5.0, 5.0, M_PI, M_PI_2, YES); | |
CGContextAddArc(context, CGRectGetMaxX(bounds) - 5.0, CGRectGetMaxY(bounds) - 5.0, 5.0, M_PI_2, 0, YES); | |
CGContextAddLineToPoint(context, CGRectGetMaxX(bounds), CGRectGetMinY(bounds)); | |
CGContextAddLineToPoint(context, CGRectGetMinX(bounds), CGRectGetMinY(bounds)); | |
CGContextClosePath(context); | |
CGContextDrawPath(context, kCGPathFillStroke); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment