From 36452a8e2415668261c99eebbe7889a35a88ec69 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Fri, 9 Nov 2012 10:53:43 +0100 Subject: [PATCH] [FIX]: Build rubberband completely even with incomplete input An empty polyline in a mulipolyline led to the rubberband ignoring all further polylines. e.g. addGeometry( [[(1,2)(2,3)][][(2,3)(3,4)]] ) was ignoring the polyline (2,3)(3,4). --- src/gui/qgsrubberband.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/qgsrubberband.cpp b/src/gui/qgsrubberband.cpp index 723af14050c..252db6f89f3 100644 --- a/src/gui/qgsrubberband.cpp +++ b/src/gui/qgsrubberband.cpp @@ -270,6 +270,12 @@ void QgsRubberBand::addGeometry( QgsGeometry* geom, QgsVectorLayer* layer ) for ( int i = 0; i < mline.size(); ++i, ++idx ) { QgsPolyline line = mline[i]; + + if ( line.size() == 0 ) + { + --idx; + } + for ( int j = 0; j < line.size(); ++j ) { if ( layer )