Skip to content
Permalink
Browse files

fix mixing pixels and map units in calculation of update rectangle

  • Loading branch information
3nids committed Aug 15, 2013
1 parent bc58898 commit 93a5879f860df2a24897a192bb5f1b936feb2acd
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/gui/qgsrubberband.cpp
@@ -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 );

0 comments on commit 93a5879

Please sign in to comment.
You can’t perform that action at this time.