     return C4Rect(CGRectInset(CGRect(r), CGFloat(dx), CGFloat(dy)))
 }
 
-// MARK: - Casting to and from CGRect
-
-/// Initializes a C4Rect from a CGRect
-public extension C4Rect {
-    public init(_ rect: CGRect) {
-        origin = C4Point(rect.origin)
-        size = C4Size(rect.size)
-    }
-}
-
-/// Initializes a CGRect from a C4Rect
+// MARK: - Casting to CGRect
 public extension CGRect {
+    /// Initializes a CGRect from a C4Rect
     public init(_ rect: C4Rect) {
         origin = CGPoint(rect.origin)
         size = CGSize(rect.size)

            size.width = newValue
        }
    }
    public var height : Double {
        get {
            return size.height

import Foundation
import CoreGraphics

///  A structure that contains the location and dimensions of a rectangle.
public struct C4Rect : Equatable, CustomStringConvertible {
    /// The origin (top-left) of the rect.
    public var origin: C4Point

    /// The size (width / height) of the rect.
    public var size: C4Size

    /// The width of the rect.
    public var width : Double {
        get {
            return size.width
