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 authored and nyalldawson committed May 9, 2019
1 parent dbc6463 commit ed49b57
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/gui/symbology/qgslayerpropertieswidget.cpp
Original file line number Diff line number Diff line change
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 ed49b57

Please sign in to comment.