mirror of https://github.com/SnapKit/SnapKit
Fix up leading and trailing with UIEdgeInsets
This commit is contained in:
parent
de00f5e87e
commit
e38b01b52e
|
@ -107,9 +107,9 @@ extension ConstraintConstantTarget {
|
|||
case .bottom, .bottomMargin:
|
||||
return -value.bottom
|
||||
case .leading, .leadingMargin:
|
||||
return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.left : -value.right
|
||||
return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.left : value.right
|
||||
case .trailing, .trailingMargin:
|
||||
return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.right : -value.left
|
||||
return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? -value.right : -value.left
|
||||
case .width:
|
||||
return -(value.left + value.right)
|
||||
case .height:
|
||||
|
@ -128,9 +128,9 @@ extension ConstraintConstantTarget {
|
|||
case .bottom:
|
||||
return -value.bottom
|
||||
case .leading:
|
||||
return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.left : -value.right
|
||||
return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.left : value.right
|
||||
case .trailing:
|
||||
return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.right : -value.left
|
||||
return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? -value.right : -value.left
|
||||
case .width:
|
||||
return -(value.left + value.right)
|
||||
case .height:
|
||||
|
|
Loading…
Reference in New Issue