macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

setFlatness:

INDEX>AppKit>NSBezier

レシーバーの平坦さをセットします

Objective-C

Swift


    
-(void)setFlatness:(float)flatness:

解説

レシーバーの平坦さをセットします。

返り値

Objective-C

Swift


    
( void )

なし

引数

Objective-C

Swift


    
( float )flatness

平滑度

フレームワーク

ApplicationKit

クラス

NSBezierPath

使用可能

10.0

参照

- flatness
+ setDefaultFlatness:

関連記事(外部サイト)

例文

Objective-C

#import "MyView.h"

@implementation MyView

//NSViewのサブクラス MyViewのDrawRectに上書き
-(void)drawRect:(NSRect)rect
{

NSBezierPath *thePath = [NSBezierPath bezierPath];

[NSBezierPath setDefaultLineJoinStyle:NSBevelLineJoinStyle];

[thePath moveToPoint:NSMakePoint(20,20)];
[thePath lineToPoint:NSMakePoint(120,120)];
[thePath lineToPoint:NSMakePoint(40,20)];


[thePath appendBezierPathWithRect:NSMakeRect(50,50,100,100)];
[thePath setFlatness:0.5];
[thePath setLineWidth:5];
[[NSColor redColor] set];

[thePath stroke];
NSLog([NSString stringWithFormat:@"%.1f",[thePath flatness]]);

}

@end

Swift


    

更新時バージョン

10.10