Fix handling of UIEdgeInsets for width and height

This commit is contained in:
Ray Lillywhite 2016-01-07 13:52:28 -08:00 committed by Robert Payne
parent a3824e54a0
commit 121058af73
1 changed files with 6 additions and 2 deletions

View File

@ -443,7 +443,9 @@ private extension NSLayoutAttribute {
case .Bottom, .BottomMargin: return insets.bottom
case .Leading, .LeadingMargin: return (Config.interfaceLayoutDirection == .LeftToRight) ? insets.left : -insets.right
case .Trailing, .TrailingMargin: return (Config.interfaceLayoutDirection == .LeftToRight) ? insets.right : -insets.left
case .Width, .Height, .NotAnAttribute: return CGFloat(0)
case .Width: return -insets.left + insets.right
case .Height: return -insets.top + insets.bottom
case .NotAnAttribute: return CGFloat(0)
}
#else
switch self {
@ -453,7 +455,9 @@ private extension NSLayoutAttribute {
case .Bottom: return insets.bottom
case .Leading: return (Config.interfaceLayoutDirection == .LeftToRight) ? insets.left : -insets.right
case .Trailing: return (Config.interfaceLayoutDirection == .LeftToRight) ? insets.right : -insets.left
case .Width, .Height, .NotAnAttribute: return CGFloat(0)
case .Width: return -insets.left + insets.right
case .Height: return -insets.top + insets.bottom
case .NotAnAttribute: return CGFloat(0)
case .FirstBaseline: return insets.bottom
}
#endif