Skip to content

Commit

Permalink
fix mixing pixels and map units in calculation of update rectangle
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Aug 15, 2013
1 parent bc58898 commit 93a5879
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gui/qgsrubberband.cpp
Expand Up @@ -502,8 +502,10 @@ void QgsRubberBand::updateRect()
{
return;
}
qreal s = ( mIconSize - 1 ) / 2;
qreal p = mPen.width();

qreal scale = mMapCanvas->mapUnitsPerPixel();
qreal s = ( mIconSize - 1 ) / 2 * scale;
qreal p = mPen.width() * scale;

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

0 comments on commit 93a5879

Please sign in to comment.