Skip to content

Commit 09ce9d4

Browse files
committed
fix highlighting for identify tool when OTF enabled (closes #4843)
1 parent 49cdac0 commit 09ce9d4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/app/qgshighlight.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "qgsgeometry.h"
1919
#include "qgsmapcanvas.h"
2020
#include "qgsmaprenderer.h"
21+
#include "qgscoordinatetransform.h"
2122
#include "qgsvectorlayer.h"
2223
#include <QPainter>
2324

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

0 commit comments

Comments
 (0)