From 9924535415cfaa45aa27d613f6141b96c7f16a68 Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Wed, 15 Feb 2017 14:35:45 -0800 Subject: [PATCH] [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. --- mapbox-gl-js | 2 +- src/mbgl/style/layers/circle_layer_impl.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/mapbox-gl-js b/mapbox-gl-js index 2af18eebc..fd73395ef 160000 --- a/mapbox-gl-js +++ b/mapbox-gl-js @@ -1 +1 @@ -Subproject commit 2af18eebca9173ca8e5cf15559f9b16d7c986fc1 +Subproject commit fd73395ef71cf77993d717b2e23c5dab5e372b61 diff --git a/src/mbgl/style/layers/circle_layer_impl.cpp b/src/mbgl/style/layers/circle_layer_impl.cpp index 655ad9b5b..ea1d4eeb6 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().constantOr(1) > 0 - && paint.evaluated.get().constantOr(Color::black()).a > 0 - && paint.evaluated.get().constantOr(1) > 0) + passes = ((paint.evaluated.get().constantOr(1) > 0 || + paint.evaluated.get().constantOr(1) > 0) + && (paint.evaluated.get().constantOr(Color::black()).a > 0 || + paint.evaluated.get().constantOr(Color::black()).a > 0) + && (paint.evaluated.get().constantOr(1) > 0 || + paint.evaluated.get().constantOr(1) > 0)) ? RenderPass::Translucent : RenderPass::None; return paint.hasTransition();