Skip to content

Commit

Permalink
Fix for ticket #58 - infinite redraw loop when render flag turned off
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5172 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Apr 5, 2006
1 parent 6679455 commit 7ea834a
Showing 1 changed file with 18 additions and 26 deletions.
44 changes: 18 additions & 26 deletions src/gui/qgsmapcanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ void QgsMapCanvas::drawContents(QPainter * p, int cx, int cy, int cw, int ch)
std::cout << "QgsMapCanvas::drawContents" << std::endl;
#endif

if (mDirty && !mFrozen)
if (mDirty && mRenderFlag && !mFrozen)
{
render();

Expand All @@ -304,35 +304,27 @@ void QgsMapCanvas::render()
{

#ifdef QGISDEBUG
QString msg = mFrozen ? "frozen" : "thawed";
std::cout << "QgsMapCanvas::render: canvas is " << msg.toLocal8Bit().data() << std::endl;
std::cout << "QgsMapCanvas::render" << std::endl;
#endif

if (!mFrozen)
{
if (mRenderFlag && mDirty)
{
// Tell the user we're going to be a while
QApplication::setOverrideCursor(Qt::WaitCursor);
// Tell the user we're going to be a while
QApplication::setOverrideCursor(Qt::WaitCursor);

mMap->render();
mDirty = false;

// notify any listeners that rendering is complete
QPainter p;
p.begin(&mMap->pixmap());
emit renderComplete(&p);
p.end();

// notifies current map tool
if (mMapTool)
mMapTool->renderComplete();

// Tell the user we've finished going to be a while
QApplication::restoreOverrideCursor();
}
mMap->render();
mDirty = false;

}
// notify any listeners that rendering is complete
QPainter p;
p.begin(&mMap->pixmap());
emit renderComplete(&p);
p.end();

// notifies current map tool
if (mMapTool)
mMapTool->renderComplete();

// Tell the user we've finished going to be a while
QApplication::restoreOverrideCursor();

} // render

Expand Down

0 comments on commit 7ea834a

Please sign in to comment.