Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Remove unnecessary background color method
Browse files Browse the repository at this point in the history
  • Loading branch information
friedbunny committed May 5, 2016
1 parent b6c0c9f commit b416ac0
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions platform/ios/src/MGLCompactCalloutView.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ - (instancetype)initWithFrame:(CGRect)frame

// Create and add a subview to hold the callout’s text
UIButton *mainBody = [UIButton buttonWithType:UIButtonTypeSystem];
mainBody.backgroundColor = [self backgroundColorForCallout];
mainBody.backgroundColor = [UIColor whiteColor];
mainBody.contentEdgeInsets = UIEdgeInsetsMake(10.0, 10.0, 10.0, 10.0);
mainBody.layer.cornerRadius = 4.0;
self.mainBody = mainBody;
Expand Down Expand Up @@ -96,16 +96,9 @@ - (void)dismissCalloutAnimated:(BOOL)animated

#pragma mark - Custom view styling

- (UIColor *)backgroundColorForCallout
{
return [UIColor whiteColor];
}

- (void)drawRect:(CGRect)rect
{
// Draw the pointed tip at the bottom
UIColor *fillColor = [self backgroundColorForCallout];

CGFloat tipLeft = rect.origin.x + (rect.size.width / 2.0) - (tipWidth / 2.0);
CGPoint tipBottom = CGPointMake(rect.origin.x + (rect.size.width / 2.0), rect.origin.y + rect.size.height);
CGFloat heightWithoutTip = rect.size.height - tipHeight - 1;
Expand All @@ -118,7 +111,7 @@ - (void)drawRect:(CGRect)rect
CGPathAddLineToPoint(tipPath, NULL, tipLeft + tipWidth, heightWithoutTip);
CGPathCloseSubpath(tipPath);

[fillColor setFill];
[self.mainBody.backgroundColor setFill];
CGContextAddPath(currentContext, tipPath);
CGContextFillPath(currentContext);
CGPathRelease(tipPath);
Expand Down

0 comments on commit b416ac0

Please sign in to comment.