Permalink
Browse files

Fixed placement of title.

  • Loading branch information...
1 parent 25a9946 commit 4f361cf564ceb1db777435531e0e003e40d4ce8e @amjaliks committed Mar 2, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 Source/Classes/Callout View/OACalloutView.m
@@ -148,8 +148,8 @@ - (void)updateLayout:(BOOL)animated {
[UIView setAnimationDuration:0.1f];
}
- CGSize titleSize = [self.calloutTitleLabel.text sizeWithFont:self.calloutTitleLabel.font];
- CGSize subtitleSize = [self.calloutSubtitleLabel.text sizeWithFont:self.calloutSubtitleLabel.font];
+ CGSize titleSize = [self.calloutTitleLabel.text length] ? [self.calloutTitleLabel.text sizeWithFont:self.calloutTitleLabel.font] : CGSizeZero;
+ CGSize subtitleSize = [self.calloutSubtitleLabel.text length] ? [self.calloutSubtitleLabel.text sizeWithFont:self.calloutSubtitleLabel.font] : CGSizeZero;
CGFloat labelWidth = MAX(titleSize.width, subtitleSize.width);
CGFloat titleOffset = roundf((LABEL_HEIGHT - titleSize.height - subtitleSize.height) / 2.0f);

0 comments on commit 4f361cf

Please sign in to comment.