@implementation MyView
- (void)drawRect:(NSRect)dirtyRect
{
NSGraphicsContext* theContext = [NSGraphicsContext currentContext];
[theContext saveGraphicsState];
{
double d_th= 0.005;
double x= 0.0;
double y= 0.0;
double th= 0.0;
NSBezierPath *path= [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(0, 0)];
while(th<6.0) {
x= x+d_th*cos(th*th);
y= y+d_th*sin(th*th);
th= th + d_th;
[path lineToPoint:NSMakePoint(x, y)];
}
NSAffineTransform *t= [NSAffineTransform transform];
[t scaleBy:300.0];
[[t transformBezierPath:path] stroke];
}
[theContext restoreGraphicsState];
}
@end
NSViewが左下基準をまともに利用したのははじめてかもしれないと思ったw.
0 件のコメント:
コメントを投稿