add isVisible function to Properties

This commit is contained in:
Konstantin Käfer
2014-05-26 15:34:50 +02:00
parent 6350dc5235
commit 9b5c75cef0
2 changed files with 8 additions and 9 deletions

View File

@@ -572,18 +572,11 @@ typename Styles::const_iterator find_style(const Styles &styles, const LayerDesc
return it;
}
template <typename Properties>
bool is_invisible(const Properties &properties) {
if (!properties.enabled) { return true; }
if (properties.opacity <= 0) { return true; }
return false;
}
template <typename Styles>
bool is_invisible(const Styles &styles, const LayerDescription &layer_desc) {
auto it = find_style(styles, layer_desc);
if (it == styles.end()) { return true; }
return is_invisible(it->second);
return !it->second.isVisible();
}
void Map::renderLayer(const LayerDescription& layer_desc, RenderPass pass) {
@@ -592,7 +585,7 @@ void Map::renderLayer(const LayerDescription& layer_desc, RenderPass pass) {
if (pass == Translucent) {
auto it = find_style(style.computed.composites, layer_desc);
const CompositeProperties &properties = (it != style.computed.composites.end()) ? it->second : defaultCompositeProperties;
if (!is_invisible(properties)) {
if (properties.isVisible()) {
gl::group group(std::string("group: ") + layer_desc.name);
if (debug::renderTree) {