 	private func updateDrawFrame() {
 		var drawFrame = CGRect()
 
-		let contentMode = self.contentMode
+		let gravity = self.gravity
+		let scaling = self.scaling
 		let imageSize: CGSize
 		let availableFrame = CGRect(size: bounds.size).insetBy(padding)
 

			if !drawFrame.isEmpty {
				if image.renderingMode == .AlwaysTemplate {
					let viewSize = bounds.size
					
					let context = UIGraphicsGetCurrentContext()
					CGContextSaveGState(context)
					CGContextScaleCTM(context, 1, -1)
					CGContextTranslateCTM(context, 0, -viewSize.height)
					CGContextClipToMask(context, drawFrame, image.CGImage)
					tintColor.setFill()
					CGContextFillRect(context, drawFrame)



	public var preferredSize: CGSize?


	@IBInspectable
	public var scaling: Scaling = .FitInside {
		didSet {
			guard scaling != oldValue else {
				return
			}

			if image != nil {
				setNeedsDisplay()
			}
		}
	}


	public override func sizeThatFitsSize(maximumSize: CGSize) -> CGSize {
