Skip to content

Commit d43d8bf

Browse files
naihilSandro Santilli
authored and
Sandro Santilli
committed
Fix invalid calculation of rubberband boundingRect
1 parent 5e6ca2e commit d43d8bf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/gui/qgsrubberband.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,16 @@ void QgsRubberBand::updateRect()
547547
QgsPoint p( it->x() + mTranslationOffsetX, it->y() + mTranslationOffsetY );
548548
p = m2p.transform( p );
549549
QgsRectangle rect( p.x() - w, p.y() - w, p.x() + w, p.y() + w );
550-
r.combineExtentWith( &rect );
550+
551+
if ( r.isEmpty() )
552+
{
553+
// Get rectangle of the first point
554+
r = rect;
555+
}
556+
else
557+
{
558+
r.combineExtentWith( &rect );
559+
}
551560
}
552561
}
553562

0 commit comments

Comments
 (0)