我想在NSImage上做一个圆角矩形轮廓,我想使用NSBezierPath是最好的方法.然而,我遇到了一个问题:我得到了这个:而不是绘制一条漂亮的曲线:

由于我无法理解的原因,NSBezierPath正在绘制比其余部分颜色更深的圆角部分.
这是我正在使用的代码(在drawRect中:在自定义视图上调用):
NSBezierPath* bp = [NSBezierPath bezierPathWithRoundedRect: self.bounds xRadius: 5 yRadius: 5];
[[[NSColor blackColor] colorWithAlphaComponent: 0.5] setStroke];
[bp stroke];
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
如果我将路径插入0.5,一切都很好.但是,当我将路径偏移10个像素(例如)时,为什么会得到这个?

如果我理解正确的话,它也应该画一条细线......