Skip to content

Commit

Permalink
rule based renderer: keep skip else rule if an inactive rule matches,…
Browse files Browse the repository at this point in the history
… 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 ea0ce4e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/symbology-ng/qgsrulebasedrendererv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}

Expand All @@ -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 )
Expand Down Expand Up @@ -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;
}


Expand Down

0 comments on commit ea0ce4e

Please sign in to comment.