diff --git a/include/llmr/style/properties.hpp b/include/llmr/style/properties.hpp index 42bc3ca40..10299d051 100644 --- a/include/llmr/style/properties.hpp +++ b/include/llmr/style/properties.hpp @@ -64,7 +64,7 @@ struct FunctionProperty { }; struct PointClass { - FunctionProperty hidden; + FunctionProperty enabled = true; FunctionProperty size; Color color = {{ 0, 0, 0, 1 }}; FunctionProperty opacity = 1; @@ -72,7 +72,7 @@ struct PointClass { }; struct PointProperties { - bool hidden = false; + bool enabled = true; float size = 0; Color color = {{ 0, 0, 0, 1 }}; float opacity = 1.0; @@ -80,7 +80,7 @@ struct PointProperties { }; struct LineClass { - FunctionProperty hidden; + FunctionProperty enabled = true; FunctionProperty width; FunctionProperty offset; Color color = {{ 0, 0, 0, 1 }}; @@ -88,7 +88,7 @@ struct LineClass { }; struct LineProperties { - bool hidden = false; + bool enabled = true; float width = 0; float offset = 0; Color color = {{ 0, 0, 0, 1 }}; @@ -96,7 +96,7 @@ struct LineProperties { }; struct FillClass { - FunctionProperty hidden; + FunctionProperty enabled = true; Winding winding = Winding::NonZero; FunctionProperty antialias = true; Color fill_color = {{ 0, 0, 0, 1 }}; @@ -106,7 +106,7 @@ struct FillClass { }; struct FillProperties { - bool hidden = false; + bool enabled = true; Winding winding = Winding::NonZero; bool antialias = true; Color fill_color = {{ 0, 0, 0, 1 }}; @@ -116,7 +116,7 @@ struct FillProperties { }; struct TextClass { - FunctionProperty hidden; + FunctionProperty enabled = true; Color color = {{ 0, 0, 0, 1 }}; Color halo = {{ 1, 1, 1, 0.75 }}; FunctionProperty haloRadius = 0.25f; @@ -126,7 +126,7 @@ struct TextClass { }; struct TextProperties { - bool hidden = false; + bool enabled = true; Color color = {{ 0, 0, 0, 1 }}; Color halo = {{ 1, 1, 1, 0.75 }}; float haloRadius = 0.25f; diff --git a/src/renderer/painter.cpp b/src/renderer/painter.cpp index 9a52cb36d..2f32ef4ad 100644 --- a/src/renderer/painter.cpp +++ b/src/renderer/painter.cpp @@ -366,7 +366,7 @@ void Painter::renderLine(LineBucket& bucket, const std::string& layer_name, cons if (bucket.empty()) return; const LineProperties& properties = style.computed.lines[layer_name]; - if (properties.hidden) return; + if (!properties.enabled) return; float width = properties.width; float offset = properties.offset / 2; @@ -447,7 +447,7 @@ void Painter::renderPoint(PointBucket& bucket, const std::string& layer_name, co if (pass == Opaque) return; const PointProperties& properties = style.computed.points[layer_name]; - if (properties.hidden) return; + if (!properties.enabled) return; Color color = properties.color; color[0] *= properties.opacity; @@ -489,7 +489,7 @@ void Painter::renderText(TextBucket& bucket, const std::string& layer_name, cons if (bucket.empty()) return; const TextProperties& properties = style.computed.texts[layer_name]; - if (properties.hidden) return; + if (!properties.enabled) return; mat4 exMatrix; matrix::copy(exMatrix, projMatrix); diff --git a/src/style/style.cpp b/src/style/style.cpp index 5367da0bd..a8a8bfeb2 100644 --- a/src/style/style.cpp +++ b/src/style/style.cpp @@ -37,7 +37,7 @@ void Style::cascade(float z) { // TODO: This should be restricted to fill styles that have actual // values so as to not override with default values. llmr::FillProperties& fill = computed.fills[layer_name]; - fill.hidden = layer.hidden(z); + fill.enabled = layer.enabled(z); fill.winding = layer.winding; fill.antialias = layer.antialias(z); fill.fill_color = layer.fill_color; @@ -54,7 +54,7 @@ void Style::cascade(float z) { // TODO: This should be restricted to line styles that have actual // values so as to not override with default values. llmr::LineProperties& stroke = computed.lines[layer_name]; - stroke.hidden = layer.hidden(z); + stroke.enabled = layer.enabled(z); stroke.width = layer.width(z); stroke.offset = layer.offset(z); stroke.color = layer.color; @@ -69,7 +69,7 @@ void Style::cascade(float z) { // TODO: This should be restricted to point styles that have actual // values so as to not override with default values. llmr::PointProperties& point = computed.points[layer_name]; - point.hidden = layer.hidden(z); + point.enabled = layer.enabled(z); point.color = layer.color; point.size = layer.size(z); point.opacity = layer.opacity(z); @@ -83,7 +83,7 @@ void Style::cascade(float z) { // TODO: This should be restricted to point styles that have actual // values so as to not override with default values. llmr::TextProperties& text = computed.texts[layer_name]; - text.hidden = layer.hidden(z); + text.enabled = layer.enabled(z); text.color = layer.color; text.size = layer.size(z); text.halo = layer.halo; diff --git a/src/style/style_parser.cpp b/src/style/style_parser.cpp index cc2eccda6..1902af2dc 100644 --- a/src/style/style_parser.cpp +++ b/src/style/style_parser.cpp @@ -428,8 +428,8 @@ FunctionProperty StyleParser::parseBoolFunction(JSVal value) { FillClass StyleParser::parseFillClass(JSVal value) { FillClass klass; - if (value.HasMember("hidden")) { - klass.hidden = parseBoolFunction(value["hidden"]); + if (value.HasMember("enabled")) { + klass.enabled = parseBoolFunction(value["enabled"]); } if (value.HasMember("color")) { @@ -460,8 +460,8 @@ FillClass StyleParser::parseFillClass(JSVal value) { LineClass StyleParser::parseLineClass(JSVal value) { LineClass klass; - if (value.HasMember("hidden")) { - klass.hidden = parseBoolFunction(value["hidden"]); + if (value.HasMember("enabled")) { + klass.enabled = parseBoolFunction(value["enabled"]); } if (value.HasMember("color")) { @@ -482,8 +482,8 @@ LineClass StyleParser::parseLineClass(JSVal value) { PointClass StyleParser::parsePointClass(JSVal value) { PointClass klass; - if (value.HasMember("hidden")) { - klass.hidden = parseBoolFunction(value["hidden"]); + if (value.HasMember("enabled")) { + klass.enabled = parseBoolFunction(value["enabled"]); } if (value.HasMember("color")) { @@ -509,8 +509,8 @@ PointClass StyleParser::parsePointClass(JSVal value) { TextClass StyleParser::parseTextClass(JSVal value) { TextClass klass; - if (value.HasMember("hidden")) { - klass.hidden = parseBoolFunction(value["hidden"]); + if (value.HasMember("enabled")) { + klass.enabled = parseBoolFunction(value["enabled"]); } if (value.HasMember("color")) {