Applied patch #1323

git-svn-id: http://svn.osgeo.org/qgis/branches/Version-1_0@9815 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
mhugent 2008-12-16 07:49:42 +00:00
parent 0fb8a4e67c
commit c3d8756b8f
2 changed files with 14 additions and 1 deletions

View File

@ -1585,7 +1585,7 @@ void QgisApp::createOverview()
QBitmap overviewPanBmp = QBitmap::fromData( QSize( 16, 16 ), pan_bits );
QBitmap overviewPanBmpMask = QBitmap::fromData( QSize( 16, 16 ), pan_mask_bits );
mOverviewMapCursor = new QCursor( overviewPanBmp, overviewPanBmpMask, 5, 5 );
mOverviewMapCursor = new QCursor( overviewPanBmp, overviewPanBmpMask, 0, 0 ); //set upper left corner as hot spot - this is better when extent marker is small; hand won't cover the marker
overviewCanvas->setCursor( *mOverviewMapCursor );
// QVBoxLayout *myOverviewLayout = new QVBoxLayout;
// myOverviewLayout->addWidget(overviewCanvas);

View File

@ -27,6 +27,7 @@
#include <QResizeEvent>
#include <QMouseEvent>
#include "qgslogger.h"
#include <limits.h>
//! widget that serves as rectangle showing current extent in overview
class QgsPanningWidget : public QWidget
@ -146,6 +147,18 @@ void QgsMapOverviewCanvas::drawExtentRect()
QRect r( x1, y1, x2 - x1 + 1, y2 - y1 + 1 );
// allow for 5 pixel minimum widget size
if ( r.width() < 5 && x1 > INT_MIN + 2 ) // make sure no underflow occurs (2 is largest adjustment)
{
r.setX( r.x() - ( ( 5 - r.width() ) / 2 ) ); // adjust x by 1/2 the difference of calculated and min. width
r.setWidth(5);
}
if ( r.height() < 5 && y1 > INT_MIN + 2 )
{
r.setY( r.y() - ( ( 5 - r.height() ) / 2 ) ); // adjust y
r.setHeight(5);
}
QgsDebugMsg( QString( "panning: extent to widget: [%1,%2] [%3x%4]" ).arg( x1 ).arg( y1 ).arg( r.width() ).arg( r.height() ) );
mPanningWidget->setGeometry( r );