]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
Settings: better padding calculation
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 13 Dec 2018 04:15:50 +0000 (05:15 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Thu, 13 Dec 2018 04:22:13 +0000 (05:22 +0100)
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift

index 346f66d932e67d56eee82ee2efee0981039e0eb9..fe276b1ceee06931cc98e6305fca2cc934acdf7a 100644 (file)
@@ -48,9 +48,9 @@ class SettingsTableViewController: UITableViewController {
         logo.contentMode = .scaleAspectFit
         var height = self.tableView.estimatedRowHeight * 1.5
         var width = height * image.size.width / image.size.height
-        let minScreenDimension = min(UIScreen.main.bounds.size.width, UIScreen.main.bounds.size.height)
-        if width > minScreenDimension - 30 {
-            width = minScreenDimension - 30
+        let minScreenDimension = min(UIScreen.main.bounds.size.width, UIScreen.main.bounds.size.height) - max(self.tableView.layoutMargins.right, CGFloat(10))
+        if width > minScreenDimension {
+            width = minScreenDimension
             height = width * image.size.height / image.size.width
         }
         logo.frame = CGRect(x: 0, y: 0, width: width, height: height)