mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-08 00:05:09 -04:00
Fix last segment length in measure dialog is incorrect after
completing measurement with right mouse click
This commit is contained in:
parent
03bff507d9
commit
bad137283b
@ -213,16 +213,24 @@ void QgsMeasureDialog::removeLastPoint()
|
|||||||
//remove final row
|
//remove final row
|
||||||
delete mTable->takeTopLevelItem( mTable->topLevelItemCount() - 1 );
|
delete mTable->takeTopLevelItem( mTable->topLevelItemCount() - 1 );
|
||||||
|
|
||||||
QgsPoint p1( mTool->points().last() );
|
|
||||||
double d = mDa.measureLine( p1, mLastMousePoint );
|
|
||||||
|
|
||||||
mTotal = mDa.measureLine( mTool->points() );
|
mTotal = mDa.measureLine( mTool->points() );
|
||||||
editTotal->setText( formatDistance( mTotal + d ) );
|
|
||||||
|
|
||||||
d = convertLength( d, mDistanceUnits );
|
if ( !mTool->done() )
|
||||||
|
{
|
||||||
|
// need to add the distance for the temporary mouse cursor point
|
||||||
|
QgsPoint p1( mTool->points().last() );
|
||||||
|
double d = mDa.measureLine( p1, mLastMousePoint );
|
||||||
|
|
||||||
QTreeWidgetItem *item = mTable->topLevelItem( mTable->topLevelItemCount() - 1 );
|
d = convertLength( d, mDistanceUnits );
|
||||||
item->setText( 0, QLocale::system().toString( d, 'f', mDecimalPlaces ) );
|
|
||||||
|
QTreeWidgetItem *item = mTable->topLevelItem( mTable->topLevelItemCount() - 1 );
|
||||||
|
item->setText( 0, QLocale::system().toString( d, 'f', mDecimalPlaces ) );
|
||||||
|
editTotal->setText( formatDistance( mTotal + d ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
editTotal->setText( formatDistance( mTotal ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user