diff --git a/AppKit/CPBox.j b/AppKit/CPBox.j index fb78bf85e..8151b33d6 100644 --- a/AppKit/CPBox.j +++ b/AppKit/CPBox.j @@ -352,6 +352,7 @@ CPBelowBottom = 6; [_titleView setAutoresizingMask:CPViewMinYMargin]; break; } + [self sizeToFit]; [self setNeedsDisplay:YES]; } @@ -361,6 +362,9 @@ CPBelowBottom = 6; var contentFrame = [_contentView frame], offset = [self _titleHeightOffset]; + if (!contentFrame) + return; + [_contentView setAutoresizingMask:CPViewNotSizable]; [self setFrameSize:CGSizeMake(contentFrame.size.width + _contentMargin.width * 2, contentFrame.size.height + _contentMargin.height * 2 + offset[0])];