Skip to content

Commit 5129f8e

Browse files
author
mhugent
committed
Applied Smizunos patch that fixes bug #1171
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9891 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 3f96a08 commit 5129f8e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/gui/qgsmapcanvas.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ void QgsMapCanvas::enableAntiAliasing( bool theFlag )
160160
void QgsMapCanvas::useImageToRender( bool theFlag )
161161
{
162162
mMap->useImageToRender( theFlag );
163+
refresh(); // redraw the map on change - prevents black map view
163164
}
164165

165166
QgsMapCanvasMap* QgsMapCanvas::map()

src/gui/qgsmapcanvasmap.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ QRectF QgsMapCanvasMap::boundingRect() const
4949
void QgsMapCanvasMap::resize( QSize size )
5050
{
5151
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
5253
mCanvas->mapRenderer()->setOutputSize( size, mPixmap.logicalDpiX() );
5354
}
5455

@@ -68,8 +69,6 @@ void QgsMapCanvasMap::render()
6869
if ( mUseQImageToRender )
6970
{
7071
// use temporary image for rendering
71-
mImage = QImage( boundingRect().size().toSize(), QImage::Format_RGB32 );
72-
7372
mImage.fill( mBgColor.rgb() );
7473

7574
QPainter paint;

0 commit comments

Comments
 (0)