Skip to content
Permalink
Browse files

Fix point marker resolution

  • Loading branch information
mhugent committed Jul 18, 2011
1 parent 7dc8fbd commit 61a5422aeb0e1fed23851c36c4cc8b83a3da2c16
Showing with 9 additions and 7 deletions.
  1. +9 −7 src/core/symbology-ng/qgsfillsymbollayerv2.cpp
@@ -592,18 +592,20 @@ void QgsPointPatternFillSymbolLayer::startRender( QgsSymbolV2RenderContext& cont
QImage patternImage( width, height, QImage::Format_ARGB32 );
patternImage.fill( 0 );


//create render context for image
QgsRenderContext pointRenderContext;

if( mMarkerSymbol )
{
QPainter p( &patternImage );

//marker rendering needs context for drawing on patternImage
QgsRenderContext pointRenderContext;
pointRenderContext.setPainter( &p );
pointRenderContext.setRasterScaleFactor( context.renderContext().rasterScaleFactor() );
pointRenderContext.setScaleFactor( context.renderContext().scaleFactor() );
pointRenderContext.setRasterScaleFactor( 1.0 );
pointRenderContext.setScaleFactor( context.renderContext().scaleFactor() * context.renderContext().rasterScaleFactor() );
QgsMapToPixel mtp( context.renderContext().mapToPixel().mapUnitsPerPixel() / context.renderContext().rasterScaleFactor() );
pointRenderContext.setMapToPixel( mtp );
pointRenderContext.setForceVectorOutput( false );

//mMarkerSymbol->setOutputUnit( context.outputUnit() );
mMarkerSymbol->setOutputUnit( context.outputUnit() );
mMarkerSymbol->startRender( pointRenderContext );
mMarkerSymbol->renderPoint( QPointF( 0, 0 ), pointRenderContext );
mMarkerSymbol->renderPoint( QPointF( width, 0 ), pointRenderContext );

0 comments on commit 61a5422

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