From 7d767f518b62ddb00ba0c526b3d52d140c36197c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Fri, 23 May 2014 12:40:15 +0200 Subject: [PATCH] add keys to stylesheet --- include/llmr/style/properties.hpp | 4 ++++ src/style/style.cpp | 8 ++++++++ src/style/style_parser.cpp | 8 ++++++++ 3 files changed, 20 insertions(+) diff --git a/include/llmr/style/properties.hpp b/include/llmr/style/properties.hpp index ba0979cb9..616936ea8 100644 --- a/include/llmr/style/properties.hpp +++ b/include/llmr/style/properties.hpp @@ -155,6 +155,8 @@ struct FillClass { boost::optional opacity; boost::optional opacity_transition; boost::optional image; + boost::optional prerendered; + boost::optional blur; }; struct FillProperties { @@ -166,6 +168,8 @@ struct FillProperties { Color fill_color = {{ 0, 0, 0, 1 }}; Color stroke_color = {{ 0, 0, 0, 1 }}; float opacity = 1.0; + bool prerendered = false; + float blur = 0.0f; std::string image; }; diff --git a/src/style/style.cpp b/src/style/style.cpp index 918709924..fce70eade 100644 --- a/src/style/style.cpp +++ b/src/style/style.cpp @@ -114,6 +114,14 @@ void Style::cascade(float z) { if (layer.image) { fill.image = layer.image.get(); } + + if (layer.prerendered) { + fill.prerendered = layer.prerendered.get().evaluate(z); + } + + if (layer.blur) { + fill.blur = layer.blur.get().evaluate(z); + } } // Cascade line classes. diff --git a/src/style/style_parser.cpp b/src/style/style_parser.cpp index c299f1fd9..52ef85f1d 100644 --- a/src/style/style_parser.cpp +++ b/src/style/style_parser.cpp @@ -537,6 +537,14 @@ FillClass StyleParser::parseFillClass(JSVal value) { klass.antialias = parseBoolean(value["antialias"]); } + if (value.HasMember("prerendered")) { + klass.prerendered = parseBoolean(value["prerendered"]); + } + + if (value.HasMember("blur")) { + klass.blur = parseFunction(value["blur"]); + } + if (value.HasMember("image")) { klass.image = parseString(value["image"]); }