Skip to content

Commit edc317b

Browse files
author
jef
committed
fix r15315
git-svn-id: http://svn.osgeo.org/qgis/trunk@15317 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent e9038a3 commit edc317b

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/app/qgshighlight.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#include "qgshighlight.h"
1818
#include "qgsgeometry.h"
19-
#include "qgslogger.h"
2019
#include "qgsmapcanvas.h"
2120
#include "qgsmaprenderer.h"
2221
#include "qgsvectorlayer.h"
@@ -31,7 +30,6 @@ QgsHighlight::QgsHighlight( QgsMapCanvas* mapCanvas, QgsGeometry *geom, QgsVecto
3130
: QgsMapCanvasItem( mapCanvas )
3231
, mLayer( layer )
3332
{
34-
QgsDebugMsg( geom ? "geometry!" : "no geometry" );
3533
mGeometry = geom ? new QgsGeometry( *geom ) : 0;
3634
updateRect();
3735
update();
@@ -66,13 +64,12 @@ void QgsHighlight::paintPoint( QPainter *p, QgsPoint point )
6664
{
6765
QPolygonF r( 5 );
6866

69-
double d = mMapCanvas->extent().width() * 0.005;
70-
7167
if ( mLayer )
7268
{
7369
point = mMapCanvas->mapRenderer()->layerToMapCoordinates( mLayer, point );
7470
}
7571

72+
double d = mMapCanvas->extent().width() * 0.005;
7673
r[0] = toCanvasCoordinates( point + QgsVector( -d, -d ) ) - pos();
7774
r[1] = toCanvasCoordinates( point + QgsVector( d, -d ) ) - pos();
7875
r[2] = toCanvasCoordinates( point + QgsVector( d, d ) ) - pos();
@@ -129,7 +126,6 @@ void QgsHighlight::paintPolygon( QPainter *p, QgsPolygon polygon )
129126
poly = ring;
130127
else
131128
poly = poly.subtracted( ring );
132-
133129
}
134130

135131
// just fill, no outline
@@ -143,11 +139,8 @@ void QgsHighlight::paintPolygon( QPainter *p, QgsPolygon polygon )
143139
*/
144140
void QgsHighlight::paint( QPainter* p )
145141
{
146-
QgsDebugMsg( "entered." );
147-
148142
if ( !mGeometry )
149143
{
150-
QgsDebugMsg( "no geometry." );
151144
return;
152145
}
153146

@@ -229,7 +222,7 @@ void QgsHighlight::updateRect()
229222
r.setXMinimum( r.xMinimum() - d );
230223
r.setYMinimum( r.yMinimum() - d );
231224
r.setXMaximum( r.xMaximum() + d );
232-
r.setXMaximum( r.yMaximum() + d );
225+
r.setYMaximum( r.yMaximum() + d );
233226
}
234227

235228
setRect( r );
@@ -239,6 +232,4 @@ void QgsHighlight::updateRect()
239232
{
240233
setRect( QgsRectangle() );
241234
}
242-
243235
}
244-

0 commit comments

Comments
 (0)