             midX = newValue.x
             midY = newValue.y
         }
+    }
+}
+
+extension Rect {
+    
+    @_transparent
+    public var standardized: Rect {
+        return Rect(x: minX, y: minY, width: abs(width), height: abs(height))
     }
 }
 

    }
    @_inlineable
    public func inset(dx: Double, dy: Double) -> Rect {
        return Rect(x: self.x + dx, y: self.y + dy, width: self.width - 2 * dx, height: self.height - 2 * dy)
    }
    @_inlineable
    public func inset(top: Double, left: Double, right: Double, bottom: Double) -> Rect {
        return Rect(x: self.x + left, y: self.y + top, width: self.width - left - right, height: self.height - top - bottom)
    }
    @_inlineable
    public func offset(dx: Double, dy: Double) -> Rect {

    
    @_transparent
    public var minX : Double {
        return width < 0 ? x + width : x
    }
    @_transparent
    public var minY : Double {
        return height < 0 ? y + height : y
    }
    @_transparent
    public var maxX : Double {
        return width < 0 ? x : x + width
    }
    @_transparent
    public var maxY : Double {
        return height < 0 ? y : y + height
    }
    @_transparent
    public var midX : Double {
