controlPointBounds
制御点も含むレシーバーのパスのボックスを返します
@property(readonly) NSRect controlPointBoundsvar controlPointBounds: NSRect { get }
解説
制御点も含むレシーバーのパスのボックスを返します。
サンプル 緑の矩形がcontrolPointBounds
設定値
矩形
Objective-C@property(readonly) NSRect controlPointBoundsvar controlPointBounds: NSRect { get }
フレームワーク
ApplicationKit
クラス
NSBezierPath
使用可能
10.0
例文
#import "MyView.h" @implementation MyView //NSViewのサブクラス MyViewのDrawRectに上書き -(void)drawRect:(NSRect)rect { NSRect pathBounds; NSBezierPath *thePath1 = [NSBezierPath bezierPath]; [thePath1 setWindingRule:NSEvenOddWindingRule]; [thePath1 moveToPoint:NSMakePoint(20,20)]; [thePath1 appendBezierPathWithOvalInRect:NSMakeRect(50,50,100,100)]; [thePath1 appendBezierPathWithOvalInRect:NSMakeRect(20,20,80,80)]; [[NSColor redColor] set]; [thePath1 fill]; pathBounds = [thePath1 controlPointBounds]; NSLog([NSString stringWithFormat:@"x:%.1fy:,%.1f,width:%.1f,height:%.1f",pathBounds.origin.x,pathBounds.origin.y,pathBounds.size.width,pathBounds.size.height]); } @end