From ecd4aa14397ed081a521d8412557724e52f277f3 Mon Sep 17 00:00:00 2001 From: Young Hahn Date: Fri, 10 Jun 2016 23:05:15 -0400 Subject: 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 --- scripts/generate-style-code.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'scripts') 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': -- cgit v1.2.1