I was a bit tired last night but this is another way I meant to send:
//
// PolicyView.swift
// poliAlpha
//
// Created by Ian Brown on 10/17/24.
//
import SwiftUI
struct Polygon: View {
let cornerRad: CGFloat = 12
var body: some View {
VStack {
let polygonWidth: CGFloat = 100
let polygonHeight: CGFloat = 100
let path = Path { path in
path.move(to: CGPoint(x: 0, y: 0))
path.addLine(to: CGPoint(x: 0, y: polygonHeight))
path.addLine(to: CGPoint(x: polygonWidth, y: polygonHeight))
path.addLine(to: CGPoint(x: polygonWidth, y: 0))
path.closeSubpath()
}
path.fill()
}
}
}
#Preview {
Polygon()
}
Topic:
Graphics & Games
SubTopic:
General
Tags: