Fix up leading and trailing with UIEdgeInsets

This commit is contained in:
Robert Payne 2016-09-20 17:11:30 +12:00
parent de00f5e87e
commit e38b01b52e
1 changed files with 4 additions and 4 deletions

View File

@ -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: