Settings: better padding calculation

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2018-12-13 05:22:13 +01:00
parent 4eec53d6d3
commit ecbab37e0e
@@ -48,9 +48,9 @@ class SettingsTableViewController: UITableViewController {
logo.contentMode = .scaleAspectFit logo.contentMode = .scaleAspectFit
var height = self.tableView.estimatedRowHeight * 1.5 var height = self.tableView.estimatedRowHeight * 1.5
var width = height * image.size.width / image.size.height var width = height * image.size.width / image.size.height
let minScreenDimension = min(UIScreen.main.bounds.size.width, UIScreen.main.bounds.size.height) let minScreenDimension = min(UIScreen.main.bounds.size.width, UIScreen.main.bounds.size.height) - max(self.tableView.layoutMargins.right, CGFloat(10))
if width > minScreenDimension - 30 { if width > minScreenDimension {
width = minScreenDimension - 30 width = minScreenDimension
height = width * image.size.height / image.size.width height = width * image.size.height / image.size.width
} }
logo.frame = CGRect(x: 0, y: 0, width: width, height: height) logo.frame = CGRect(x: 0, y: 0, width: width, height: height)