File tree 2 files changed +2
-2
lines changed
2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ void QgsMapCanvas::enableAntiAliasing( bool theFlag )
160
160
void QgsMapCanvas::useImageToRender ( bool theFlag )
161
161
{
162
162
mMap ->useImageToRender ( theFlag );
163
+ refresh (); // redraw the map on change - prevents black map view
163
164
}
164
165
165
166
QgsMapCanvasMap* QgsMapCanvas::map ()
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ QRectF QgsMapCanvasMap::boundingRect() const
49
49
void QgsMapCanvasMap::resize ( QSize size )
50
50
{
51
51
mPixmap = QPixmap ( size );
52
+ mImage = QImage ( size, QImage::Format_RGB32 ); // temporary image - build it here so it is available when switching from QPixmap to QImage rendering
52
53
mCanvas ->mapRenderer ()->setOutputSize ( size, mPixmap .logicalDpiX () );
53
54
}
54
55
@@ -68,8 +69,6 @@ void QgsMapCanvasMap::render()
68
69
if ( mUseQImageToRender )
69
70
{
70
71
// use temporary image for rendering
71
- mImage = QImage ( boundingRect ().size ().toSize (), QImage::Format_RGB32 );
72
-
73
72
mImage .fill ( mBgColor .rgb () );
74
73
75
74
QPainter paint;
You can’t perform that action at this time.
0 commit comments