diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-08-25 21:59:55 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2016-08-26 15:40:10 -0700 |
commit | 9d368ea98d096c1eed2c1eb7edc4a37ff31b03b7 (patch) | |
tree | 602b5aaf36a8d3db50e14b58e668f53ffe8d99a0 /platform/darwin/src/MGLBackgroundStyleLayer.mm | |
parent | 8dff7ab2f0fe1f2d1412e79c99285f1a389e6541 (diff) | |
download | qtlocation-mapboxgl-9d368ea98d096c1eed2c1eb7edc4a37ff31b03b7.tar.gz |
[ios, macos] Mark MGLStyleLayer properties null_resettable
If the property is unset, return the default value.
Fixes #6126.
Diffstat (limited to 'platform/darwin/src/MGLBackgroundStyleLayer.mm')
-rw-r--r-- | platform/darwin/src/MGLBackgroundStyleLayer.mm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/darwin/src/MGLBackgroundStyleLayer.mm b/platform/darwin/src/MGLBackgroundStyleLayer.mm index 1a991a65e9..32e2e7847e 100644 --- a/platform/darwin/src/MGLBackgroundStyleLayer.mm +++ b/platform/darwin/src/MGLBackgroundStyleLayer.mm @@ -37,7 +37,7 @@ } - (id <MGLStyleAttributeValue>)backgroundColor { - return [MGLStyleAttribute mbgl_colorWithPropertyValueColor:self.layer->getBackgroundColor()]; + return [MGLStyleAttribute mbgl_colorWithPropertyValueColor:self.layer->getBackgroundColor() ?: self.layer->getDefaultBackgroundColor()]; } - (void)setBackgroundPattern:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)backgroundPattern { @@ -46,7 +46,7 @@ } - (id <MGLStyleAttributeValue>)backgroundPattern { - return [MGLStyleAttribute mbgl_stringWithPropertyValueString:self.layer->getBackgroundPattern()]; + return [MGLStyleAttribute mbgl_stringWithPropertyValueString:self.layer->getBackgroundPattern() ?: self.layer->getDefaultBackgroundPattern()]; } - (void)setBackgroundOpacity:(id <MGLStyleAttributeValue, MGLStyleAttributeValue_Private>)backgroundOpacity { @@ -55,7 +55,7 @@ } - (id <MGLStyleAttributeValue>)backgroundOpacity { - return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getBackgroundOpacity()]; + return [MGLStyleAttribute mbgl_numberWithPropertyValueNumber:self.layer->getBackgroundOpacity() ?: self.layer->getDefaultBackgroundOpacity()]; } @end |