๐ŸŒ€CGSize

import SwiftUI

// ๐ŸŒ€CGSize + ๐Ÿ…ฟ๏ธ Rectangular
extension CGSize: Rectangular {
    public var origin: CGPoint { .zero }
    public var size  : CGSize  {  self }
}

// ๐ŸŒ€CGSize + ๐Ÿ…ฟ๏ธ Vector2D
extension CGSize: Vector2D {
    public var x: CGFloat { width }
    public var y: CGFloat { height }
    public init(x: CGFloat, y: CGFloat) { 
        self.init(width: x, height: y) 
    }
}

Last updated