diff options
author | Jason Wray <jason@mapbox.com> | 2016-05-05 18:27:01 -0400 |
---|---|---|
committer | Jason Wray <jason@mapbox.com> | 2016-07-26 18:54:02 -0700 |
commit | 8dc99e60a532a24867810a75bd88b3ed02c246b2 (patch) | |
tree | 8dcc4d2fe5e613bede60d39df32e3915598f4336 | |
parent | fa27c4f880ff89f51b6290fc50c3e61f931e9a52 (diff) | |
download | qtlocation-mapboxgl-8dc99e60a532a24867810a75bd88b3ed02c246b2.tar.gz |
Remove unnecessary background color method
-rw-r--r-- | platform/ios/src/MGLCompactCalloutView.m | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/platform/ios/src/MGLCompactCalloutView.m b/platform/ios/src/MGLCompactCalloutView.m index 8f0a2c4f56..ea665c7c5c 100644 --- a/platform/ios/src/MGLCompactCalloutView.m +++ b/platform/ios/src/MGLCompactCalloutView.m @@ -26,7 +26,7 @@ static CGFloat const tipWidth = 20.0; // 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; @@ -96,16 +96,9 @@ static CGFloat const tipWidth = 20.0; #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; @@ -118,7 +111,7 @@ static CGFloat const tipWidth = 20.0; CGPathAddLineToPoint(tipPath, NULL, tipLeft + tipWidth, heightWithoutTip); CGPathCloseSubpath(tipPath); - [fillColor setFill]; + [self.mainBody.backgroundColor setFill]; CGContextAddPath(currentContext, tipPath); CGContextFillPath(currentContext); CGPathRelease(tipPath); |