Skip to content

Commit

Permalink
fixed issue #4
Browse files Browse the repository at this point in the history
  • Loading branch information
okmr-d committed Jul 21, 2015
1 parent 2f9bfe5 commit 0b12848
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DOFavoriteButton/DOFavoriteButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class DOFavoriteButton: UIButton {
private var imageShape: CAShapeLayer!
@IBInspectable public var image: UIImage! {
didSet {
imageShape.mask.contents = image.CGImage
createLayers(image: image)
}
}
@IBInspectable public var imageColorOn: UIColor! = UIColor(red: 255/255, green: 172/255, blue: 51/255, alpha: 1.0) {
Expand Down Expand Up @@ -104,6 +104,7 @@ public class DOFavoriteButton: UIButton {
}

private func createLayers(#image: UIImage!) {
self.layer.sublayers = nil

let imageFrame = CGRectMake(frame.size.width / 2 - frame.size.width / 4, frame.size.height / 2 - frame.size.height / 4, frame.size.width / 2, frame.size.height / 2)
let imgCenterPoint = CGPointMake(imageFrame.origin.x + imageFrame.width / 2, imageFrame.origin.y + imageFrame.height / 2)
Expand Down

0 comments on commit 0b12848

Please sign in to comment.