diff options
author | Young Hahn <young@mapbox.com> | 2016-06-10 23:05:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-10 23:05:15 -0400 |
commit | ecd4aa14397ed081a521d8412557724e52f277f3 (patch) | |
tree | a04bca00190eba8f3f3947689ab6b7ff537e8946 /scripts | |
parent | a8df0feb5414af2c16bfdae27431d779e4545dbe (diff) | |
download | qtlocation-mapboxgl-ecd4aa14397ed081a521d8412557724e52f277f3.tar.gz |
text-pitch-alignment (#5288)
* First pass at port of https://github.com/mapbox/mapbox-gl-js/pull/2668
* RotationAlignmentType => AlignmentType
* Handle undefined default value for text-pitch-alignment and implement inheritance for this value from text-rotation-alignment
* Update dependencies
* Move handling fo undefined default value out of camelize functions
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/generate-style-code.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/generate-style-code.js b/scripts/generate-style-code.js index 6379598446..1796cda212 100644 --- a/scripts/generate-style-code.js +++ b/scripts/generate-style-code.js @@ -21,8 +21,8 @@ global.propertyType = function (property) { if (/-translate-anchor$/.test(property.name)) { return 'TranslateAnchorType'; } - if (/-rotation-alignment$/.test(property.name)) { - return 'RotationAlignmentType'; + if (/-(rotation|pitch)-alignment$/.test(property.name)) { + return 'AlignmentType'; } switch (property.type) { case 'boolean': @@ -57,7 +57,11 @@ global.defaultValue = function (property) { case 'string': return JSON.stringify(property.default || ""); case 'enum': - return `${propertyType(property)}::${camelize(property.default)}`; + if (property.default === undefined) { + return `${propertyType(property)}::Undefined`; + } else { + return `${propertyType(property)}::${camelize(property.default)}`; + } case 'color': return `{{ ${parseCSSColor(property.default).join(', ')} }}` case 'array': |