line-offset -> line-gap-width

This commit is contained in:
Lauren Budorick
2014-10-26 17:31:06 -04:00
committed by John Firebaugh
parent 0e3f111a79
commit 0d6bca0e7e
6 changed files with 8 additions and 7 deletions

View File

@@ -21,7 +21,7 @@ enum class PropertyKey {
LineTranslateY,
LineTranslateAnchor,
LineWidth,
LineOffset,
LineGapWidth,
LineBlur,
LineDashArray, // for transitions only
LineDashLand,

View File

@@ -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;

View File

@@ -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

View File

@@ -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] },

View File

@@ -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);

View File

@@ -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);