Skip to content

Commit

Permalink
Merge pull request #79 from mapbox/1ec5-pedantry
Browse files Browse the repository at this point in the history
Resolved pedantic warnings; fixed Retina images
  • Loading branch information
nfarina committed Mar 26, 2015
2 parents 53dfb88 + 7770db3 commit 0c00bbb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
8 changes: 4 additions & 4 deletions SMCalloutView.m
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ - (UIView *)subtitleViewOrDefault {

- (SMCalloutBackgroundView *)backgroundView {
// create our default background on first access only if it's nil, since you might have set your own background anyway.
return _backgroundView ?: (_backgroundView = [self defaultBackgroundView]);
return _backgroundView ? _backgroundView : (_backgroundView = [self defaultBackgroundView]);
}

- (SMCalloutBackgroundView *)defaultBackgroundView {
Expand Down Expand Up @@ -160,7 +160,7 @@ - (CGFloat)leftAccessoryVerticalMargin {
}

- (CGFloat)leftAccessoryHorizontalMargin {
return MIN(self.leftAccessoryVerticalMargin, TITLE_HMARGIN);
return fminf(self.leftAccessoryVerticalMargin, TITLE_HMARGIN);
}

- (CGFloat)rightAccessoryVerticalMargin {
Expand All @@ -171,7 +171,7 @@ - (CGFloat)rightAccessoryVerticalMargin {
}

- (CGFloat)rightAccessoryHorizontalMargin {
return MIN(self.rightAccessoryVerticalMargin, TITLE_HMARGIN);
return fminf(self.rightAccessoryVerticalMargin, TITLE_HMARGIN);
}

- (CGFloat)innerContentMarginLeft {
Expand Down Expand Up @@ -250,7 +250,7 @@ - (CGSize)offsetToContainRect:(CGRect)innerRect inRect:(CGRect)outerRect {
CGFloat nudgeLeft = fminf(0, CGRectGetMaxX(outerRect) - CGRectGetMaxX(innerRect));
CGFloat nudgeTop = fmaxf(0, CGRectGetMinY(outerRect) - CGRectGetMinY(innerRect));
CGFloat nudgeBottom = fminf(0, CGRectGetMaxY(outerRect) - CGRectGetMaxY(innerRect));
return CGSizeMake(nudgeLeft ?: nudgeRight, nudgeTop ?: nudgeBottom);
return CGSizeMake(nudgeLeft ? nudgeLeft : nudgeRight, nudgeTop ? nudgeTop : nudgeBottom);
}

- (void)presentCalloutFromRect:(CGRect)rect inView:(UIView *)view constrainedToView:(UIView *)constrainedView animated:(BOOL)animated {
Expand Down
Loading

0 comments on commit 0c00bbb

Please sign in to comment.