summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-08-18 00:14:43 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-08-19 14:20:26 -0700
commita4fcea412239f6936ab0dd0d21abda912e22bd47 (patch)
tree11a644ceceb962e3124e8e98b5a9bb7aa139d142
parentaa03f0cab704f45bc7fbc2878cf7256e310f6dce (diff)
downloadqtlocation-mapboxgl-a4fcea412239f6936ab0dd0d21abda912e22bd47.tar.gz
[ios, macos] Refer to attributes in kebab-case
Fixes #5951.
-rw-r--r--platform/darwin/scripts/generate-style-code.js10
-rw-r--r--platform/darwin/src/MGLFillStyleLayer.h2
-rw-r--r--platform/darwin/src/MGLStyleLayer.h.ejs4
-rw-r--r--platform/darwin/src/MGLSymbolStyleLayer.h2
4 files changed, 14 insertions, 4 deletions
diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js
index dd634fd69b..77c1ee5a1d 100644
--- a/platform/darwin/scripts/generate-style-code.js
+++ b/platform/darwin/scripts/generate-style-code.js
@@ -87,6 +87,16 @@ global.testArrayImplementation = function (property) {
}
};
+global.propertyDoc = function (property, layerType) {
+ let doc = property.doc.replace(/`(.+?)`/g, function (m, symbol, offset, str) {
+ if (!('values' in property && property.values.indexOf(symbol) !== -1) && str.substr(offset - 4, 3) !== 'CSS') {
+ symbol = camelizeWithLeadingLowercase(symbol);
+ }
+ return '`' + symbol + '`';
+ });
+ return doc;
+};
+
global.propertyType = function (property, _private) {
return _private ? `id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>` : `id <MGLStyleAttributeValue>`;
};
diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h
index de5369a333..c3e6d63d1e 100644
--- a/platform/darwin/src/MGLFillStyleLayer.h
+++ b/platform/darwin/src/MGLFillStyleLayer.h
@@ -29,7 +29,7 @@ typedef NS_ENUM(NSUInteger, MGLFillStyleLayerFillTranslateAnchor) {
@property (nonatomic) id <MGLStyleAttributeValue> fillColor;
/**
- The outline color of the fill. Matches the value of `fill-color` if unspecified.
+ The outline color of the fill. Matches the value of `fillColor` if unspecified.
*/
@property (nonatomic) id <MGLStyleAttributeValue> fillOutlineColor;
diff --git a/platform/darwin/src/MGLStyleLayer.h.ejs b/platform/darwin/src/MGLStyleLayer.h.ejs
index 4ef28469f1..bf6721e41f 100644
--- a/platform/darwin/src/MGLStyleLayer.h.ejs
+++ b/platform/darwin/src/MGLStyleLayer.h.ejs
@@ -36,7 +36,7 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(type) %>StyleLayer<%- camelize(prope
<% for (const property of layoutProperties) { -%>
/**
- <%- property.doc %>
+ <%- propertyDoc(property, type) %>
*/
@property (nonatomic) <%- propertyType(property, false, type) %> <%- camelizeWithLeadingLowercase(property.name) %>;
@@ -46,7 +46,7 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(type) %>StyleLayer<%- camelize(prope
<% for (const property of paintProperties) { -%>
/**
- <%- property.doc %>
+ <%- propertyDoc(property, type) %>
*/
@property (nonatomic) <%- propertyType(property, false, type) %> <%- camelizeWithLeadingLowercase(property.name) %>;
diff --git a/platform/darwin/src/MGLSymbolStyleLayer.h b/platform/darwin/src/MGLSymbolStyleLayer.h
index 371107226f..a4d6c2b5b0 100644
--- a/platform/darwin/src/MGLSymbolStyleLayer.h
+++ b/platform/darwin/src/MGLSymbolStyleLayer.h
@@ -145,7 +145,7 @@ typedef NS_ENUM(NSUInteger, MGLSymbolStyleLayerTextTranslateAnchor) {
@property (nonatomic) id <MGLStyleAttributeValue> iconOffset;
/**
- Aligns text to the plane of the `viewport` or the `map` when the map is pitched. Matches `text-rotation-alignment` if unspecified.
+ Aligns text to the plane of the `viewport` or the `map` when the map is pitched. Matches `textRotationAlignment` if unspecified.
*/
@property (nonatomic) id <MGLStyleAttributeValue> textPitchAlignment;