Fixed Page 3's weird issues. We're so close to having this *just working*!
This commit is contained in:
parent
73c92dfbb5
commit
26f9d86800
19
darwin/box.m
19
darwin/box.m
|
@ -161,7 +161,6 @@ struct uiBox {
|
||||||
CGFloat padding;
|
CGFloat padding;
|
||||||
NSView *prev;
|
NSView *prev;
|
||||||
NSLayoutConstraint *c;
|
NSLayoutConstraint *c;
|
||||||
NSLayoutRelation relation;
|
|
||||||
BOOL (*hugsSecondary)(uiDarwinControl *);
|
BOOL (*hugsSecondary)(uiDarwinControl *);
|
||||||
|
|
||||||
[self removeOurConstraints];
|
[self removeOurConstraints];
|
||||||
|
@ -213,14 +212,22 @@ struct uiBox {
|
||||||
@"uiBox secondary start constraint");
|
@"uiBox secondary start constraint");
|
||||||
[self addConstraint:c];
|
[self addConstraint:c];
|
||||||
[self->otherConstraints addObject:c];
|
[self->otherConstraints addObject:c];
|
||||||
relation = NSLayoutRelationLessThanOrEqual;
|
|
||||||
if ((*hugsSecondary)(uiDarwinControl(bc.c)))
|
|
||||||
relation = NSLayoutRelationEqual;
|
|
||||||
c = mkConstraint([bc view], self->secondaryEnd,
|
c = mkConstraint([bc view], self->secondaryEnd,
|
||||||
relation,
|
NSLayoutRelationLessThanOrEqual,
|
||||||
self, self->secondaryEnd,
|
self, self->secondaryEnd,
|
||||||
1, 0,
|
1, 0,
|
||||||
@"uiBox secondary end constraint");
|
@"uiBox secondary end <= constraint");
|
||||||
|
if ((*hugsSecondary)(uiDarwinControl(bc.c)))
|
||||||
|
[c setPriority:NSLayoutPriorityDefaultLow];
|
||||||
|
[self addConstraint:c];
|
||||||
|
[self->otherConstraints addObject:c];
|
||||||
|
c = mkConstraint([bc view], self->secondaryEnd,
|
||||||
|
NSLayoutRelationEqual,
|
||||||
|
self, self->secondaryEnd,
|
||||||
|
1, 0,
|
||||||
|
@"uiBox secondary end == constraint");
|
||||||
|
if (!(*hugsSecondary)(uiDarwinControl(bc.c)))
|
||||||
|
[c setPriority:NSLayoutPriorityDefaultLow];
|
||||||
[self addConstraint:c];
|
[self addConstraint:c];
|
||||||
[self->otherConstraints addObject:c];
|
[self->otherConstraints addObject:c];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue