summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLCompassDirectionFormatter.m
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLCompassDirectionFormatter.m')
-rw-r--r--platform/darwin/src/MGLCompassDirectionFormatter.m2
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/darwin/src/MGLCompassDirectionFormatter.m b/platform/darwin/src/MGLCompassDirectionFormatter.m
index 8a4118ba55..c46fe9e4d5 100644
--- a/platform/darwin/src/MGLCompassDirectionFormatter.m
+++ b/platform/darwin/src/MGLCompassDirectionFormatter.m
@@ -98,7 +98,7 @@
NSAssert(shortStrings.count == longStrings.count, @"Long and short compass direction string arrays must have the same size.");
});
- NSInteger cardinalPoint = round(wrap(direction, 0, 360) / 360 * shortStrings.count);
+ NSInteger cardinalPoint = wrap(round(wrap(direction, 0, 360) / 360 * shortStrings.count), 0, shortStrings.count);
switch (self.unitStyle) {
case NSFormattingUnitStyleShort:
return shortStrings[cardinalPoint];