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 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 }