         }
     }
 
+    /// 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)
     }

        }
    }

    public func rectByAligning(size: CGSize, corner e1: CGRectEdge, _ e2: CGRectEdge) -> CGRect {
        return CGRect(origin: alignedOrigin(size, corner: e1, e2), size: size)
    }


    // MARK: edges

    /// Alias for origin.x.
    public var left: CGFloat {
        get {return origin.x}
        set {origin.x = newValue}
    }
    /// Accesses origin.x + size.width.
    public var right: CGFloat {
        get {return x + width}
        set {x = newValue - width}
    }

    #if os(iOS)
    /// Alias for origin.y.
    public var top: CGFloat {
        get {return y}
        set {y = newValue}
    }
    /// Accesses origin.y + size.height.
    public var bottom: CGFloat {
        get {return y + height}
        set {y = newValue - height}
    }
    #else
    /// Accesses origin.y + size.height.
    public var top: CGFloat {
        get {return y + height}
        set {y = newValue - height}
    }
    /// Alias for origin.y.
    public var bottom: CGFloat {
        get {return y}
        set {y = newValue}
