Skip to content

Commit 7ea834a

Browse files

File tree

1 file changed

+18
-26
lines changed

1 file changed

+18
-26
lines changed
 

‎src/gui/qgsmapcanvas.cpp

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ void QgsMapCanvas::drawContents(QPainter * p, int cx, int cy, int cw, int ch)
286286
std::cout << "QgsMapCanvas::drawContents" << std::endl;
287287
#endif
288288

289-
if (mDirty && !mFrozen)
289+
if (mDirty && mRenderFlag && !mFrozen)
290290
{
291291
render();
292292

@@ -304,35 +304,27 @@ void QgsMapCanvas::render()
304304
{
305305

306306
#ifdef QGISDEBUG
307-
QString msg = mFrozen ? "frozen" : "thawed";
308-
std::cout << "QgsMapCanvas::render: canvas is " << msg.toLocal8Bit().data() << std::endl;
307+
std::cout << "QgsMapCanvas::render" << std::endl;
309308
#endif
310309

311-
if (!mFrozen)
312-
{
313-
if (mRenderFlag && mDirty)
314-
{
315-
// Tell the user we're going to be a while
316-
QApplication::setOverrideCursor(Qt::WaitCursor);
310+
// Tell the user we're going to be a while
311+
QApplication::setOverrideCursor(Qt::WaitCursor);
317312

318-
mMap->render();
319-
mDirty = false;
320-
321-
// notify any listeners that rendering is complete
322-
QPainter p;
323-
p.begin(&mMap->pixmap());
324-
emit renderComplete(&p);
325-
p.end();
326-
327-
// notifies current map tool
328-
if (mMapTool)
329-
mMapTool->renderComplete();
330-
331-
// Tell the user we've finished going to be a while
332-
QApplication::restoreOverrideCursor();
333-
}
313+
mMap->render();
314+
mDirty = false;
334315

335-
}
316+
// notify any listeners that rendering is complete
317+
QPainter p;
318+
p.begin(&mMap->pixmap());
319+
emit renderComplete(&p);
320+
p.end();
321+
322+
// notifies current map tool
323+
if (mMapTool)
324+
mMapTool->renderComplete();
325+
326+
// Tell the user we've finished going to be a while
327+
QApplication::restoreOverrideCursor();
336328

337329
} // render
338330

0 commit comments

Comments
 (0)
Please sign in to comment.