ScriptControllerIconView: Update to reflect policy type

This commit is contained in:
James Magahern
2021-10-21 15:08:04 -07:00
parent fc7380ed21
commit 291abfcd6a
8 changed files with 96 additions and 32 deletions

View File

@@ -125,11 +125,13 @@ class ReliefButton: UIButton
override func imageRect(forContentRect contentRect: CGRect) -> CGRect {
let ratio = CGFloat(0.45)
let constantSize = round(ratio * contentRect.width)
return CGRect(
origin: .zero,
size: CGSize(
width: ratio * contentRect.width,
height: ratio * contentRect.width
// Ensure multiple of two for proper centering.
width: constantSize + constantSize.truncatingRemainder(dividingBy: 2),
height: constantSize + constantSize.truncatingRemainder(dividingBy: 2)
)
).centered(inRect: contentRect)
}