From fbd807fd095a8c00dcefdcae7bab77e8dea8cea9 Mon Sep 17 00:00:00 2001 From: Robert Payne Date: Tue, 16 Aug 2016 23:24:48 +1200 Subject: [PATCH] Alter how insets work when used as implied constant Using make.left.bottom.equalTo(UIEdgeInsets) will now invert the right and bottom edge. --- Source/ConstraintConstantTarget.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/ConstraintConstantTarget.swift b/Source/ConstraintConstantTarget.swift index 40ed274..46bd3ed 100644 --- a/Source/ConstraintConstantTarget.swift +++ b/Source/ConstraintConstantTarget.swift @@ -103,17 +103,17 @@ extension ConstraintConstantTarget { case .top, .topMargin, .centerY, .centerYWithinMargins, .lastBaseline, .firstBaseline: return value.top case .right, .rightMargin: - return value.right + return -value.right case .bottom, .bottomMargin: - return value.bottom + return -value.bottom case .leading, .leadingMargin: return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.left : -value.right case .trailing, .trailingMargin: return (ConstraintConfig.interfaceLayoutDirection == .leftToRight) ? value.right : -value.left case .width: - return -value.left + value.right + return -(value.left + value.right) case .height: - return -value.top + value.bottom + return -(value.top + value.bottom) case .notAnAttribute: return 0.0 }