Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix for ticket #550.
Another case where G_fatal_error has been terminating QGIS.
Also implemented suggestions in the ticket:
- only left-click will add new point/centroid
- no tool will be activated when grass edit is opened


git-svn-id: http://svn.osgeo.org/qgis/trunk@7343 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Nov 7, 2007
1 parent 65ee92c commit 8eb037c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/plugins/grass/qgsgrassedit.cpp
Expand Up @@ -537,8 +537,6 @@ void QgsGrassEdit::init()

// TODO: how to get keyboard events from canvas (shortcuts)

newPoint();

restorePosition();

mValid = true;
Expand Down Expand Up @@ -1600,6 +1598,10 @@ void QgsGrassEdit::displayElement ( int line, const QPen & pen, int size, QPaint
#ifdef QGISDEBUG
std::cerr << "QgsGrassEdit::displayElement() line = " << line << std::endl;
#endif

// is it a valid line?
if (line == 0)
return;

if ( !mSymbDisplay[mLineSymb[line]] ) return;

Expand Down
3 changes: 3 additions & 0 deletions src/plugins/grass/qgsgrassedittools.cpp
Expand Up @@ -78,6 +78,9 @@ QgsGrassEditNewPoint::QgsGrassEditNewPoint(QgsGrassEdit* edit, bool newCentroid)

void QgsGrassEditNewPoint::mouseClick(QgsPoint & point, Qt::ButtonState button)
{
if ( button != Qt::LeftButton)
return;

Vect_reset_line ( e->mEditPoints );
e->snap ( point );
Vect_append_point ( e->mEditPoints, point.x(), point.y(), 0.0 );
Expand Down

0 comments on commit 8eb037c

Please sign in to comment.