mirror of https://github.com/SnapKit/SnapKit
Fix bug in constraint maker duplicating constraints
This commit is contained in:
parent
3838029c66
commit
556536859e
|
@ -175,25 +175,9 @@ public class ConstraintMaker {
|
||||||
closure(maker)
|
closure(maker)
|
||||||
var constraints: [Constraint] = []
|
var constraints: [Constraint] = []
|
||||||
for description in maker.descriptions {
|
for description in maker.descriptions {
|
||||||
|
guard let constraint = description.constraint else {
|
||||||
guard let relation = description.relation,
|
continue
|
||||||
let related = description.related,
|
|
||||||
let sourceLocation = description.sourceLocation else {
|
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
let from = ConstraintItem(target: description.item, attributes: description.attributes)
|
|
||||||
|
|
||||||
let constraint = Constraint(
|
|
||||||
from: from,
|
|
||||||
to: related,
|
|
||||||
relation: relation,
|
|
||||||
sourceLocation: sourceLocation,
|
|
||||||
label: description.label,
|
|
||||||
multiplier: description.multiplier,
|
|
||||||
constant: description.constant,
|
|
||||||
priority: description.priority
|
|
||||||
)
|
|
||||||
|
|
||||||
constraints.append(constraint)
|
constraints.append(constraint)
|
||||||
}
|
}
|
||||||
for constraint in constraints {
|
for constraint in constraints {
|
||||||
|
|
Loading…
Reference in New Issue