summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mbgl/style/property_key.hpp2
-rw-r--r--include/mbgl/style/style_properties.hpp2
-rw-r--r--src/renderer/painter_line.cpp3
-rw-r--r--src/style/property_fallback.cpp2
-rw-r--r--src/style/style_layer.cpp2
-rw-r--r--src/style/style_parser.cpp4
6 files changed, 8 insertions, 7 deletions
diff --git a/include/mbgl/style/property_key.hpp b/include/mbgl/style/property_key.hpp
index cbf9ad2ac5..efeebf0242 100644
--- a/include/mbgl/style/property_key.hpp
+++ b/include/mbgl/style/property_key.hpp
@@ -21,7 +21,7 @@ enum class PropertyKey {
LineTranslateY,
LineTranslateAnchor,
LineWidth,
- LineOffset,
+ LineGapWidth,
LineBlur,
LineDashArray, // for transitions only
LineDashLand,
diff --git a/include/mbgl/style/style_properties.hpp b/include/mbgl/style/style_properties.hpp
index 0a5e993411..c44b7c34c8 100644
--- a/include/mbgl/style/style_properties.hpp
+++ b/include/mbgl/style/style_properties.hpp
@@ -34,7 +34,7 @@ struct LineProperties {
std::array<float, 2> translate = {{ 0, 0 }};
TranslateAnchorType translateAnchor = TranslateAnchorType::Map;
float width = 1;
- float offset = 0;
+ float gap_width = 0;
float blur = 0;
std::array<float, 2> dash_array = {{ 1, -1 }};
std::string image;
diff --git a/src/renderer/painter_line.cpp b/src/renderer/painter_line.cpp
index 9893f032dd..93d8db1a53 100644
--- a/src/renderer/painter_line.cpp
+++ b/src/renderer/painter_line.cpp
@@ -17,7 +17,8 @@ void Painter::renderLine(LineBucket& bucket, util::ptr<StyleLayer> layer_desc, c
float antialiasing = 1 / state.getPixelRatio();
float width = properties.width;
- float offset = properties.offset / 2;
+ float offset = properties.gap_width / 2;
+ offset = offset == 0 ? offset : offset + width / 2;
float blur = properties.blur + antialiasing;
// These are the radii of the line. We are limiting it to 16, which will result
diff --git a/src/style/property_fallback.cpp b/src/style/property_fallback.cpp
index 572c4b7a8a..965baf6c4b 100644
--- a/src/style/property_fallback.cpp
+++ b/src/style/property_fallback.cpp
@@ -18,7 +18,7 @@ const std::map<PropertyKey, PropertyValue> PropertyFallbackValue::properties = {
{ PropertyKey::LineTranslateY, defaultStyleProperties<LineProperties>().translate[1] },
{ PropertyKey::LineTranslateAnchor, defaultStyleProperties<LineProperties>().translateAnchor },
{ PropertyKey::LineWidth, defaultStyleProperties<LineProperties>().width },
- { PropertyKey::LineOffset, defaultStyleProperties<LineProperties>().offset },
+ { PropertyKey::LineGapWidth, defaultStyleProperties<LineProperties>().gap_width },
{ PropertyKey::LineBlur, defaultStyleProperties<LineProperties>().blur },
{ PropertyKey::LineDashLand, defaultStyleProperties<LineProperties>().dash_array[0] },
{ PropertyKey::LineDashGap, defaultStyleProperties<LineProperties>().dash_array[1] },
diff --git a/src/style/style_layer.cpp b/src/style/style_layer.cpp
index ded73c0444..e58756afa4 100644
--- a/src/style/style_layer.cpp
+++ b/src/style/style_layer.cpp
@@ -183,7 +183,7 @@ void StyleLayer::applyStyleProperties<LineProperties>(const float z, const times
applyTransitionedStyleProperty(PropertyKey::LineTranslateY, line.translate[1], z, now);
applyStyleProperty(PropertyKey::LineTranslateAnchor, line.translateAnchor, z, now);
applyTransitionedStyleProperty(PropertyKey::LineWidth, line.width, z, now);
- applyTransitionedStyleProperty(PropertyKey::LineOffset, line.offset, z, now);
+ applyTransitionedStyleProperty(PropertyKey::LineGapWidth, line.gap_width, z, now);
applyTransitionedStyleProperty(PropertyKey::LineBlur, line.blur, z, now);
applyTransitionedStyleProperty(PropertyKey::LineDashLand, line.dash_array[0], z, now);
applyTransitionedStyleProperty(PropertyKey::LineDashGap, line.dash_array[1], z, now);
diff --git a/src/style/style_parser.cpp b/src/style/style_parser.cpp
index 47ff0c30ab..5c4ed0cb1a 100644
--- a/src/style/style_parser.cpp
+++ b/src/style/style_parser.cpp
@@ -586,8 +586,8 @@ void StyleParser::parseStyle(JSVal value, ClassProperties &klass) {
parseOptionalProperty<TranslateAnchorType>("line-translate-anchor", Key::LineTranslateAnchor, klass, value);
parseOptionalProperty<Function<float>>("line-width", Key::LineWidth, klass, value);
parseOptionalProperty<PropertyTransition>("line-width-transition", Key::LineWidth, klass, value);
- parseOptionalProperty<Function<float>>("line-offset", Key::LineOffset, klass, value);
- parseOptionalProperty<PropertyTransition>("line-offset-transition", Key::LineOffset, klass, value);
+ parseOptionalProperty<Function<float>>("line-gap-width", Key::LineGapWidth, klass, value);
+ parseOptionalProperty<PropertyTransition>("line-gap-width-transition", Key::LineGapWidth, klass, value);
parseOptionalProperty<Function<float>>("line-blur", Key::LineBlur, klass, value);
parseOptionalProperty<PropertyTransition>("line-blur-transition", Key::LineBlur, klass, value);
parseOptionalProperty<Function<float>>("line-dasharray", { Key::LineDashLand, Key::LineDashGap }, klass, value);