mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-17 16:11:28 +00:00
Removes previous test
This commit is contained in:
@@ -55,44 +55,6 @@
|
||||
|
||||
@end
|
||||
|
||||
@implementation GradientView : CPView
|
||||
{
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
if(self = [super init])
|
||||
{
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)drawRect:(CGRect)aRect
|
||||
{
|
||||
[super drawRect:aRect];
|
||||
|
||||
var context = [[CPGraphicsContext currentContext] graphicsPort],
|
||||
linearGradientPointStart = CGPointMake(0, 50),
|
||||
linearGradientPointEnd = CGPointMake(100, 50),
|
||||
ellipseRect = CGRectMake(110, 10, 80, 80),
|
||||
gradientColors = CGGradientCreateWithColorComponents(CGColorSpaceCreateDeviceRGB(), [236 / 255, 126 / 255, 25 / 255, 1 , 255 / 255, 248 / 255, 197 / 255, 1], [0,1], 2);
|
||||
|
||||
// test CGContextDrawLinearGradient
|
||||
CGContextBeginPath(context);
|
||||
CGContextAddRect(context, CGRectMake(0, 0, 100, 100));
|
||||
CGContextDrawLinearGradient(context, gradientColors, linearGradientPointStart, linearGradientPointEnd, 0);
|
||||
CGContextClosePath(context);
|
||||
|
||||
// test CGContextDrawRadialGradient
|
||||
CGContextBeginPath(context);
|
||||
CGContextAddEllipseInRect(context, ellipseRect);
|
||||
CGContextDrawRadialGradient(context, gradientColors, CGPointMake(CGRectGetMidX(ellipseRect), CGRectGetMidY(ellipseRect)), 0, CGPointMake(CGRectGetMidX(ellipseRect), CGRectGetMidY(ellipseRect)), 40,0);
|
||||
CGContextClosePath(context);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
@@ -115,7 +77,6 @@
|
||||
|
||||
[contentView addSubview:label];
|
||||
[contentView addSubview:[[DiamondView alloc] initWithFrame:CGRectMake(100, 100, 200, 200)]];
|
||||
[contentView addSubview:[[GradientView alloc] initWithFrame:CGRectMake(100, 320, 200, 200)]];
|
||||
|
||||
[theWindow orderFront:self];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user