Skip to content

Commit

Permalink
Fix offset curve tool (fixes #12911)
Browse files Browse the repository at this point in the history
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 5e4841d
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/app/qgsmaptooloffsetcurve.cpp
Expand Up @@ -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 )
Expand Down Expand Up @@ -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 );
}
Expand Down

0 comments on commit 5e4841d

Please sign in to comment.