Skip to content
Permalink
Browse files

Fix invalid calculation of rubberband boundingRect

  • Loading branch information
naihil authored and Sandro Santilli committed Apr 1, 2015
1 parent 5e6ca2e commit d43d8bf59730ee2911dd141ef0bb5847e7b56d73
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/gui/qgsrubberband.cpp
@@ -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 );
}
}
}

0 comments on commit d43d8bf

Please sign in to comment.
You can’t perform that action at this time.