Fix invalid calculation of rubberband boundingRect

This commit is contained in:
Anatoliy Golubev 2015-03-31 17:59:11 +03:00 committed by Sandro Santilli
parent 5e6ca2efac
commit d43d8bf597

View File

@ -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 );
}
}
}