Skip to content

Commit

Permalink
Fix point marker resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jul 18, 2011
1 parent 7dc8fbd commit 61a5422
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/core/symbology-ng/qgsfillsymbollayerv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 61a5422

Please sign in to comment.