1
如标题所示,适用于我的NSBezierPath
的setLineDash
不会更改描边线。根本没有效果。NSBezierPath setLineDash不会产生任何效果
我期望它能让我的线条破灭。在图片上看到两条垂直的红线。
代码:
NSBezierPath* p= [NSBezierPath bezierPath];
CGFloat x = r.origin.x + r.size.width/2;
float dash_pattern[]={15.,15.};
NSInteger count = sizeof(dash_pattern)/sizeof(dash_pattern[0]);
[p setLineDash:(CGFloat*)dash_pattern count:count phase:0.]; // no effect ?
[p moveToPoint:NSMakePoint(x, r.origin.y+r.size.height)];
[p lineToPoint:NSMakePoint(x, [view bounds].origin.y+[view bounds].size.height)];
[[NSColor redColor]set];
[p stroke];
HOLY CRAP。工作。 – LiMar
你已经救了我的一天,哥们! –