File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -592,18 +592,20 @@ void QgsPointPatternFillSymbolLayer::startRender( QgsSymbolV2RenderContext& cont
592
592
QImage patternImage ( width, height, QImage::Format_ARGB32 );
593
593
patternImage.fill ( 0 );
594
594
595
-
596
- // create render context for image
597
- QgsRenderContext pointRenderContext;
598
-
599
595
if ( mMarkerSymbol )
600
596
{
601
597
QPainter p ( &patternImage );
598
+
599
+ // marker rendering needs context for drawing on patternImage
600
+ QgsRenderContext pointRenderContext;
602
601
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 );
605
607
606
- // mMarkerSymbol->setOutputUnit( context.outputUnit() );
608
+ mMarkerSymbol ->setOutputUnit ( context.outputUnit () );
607
609
mMarkerSymbol ->startRender ( pointRenderContext );
608
610
mMarkerSymbol ->renderPoint ( QPointF ( 0 , 0 ), pointRenderContext );
609
611
mMarkerSymbol ->renderPoint ( QPointF ( width, 0 ), pointRenderContext );
You can’t perform that action at this time.
0 commit comments