diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2017-01-06 12:29:03 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2017-01-07 15:47:31 -0800 |
commit | bf8d037fca3a5e76818f2cd546e783814f046019 (patch) | |
tree | d7d3522a5b7a2113a6c4fcf29b7b77ab6ed931e5 /platform/darwin/scripts | |
parent | 17b3ec1edd217b8b14d64b74cbf58b0e4ae4f241 (diff) | |
download | qtlocation-mapboxgl-bf8d037fca3a5e76818f2cd546e783814f046019.tar.gz |
[ios, macos] -translate → -translation
Diffstat (limited to 'platform/darwin/scripts')
-rw-r--r-- | platform/darwin/scripts/generate-style-code.js | 20 | ||||
-rw-r--r-- | platform/darwin/scripts/style-spec-cocoa-conventions-v8.json | 20 |
2 files changed, 27 insertions, 13 deletions
diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js index a7421da103..dfc0d64ec2 100644 --- a/platform/darwin/scripts/generate-style-code.js +++ b/platform/darwin/scripts/generate-style-code.js @@ -256,16 +256,18 @@ global.describeValue = function (value, property, layerType) { if (units) { units = ` ${units}`.replace(/pixel/, 'point'); } - if (property.name.indexOf('padding') !== -1) { - if (value[0] === 0 && value[1] === 0 && value[2] === 0 && value[3] === 0) { - return 'an `NSValue` object containing `NSEdgeInsetsZero` or `UIEdgeInsetsZero`'; - } - return 'an `NSValue` object containing an `NSEdgeInsets` or `UIEdgeInsets` struct set to' + ` ${value[0]}${units} on the top, ${value[3]}${units} on the left, ${value[2]}${units} on the bottom, and ${value[1]}${units} on the right`; - } - if (property.name.indexOf('offset') !== -1 || property.name.indexOf('translate') !== -1) { - return 'an `NSValue` object containing a `CGVector` struct set to' + ` ${value[0]}${units} from the left and ${value[1]}${units} from the top`; + switch (arrayType(property)) { + case 'padding': + if (value[0] === 0 && value[1] === 0 && value[2] === 0 && value[3] === 0) { + return 'an `NSValue` object containing `NSEdgeInsetsZero` or `UIEdgeInsetsZero`'; + } + return 'an `NSValue` object containing an `NSEdgeInsets` or `UIEdgeInsets` struct set to' + ` ${value[0]}${units} on the top, ${value[3]}${units} on the left, ${value[2]}${units} on the bottom, and ${value[1]}${units} on the right`; + case 'offset': + case 'translate': + return 'an `NSValue` object containing a `CGVector` struct set to' + ` ${value[0]}${units} from the left and ${value[1]}${units} from the top`; + default: + return 'the array `' + value.join('`, `') + '`'; } - return 'the array `' + value.join('`, `') + '`'; default: throw new Error(`unknown type for ${property.name}`); } diff --git a/platform/darwin/scripts/style-spec-cocoa-conventions-v8.json b/platform/darwin/scripts/style-spec-cocoa-conventions-v8.json index 4c47d178b5..9d80ff3896 100644 --- a/platform/darwin/scripts/style-spec-cocoa-conventions-v8.json +++ b/platform/darwin/scripts/style-spec-cocoa-conventions-v8.json @@ -21,7 +21,14 @@ "text-size": "text-font-size" }, "paint_circle": { - "circle-pitch-scale": "circle-scale-alignment" + "circle-pitch-scale": "circle-scale-alignment", + "circle-translate": "circle-translation", + "circle-translate-anchor": "circle-translation-anchor" + }, + "paint_fill": { + "fill-antialias": "is-fill-antialiased", + "fill-translate": "fill-translation", + "fill-translate-anchor": "fill-translation-anchor" }, "paint_raster": { "raster-brightness-min": "minimum-raster-brightness", @@ -29,9 +36,14 @@ "raster-hue-rotate": "raster-hue-rotation" }, "paint_line": { - "line-dasharray": "line-dash-pattern" + "line-dasharray": "line-dash-pattern", + "line-translate": "line-translation", + "line-translate-anchor": "line-translation-anchor" }, - "paint_fill": { - "fill-antialias": "is-fill-antialiased" + "paint_symbol": { + "icon-translate": "icon-translation", + "icon-translate-anchor": "icon-translation-anchor", + "text-translate": "text-translation", + "text-translate-anchor": "text-translation-anchor" } }
\ No newline at end of file |