This commit is contained in:
Trey t
2025-12-09 23:37:04 -06:00
parent 3a10b4b8d6
commit f2565678be
1587 changed files with 7747 additions and 647 deletions

View File

@@ -0,0 +1,31 @@
//
// DiamondView.swift
// Feels
//
// Created by Trey Tartt on 3/20/22.
//
import SwiftUI
struct Diamond:Shape {
func path(in rect: CGRect) -> Path {
var path = Path()
// get the center of the rect
let center = CGPoint(x: rect.midX, y: rect.midY)
// get the starting of our drawing the right side of our diamond
let startingPoint = CGPoint(x: rect.maxX, y: center.y)
// move our start of drawing to the beggining point
path.move(to: startingPoint)
// distance / 2 is our height
// create all our points
let secondPoint = CGPoint(x: center.x, y: rect.maxY)
let thirdPoint = CGPoint(x: rect.minX , y: center.y)
let fourthPoint = CGPoint(x: center.x, y: rect.minY)
path.addLine(to: secondPoint)
path.addLine(to: thirdPoint)
path.addLine(to: fourthPoint)
path.addLine(to: startingPoint)
return path
}
}