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 2db44a599ecbc8abc07b2a84c6fdfb64518a6faa
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/gui/qgshighlight.cpp
@@ -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.
You can’t perform that action at this time.