Skip to content
Permalink
Browse files
identified features highlight clip on zoom out fix
  • Loading branch information
blazek committed Jan 16, 2014
1 parent f33c490 commit 2db44a5
Showing 1 changed file with 6 additions and 1 deletion.
@@ -294,7 +294,12 @@ void QgsHighlight::paint( QPainter* p )
// The context is local rectangle of QgsHighlight we previously set.
// Because QgsMapCanvasItem::setRect() adds 1 pixel on border we cannot simply
// use boundingRect().height() for QgsMapToPixel height.
QgsRectangle extent = rect();
QgsRectangle extent = mMapCanvas->extent();
if ( extent != rect() ) // catches also canvas resize as it is causing extent change
{
updateRect();
return; // it will be repainted after updateRect()
}
double height = toCanvasCoordinates( QgsPoint( extent.xMinimum(), extent.yMinimum() ) ).y() - toCanvasCoordinates( QgsPoint( extent.xMinimum(), extent.yMaximum() ) ).y();

QgsMapToPixel mapToPixel = QgsMapToPixel( mMapCanvas->mapUnitsPerPixel(),

0 comments on commit 2db44a5

Please sign in to comment.