Some fixes for macOS

This commit is contained in:
James Magahern
2020-08-14 17:40:01 -07:00
parent 1d3d04ffdf
commit 669da89ff3
5 changed files with 55 additions and 27 deletions

View File

@@ -20,7 +20,6 @@ class ReliefButton: UIButton
}
}
init() {
super.init(frame: .zero)
@@ -105,8 +104,14 @@ class ReliefButton: UIButton
}
override func imageRect(forContentRect contentRect: CGRect) -> CGRect {
let inset = CGFloat(7.0)
return contentRect.insetBy(dx: inset, dy: inset)
let ratio = CGFloat(0.45)
return CGRect(
origin: .zero,
size: CGSize(
width: ratio * contentRect.width,
height: ratio * contentRect.width
)
).centered(inRect: contentRect)
}
override func sizeThatFits(_ size: CGSize) -> CGSize {