Skip to content

Commit

Permalink
[effects] when creating the preview image, disable effects to avoid '…
Browse files Browse the repository at this point in the history
…double apply'
  • Loading branch information
nirvn committed May 9, 2019
1 parent 80ae670 commit 0af3a4e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/gui/symbology/qgslayerpropertieswidget.cpp
Expand Up @@ -34,6 +34,7 @@
#include "qgssymbol.h" //for the unit
#include "qgspanelwidget.h"
#include "qgsmapcanvas.h"
#include "qgspainteffect.h"
#include "qgsproject.h"
#include "qgsvectorlayer.h"

Expand Down Expand Up @@ -306,7 +307,17 @@ void QgsLayerPropertiesWidget::emitSignalChanged()
emit changed();

// also update paint effect preview
bool paintEffectToggled = false;
if ( mLayer->paintEffect() && mLayer->paintEffect()->enabled() )
{
mLayer->paintEffect()->setEnabled( false );
paintEffectToggled = true;
}
mEffectWidget->setPreviewPicture( QgsSymbolLayerUtils::symbolLayerPreviewPicture( mLayer, QgsUnitTypes::RenderMillimeters, QSize( 80, 80 ) ) );
if ( paintEffectToggled )
{
mLayer->paintEffect()->setEnabled( true );
}
emit widgetChanged();
}

Expand Down

0 comments on commit 0af3a4e

Please sign in to comment.