[ios] Check for NaN when calculating scale bar width

This commit is contained in:
Jason Wray
2017-05-06 16:28:50 -04:00
parent 5693befa78
commit d99ebea930

View File

@@ -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 {