Skip to content

Commit

Permalink
Fix select by rectangle and by point in presence of rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandro Santilli committed Jan 3, 2015
1 parent d726959 commit df49538
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/qgsmaptoolselectutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}

Expand Down

0 comments on commit df49538

Please sign in to comment.