Skip to content

Commit

Permalink
improved speed of drawing layer that's being edited
Browse files Browse the repository at this point in the history
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.
11 changes: 9 additions & 2 deletions src/plugins/grass/qgsgrassedit.cpp
Expand Up @@ -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();

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

painter->end();
delete painter;

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

painter->end();
delete painter;

mCanvas->updateContents();
// mCanvas->repaint(false);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassedit.h
Expand Up @@ -204,7 +204,7 @@ public slots:
int mSize;

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

/**
* Display icon
Expand Down

0 comments on commit 3c13dce

Please sign in to comment.