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