Applied patch2 for #1016

git-svn-id: http://svn.osgeo.org/qgis/trunk@9968 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
mhugent 2009-01-13 14:58:12 +00:00
parent 93fc3c9eb6
commit e5a9ff92af
2 changed files with 4 additions and 2 deletions

View File

@ -811,8 +811,8 @@ void QgsMapCanvas::resizeEvent( QResizeEvent * e )
int height = lastSize.height();
lastSize = QSize( -1, -1 );
//set map size before scene size seems to solve the white box problem
//when moving rubber bands
//set map size before scene size helps keep scene indexes updated properly
// this was the cause of rubberband artifacts
mMap->resize( QSize( width, height ) );
mScene->setSceneRect( QRectF( 0, 0, width, height ) );

View File

@ -48,6 +48,8 @@ QRectF QgsMapCanvasMap::boundingRect() const
void QgsMapCanvasMap::resize( QSize size )
{
prepareGeometryChange(); // to keep QGraphicsScene indexes up to date on size change
mPixmap = QPixmap( size );
mImage = QImage( size, QImage::Format_RGB32 ); // temporary image - build it here so it is available when switching from QPixmap to QImage rendering
mCanvas->mapRenderer()->setOutputSize( size, mPixmap.logicalDpiX() );