Skip to content

Commit

Permalink
[FIX]: Build rubberband completely even with incomplete input
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
m-kuhn committed Nov 9, 2012
1 parent 1dacbd6 commit 36452a8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gui/qgsrubberband.cpp
Expand Up @@ -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 )
Expand Down

0 comments on commit 36452a8

Please sign in to comment.