diff options
author | Jason Wray <jason@mapbox.com> | 2017-05-06 16:28:50 -0400 |
---|---|---|
committer | Jason Wray <jason@mapbox.com> | 2017-05-08 15:44:51 -0400 |
commit | d99ebea93075b67ba435374d2de641a76c8c7da1 (patch) | |
tree | abc0992abd88eceff50f923ab6c361ab9c01bc22 /platform | |
parent | 5693befa7836f22ce747695e56990ca2ed6411f1 (diff) | |
download | qtlocation-mapboxgl-d99ebea93075b67ba435374d2de641a76c8c7da1.tar.gz |
[ios] Check for NaN when calculating scale bar width
Diffstat (limited to 'platform')
-rw-r--r-- | platform/ios/src/MGLScaleBar.mm | 3 |
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 { |