UIBezierPath 视觉错误?
UIBezierPath visual error?
我正在绘制带有 UIBezierPath
的形状,我的 Arc 有问题,我正在向您展示我的代码:
...
rightUpPath.move(to: CGPoint(x: 0, y: height/2))
rightUpPath.addArc(withCenter: CGPoint(x: cornerRadiusView, y: height - cornerRadiusView),
radius: cornerRadiusView,
startAngle: .pi,
endAngle: (.pi * 2) / 3,
clockwise: false)
rightUpPath.addLine(to: CGPoint(x: self.bounds.size.width - cornerRadiusView, y: height))
...
考虑到高度等于 40,cornerRadiusView = 10。Arc 的底部通常等于形状的底部,但这向我展示了这个:
我希望圆弧的底部等于灰色形状的高度,有人能告诉我哪里做错了吗?
好吧,我的问题很愚蠢:
我改变我的endAngle: (.pi * 2) / 3
至 endAngle: .pi / 2
...
我正在绘制带有 UIBezierPath
的形状,我的 Arc 有问题,我正在向您展示我的代码:
...
rightUpPath.move(to: CGPoint(x: 0, y: height/2))
rightUpPath.addArc(withCenter: CGPoint(x: cornerRadiusView, y: height - cornerRadiusView),
radius: cornerRadiusView,
startAngle: .pi,
endAngle: (.pi * 2) / 3,
clockwise: false)
rightUpPath.addLine(to: CGPoint(x: self.bounds.size.width - cornerRadiusView, y: height))
...
考虑到高度等于 40,cornerRadiusView = 10。Arc 的底部通常等于形状的底部,但这向我展示了这个:
我希望圆弧的底部等于灰色形状的高度,有人能告诉我哪里做错了吗?
好吧,我的问题很愚蠢:
我改变我的endAngle: (.pi * 2) / 3
至 endAngle: .pi / 2
...