diff --git a/Source/Constraint.swift b/Source/Constraint.swift index 7324c59..e5086c1 100644 --- a/Source/Constraint.swift +++ b/Source/Constraint.swift @@ -115,7 +115,11 @@ public class Constraint { layoutToAttribute = layoutToAttributes[0] } } else { - layoutToAttribute = layoutFromAttribute + if self.to.target == nil && (layoutFromAttribute == .centerX || layoutFromAttribute == .centerY) { + layoutToAttribute = layoutFromAttribute == .centerX ? .left : .top + } else { + layoutToAttribute = layoutFromAttribute + } } #else if self.from.attributes == self.to.attributes {