From ffea39abd0b8c1b3d1139a32bc691bbdc02eb92d Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 29 Sep 2017 10:35:13 -0400 Subject: [PATCH] Cap the flat button text size. // FREEBIE --- Signal/src/views/OWSFlatButton.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Signal/src/views/OWSFlatButton.swift b/Signal/src/views/OWSFlatButton.swift index 3c69f03ed..bd9e8d44f 100644 --- a/Signal/src/views/OWSFlatButton.swift +++ b/Signal/src/views/OWSFlatButton.swift @@ -99,7 +99,9 @@ import Foundation } public class func fontForHeight(_ height: CGFloat) -> UIFont { - let fontPointSize = round(height * 0.45) + // Cap the "button height" at 40pt or button text can look + // excessively large. + let fontPointSize = round(min(40, height) * 0.45) return UIFont.ows_mediumFont(withSize:fontPointSize)! }