Skip to content

Commit 85a88c8

Browse files
author
mhugent
committed
Apply patch to fix bug #1171 also to version 1
git-svn-id: http://svn.osgeo.org/qgis/branches/Version-1_0@9892 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 1fd77b7 commit 85a88c8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/gui/qgsmapcanvas.cpp

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 2 deletions
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)