Skip to content
Permalink
Browse files

Consider transparency also for point and line patterns

  • Loading branch information
marco
marco committed Jul 28, 2011
1 parent ab3ba90 commit a5f8a82515a5f399393ee11dcbab08abb2cb53c9
Showing with 20 additions and 2 deletions.
  1. +20 −2 src/core/symbology-ng/qgsfillsymbollayerv2.cpp
@@ -504,7 +504,16 @@ void QgsLinePatternFillSymbolLayer::startRender( QgsSymbolV2RenderContext& conte
p.end();

//set image to mBrush
mBrush.setTextureImage( patternImage );
if ( !doubleNear( context.alpha(), 1.0 ) )
{
QImage transparentImage = patternImage.copy();
QgsSymbolLayerV2Utils::multiplyImageOpacity( &transparentImage, context.alpha() );
mBrush.setTextureImage( transparentImage );
}
else
{
mBrush.setTextureImage( patternImage );
}

QTransform brushTransform;
brushTransform.scale( 1.0 / context.renderContext().rasterScaleFactor(), 1.0 / context.renderContext().rasterScaleFactor() );
@@ -627,7 +636,16 @@ void QgsPointPatternFillSymbolLayer::startRender( QgsSymbolV2RenderContext& cont
mMarkerSymbol->stopRender( pointRenderContext );
}

mBrush.setTextureImage( patternImage );
if ( !doubleNear( context.alpha(), 1.0 ) )
{
QImage transparentImage = patternImage.copy();
QgsSymbolLayerV2Utils::multiplyImageOpacity( &transparentImage, context.alpha() );
mBrush.setTextureImage( transparentImage );
}
else
{
mBrush.setTextureImage( patternImage );
}
QTransform brushTransform;
brushTransform.scale( 1.0 / context.renderContext().rasterScaleFactor(), 1.0 / context.renderContext().rasterScaleFactor() );
mBrush.setTransform( brushTransform );

0 comments on commit a5f8a82

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