[QGIS Commit] r9824 - in trunk/qgis/src: app gui
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Tue Dec 16 07:21:16 EST 2008
Author: mhugent
Date: 2008-12-16 07:21:16 -0500 (Tue, 16 Dec 2008)
New Revision: 9824
Modified:
trunk/qgis/src/app/qgisapp.cpp
trunk/qgis/src/gui/qgsmapoverviewcanvas.cpp
Log:
apply patch #1323 also to trunk
Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp 2008-12-16 12:18:44 UTC (rev 9823)
+++ trunk/qgis/src/app/qgisapp.cpp 2008-12-16 12:21:16 UTC (rev 9824)
@@ -1585,7 +1585,7 @@
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);
Modified: trunk/qgis/src/gui/qgsmapoverviewcanvas.cpp
===================================================================
--- trunk/qgis/src/gui/qgsmapoverviewcanvas.cpp 2008-12-16 12:18:44 UTC (rev 9823)
+++ trunk/qgis/src/gui/qgsmapoverviewcanvas.cpp 2008-12-16 12:21:16 UTC (rev 9824)
@@ -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 @@
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 );
More information about the QGIS-commit
mailing list