From c4596d91a0f198e816032e760c698388ca6299be Mon Sep 17 00:00:00 2001 From: Gabriel Wong Date: Fri, 17 Nov 2017 15:25:37 +0700 Subject: [PATCH 1/2] Fix width of KeyboardMenuView --- ios/engine/KMEI/KeymanEngine/Classes/KeyboardMenuView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/engine/KMEI/KeymanEngine/Classes/KeyboardMenuView.swift b/ios/engine/KMEI/KeymanEngine/Classes/KeyboardMenuView.swift index c34c625f01..2be6c681c9 100644 --- a/ios/engine/KMEI/KeymanEngine/Classes/KeyboardMenuView.swift +++ b/ios/engine/KMEI/KeymanEngine/Classes/KeyboardMenuView.swift @@ -85,7 +85,7 @@ class KeyboardMenuView: UIView, UITableViewDelegate, UITableViewDataSource, UIGe super.init(frame: mainFrame) let screenWidth = UIScreen.main.bounds.width - let maxWidth = CGFloat.maximum(getMaxWidth(), screenWidth) + let maxWidth = CGFloat.minimum(getMaxWidth(), screenWidth) let baseHeight = keyFrame.size.height let containerWidth = maxWidth - strokeWidth * 2 var containerHeight = CGFloat(tableList.count) * rowHeight From bde9b7f408cfcdba16e9c636ea62c9a661a546d5 Mon Sep 17 00:00:00 2001 From: Gabriel Wong Date: Fri, 17 Nov 2017 15:28:33 +0700 Subject: [PATCH 2/2] Use maximum() instead of ternary statement --- ios/engine/KMEI/KeymanEngine/Classes/SubKeysView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/engine/KMEI/KeymanEngine/Classes/SubKeysView.swift b/ios/engine/KMEI/KeymanEngine/Classes/SubKeysView.swift index 2cadbc72ff..e3b5899932 100644 --- a/ios/engine/KMEI/KeymanEngine/Classes/SubKeysView.swift +++ b/ios/engine/KMEI/KeymanEngine/Classes/SubKeysView.swift @@ -198,7 +198,7 @@ class SubKeysView: UIView { } if viewRight.rounded() == keyRight.rounded() || viewRight.rounded(.down) == keyRight.rounded(.down) { - keyRight = viewRight > keyRight ? viewRight : keyRight + keyRight = CGFloat.maximum(viewRight, keyRight) viewRight = keyRight }