Skip to content
Permalink
Browse files

[effects] when creating the preview image, disable effects to avoid '…

…double apply'
  • Loading branch information
nirvn committed May 9, 2019
1 parent 80ae670 commit 0af3a4ec281fbefa6a5cfdcf1838ad84a10c1673
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/gui/symbology/qgslayerpropertieswidget.cpp
@@ -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"

@@ -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();
}

0 comments on commit 0af3a4e

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