Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] Render a circle if either the color or stroke color are visible
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
boundsj authored and jfirebaugh committed Feb 17, 2017
1 parent ab20d38 commit 9924535
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/mbgl/style/layers/circle_layer_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 9924535

Please sign in to comment.