Skip to content

Commit 2db44a5

Browse files
committedJan 16, 2014
identified features highlight clip on zoom out fix
1 parent f33c490 commit 2db44a5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎src/gui/qgshighlight.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,12 @@ void QgsHighlight::paint( QPainter* p )
294294
// The context is local rectangle of QgsHighlight we previously set.
295295
// Because QgsMapCanvasItem::setRect() adds 1 pixel on border we cannot simply
296296
// use boundingRect().height() for QgsMapToPixel height.
297-
QgsRectangle extent = rect();
297+
QgsRectangle extent = mMapCanvas->extent();
298+
if ( extent != rect() ) // catches also canvas resize as it is causing extent change
299+
{
300+
updateRect();
301+
return; // it will be repainted after updateRect()
302+
}
298303
double height = toCanvasCoordinates( QgsPoint( extent.xMinimum(), extent.yMinimum() ) ).y() - toCanvasCoordinates( QgsPoint( extent.xMinimum(), extent.yMaximum() ) ).y();
299304

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

0 commit comments

Comments
 (0)
Please sign in to comment.