[QGIS Commit] r15317 - trunk/qgis/src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Mar 3 02:59:12 EST 2011


Author: jef
Date: 2011-03-02 23:59:12 -0800 (Wed, 02 Mar 2011)
New Revision: 15317

Modified:
   trunk/qgis/src/app/qgshighlight.cpp
Log:
fix r15315

Modified: trunk/qgis/src/app/qgshighlight.cpp
===================================================================
--- trunk/qgis/src/app/qgshighlight.cpp	2011-03-03 07:54:04 UTC (rev 15316)
+++ trunk/qgis/src/app/qgshighlight.cpp	2011-03-03 07:59:12 UTC (rev 15317)
@@ -16,7 +16,6 @@
 
 #include "qgshighlight.h"
 #include "qgsgeometry.h"
-#include "qgslogger.h"
 #include "qgsmapcanvas.h"
 #include "qgsmaprenderer.h"
 #include "qgsvectorlayer.h"
@@ -31,7 +30,6 @@
     : QgsMapCanvasItem( mapCanvas )
     , mLayer( layer )
 {
-  QgsDebugMsg( geom ? "geometry!" : "no geometry" );
   mGeometry = geom ? new QgsGeometry( *geom ) : 0;
   updateRect();
   update();
@@ -66,13 +64,12 @@
 {
   QPolygonF r( 5 );
 
-  double d = mMapCanvas->extent().width() * 0.005;
-
   if ( mLayer )
   {
     point = mMapCanvas->mapRenderer()->layerToMapCoordinates( mLayer, point );
   }
 
+  double d = mMapCanvas->extent().width() * 0.005;
   r[0] = toCanvasCoordinates( point + QgsVector( -d, -d ) ) - pos();
   r[1] = toCanvasCoordinates( point + QgsVector( d, -d ) ) - pos();
   r[2] = toCanvasCoordinates( point + QgsVector( d, d ) ) - pos();
@@ -129,7 +126,6 @@
       poly = ring;
     else
       poly = poly.subtracted( ring );
-
   }
 
   // just fill, no outline
@@ -143,11 +139,8 @@
   */
 void QgsHighlight::paint( QPainter* p )
 {
-  QgsDebugMsg( "entered." );
-
   if ( !mGeometry )
   {
-    QgsDebugMsg( "no geometry." );
     return;
   }
 
@@ -229,7 +222,7 @@
       r.setXMinimum( r.xMinimum() - d );
       r.setYMinimum( r.yMinimum() - d );
       r.setXMaximum( r.xMaximum() + d );
-      r.setXMaximum( r.yMaximum() + d );
+      r.setYMaximum( r.yMaximum() + d );
     }
 
     setRect( r );
@@ -239,6 +232,4 @@
   {
     setRect( QgsRectangle() );
   }
-
 }
-



More information about the QGIS-commit mailing list