bezierPathByReversingPath
パスを逆向きにして新しいベジエパスオブジェクトを作って返します
解説
レシーバのパスを逆向きにして新しいベジエパスオブジェクトを作って返します。
(逆というのは、描画順が逆。PostScriptと同じく向きが逆になることで、重なった塗りオブジェクトがくりぬかれます。)
重なった図形が違う描画方向だとくり抜かれる
重なった画像が同じ描画方向だとくり抜かれない
返り値
( NSBezierPath * )
逆にしたパス
引数
フレームワーク
ApplicationKit
クラス
NSBezierPath
使用可能
10.0
参照
例文
//NSViewのサブクラス MyViewのDrawRectに上書き -(void)drawRect:(NSRect)rect { NSBezierPath *thePath = [NSBezierPath bezierPath]; NSBezierPath *revPath = [NSBezierPath bezierPath]; [thePath appendBezierPath:[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(50,50,150,100)]]; [[NSColor redColor] set]; [revPath appendBezierPath:[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(60,60,100,100)]]; revPath = [revPath bezierPathByReversingPath]; [thePath appendBezierPath:revPath]; [[NSColor redColor] set]; [thePath fill]; }