From d99ebea93075b67ba435374d2de641a76c8c7da1 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Sat, 6 May 2017 16:28:50 -0400 Subject: [PATCH] [ios] Check for NaN when calculating scale bar width --- platform/ios/src/MGLScaleBar.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/ios/src/MGLScaleBar.mm b/platform/ios/src/MGLScaleBar.mm index 383710ea3..1216e400b 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 {