Created
April 4, 2010 17:58
-
-
Save cacaodev/355567 to your computer and use it in GitHub Desktop.
issue #585
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
- (void)drawRect:(CGRect)rect | |
{ | |
var ctx = [[CPGraphicsContext currentContext] graphicsPort]; | |
CGContextSetFillColor(ctx, [CPColor redColor]); | |
var path = CGPathCreateMutable(); | |
CGPathAddRect(path,NULL,CGRectMake(10,10,50,50)); | |
CGContextAddPath(ctx, path); | |
CGContextFillPath(ctx); | |
CGContextSetFillColor(ctx, [CPColor blueColor]) | |
path = CGPathCreateMutable(); | |
CGPathAddRect(path,NULL,CGRectMake(80,10,50,50)); | |
CGContextAddPath(ctx, path); | |
CGContextFillPath(ctx); | |
} |
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
- (void)drawRect:(NSRect)rect | |
{ | |
CGContextRef ctx = [[NSGraphicsContext currentContext] graphicsPort]; | |
CGContextSetRGBFillColor(ctx, 1, 0, 0, 1); | |
CGMutablePathRef path = CGPathCreateMutable(); | |
CGPathAddRect(path,NULL,CGRectMake(10,10,50,50)); | |
CGContextAddPath(ctx, path); | |
CGContextFillPath(ctx); | |
CGContextSetRGBFillColor(ctx, 0, 0, 1, 1); | |
path = CGPathCreateMutable(); | |
CGPathAddRect(path,NULL,CGRectMake(80,10,50,50)); | |
CGContextAddPath(ctx, path); | |
CGContextFillPath(ctx); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment