mirror of https://github.com/SnapKit/SnapKit
change the result constraint of maker.center.equalTo(CGPoint) to based on the original point of superview (#336)
* change center.equalTo * fix logic
This commit is contained in:
parent
3f529652a4
commit
da4426cb9a
|
@ -114,9 +114,13 @@ public class Constraint {
|
|||
} else {
|
||||
layoutToAttribute = layoutToAttributes[0]
|
||||
}
|
||||
} else {
|
||||
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 {
|
||||
layoutToAttribute = layoutFromAttribute
|
||||
|
|
Loading…
Reference in New Issue