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 8d71eeb commit f4e0fa8
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"
#include "qgsexpressioncontextutils.h"
Expand Down Expand Up @@ -308,7 +309,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 f4e0fa8

Please sign in to comment.