diff options
author | Jason Wray <jason@mapbox.com> | 2018-10-08 11:57:01 -0400 |
---|---|---|
committer | Jason Wray <friedbunny@users.noreply.github.com> | 2018-10-09 12:34:58 -0400 |
commit | 096bf5ac0e4ca2a9b480aafa1bcfa2a82b8cd8aa (patch) | |
tree | 5157f64c9cfd05f0770b2c58e37c80ef24ff376a | |
parent | 68e5b66b5d22641f34433ef57c59789278683e95 (diff) | |
download | qtlocation-mapboxgl-096bf5ac0e4ca2a9b480aafa1bcfa2a82b8cd8aa.tar.gz |
[ios] Fix divide-by-zero when setting FPS on iOS <10
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 4 |
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); } } |