Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 committed Jul 28, 2009
1 parent 1c3390e commit 154ce41
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/core/composer/qgscomposermap.cpp
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 )
Expand All @@ -156,6 +147,13 @@ void QgsComposerMap::cache( void )
return;
}

if ( mDrawing )
{
return;
}

mDrawing = true;

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

Expand All @@ -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 )
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 154ce41

Please sign in to comment.