                 self.animationLayer?.removeFromSuperlayer()
             }
             self.animationLayer = CALayer()
-            self.animationLayer?.bounds = self.bounds
-            self.animationLayer?.setAffineTransform(CGAffineTransformMakeTranslation(self.bounds.width / 2.0, self.bounds.height / 2.0))
+            let hh = self.bounds.size.height / 2.0
+            let hw = self.bounds.size.width / 2.0
+            self.animationLayer?.bounds = CGRectMake(-hw, -hh, self.bounds.width, self.bounds.height)
+            self.animationLayer?.setAffineTransform(CGAffineTransformMakeTranslation(self.bounds.size.width / 2.0, self.bounds.size.height / 2.0))
             self.layer.addSublayer(animationLayer!)
             applyCircularBorderMaskWithDiameter(diameterForCircularBorder())
         }

        }
    }
    
    @IBInspectable
    public var style : ProgressStyle = .Circular {
        didSet {
            setup()

        didSet {
            if animating {
                animationLayer?.opacity = 1
                let contentLayer = CAShapeLayer()
                contentLayer.position = CGPoint(x: 0, y: 0)
                drawIndicatorToLayer(contentLayer)
                animationLayer!.addSublayer(contentLayer)
                startAnimation()
            }
            else {
