Skip to content

Commit 5e4841d

Browse files
committed
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
1 parent 1bf9844 commit 5e4841d

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/app/qgsmaptooloffsetcurve.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -190,19 +190,7 @@ void QgsMapToolOffsetCurve::applyOffset()
190190

191191
void QgsMapToolOffsetCurve::placeOffsetCurveToValue()
192192
{
193-
if ( mOriginalGeometry && mRubberBand && mRubberBand->numberOfVertices() > 0 )
194-
{
195-
//is rubber band left or right of original geometry
196-
double leftOf = 0;
197-
const QgsPoint *firstPoint = mRubberBand->getPoint( 0 );
198-
if ( firstPoint )
199-
{
200-
QgsPoint minDistPoint;
201-
int beforeVertex;
202-
mOriginalGeometry->closestSegmentWithContext( *firstPoint, minDistPoint, beforeVertex, &leftOf );
203-
}
204-
setOffsetForRubberBand( mDistanceWidget->value() );
205-
}
193+
setOffsetForRubberBand( mDistanceWidget->value() );
206194
}
207195

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

256244
if ( mDistanceWidget )
257245
{
246+
// this will also set the rubber band
258247
mDistanceWidget->setValue( leftOf < 0 ? offset : -offset );
259248
mDistanceWidget->setFocus( Qt::TabFocusReason );
260249
}

0 commit comments

Comments
 (0)