mirror of https://github.com/SnapKit/SnapKit
Handle new NSLayoutAttribute FirstBaseline that is introduced in OS X 10.11 for CGPoint or EdgeInsets
This commit is contained in:
parent
c6b3ecaad8
commit
5afd216e21
|
@ -406,7 +406,7 @@ private extension NSLayoutAttribute {
|
||||||
case .Leading: return point.x
|
case .Leading: return point.x
|
||||||
case .Trailing: return point.x
|
case .Trailing: return point.x
|
||||||
case .Width, .Height, .NotAnAttribute: return CGFloat(0)
|
case .Width, .Height, .NotAnAttribute: return CGFloat(0)
|
||||||
default: return CGFloat(0)
|
case .FirstBaseline: return point.y
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -431,7 +431,7 @@ private extension NSLayoutAttribute {
|
||||||
case .Leading: return (Config.interfaceLayoutDirection == .LeftToRight) ? insets.left : -insets.right
|
case .Leading: return (Config.interfaceLayoutDirection == .LeftToRight) ? insets.left : -insets.right
|
||||||
case .Trailing: return (Config.interfaceLayoutDirection == .LeftToRight) ? insets.right : -insets.left
|
case .Trailing: return (Config.interfaceLayoutDirection == .LeftToRight) ? insets.right : -insets.left
|
||||||
case .Width, .Height, .NotAnAttribute: return CGFloat(0)
|
case .Width, .Height, .NotAnAttribute: return CGFloat(0)
|
||||||
default: return CGFloat(0)
|
case .FirstBaseline: return insets.bottom
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue