From 89d4c40d927388f44e00e004e8a22db2d1b2eeab Mon Sep 17 00:00:00 2001 From: Fredrik Karlsson Date: Thu, 8 Dec 2016 10:05:58 +0100 Subject: [ios, macos] renamed raster-hue-rotate --- platform/darwin/scripts/style-spec-cocoa-conventions-v8.json | 3 ++- platform/darwin/src/MGLRasterStyleLayer.h | 4 +++- platform/darwin/src/MGLRasterStyleLayer.mm | 6 +++--- platform/darwin/test/MGLRasterStyleLayerTests.m | 8 ++++---- 4 files changed, 12 insertions(+), 9 deletions(-) (limited to 'platform') diff --git a/platform/darwin/scripts/style-spec-cocoa-conventions-v8.json b/platform/darwin/scripts/style-spec-cocoa-conventions-v8.json index 0a1aa90493..a144871a67 100644 --- a/platform/darwin/scripts/style-spec-cocoa-conventions-v8.json +++ b/platform/darwin/scripts/style-spec-cocoa-conventions-v8.json @@ -5,7 +5,8 @@ }, "paint_raster": { "raster-brightness-min": "minimum-raster-brightness", - "raster-brightness-max": "maximum-raster-brightness" + "raster-brightness-max": "maximum-raster-brightness", + "raster-hue-rotate": "raster-hue-rotation" }, "paint_line": { "line-dasharray": "line-dash-pattern" diff --git a/platform/darwin/src/MGLRasterStyleLayer.h b/platform/darwin/src/MGLRasterStyleLayer.h index e1b88900b0..916a0128d6 100644 --- a/platform/darwin/src/MGLRasterStyleLayer.h +++ b/platform/darwin/src/MGLRasterStyleLayer.h @@ -56,8 +56,10 @@ NS_ASSUME_NONNULL_BEGIN This property is measured in degrees. The default value of this property is an `MGLStyleValue` object containing an `NSNumber` object containing the float `0`. Set this property to `nil` to reset it to the default value. + + This attribute corresponds to the raster-hue-rotate paint property in the Mapbox Style Specification. */ -@property (nonatomic, null_resettable) MGLStyleValue *rasterHueRotate; +@property (nonatomic, null_resettable) MGLStyleValue *rasterHueRotation; /** The opacity at which the image will be drawn. diff --git a/platform/darwin/src/MGLRasterStyleLayer.mm b/platform/darwin/src/MGLRasterStyleLayer.mm index d54f027432..1bb5c33c28 100644 --- a/platform/darwin/src/MGLRasterStyleLayer.mm +++ b/platform/darwin/src/MGLRasterStyleLayer.mm @@ -127,14 +127,14 @@ return MGLStyleValueTransformer().toStyleValue(propertyValue); } -- (void)setRasterHueRotate:(MGLStyleValue *)rasterHueRotate { +- (void)setRasterHueRotation:(MGLStyleValue *)rasterHueRotation { MGLAssertStyleLayerIsValid(); - auto mbglValue = MGLStyleValueTransformer().toPropertyValue(rasterHueRotate); + auto mbglValue = MGLStyleValueTransformer().toPropertyValue(rasterHueRotation); _rawLayer->setRasterHueRotate(mbglValue); } -- (MGLStyleValue *)rasterHueRotate { +- (MGLStyleValue *)rasterHueRotation { MGLAssertStyleLayerIsValid(); auto propertyValue = _rawLayer->getRasterHueRotate() ?: _rawLayer->getDefaultRasterHueRotate(); diff --git a/platform/darwin/test/MGLRasterStyleLayerTests.m b/platform/darwin/test/MGLRasterStyleLayerTests.m index 84fd0fe3e5..197f1d4723 100644 --- a/platform/darwin/test/MGLRasterStyleLayerTests.m +++ b/platform/darwin/test/MGLRasterStyleLayerTests.m @@ -20,7 +20,7 @@ layer.minimumRasterBrightness = [MGLRuntimeStylingHelper testNumber]; layer.rasterContrast = [MGLRuntimeStylingHelper testNumber]; layer.rasterFadeDuration = [MGLRuntimeStylingHelper testNumber]; - layer.rasterHueRotate = [MGLRuntimeStylingHelper testNumber]; + layer.rasterHueRotation = [MGLRuntimeStylingHelper testNumber]; layer.rasterOpacity = [MGLRuntimeStylingHelper testNumber]; layer.rasterSaturation = [MGLRuntimeStylingHelper testNumber]; @@ -30,7 +30,7 @@ XCTAssertEqualObjects(gLayer.minimumRasterBrightness, [MGLRuntimeStylingHelper testNumber]); XCTAssertEqualObjects(gLayer.rasterContrast, [MGLRuntimeStylingHelper testNumber]); XCTAssertEqualObjects(gLayer.rasterFadeDuration, [MGLRuntimeStylingHelper testNumber]); - XCTAssertEqualObjects(gLayer.rasterHueRotate, [MGLRuntimeStylingHelper testNumber]); + XCTAssertEqualObjects(gLayer.rasterHueRotation, [MGLRuntimeStylingHelper testNumber]); XCTAssertEqualObjects(gLayer.rasterOpacity, [MGLRuntimeStylingHelper testNumber]); XCTAssertEqualObjects(gLayer.rasterSaturation, [MGLRuntimeStylingHelper testNumber]); @@ -38,7 +38,7 @@ layer.minimumRasterBrightness = [MGLRuntimeStylingHelper testNumberFunction]; layer.rasterContrast = [MGLRuntimeStylingHelper testNumberFunction]; layer.rasterFadeDuration = [MGLRuntimeStylingHelper testNumberFunction]; - layer.rasterHueRotate = [MGLRuntimeStylingHelper testNumberFunction]; + layer.rasterHueRotation = [MGLRuntimeStylingHelper testNumberFunction]; layer.rasterOpacity = [MGLRuntimeStylingHelper testNumberFunction]; layer.rasterSaturation = [MGLRuntimeStylingHelper testNumberFunction]; @@ -46,7 +46,7 @@ XCTAssertEqualObjects(gLayer.minimumRasterBrightness, [MGLRuntimeStylingHelper testNumberFunction]); XCTAssertEqualObjects(gLayer.rasterContrast, [MGLRuntimeStylingHelper testNumberFunction]); XCTAssertEqualObjects(gLayer.rasterFadeDuration, [MGLRuntimeStylingHelper testNumberFunction]); - XCTAssertEqualObjects(gLayer.rasterHueRotate, [MGLRuntimeStylingHelper testNumberFunction]); + XCTAssertEqualObjects(gLayer.rasterHueRotation, [MGLRuntimeStylingHelper testNumberFunction]); XCTAssertEqualObjects(gLayer.rasterOpacity, [MGLRuntimeStylingHelper testNumberFunction]); XCTAssertEqualObjects(gLayer.rasterSaturation, [MGLRuntimeStylingHelper testNumberFunction]); } -- cgit v1.2.1