我有一个带有 NSView 的 NSWindow(存储在笔尖中):
我正在尝试将 BezierPath 添加到该视图的图层(self.view2):
CAShapeLayer* circleLayer = [CAShapeLayer layer];
[self.view2 setLayer:circleLayer];
circleLayer.fillColor = [NSColor redColor].CGColor;
circleLayer.path = [NSBezierPath bezierPathWithOvalInRect:self.view2.bounds].quartzPath;
circleLayer.strokeColor = [NSColor blueColor].CGColor;
circleLayer.strokeStart = 0.0f;
circleLayer.strokeEnd = 0.5f;
circleLayer.lineWidth = 5.0f;
circleLayer.transform = CATransform3DMakeRotation(135.0 / 180.0 * M_PI, 0.0, 0.0, 1.0);
这是我回来的:
为什么生成的视图没有正确对齐(即右上角,就像它在我的笔尖上一样)?