         }
     }
 
+    /// Modifies all values by setting the size while centering the rect.
     public mutating func setSizeCentered(size: CGSize) {
         self = rectByCentering(size)
     }
 
+    /// Modifies all values by setting the size while centering the rect touching the specified edge.
     public mutating func setSizeCentered(size: CGSize, alignTo edge: CGRectEdge) {
         self = rectByCentering(size, alignTo: edge)
     }
 
+    /// Modifies all values by setting the size while centering the rect touching the specified corner.
     public mutating func setSizeAligned(size: CGSize, corner e1: CGRectEdge, _ e2: CGRectEdge) {
         self = rectByAligning(size, corner: e1, e2)
     }


    // MARK: edges

    public var left: CGFloat {
        get {return origin.x}
        set {origin.x = newValue}
    }
    public var right: CGFloat {
        get {return x + width}
        set {x = newValue - width}
    }

    #if os(iOS)
    public var top: CGFloat {
        get {return y}
        set {y = newValue}
    }
    public var bottom: CGFloat {
        get {return y + height}
        set {y = newValue - height}
    }
    #else
    public var top: CGFloat {
        get {return y + height}
        set {y = newValue - height}
    }
    public var bottom: CGFloat {
        get {return y}
        set {y = newValue}


extension CGRect {

    /// Creates a rect with unnamed arguments.
    public init(_ origin: CGPoint, _ size: CGSize) {
        self.origin = origin
        self.size = size
    }

    /// Creates a rect with unnamed arguments.
    public init(_ x: CGFloat, _ y: CGFloat, _ width: CGFloat, _ height: CGFloat) {
        self.origin = CGPoint(x: x, y: y)
        self.size = CGSize(width: width, height: height)
