     
     // MARK: shortcuts
     
-    public var x: CGFloat
+    var x: CGFloat
         {
         get { return origin.x }
         set { origin.x = newValue }
     }
     
-    public var y: CGFloat
+    var y: CGFloat
         {
         get { return origin.y }
         set { origin.y = newValue }

    
    // MARK: CGRectGet...
    
    public var minX : CGFloat { get { return CGRectGetMinX(self) } }
    public var midX : CGFloat { get { return CGRectGetMidX(self) } }
    public var maxX : CGFloat { get { return CGRectGetMaxX(self) } }
    
    public var minY : CGFloat { get { return CGRectGetMinY(self) } }
    public var midY : CGFloat { get { return CGRectGetMidY(self) } }
    public var maxY : CGFloat { get { return CGRectGetMaxY(self) } }
    
    // MARK: Contains
    
    public func contains(point: CGPoint) -> Bool
    {
        return CGRectContainsPoint(self, point)
    }
    
    public func contains(rect: CGRect) -> Bool
    {
        return CGRectContainsRect(self, rect)
    }
    
    // MARK: Intersects
    
    public func intersects(rect: CGRect) -> Bool
    {
        return CGRectIntersectsRect(self, rect)
    }
    
    // MARK: with
    
    public func with(origin origin: CGPoint) -> CGRect
    {
        return CGRect(origin: origin, size: size)
    }
    
    public func with(center center: CGPoint) -> CGRect
    {
        return CGRect(center: center, size: size)
    }
    
    public func with(x x: CGFloat, y: CGFloat) -> CGRect
    {
        return with(origin: CGPoint(x: x, y: y))
    }
    
    public func with(x x: CGFloat) -> CGRect
    {
        return with(x: x, y: y)
    }
    
    public func with(y y: CGFloat) -> CGRect
    {
        return with(x: x, y: y)
    }
    
    public func with(size size: CGSize) -> CGRect
    {
        return CGRect(origin: origin, size: size)
    }
    
    public func with(width width: CGFloat, height: CGFloat) -> CGRect
    {
        return with(size: CGSize(width: width, height: height))
    }
    
    public func with(width width: CGFloat) -> CGRect
    {
        return with(width: width, height: height)
    }
    
    public func with(height height: CGFloat) -> CGRect
    {
        return with(width: width, height: height)
    }
    
    public func with(x x: CGFloat, width: CGFloat) -> CGRect
    {
        return CGRect(origin: CGPoint(x: x, y: y), size: CGSize(width: width, height: height))
    }
    
    public func with(y y: CGFloat, height: CGFloat) -> CGRect
    {
        return CGRect(origin: CGPoint(x: x, y: y), size: CGSize(width: width, height: height))
    }
    
    // MARK: inset
    
    public mutating func inset(by: CGFloat)
    {
        insetInPlace(dx: by, dy: by)
    }
    
    public mutating func inset(dx dx: CGFloat)
    {
        insetInPlace(dx: dx, dy: 0)
    }
    
    public mutating func inset(dy dy: CGFloat)
    {
        insetInPlace(dx: 0, dy: dy)
    }
    
    public mutating func inset(top: CGFloat = 0, left: CGFloat = 0, bottom: CGFloat = 0, right: CGFloat = 0)
    {
        x = x + left
        y = y + top

        size.height = height - top - bottom
    }
    
    mutating func inset(topLeft topLeft: CGSize)
    {
        inset(topLeft.height, left: topLeft.width, bottom: 0, right: 0)
    }
    
    mutating func inset(topRight topRight: CGSize)
    {
        inset(topRight.height, right: topRight.width, bottom: 0, left: 0)
    }
    
    mutating func inset(bottomLeft bottomLeft: CGSize)
    {
        inset(bottom: bottomLeft.height, left: bottomLeft.width)
    }
    
    mutating func inset(bottomRight bottomRight: CGSize)
    {
        inset(bottom: bottomRight.height, right: bottomRight.width)
    }
}

// MARK: - Edge points
public extension CGRect
{
    var topLeft: CGPoint
        {
        get { return CGPoint(x: left, y: top) }
        set { left = newValue.x; top = newValue.y }
    }
    
    var topCenter: CGPoint
        {
        get { return CGPoint(x: centerX, y: top) }
        set { centerX = newValue.x; top = newValue.y }
    }
    
    var topRight: CGPoint
        {
        get { return CGPoint(x: right, y: top) }
        set { right = newValue.x; top = newValue.y }
    }
    
    var centerLeft: CGPoint
        {
        get { return CGPoint(x: left, y: centerY) }
        set { left = newValue.x; centerY = newValue.y }
    }
    
    var centerRight: CGPoint
        {
        get { return CGPoint(x: right, y: centerY) }
        set { right = newValue.x; centerY = newValue.y }
    }
    
    var bottomLeft: CGPoint
        {
        get { return CGPoint(x: left, y: bottom) }
        set { left = newValue.x; bottom = newValue.y }
    }
    
    var bottomCenter: CGPoint
        {
        get { return CGPoint(x: centerX, y: bottom) }
        set { centerX = newValue.x; bottom = newValue.y }
    }
    
    var bottomRight: CGPoint
        {
        get { return CGPoint(x: right, y: bottom) }
        set { right = newValue.x; bottom = newValue.y }
