Skip to content
Permalink
Browse files
Fix select by rectangle and by point in presence of rotation
  • Loading branch information
Sandro Santilli committed Jan 3, 2015
1 parent d726959 commit df49538298c7e9f5ff596efbe4c9f65d2d511c8f
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/app/qgsmaptoolselectutils.cpp
@@ -49,15 +49,17 @@ void QgsMapToolSelectUtils::setRubberBand( QgsMapCanvas* canvas, QRect& selectRe
{
const QgsMapToPixel* transform = canvas->getCoordinateTransform();
QgsPoint ll = transform->toMapCoordinates( selectRect.left(), selectRect.bottom() );
QgsPoint lr = transform->toMapCoordinates( selectRect.right(), selectRect.bottom() );
QgsPoint ul = transform->toMapCoordinates( selectRect.left(), selectRect.top() );
QgsPoint ur = transform->toMapCoordinates( selectRect.right(), selectRect.top() );

if ( rubberBand )
{
rubberBand->reset( QGis::Polygon );
rubberBand->addPoint( ll, false );
rubberBand->addPoint( QgsPoint( ur.x(), ll.y() ), false );
rubberBand->addPoint( lr, false );
rubberBand->addPoint( ur, false );
rubberBand->addPoint( QgsPoint( ll.x(), ur.y() ), true );
rubberBand->addPoint( ul, true );
}
}

0 comments on commit df49538

Please sign in to comment.