Skip to content
Permalink
Browse files

Fix for ticket #58 - infinite redraw loop when render flag turned off

git-svn-id: http://svn.osgeo.org/qgis/trunk@5172 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Apr 5, 2006
1 parent 220a032 commit a38ce51af6882e241570815b0a0110ebff8fdd04
Showing with 18 additions and 26 deletions.
  1. +18 −26 src/gui/qgsmapcanvas.cpp
@@ -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();

@@ -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

0 comments on commit a38ce51

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