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
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue