Skip to content

Commit 62ba02e

Browse files
committed
fix highlighting for identify tool when OTF enabled (closes #4843)
1 parent 42617a0 commit 62ba02e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/app/qgshighlight.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "qgsgeometry.h"
1818
#include "qgsmapcanvas.h"
1919
#include "qgsmaprenderer.h"
20+
#include "qgscoordinatetransform.h"
2021
#include "qgsvectorlayer.h"
2122
#include <QPainter>
2223

@@ -30,6 +31,11 @@ QgsHighlight::QgsHighlight( QgsMapCanvas* mapCanvas, QgsGeometry *geom, QgsVecto
3031
, mLayer( layer )
3132
{
3233
mGeometry = geom ? new QgsGeometry( *geom ) : 0;
34+
if ( mapCanvas->mapRenderer()->hasCrsTransformEnabled() )
35+
{
36+
QgsCoordinateTransform transform( mLayer->crs(), mapCanvas->mapRenderer()->destinationCrs() );
37+
mGeometry->transform( transform );
38+
}
3339
updateRect();
3440
update();
3541
setColor( QColor( Qt::lightGray ) );

0 commit comments

Comments
 (0)