diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-06-28 10:03:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-28 10:03:55 -0700 |
commit | c96b7dae687f43a7ca233698554aa33eb3180f0a (patch) | |
tree | cdb33b90e74ff54e02ed2416847fa1984a2f504f | |
parent | 72c342284c13a8f524b5f1aef3bf452f85dd8eee (diff) | |
download | qtlocation-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.mm | 3 |
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, |