         return rect;
     }
     
+    private func constrainedRectWithRectBasisOfWidth(var rect: CGRect, aspectRatio: CGFloat) -> CGRect {
+        let width = CGRectGetWidth(rect);
+        var height = CGRectGetHeight(rect);
+        if (width < height) {
+            height = width * self.fixedAspectRatio
+        } else {
+            height = width / self.fixedAspectRatio
+        }
+        rect.size = CGSizeMake(width, height)
+        
+        return rect;
+    }
 }

        self.addSubview(self.rightEdgeView)
    }
    
    private func cropRectMakeWithResizeControlView(resizeControlView: SSResizeControl) {
        var rect = self.frame
        if resizeControlView == self.topEdgeView {
            rect = CGRectMake(CGRectGetMinX(self.initialRect),

    }
    
    func resizeControlViewDidResize(resizeControlView: SSResizeControl) {
        self.frame = self.cropRectMakeWithResizeControlView(resizeControlView)
        self.delegate?.cropRectViewEditingChanged(self)
    }
    
    func resizeControlViewDidEndResizing(resizeControlView: SSResizeControl) {
        self.delegate?.cropRectViewDidEndEditing(self)
    }
    
    //MARK: - private method
