Add pen width to rubberband bounding rect

This commit is contained in:
Matthias Kuhn 2012-12-26 16:33:10 +01:00
parent f2328962df
commit 90c571da90

View File

@ -479,8 +479,9 @@ void QgsRubberBand::updateRect()
for ( ; it != mPoints.at( i ).constEnd(); ++it )
{
qreal s = ( mIconSize - 1 ) / 2;
QgsRectangle rect = QgsRectangle( it->x() + mTranslationOffsetX - s, it->y() + mTranslationOffsetY - s,
it->x() + mTranslationOffsetX + s, it->y() + mTranslationOffsetY + s );
qreal p = mWidth;
QgsRectangle rect = QgsRectangle( it->x() + mTranslationOffsetX - s - p, it->y() + mTranslationOffsetY - s - p,
it->x() + mTranslationOffsetX + s + p, it->y() + mTranslationOffsetY + s + p);
r.combineExtentWith( &rect );
}
}