summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-06-28 10:03:55 -0700
committerGitHub <noreply@github.com>2016-06-28 10:03:55 -0700
commitc96b7dae687f43a7ca233698554aa33eb3180f0a (patch)
treecdb33b90e74ff54e02ed2416847fa1984a2f504f
parent72c342284c13a8f524b5f1aef3bf452f85dd8eee (diff)
downloadqtlocation-mapboxgl-c96b7dae687f43a7ca233698554aa33eb3180f0a.tar.gz
[ios] Specify ultra light weight literally (#5497)
Fixed a crash on iOS 8.1 and below due to specifying the compass legend’s font weight using a font weight constant that was introduced in iOS 8.2. Fixes #5486.
-rw-r--r--platform/ios/src/MGLMapView.mm3
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 19f5e425ef..25cf23c878 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -579,8 +579,9 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration)
UIGraphicsBeginImageContextWithOptions(scaleImage.size, NO, [UIScreen mainScreen].scale);
[scaleImage drawInRect:{ CGPointZero, scaleImage.size }];
+ CGFloat weight = &UIFontWeightUltraLight ? UIFontWeightUltraLight : -0.8;
NSAttributedString *north = [[NSAttributedString alloc] initWithString:NSLocalizedStringWithDefaultValue(@"COMPASS_NORTH", nil, nil, @"N", @"Compass abbreviation for north") attributes:@{
- NSFontAttributeName: [UIFont systemFontOfSize:9 weight:UIFontWeightUltraLight],
+ NSFontAttributeName: [UIFont systemFontOfSize:9 weight:weight],
NSForegroundColorAttributeName: [UIColor whiteColor],
}];
CGRect stringRect = CGRectMake((scaleImage.size.width - north.size.width) / 2,