Don't render effects which require rasterisation when forcing vector

This commit is contained in:
Nyall Dawson 2025-06-09 12:18:00 +10:00
parent 833582a1f0
commit 3a3eefd66c
4 changed files with 28 additions and 0 deletions

View File

@ -33,6 +33,13 @@ void QgsBlurEffect::draw( QgsRenderContext &context )
if ( !enabled() || !context.painter() || source().isNull() )
return;
if ( context.rasterizedRenderingPolicy() == Qgis::RasterizedRenderingPolicy::ForceVector )
{
//just draw unmodified source, we can't render this effect when forcing vectors
drawSource( *context.painter() );
return;
}
switch ( mBlurMethod )
{
case StackBlur:

View File

@ -40,6 +40,13 @@ void QgsColorEffect::draw( QgsRenderContext &context )
if ( !enabled() || !context.painter() || source().isNull() )
return;
if ( context.rasterizedRenderingPolicy() == Qgis::RasterizedRenderingPolicy::ForceVector )
{
//just draw unmodified source, we can't render this effect when forcing vectors
drawSource( *context.painter() );
return;
}
QPainter *painter = context.painter();
//rasterize source and apply modifications

View File

@ -44,6 +44,13 @@ void QgsGlowEffect::draw( QgsRenderContext &context )
if ( !enabled() || !context.painter() || source().isNull() )
return;
if ( context.rasterizedRenderingPolicy() == Qgis::RasterizedRenderingPolicy::ForceVector )
{
//just draw unmodified source, we can't render this effect when forcing vectors
drawSource( *context.painter() );
return;
}
QImage im = sourceAsImage( context ).copy();
QgsColorRamp *ramp = nullptr;

View File

@ -35,6 +35,13 @@ void QgsShadowEffect::draw( QgsRenderContext &context )
if ( context.feedback() && context.feedback()->isCanceled() )
return;
if ( context.rasterizedRenderingPolicy() == Qgis::RasterizedRenderingPolicy::ForceVector )
{
//just draw unmodified source, we can't render this effect when forcing vectors
drawSource( *context.painter() );
return;
}
QImage colorisedIm = sourceAsImage( context ).copy();
if ( context.feedback() && context.feedback()->isCanceled() )