Fixed Auto Layout prefix issues.

This commit is contained in:
Pietro Gagliardi 2015-08-02 18:19:11 -04:00
parent ebae310ff1
commit b3ad1768b0
1 changed files with 5 additions and 5 deletions

View File

@ -44,7 +44,7 @@
NSView *contentView; NSView *contentView;
tAutoLayoutParams p; tAutoLayoutParams p;
NSString *margin; NSString *margin;
void (^run)(NSArray *, NSArray *, NSArray *); void (^run)(NSArray *, NSArray *, NSArray *, NSString *);
if (self->c == nil) if (self->c == nil)
return; return;
@ -70,7 +70,7 @@
if (self->margined) if (self->margined)
margin = @"-"; margin = @"-";
run = ^(NSArray *side, NSArray *attachStart, NSArray *attachEnd) { run = ^(NSArray *side, NSArray *attachStart, NSArray *attachEnd, NSString *prefix) {
NSUInteger i; NSUInteger i;
for (i = 0; i < [side count]; i++) { for (i = 0; i < [side count]; i++) {
@ -78,7 +78,7 @@
NSNumber *attach; NSNumber *attach;
NSArray *constraints; NSArray *constraints;
constraint = [NSMutableString stringWithString:@"H:"]; constraint = [NSMutableString stringWithString:prefix];
attach = (NSNumber *) [attachStart objectAtIndex:i]; attach = (NSNumber *) [attachStart objectAtIndex:i];
if ([attach boolValue]) { if ([attach boolValue]) {
[constraint appendString:@"|"]; [constraint appendString:@"|"];
@ -96,8 +96,8 @@
} }
}; };
run(p.horz, p.horzAttachLeft, p.horzAttachRight); run(p.horz, p.horzAttachLeft, p.horzAttachRight, @"H:");
run(p.vert, p.vertAttachTop, p.vertAttachBottom); run(p.vert, p.vertAttachTop, p.vertAttachBottom, @"V:");
// TODO release everything // TODO release everything
} }