Skip to content
Permalink
Browse files

Fix offset curve tool (fixes #12911)

Modified geometry would not be updated anymore if at one point
the rubber band would end up without vertices
  • Loading branch information
wonder-sk committed Jun 19, 2015
1 parent 1bf9844 commit 5e4841d94d7586a66e6be21b70d368ef65ca6087
Showing with 2 additions and 13 deletions.
  1. +2 −13 src/app/qgsmaptooloffsetcurve.cpp
@@ -190,19 +190,7 @@ void QgsMapToolOffsetCurve::applyOffset()

void QgsMapToolOffsetCurve::placeOffsetCurveToValue()
{
if ( mOriginalGeometry && mRubberBand && mRubberBand->numberOfVertices() > 0 )
{
//is rubber band left or right of original geometry
double leftOf = 0;
const QgsPoint *firstPoint = mRubberBand->getPoint( 0 );
if ( firstPoint )
{
QgsPoint minDistPoint;
int beforeVertex;
mOriginalGeometry->closestSegmentWithContext( *firstPoint, minDistPoint, beforeVertex, &leftOf );
}
setOffsetForRubberBand( mDistanceWidget->value() );
}
setOffsetForRubberBand( mDistanceWidget->value() );
}

void QgsMapToolOffsetCurve::canvasMoveEvent( QMouseEvent * e )
@@ -255,6 +243,7 @@ void QgsMapToolOffsetCurve::canvasMoveEvent( QMouseEvent * e )

if ( mDistanceWidget )
{
// this will also set the rubber band
mDistanceWidget->setValue( leftOf < 0 ? offset : -offset );
mDistanceWidget->setFocus( Qt::TabFocusReason );
}

0 comments on commit 5e4841d

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