Skip to content

Commit

Permalink
Fix xib-based autolayout image sizing issues. Closes #58 and #59
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Vogelzang committed Dec 10, 2016
1 parent 87ccdce commit 6455119
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions SevenSwitch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,11 @@ import QuartzCore
let normalKnobWidth = frame.size.height - 2
if self.on {
thumbView.frame = CGRect(x: frame.size.width - (normalKnobWidth + 1), y: 1, width: frame.size.height - 2, height: normalKnobWidth)
thumbImageView.frame = CGRect(x: frame.size.width - normalKnobWidth, y: 0, width: normalKnobWidth, height: normalKnobWidth)
}
else {
thumbView.frame = CGRect(x: 1, y: 1, width: normalKnobWidth, height: normalKnobWidth)
thumbImageView.frame = CGRect(x: 0, y: 0, width: normalKnobWidth, height: normalKnobWidth)
}

thumbView.layer.cornerRadius = self.isRounded ? (frame.size.height * 0.5) - 1 : 2
Expand Down

0 comments on commit 6455119

Please sign in to comment.