Skip to content
Permalink
Browse files

[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 5, 2014
1 parent fd1ced7 commit 47a16184c624dc7086dcb2050acad7d8f56b069c
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/core/qgsmaphittest.cpp
@@ -3,6 +3,7 @@
#include "qgsmaplayerregistry.h"
#include "qgsrendercontext.h"
#include "qgsrendererv2.h"
#include "qgspointdisplacementrenderer.h"
#include "qgsvectorlayer.h"


@@ -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;

0 comments on commit 47a1618

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