Skip to content

Commit

Permalink
Fix invalid calculation of rubberband boundingRect
Browse files Browse the repository at this point in the history
  • Loading branch information
naihil authored and Sandro Santilli committed Apr 1, 2015
1 parent 5e6ca2e commit d43d8bf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/gui/qgsrubberband.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,16 @@ void QgsRubberBand::updateRect()
QgsPoint p( it->x() + mTranslationOffsetX, it->y() + mTranslationOffsetY );
p = m2p.transform( p );
QgsRectangle rect( p.x() - w, p.y() - w, p.x() + w, p.y() + w );
r.combineExtentWith( &rect );

if ( r.isEmpty() )
{
// Get rectangle of the first point
r = rect;
}
else
{
r.combineExtentWith( &rect );
}
}
}

Expand Down

0 comments on commit d43d8bf

Please sign in to comment.