From 0ff218d688084146fee178ce52c17f346fa67198 Mon Sep 17 00:00:00 2001 From: Alexander Shalamov Date: Wed, 19 Jun 2019 22:07:32 +0300 Subject: [darwin] Add plural override for 'text-writing-mode' layout property --- platform/darwin/src/MGLSymbolStyleLayer.mm | 35 ++++++++++++++++++------------ 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'platform/darwin/src/MGLSymbolStyleLayer.mm') diff --git a/platform/darwin/src/MGLSymbolStyleLayer.mm b/platform/darwin/src/MGLSymbolStyleLayer.mm index 99cfe5db10..e60da45a38 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.mm +++ b/platform/darwin/src/MGLSymbolStyleLayer.mm @@ -96,9 +96,9 @@ namespace mbgl { { MGLTextTransformLowercase, "lowercase" }, }); - MBGL_DEFINE_ENUM(MGLTextWritingMode, { - { MGLTextWritingModeHorizontal, "horizontal" }, - { MGLTextWritingModeVertical, "vertical" }, + MBGL_DEFINE_ENUM(MGLTextWritingModes, { + { MGLTextWritingModesHorizontal, "horizontal" }, + { MGLTextWritingModesVertical, "vertical" }, }); MBGL_DEFINE_ENUM(MGLIconTranslationAnchor, { @@ -1028,22 +1028,29 @@ namespace mbgl { return MGLStyleValueTransformer, NSArray *, mbgl::style::SymbolAnchorType, MGLTextAnchor>().toExpression(propertyValue); } -- (void)setTextWritingMode:(NSExpression *)textWritingMode { +- (void)setTextWritingModes:(NSExpression *)textWritingModes { MGLAssertStyleLayerIsValid(); - MGLLogDebug(@"Setting textWritingMode: %@", textWritingMode); + MGLLogDebug(@"Setting textWritingModes: %@", textWritingModes); - auto mbglValue = MGLStyleValueTransformer, NSArray *, mbgl::style::TextWritingModeType, MGLTextWritingMode>().toPropertyValue>>(textWritingMode, false); + auto mbglValue = MGLStyleValueTransformer, NSArray *, mbgl::style::TextWritingModeType, MGLTextWritingModes>().toPropertyValue>>(textWritingModes, false); self.rawLayer->setTextWritingMode(mbglValue); } -- (NSExpression *)textWritingMode { +- (NSExpression *)textWritingModes { MGLAssertStyleLayerIsValid(); auto propertyValue = self.rawLayer->getTextWritingMode(); if (propertyValue.isUndefined()) { propertyValue = self.rawLayer->getDefaultTextWritingMode(); } - return MGLStyleValueTransformer, NSArray *, mbgl::style::TextWritingModeType, MGLTextWritingMode>().toExpression(propertyValue); + return MGLStyleValueTransformer, NSArray *, mbgl::style::TextWritingModeType, MGLTextWritingModes>().toExpression(propertyValue); +} + +- (void)setTextWritingMode:(NSExpression *)textWritingMode { +} + +- (NSExpression *)textWritingMode { + return self.textWritingModes; } #pragma mark - Accessing the Paint Attributes @@ -1622,14 +1629,14 @@ namespace mbgl { return textTransform; } -+ (NSValue *)valueWithMGLTextWritingMode:(MGLTextWritingMode)textWritingMode { - return [NSValue value:&textWritingMode withObjCType:@encode(MGLTextWritingMode)]; ++ (NSValue *)valueWithMGLTextWritingModes:(MGLTextWritingModes)textWritingModes { + return [NSValue value:&textWritingModes withObjCType:@encode(MGLTextWritingModes)]; } -- (MGLTextWritingMode)MGLTextWritingModeValue { - MGLTextWritingMode textWritingMode; - [self getValue:&textWritingMode]; - return textWritingMode; +- (MGLTextWritingModes)MGLTextWritingModesValue { + MGLTextWritingModes textWritingModes; + [self getValue:&textWritingModes]; + return textWritingModes; } + (NSValue *)valueWithMGLIconTranslationAnchor:(MGLIconTranslationAnchor)iconTranslationAnchor { -- cgit v1.2.1