     }
     
     public func scale(image: UIImage) -> UIImage? {
-        let rect = drawRect(for: image)
         var alpha: CGFloat = 0.0
         var white: CGFloat = 0.0
         backgroundColor.getWhite(&white, alpha: &alpha)

    return CGRect(origin: (size - newSize).mid, size: newSize)
}


#if os(iOS) || os(tvOS)
    

            return aspectFit(size: size, imageSize: image.size)
        case .scaleAspectFill:
            return aspectFill(size: size, imageSize: image.size)
        case .scaleToFill:
            return CGRect(origin: CGPoint.zero, size: size)
        case .redraw:
            return CGRect(origin: CGPoint.zero, size: size)
        case .center:
            return center(size: size, imageSize: image.size)
        case .top:
            return top(size: size, imageSize: image.size)
        case .bottom:
            return bottom(size: size, imageSize: image.size)
        case .left:
            return left(size: size, imageSize: image.size)
        case .right:
            return right(size: size, imageSize: image.size)
        case .topLeft:
            return topLeft(size: size, imageSize: image.size)
        case .topRight:
            return topRight(size: size, imageSize: image.size)
        case .bottomLeft:
            return bottomLeft(size: size, imageSize: image.size)
        case .bottomRight:
            return bottomRight(size: size, imageSize: image.size)
        }
    }
}
