setAssociatedPoints:atIndex:
指定したエレメントを修正します
- (void)setAssociatedPoints:(NSPointArray)points atIndex:(NSInteger)index
func setAssociatedPoints(_ points: NSPointArray, atIndex index: Int)
解説
点であるインデックスでエレメントと結合される点を修正します。
このメソッドは、レシーバーを修正する。
NSBezierPathは、ラインエレメントから成る。
返り値
なし
引数
位置
Objective-C(NSPointArray)pointspoints: NSPointArray
インデックス
Objective-C(NSInteger)indexatIndex index: Int)
フレームワーク
ApplicationKit
クラス
NSBezierPath
使用可能
10.0
参照
例文
#import "MyView.h" @implementation MyView //NSViewのサブクラス MyViewのDrawRectに上書き -(void)drawRect:(NSRect)rect { NSBezierPath *thePath = [NSBezierPath bezierPath]; NSPoint points = NSMakePoint(20.0, 20.0); //[thePath moveToPoint: NSMakePoint(0.0, 0.0)]; //○を描く [thePath appendBezierPathWithOvalInRect:NSMakeRect(50,50,100,100)]; //変更前を描画 [[NSColor blueColor] set]; [thePath stroke]; //○の3つめのポイントをpointsに近づける [thePath setAssociatedPoints: &points atIndex: 3]; //変更後を描画 [[NSColor redColor] set]; [thePath stroke]; } @end