Skip to content
Permalink
Browse files
improved speed of drawing layer that's being edited
fixed one memory leak


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5028 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Mar 15, 2006
1 parent 2ef9bb3 commit 3c13dce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
@@ -2004,22 +2004,25 @@ void QgsGrassEdit::postRender(QPainter *)

if ( !mValid ) return;

displayMap(NULL);
displayMap();

// Redisplay highlighted
if ( mSelectedLine ) {
displayElement ( mSelectedLine, mSymb[SYMB_HIGHLIGHT], mSize );
}
}

void QgsGrassEdit::displayMap (QPainter *painter)
void QgsGrassEdit::displayMap ()
{
#ifdef QGISDEBUG
std::cerr << "QgsGrassEdit::displayMap" << std::endl;
#endif

mTransform = mCanvas->getCoordinateTransform();

QPainter *painter = new QPainter();
painter->begin(mPixmap);

// Display lines
int nlines = mProvider->numLines();

@@ -2042,6 +2045,9 @@ void QgsGrassEdit::displayMap (QPainter *painter)
}
}

painter->end();
delete painter;

mCanvas->updateContents();
// mCanvas->repaint(false);
}
@@ -2077,6 +2083,7 @@ void QgsGrassEdit::displayUpdated (void)
}

painter->end();
delete painter;

mCanvas->updateContents();
// mCanvas->repaint(false);
@@ -204,7 +204,7 @@ public slots:
int mSize;

//! Display all lines and nodes
void displayMap (QPainter *painter);
void displayMap ();

/**
* Display icon

0 comments on commit 3c13dce

Please sign in to comment.