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@5028 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Mar 15, 2006
1 parent 5179ee9 commit 8863a4a81c740ed44aef412930f0489deba59e77
Showing with 10 additions and 3 deletions.
  1. +9 −2 src/plugins/grass/qgsgrassedit.cpp
  2. +1 −1 src/plugins/grass/qgsgrassedit.h
@@ -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 8863a4a

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