@@ -103,13 +103,6 @@ void QgsComposerMap::draw( QPainter *painter, const QgsRectangle& extent, const
103103 return ;
104104 }
105105
106- if ( mDrawing )
107- {
108- return ;
109- }
110-
111- mDrawing = true ;
112-
113106 QgsMapRenderer theMapRenderer;
114107 theMapRenderer.setExtent ( extent );
115108 theMapRenderer.setOutputSize ( size, dpi );
@@ -145,8 +138,6 @@ void QgsComposerMap::draw( QPainter *painter, const QgsRectangle& extent, const
145138 theMapRenderer.setScale ( scale () );
146139 theMapRenderer.render ( painter );
147140 theMapRenderer.setScale ( bk_scale );
148-
149- mDrawing = false ;
150141}
151142
152143void QgsComposerMap::cache ( void )
@@ -156,6 +147,13 @@ void QgsComposerMap::cache( void )
156147 return ;
157148 }
158149
150+ if ( mDrawing )
151+ {
152+ return ;
153+ }
154+
155+ mDrawing = true ;
156+
159157 int w = rect ().width () * horizontalViewScaleFactor ();
160158 int h = rect ().height () * horizontalViewScaleFactor ();
161159
@@ -181,6 +179,8 @@ void QgsComposerMap::cache( void )
181179 draw ( &p, mExtent , QSize ( w, h ), mCacheImage .logicalDpiX () );
182180 p.end ();
183181 mCacheUpdated = true ;
182+
183+ mDrawing = false ;
184184}
185185
186186void QgsComposerMap::paint ( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget )
@@ -307,7 +307,7 @@ void QgsComposerMap::moveContent( double dx, double dy )
307307
308308void QgsComposerMap::zoomContent ( int delta, double x, double y )
309309{
310- if ( mDrawing )
310+ if ( mDrawing )
311311 {
312312 return ;
313313 }
0 commit comments