Trying to find out the best way to add a radius/slightly rounded corners to this diamond shape code. Have tried a few things yielding some pretty odd results. Any help is greatly appreaciated.
struct DiamondShape: Shape {
func path(in rect: CGRect) -> Path {
var path = Path()
let center = CGPoint(x: rect.width / 2, y: rect.height / 2)
path.move(to: CGPoint(x: center.x, y: 0))
path.addLine(to: CGPoint(x: rect.width, y: center.y))
path.addLine(to: CGPoint(x: center.x, y: rect.height))
path.addLine(to: CGPoint(x: 0, y: center.y))
path.addLine(to: CGPoint(x: center.x, y: 0))
return path
}
}