Skip to content
Permalink
Browse files

rule based renderer: keep skip else rule if an inactive rule matches,…

… but still return if the feature was actually rendered so that only rendered features are labeled (fixes #13631)
  • Loading branch information
jef-n committed Oct 21, 2015
1 parent 29b061c commit ea0ce4ec1ede1342795544bf42a1bdd766d66cec
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core/symbology-ng/qgsrulebasedrendererv2.cpp
@@ -536,7 +536,7 @@ QgsRuleBasedRendererV2::Rule::RenderResult QgsRuleBasedRendererV2::Rule::renderF
RenderResult res = rule->renderFeature( featToRender, context, renderQueue );
// consider inactive items as "rendered" so the else rule will ignore them
willrendersomething |= ( res == Rendered || res == Inactive );
rendered |= willrendersomething;
rendered |= ( res == Rendered );
}
}

@@ -545,7 +545,7 @@ QgsRuleBasedRendererV2::Rule::RenderResult QgsRuleBasedRendererV2::Rule::renderF
{
Q_FOREACH ( Rule* rule, mElseRules )
{
rendered |= rule->renderFeature( featToRender, context, renderQueue ) != Filtered;
rendered |= rule->renderFeature( featToRender, context, renderQueue ) == Rendered;
}
}
if ( !mIsActive )
@@ -821,7 +821,7 @@ bool QgsRuleBasedRendererV2::renderFeature( QgsFeature& feature,
mCurrentFeatures.append( FeatureToRender( feature, flags ) );

// check each active rule
return mRootRule->renderFeature( mCurrentFeatures.last(), context, mRenderQueue );
return mRootRule->renderFeature( mCurrentFeatures.last(), context, mRenderQueue ) == Rule::Rendered;
}


0 comments on commit ea0ce4e

Please sign in to comment.
You can’t perform that action at this time.