Skip to content

Commit 93a5879

Browse files
committedAug 15, 2013
fix mixing pixels and map units in calculation of update rectangle
1 parent bc58898 commit 93a5879

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/gui/qgsrubberband.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,10 @@ void QgsRubberBand::updateRect()
502502
{
503503
return;
504504
}
505-
qreal s = ( mIconSize - 1 ) / 2;
506-
qreal p = mPen.width();
505+
506+
qreal scale = mMapCanvas->mapUnitsPerPixel();
507+
qreal s = ( mIconSize - 1 ) / 2 * scale;
508+
qreal p = mPen.width() * scale;
507509

508510
QgsRectangle r( it->x() + mTranslationOffsetX - s - p, it->y() + mTranslationOffsetY - s - p,
509511
it->x() + mTranslationOffsetX + s + p, it->y() + mTranslationOffsetY + s + p );

0 commit comments

Comments
 (0)
Please sign in to comment.