diff options
author | Jesse Bounds <jesse@rebounds.net> | 2017-02-15 14:35:45 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-02-17 14:36:36 -0800 |
commit | 9924535415cfaa45aa27d613f6141b96c7f16a68 (patch) | |
tree | 5c01c8bad6db31fce012ce964db69da43067077a | |
parent | ab20d38883a6fdd2f861a5b799c51d0b09306e79 (diff) | |
download | qtlocation-mapboxgl-9924535415cfaa45aa27d613f6141b96c7f16a68.tar.gz |
[core] Render a circle if either the color or stroke color are visible
This updates the circle paint check to pass if the circle stroke is
visible but:
* The circle color is clear
* The circle is transparent
* The circle has a radius of 0
Previously, a transparent circle or a circle with a radius of 0 would
cause the layer to be passed up even if the circle stroke color had a
non zero alpha.
m--------- | mapbox-gl-js | 0 | ||||
-rw-r--r-- | src/mbgl/style/layers/circle_layer_impl.cpp | 9 |
2 files changed, 6 insertions, 3 deletions
diff --git a/mapbox-gl-js b/mapbox-gl-js -Subproject 2af18eebca9173ca8e5cf15559f9b16d7c986fc +Subproject fd73395ef71cf77993d717b2e23c5dab5e372b6 diff --git a/src/mbgl/style/layers/circle_layer_impl.cpp b/src/mbgl/style/layers/circle_layer_impl.cpp index 655ad9b5b9..ea1d4eeb65 100644 --- a/src/mbgl/style/layers/circle_layer_impl.cpp +++ b/src/mbgl/style/layers/circle_layer_impl.cpp @@ -14,9 +14,12 @@ void CircleLayer::Impl::cascade(const CascadeParameters& parameters) { bool CircleLayer::Impl::evaluate(const PropertyEvaluationParameters& parameters) { paint.evaluate(parameters); - passes = (paint.evaluated.get<CircleRadius>().constantOr(1) > 0 - && paint.evaluated.get<CircleColor>().constantOr(Color::black()).a > 0 - && paint.evaluated.get<CircleOpacity>().constantOr(1) > 0) + passes = ((paint.evaluated.get<CircleRadius>().constantOr(1) > 0 || + paint.evaluated.get<CircleStrokeWidth>().constantOr(1) > 0) + && (paint.evaluated.get<CircleColor>().constantOr(Color::black()).a > 0 || + paint.evaluated.get<CircleStrokeColor>().constantOr(Color::black()).a > 0) + && (paint.evaluated.get<CircleOpacity>().constantOr(1) > 0 || + paint.evaluated.get<CircleStrokeOpacity>().constantOr(1) > 0)) ? RenderPass::Translucent : RenderPass::None; return paint.hasTransition(); |