summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2017-05-06 16:28:50 -0400
committerJason Wray <jason@mapbox.com>2017-05-08 15:44:51 -0400
commitd99ebea93075b67ba435374d2de641a76c8c7da1 (patch)
treeabc0992abd88eceff50f923ab6c361ab9c01bc22 /platform
parent5693befa7836f22ce747695e56990ca2ed6411f1 (diff)
downloadqtlocation-mapboxgl-d99ebea93075b67ba435374d2de641a76c8c7da1.tar.gz
[ios] Check for NaN when calculating scale bar width
Diffstat (limited to 'platform')
-rw-r--r--platform/ios/src/MGLScaleBar.mm3
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/ios/src/MGLScaleBar.mm b/platform/ios/src/MGLScaleBar.mm
index 383710ea37..1216e400b3 100644
--- a/platform/ios/src/MGLScaleBar.mm
+++ b/platform/ios/src/MGLScaleBar.mm
@@ -161,7 +161,8 @@ static const CGFloat MGLFeetPerMeter = 3.28084;
}
- (CGFloat)actualWidth {
- return self.row.distance / [self unitsPerPoint];
+ CGFloat width = self.row.distance / [self unitsPerPoint];
+ return !isnan(width) ? width : 0;
}
- (CGFloat)maximumWidth {