patch_for_1171.txt

fix for blank map after choosing anti-alias (QImage) rendering - Steven Mizuno, 2008-09-13 11:12 AM

Download (1.17 KB)

 
1
Index: src/gui/qgsmapcanvasmap.cpp
2
===================================================================
3
--- src/gui/qgsmapcanvasmap.cpp	(revision 9268)
4
+++ src/gui/qgsmapcanvasmap.cpp	(working copy)
5
@@ -49,6 +49,7 @@
6
 void QgsMapCanvasMap::resize( QSize size )
7
 {
8
   mPixmap = QPixmap( size );
9
+  mImage = QImage( size, QImage::Format_RGB32 );	// temporary image - build it here so it is available when switching from QPixmap to QImage rendering
10
   mCanvas->mapRenderer()->setOutputSize( size, mPixmap.logicalDpiX() );
11
 }
12
 
13
@@ -68,8 +69,6 @@
14
   if ( mUseQImageToRender )
15
   {
16
     // use temporary image for rendering
17
-    mImage = QImage( boundingRect().size().toSize(), QImage::Format_RGB32 );
18
-
19
     mImage.fill( mBgColor.rgb() );
20
 
21
     QPainter paint;
22
Index: src/gui/qgsmapcanvas.cpp
23
===================================================================
24
--- src/gui/qgsmapcanvas.cpp	(revision 9268)
25
+++ src/gui/qgsmapcanvas.cpp	(working copy)
26
@@ -160,6 +160,7 @@
27
 void QgsMapCanvas::useImageToRender( bool theFlag )
28
 {
29
   mMap->useImageToRender( theFlag );
30
+  refresh();	// redraw the map on change - prevents black map view
31
 }
32
 
33
 QgsMapCanvasMap* QgsMapCanvas::map()