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:
|
case .bottom, .bottomMargin:
|
||||||
return -value.bottom
|
return -value.bottom
|
||||||
case .leading, .leadingMargin:
|
case .leading, .leadingMargin:
|
||||||
return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.left : -value.right
|
return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.left : value.right
|
||||||
case .trailing, .trailingMargin:
|
case .trailing, .trailingMargin:
|
||||||
return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.right : -value.left
|
return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? -value.right : -value.left
|
||||||
case .width:
|
case .width:
|
||||||
return -(value.left + value.right)
|
return -(value.left + value.right)
|
||||||
case .height:
|
case .height:
|
||||||
|
@ -128,9 +128,9 @@ extension ConstraintConstantTarget {
|
||||||
case .bottom:
|
case .bottom:
|
||||||
return -value.bottom
|
return -value.bottom
|
||||||
case .leading:
|
case .leading:
|
||||||
return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.left : -value.right
|
return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.left : value.right
|
||||||
case .trailing:
|
case .trailing:
|
||||||
return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.right : -value.left
|
return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? -value.right : -value.left
|
||||||
case .width:
|
case .width:
|
||||||
return -(value.left + value.right)
|
return -(value.left + value.right)
|
||||||
case .height:
|
case .height:
|
||||||
|
|
Loading…
Reference in New Issue