Skip to content

Commit

Permalink
Fixed restarting measurement with right-clicking.
Browse files Browse the repository at this point in the history
  • Loading branch information
homann committed Sep 18, 2012
1 parent 3032f71 commit 5eb1e2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/app/qgsmeasuredialog.cpp
Expand Up @@ -98,7 +98,6 @@ void QgsMeasureDialog::restart()

void QgsMeasureDialog::mousePress( QgsPoint &point )
{

show();
raise();
if ( ! mTool->done() )
Expand Down Expand Up @@ -144,7 +143,6 @@ void QgsMeasureDialog::addPoint( QgsPoint &p )
{
Q_UNUSED( p );

QgsDebugMsg( "Entering" );
int numPoints = mTool->points().size();
if ( mMeasureArea && numPoints > 2 )
{
Expand Down
11 changes: 6 additions & 5 deletions src/app/qgsmeasuretool.cpp
Expand Up @@ -40,7 +40,7 @@ QgsMeasureTool::QgsMeasureTool( QgsMapCanvas* canvas, bool measureArea )
QPixmap myCrossHairQPixmap = QPixmap(( const char ** ) cross_hair_cursor );
mCursor = QCursor( myCrossHairQPixmap, 8, 8 );

mDone = false;
mDone = true;
// Append point we will move
mPoints.append( QgsPoint( 0, 0 ) );

Expand Down Expand Up @@ -103,14 +103,14 @@ void QgsMeasureTool::restart()
{
mPoints.clear();
// Append point we will move
mPoints.append( QgsPoint( 0, 0 ) );
// mPoints.append( QgsPoint( 0, 0 ) );

mRubberBand->reset( mMeasureArea );

// re-read settings
updateSettings();

mDone = false;
mDone = true;
mWrongProjectProjection = false;

}
Expand All @@ -135,9 +135,10 @@ void QgsMeasureTool::canvasPressEvent( QMouseEvent * e )
if ( mDone )
{
mDialog->restart();
QgsPoint point = snapPoint( e->pos() );
addPoint( point );
mDone = false;
}
QgsPoint idPoint = snapPoint( e->pos() );
// mDialog->mousePress( idPoint );
}
}

Expand Down

0 comments on commit 5eb1e2d

Please sign in to comment.