From d43d8bf59730ee2911dd141ef0bb5847e7b56d73 Mon Sep 17 00:00:00 2001 From: Anatoliy Golubev Date: Tue, 31 Mar 2015 17:59:11 +0300 Subject: [PATCH] Fix invalid calculation of rubberband boundingRect --- src/gui/qgsrubberband.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gui/qgsrubberband.cpp b/src/gui/qgsrubberband.cpp index 7cc1e186155..1e9d1d80cba 100644 --- a/src/gui/qgsrubberband.cpp +++ b/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 ); + } } }