From b1cc89fc9c83784c30afcf67e40130ddc69d989c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Fri, 26 Aug 2016 00:32:00 -0700 Subject: [PATCH] [ios, macos] Fixed roundtripping padding functions --- platform/darwin/src/MGLStyleAttributeFunction.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/darwin/src/MGLStyleAttributeFunction.mm b/platform/darwin/src/MGLStyleAttributeFunction.mm index 46fa3ec6a..56dd852b3 100644 --- a/platform/darwin/src/MGLStyleAttributeFunction.mm +++ b/platform/darwin/src/MGLStyleAttributeFunction.mm @@ -94,7 +94,7 @@ { __block std::vector>> stops; [self.stops enumerateKeysAndObjectsUsingBlock:^(NSNumber * _Nonnull zoomKey, NSValue * _Nonnull padding, BOOL * _Nonnull stop) { - NSAssert([padding isKindOfClass:[NSArray class]], @"Stops should be NSValue"); + NSAssert([padding isKindOfClass:[NSValue class]], @"Stops should be NSValue"); stops.emplace_back(zoomKey.floatValue, padding.mgl_paddingArrayValue); }]; return mbgl::style::Function>({{stops}}, _base.floatValue); @@ -181,7 +181,7 @@ auto stops = property.getStops(); NSMutableDictionary *convertedStops = [NSMutableDictionary dictionaryWithCapacity:stops.size()]; for (auto stop : stops) { - convertedStops[@(stop.first)] = @[@(stop.second[0]), @(stop.second[1]), @(stop.second[2]), @(stop.second[3])]; + convertedStops[@(stop.first)] = [NSValue mgl_valueWithPaddingArray:stop.second]; } function.base = @(property.getBase()); function.stops = convertedStops;