summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2018-10-08 11:57:01 -0400
committerJason Wray <friedbunny@users.noreply.github.com>2018-10-09 11:30:36 -0400
commit90ccf22dec0b6065f9bb78a2f0995dbc5dda7f1a (patch)
treeb5a3375726d1d66512f46b177c59fc9b0119c1e5
parent33f2ae0f3fb75c09d08a6f50f9ff0b480c4b1d13 (diff)
downloadqtlocation-mapboxgl-90ccf22dec0b6065f9bb78a2f0995dbc5dda7f1a.tar.gz
[ios] Fix divide-by-zero when setting FPS on iOS <10
-rw-r--r--platform/ios/src/MGLMapView.mm4
1 files changed, 4 insertions, 0 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index e9fd568a04..7096c55a8c 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -1219,6 +1219,10 @@ public:
// CADisplayLink.frameInterval does not support more than 60 FPS (and
// no device that supports >60 FPS ever supported iOS 9).
NSInteger maximumFrameRate = 60;
+
+ // `0` is an alias for maximum frame rate.
+ newFrameRate = newFrameRate ?: maximumFrameRate;
+
_displayLink.frameInterval = maximumFrameRate / MIN(newFrameRate, maximumFrameRate);
}
}