@@ -160,8 +160,7 @@ QColor QgsSymbolV2::color()
160
160
161
161
void QgsSymbolV2::drawPreviewIcon ( QPainter* painter, QSize size )
162
162
{
163
- QgsRenderContext context;
164
- context.setPainter ( painter );
163
+ QgsRenderContext context = QgsSymbolLayerV2Utils::createRenderContext ( painter );
165
164
QgsSymbolV2RenderContext symbolContext ( context, mOutputUnit );
166
165
for ( QgsSymbolLayerV2List::iterator it = mLayers .begin (); it != mLayers .end (); ++it )
167
166
{
@@ -186,9 +185,7 @@ QImage QgsSymbolV2::bigSymbolPreviewImage()
186
185
p.drawLine ( 50 , 0 , 50 , 100 );
187
186
}
188
187
189
- QgsRenderContext context;
190
- context.setPainter ( &p );
191
-
188
+ QgsRenderContext context = QgsSymbolLayerV2Utils::createRenderContext ( &p );
192
189
startRender ( context );
193
190
194
191
if ( mType == QgsSymbolV2::Line )
@@ -248,7 +245,7 @@ QgsSymbolLayerV2List QgsSymbolV2::cloneLayers() const
248
245
// //////////////////
249
246
250
247
QgsSymbolV2RenderContext::QgsSymbolV2RenderContext ( QgsRenderContext& c, QgsSymbolV2::OutputUnit u )
251
- : mRenderContext( c ), mOutputUnit( u )
248
+ : mRenderContext( c ), mOutputUnit( u )
252
249
{
253
250
254
251
}
@@ -258,12 +255,12 @@ QgsSymbolV2RenderContext::~QgsSymbolV2RenderContext()
258
255
259
256
}
260
257
261
- double QgsSymbolV2RenderContext::outputLineWidth (double width) const
258
+ double QgsSymbolV2RenderContext::outputLineWidth ( double width ) const
262
259
{
263
260
return width * QgsSymbolLayerV2Utils::lineWidthScaleFactor ( mRenderContext , mOutputUnit );
264
261
}
265
262
266
- double QgsSymbolV2RenderContext::outputPixelSize (double size) const
263
+ double QgsSymbolV2RenderContext::outputPixelSize ( double size ) const
267
264
{
268
265
return size * QgsSymbolLayerV2Utils::pixelSizeScaleFactor ( mRenderContext , mOutputUnit );
269
266
}
0 commit comments