summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2018-10-08 11:57:01 -0400
committerJason Wray <jason@mapbox.com>2018-10-08 11:57:01 -0400
commit8992a7e2d1fd1f2f47ad92222ca69b267f8a0da3 (patch)
tree4832cdc864b5b78d3ed0b619be3b310bab1c0bf1
parent7234eaa3173299d3f35176831f7cd5903e2ce709 (diff)
downloadqtlocation-mapboxgl-upstream/fb-framerate-division-fix.tar.gz
[ios] Fix divide-by-zero when setting FPS on iOS <10upstream/fb-framerate-division-fix
-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);
}
}