[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.
This commit is contained in:
Jesse Bounds
2017-02-15 14:35:45 -08:00
committed by John Firebaugh
parent ab20d38883
commit 9924535415
2 changed files with 7 additions and 4 deletions

View File

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