diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-10-19 15:24:22 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-10-22 09:34:40 -0700 |
commit | 3afc8b4a2939da70c76dc5b2eb5d007fc917d348 (patch) | |
tree | 176372e3631a81303f379f30de235996f22212f2 /src/mbgl/layer/line_layer.cpp | |
parent | df89de5cc5bf043ca2fe57ef4dd9a7b5d25464cb (diff) | |
download | qtlocation-mapboxgl-3afc8b4a2939da70c76dc5b2eb5d007fc917d348.tar.gz |
[core] Introduce StyleLayer subclasses
Diffstat (limited to 'src/mbgl/layer/line_layer.cpp')
-rw-r--r-- | src/mbgl/layer/line_layer.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mbgl/layer/line_layer.cpp b/src/mbgl/layer/line_layer.cpp new file mode 100644 index 0000000000..340f8fe7f4 --- /dev/null +++ b/src/mbgl/layer/line_layer.cpp @@ -0,0 +1,22 @@ +#include <mbgl/layer/line_layer.hpp> + +namespace mbgl { + +RenderPass LineLayer::applyStyleProperties(const float z, const TimePoint& now, const ZoomHistory& zoomHistory) { + applyTransitionedStyleProperty(PropertyKey::LineOpacity, properties.opacity, z, now, zoomHistory); + applyTransitionedStyleProperty(PropertyKey::LineColor, properties.color, z, now, zoomHistory); + applyTransitionedStyleProperty(PropertyKey::LineTranslate, properties.translate, z, now, zoomHistory); + applyStyleProperty(PropertyKey::LineTranslateAnchor, properties.translateAnchor, z, now, zoomHistory); + applyTransitionedStyleProperty(PropertyKey::LineWidth, properties.width, z, now, zoomHistory); + applyTransitionedStyleProperty(PropertyKey::LineGapWidth, properties.gap_width, z, now, zoomHistory); + applyTransitionedStyleProperty(PropertyKey::LineBlur, properties.blur, z, now, zoomHistory); + applyStyleProperty(PropertyKey::LineDashArray, properties.dash_array, z, now, zoomHistory); + applyStyleProperty(PropertyKey::LineImage, properties.image, z, now, zoomHistory); + + // for scaling dasharrays + applyStyleProperty(PropertyKey::LineWidth, properties.dash_line_width, std::floor(z), now, zoomHistory); + + return properties.isVisible() ? RenderPass::Translucent : RenderPass::None; +} + +} |