Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED] #11572 ilter Legend By Map Content doesn't maintain point dis…
…placement legend

For point vector layer render with 'displacement point', when 'Filter
 Legend By Map Content' is activated, the legend is not rendered even
 if it has to be.

It's due to QgsPointDisplacementRenderer that embedded the real
 renderer.

The solution proposed in this patch is to get the embedded renderer
 for QgsPointDisplacementRenderer.
  • Loading branch information
rldhont committed Nov 7, 2014
1 parent fd1ced7 commit 47a1618
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/qgsmaphittest.cpp
Expand Up @@ -3,6 +3,7 @@
#include "qgsmaplayerregistry.h"
#include "qgsrendercontext.h"
#include "qgsrendererv2.h"
#include "qgspointdisplacementrenderer.h"
#include "qgsvectorlayer.h"


Expand Down Expand Up @@ -52,6 +53,12 @@ void QgsMapHitTest::run()
void QgsMapHitTest::runHitTestLayer( QgsVectorLayer* vl, SymbolV2Set& usedSymbols, QgsRenderContext& context )
{
QgsFeatureRendererV2* r = vl->rendererV2();

// Point displacement case
QgsPointDisplacementRenderer* pdr = dynamic_cast<QgsPointDisplacementRenderer*>( r );
if ( pdr )
r = pdr->embeddedRenderer();

bool moreSymbolsPerFeature = r->capabilities() & QgsFeatureRendererV2::MoreSymbolsPerFeature;
r->startRender( context, vl->pendingFields() );
QgsFeature f;
Expand Down

0 comments on commit 47a1618

Please sign in to comment.