diff options
Diffstat (limited to 'src/mbgl/layer/circle_layer.hpp')
-rw-r--r-- | src/mbgl/layer/circle_layer.hpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/mbgl/layer/circle_layer.hpp b/src/mbgl/layer/circle_layer.hpp index 29cdf513df..eac9a915cc 100644 --- a/src/mbgl/layer/circle_layer.hpp +++ b/src/mbgl/layer/circle_layer.hpp @@ -2,11 +2,24 @@ #define MBGL_CIRCLE_LAYER #include <mbgl/style/style_layer.hpp> -#include <mbgl/style/style_properties.hpp> -#include <mbgl/style/paint_properties_map.hpp> +#include <mbgl/style/paint_property.hpp> namespace mbgl { +class CirclePaintProperties { +public: + PaintProperty<float> radius = 5.0f; + PaintProperty<Color> color = { {{ 0, 0, 0, 1 }} }; + PaintProperty<float> opacity = 1.0f; + PaintProperty<std::array<float, 2>> translate = { {{ 0, 0 }} }; + PaintProperty<TranslateAnchorType> translateAnchor = TranslateAnchorType::Map; + PaintProperty<float> blur = 0; + + bool isVisible() const { + return radius > 0 && color.value[3] > 0 && opacity > 0; + } +}; + class CircleLayer : public StyleLayer { public: std::unique_ptr<StyleLayer> clone() const override; @@ -15,15 +28,11 @@ public: void parsePaints(const JSVal&) override; void cascade(const StyleCascadeParameters&) override; - void recalculate(const StyleCalculationParameters&) override; + bool recalculate(const StyleCalculationParameters&) override; std::unique_ptr<Bucket> createBucket(StyleBucketParameters&) const override; - bool hasTransitions() const override; - - PaintPropertiesMap paints; - - CirclePaintProperties properties; + CirclePaintProperties paint; }; } |