Skip to content

Commit 61a5422

Browse files
committedJul 18, 2011
Fix point marker resolution
1 parent 7dc8fbd commit 61a5422

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed
 

‎src/core/symbology-ng/qgsfillsymbollayerv2.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -592,18 +592,20 @@ void QgsPointPatternFillSymbolLayer::startRender( QgsSymbolV2RenderContext& cont
592592
QImage patternImage( width, height, QImage::Format_ARGB32 );
593593
patternImage.fill( 0 );
594594

595-
596-
//create render context for image
597-
QgsRenderContext pointRenderContext;
598-
599595
if( mMarkerSymbol )
600596
{
601597
QPainter p( &patternImage );
598+
599+
//marker rendering needs context for drawing on patternImage
600+
QgsRenderContext pointRenderContext;
602601
pointRenderContext.setPainter( &p );
603-
pointRenderContext.setRasterScaleFactor( context.renderContext().rasterScaleFactor() );
604-
pointRenderContext.setScaleFactor( context.renderContext().scaleFactor() );
602+
pointRenderContext.setRasterScaleFactor( 1.0 );
603+
pointRenderContext.setScaleFactor( context.renderContext().scaleFactor() * context.renderContext().rasterScaleFactor() );
604+
QgsMapToPixel mtp( context.renderContext().mapToPixel().mapUnitsPerPixel() / context.renderContext().rasterScaleFactor() );
605+
pointRenderContext.setMapToPixel( mtp );
606+
pointRenderContext.setForceVectorOutput( false );
605607

606-
//mMarkerSymbol->setOutputUnit( context.outputUnit() );
608+
mMarkerSymbol->setOutputUnit( context.outputUnit() );
607609
mMarkerSymbol->startRender( pointRenderContext );
608610
mMarkerSymbol->renderPoint( QPointF( 0, 0 ), pointRenderContext );
609611
mMarkerSymbol->renderPoint( QPointF( width, 0 ), pointRenderContext );

0 commit comments

Comments
 (0)
Please sign in to comment.