Skip to content
Permalink
Browse files

Slightly better fix for composer map crash

git-svn-id: http://svn.osgeo.org/qgis/trunk@11190 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Jul 28, 2009
1 parent 1c3390e commit 154ce41bdea5bc3e71c3394d0bd111688c897782
Showing with 10 additions and 10 deletions.
  1. +10 −10 src/core/composer/qgscomposermap.cpp
@@ -103,13 +103,6 @@ void QgsComposerMap::draw( QPainter *painter, const QgsRectangle& extent, const
return;
}

if ( mDrawing )
{
return;
}

mDrawing = true;

QgsMapRenderer theMapRenderer;
theMapRenderer.setExtent( extent );
theMapRenderer.setOutputSize( size, dpi );
@@ -145,8 +138,6 @@ void QgsComposerMap::draw( QPainter *painter, const QgsRectangle& extent, const
theMapRenderer.setScale( scale() );
theMapRenderer.render( painter );
theMapRenderer.setScale( bk_scale );

mDrawing = false;
}

void QgsComposerMap::cache( void )
@@ -156,6 +147,13 @@ void QgsComposerMap::cache( void )
return;
}

if ( mDrawing )
{
return;
}

mDrawing = true;

int w = rect().width() * horizontalViewScaleFactor();
int h = rect().height() * horizontalViewScaleFactor();

@@ -181,6 +179,8 @@ void QgsComposerMap::cache( void )
draw( &p, mExtent, QSize( w, h ), mCacheImage.logicalDpiX() );
p.end();
mCacheUpdated = true;

mDrawing = false;
}

void QgsComposerMap::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget )
@@ -307,7 +307,7 @@ void QgsComposerMap::moveContent( double dx, double dy )

void QgsComposerMap::zoomContent( int delta, double x, double y )
{
if(mDrawing)
if ( mDrawing )
{
return;
}

0 comments on commit 154ce41

Please sign in to comment.
You can’t perform that action at this time.